https://git.reactos.org/?p=reactos.git;a=commitdiff;h=90a6086f17114bc6f1d75…
commit 90a6086f17114bc6f1d75e90ac5fda2c3f64a2c7
Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com>
AuthorDate: Sat Oct 17 18:09:11 2020 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Oct 17 18:09:11 2020 +0200
[NTOSKRNL] include/config.h: Sync it to current code (#3263)
* SERIALIZE_DBGPRINT: Removed on c15e04c (r18078).
* ENABLE_VALIDATE_POOL: Removed on 5899e14 (r42249).
* TAG_STATISTICS_TRACKING: Removed on 5899e14 (r42249).
* POOL_DEBUG_APIS: Removed on 5899e14 (r42249).
* R_RZ: Removed on 7d21cf7 (r48999).
* R_STACK: Removed on 7d21cf7 (r48999).
* WHOLE_PAGE_ALLOCATIONS: Removed on b431563 (r17306).
+
* _GLOBAL_PAGES_ARE_AWESOME_: Move it here.
---
ntoskrnl/include/config.h | 40 ++--------------------------------------
ntoskrnl/include/ntoskrnl.h | 9 +--------
2 files changed, 3 insertions(+), 46 deletions(-)
diff --git a/ntoskrnl/include/config.h b/ntoskrnl/include/config.h
index 7e925ef419a..a98c36974aa 100644
--- a/ntoskrnl/include/config.h
+++ b/ntoskrnl/include/config.h
@@ -1,40 +1,4 @@
#pragma once
-/********** dbg/print.c **********/
-
-/* Enable serialization of debug messages printed with DbgPrint
- *
- * If this is enabled DbgPrint will queue messages if another thread is already
- * printing a message, and immediately returns. The other thread will print
- * queued messages before it returns.
- * It could happen that some messages are lost if the processor is halted before
- * the message queue was flushed.
- */
-#undef SERIALIZE_DBGPRINT
-
-/********** mm/ppool.c **********/
-
-/* Disable Debugging Features */
-#if !DBG
- /* Enable strict checking of the nonpaged pool on every allocation */
- #undef ENABLE_VALIDATE_POOL
-
- /* Enable tracking of statistics about the tagged blocks in the pool */
- #undef TAG_STATISTICS_TRACKING
-
- /* Enable Memory Debugging Features/Helpers */
- #undef POOL_DEBUG_APIS
-
- /* Enable Redzone */
- #define R_RZ 0
-
- /* Enable Allocator Stack */
- #define R_STACK 0
-
- /*
- * Put each block in its own range of pages and position the block at the
- * end of the range so any accesses beyond the end of block are to invalid
- * memory locations.
- */
- #undef WHOLE_PAGE_ALLOCATIONS
-#endif
+// Enable global page support.
+// #define _GLOBAL_PAGES_ARE_AWESOME_
diff --git a/ntoskrnl/include/ntoskrnl.h b/ntoskrnl/include/ntoskrnl.h
index 85970d59892..74921c4ac97 100644
--- a/ntoskrnl/include/ntoskrnl.h
+++ b/ntoskrnl/include/ntoskrnl.h
@@ -108,16 +108,9 @@
C_ASSERT(MAX_WIN32_PATH == MAX_PATH);
#undef MAX_PATH
-//
-// Switch for enabling global page support
-//
-
-//#define _GLOBAL_PAGES_ARE_AWESOME_
-
-
/* Internal Headers */
-#include "internal/ntoskrnl.h"
#include "config.h"
+#include "internal/ntoskrnl.h"
#include <reactos/probe.h>
#include "internal/probe.h"
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c7c0b09eb6ea18e180d77…
commit c7c0b09eb6ea18e180d77d38224ed535699001aa
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sat Oct 17 16:55:56 2020 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sat Oct 17 16:55:56 2020 +0200
[BASESRV] Use the correct value for the last parameter of a CsrValidateMessageBuffer() call.
---
subsystems/win/basesrv/nls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/subsystems/win/basesrv/nls.c b/subsystems/win/basesrv/nls.c
index de4027bbeb2..ef918667188 100644
--- a/subsystems/win/basesrv/nls.c
+++ b/subsystems/win/basesrv/nls.c
@@ -338,7 +338,7 @@ CSR_API(BaseSrvNlsGetUserInfo)
PBASE_NLS_GET_USER_INFO NlsMsg = &((PBASE_API_MESSAGE)ApiMessage)->Data.NlsGetUserInfo;
/* Make sure the buffer is valid and of the right size */
- if ((CsrValidateMessageBuffer(ApiMessage, &NlsMsg->NlsUserInfo, NlsMsg->Size, TRUE)) &&
+ if ((CsrValidateMessageBuffer(ApiMessage, &NlsMsg->NlsUserInfo, NlsMsg->Size, sizeof(BYTE))) &&
(NlsMsg->Size == sizeof(NLS_USER_INFO)))
{
/* Acquire the lock to prevent updates while we copy */
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bd2a40d57b6c13e76ba46…
commit bd2a40d57b6c13e76ba4659997d9a19cb4e5d8f1
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sat Oct 10 17:41:44 2020 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sat Oct 17 16:13:05 2020 +0200
[NTOS:IO] Some fixes for IoRaiseHardError(). (#3302)
CORE-14037
- Fix buggy retrieval of the current calling Irp->Tail.Overlay.Thread.
- The 4th argument (KernelRoutine) to the KeInitializeApc() is **NOT**
optional; however its 5th argument (RundownRoutine) is.
So use the mandatory routine for freeing the allocated APC instead.
We don't use the rundown routine yet.
- Check whether the ExAllocatePoolWithTag() call failed or not before
queueing the allocated APC.
---
ntoskrnl/io/iomgr/error.c | 36 ++++++++++++++++++++++++++----------
1 file changed, 26 insertions(+), 10 deletions(-)
diff --git a/ntoskrnl/io/iomgr/error.c b/ntoskrnl/io/iomgr/error.c
index 171f02eac80..312b29f942a 100644
--- a/ntoskrnl/io/iomgr/error.c
+++ b/ntoskrnl/io/iomgr/error.c
@@ -484,14 +484,22 @@ IopLogWorker(IN PVOID Parameter)
ExFreePoolWithTag(Message, TAG_IO);
}
+static
VOID
NTAPI
-IopFreeApc(IN PKAPC Apc)
+IopFreeApc(IN PKAPC Apc,
+ IN OUT PKNORMAL_ROUTINE* NormalRoutine,
+ IN OUT PVOID* NormalContext,
+ IN OUT PVOID* SystemArgument1,
+ IN OUT PVOID* SystemArgument2)
{
+ PAGED_CODE();
+
/* Free the APC */
- ExFreePool(Apc);
+ ExFreePoolWithTag(Apc, TAG_APC);
}
+static
VOID
NTAPI
IopRaiseHardError(IN PVOID NormalContext,
@@ -657,7 +665,7 @@ IoRaiseHardError(IN PIRP Irp,
IN PVPB Vpb,
IN PDEVICE_OBJECT RealDeviceObject)
{
- PETHREAD Thread = (PETHREAD)&Irp->Tail.Overlay.Thread;
+ PETHREAD Thread = Irp->Tail.Overlay.Thread;
PKAPC ErrorApc;
/* Don't do anything if hard errors are disabled on the thread */
@@ -669,21 +677,29 @@ IoRaiseHardError(IN PIRP Irp,
return;
}
- /* Setup an APC */
- ErrorApc = ExAllocatePoolWithTag(NonPagedPool,
- sizeof(KAPC),
- TAG_APC);
+ // TODO: In case we were called in the context of a paging I/O or for
+ // a synchronous operation, that happens with APCs disabled, queue the
+ // hard-error call for later processing (see also IofCompleteRequest).
+
+ /* Setup an APC and queue it to deal with the error (see OSR documentation) */
+ ErrorApc = ExAllocatePoolWithTag(NonPagedPool, sizeof(*ErrorApc), TAG_APC);
+ if (!ErrorApc)
+ {
+ /* Fail */
+ IoCompleteRequest(Irp, IO_DISK_INCREMENT);
+ return;
+ }
+
KeInitializeApc(ErrorApc,
&Thread->Tcb,
Irp->ApcEnvironment,
- NULL,
IopFreeApc,
+ NULL,
IopRaiseHardError,
KernelMode,
Irp);
- /* Queue an APC to deal with the error (see osr documentation) */
- KeInsertQueueApc(ErrorApc, Vpb, RealDeviceObject, 0);
+ KeInsertQueueApc(ErrorApc, Vpb, RealDeviceObject, IO_NO_INCREMENT);
}
/*