Author: ion
Date: Mon Jan 22 11:46:56 2007
New Revision: 25587
URL:
http://svn.reactos.org/svn/reactos?rev=25587&view=rev
Log:
- Proper fix for the bug that 25558 attempted to fix. Kernel-mode registry handles now
work (they didn't before 25558).
- Also the system now boots again since this fix is correct.
Modified:
trunk/reactos/ntoskrnl/cm/ntfunc.c
Modified: trunk/reactos/ntoskrnl/cm/ntfunc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/ntfunc.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/cm/ntfunc.c (original)
+++ trunk/reactos/ntoskrnl/cm/ntfunc.c Mon Jan 22 11:46:56 2007
@@ -49,7 +49,8 @@
*/
{
HANDLE_TABLE_ENTRY NewEntry;
- PEPROCESS Process, CurrentProcess;
+ PEPROCESS CurrentProcess;
+ PVOID HandleTable;
POBJECT_HEADER ObjectHeader;
HANDLE Handle;
KAPC_STATE ApcState;
@@ -90,22 +91,20 @@
if ((HandleAttributes & OBJ_KERNEL_HANDLE) &&
ExGetPreviousMode() == KernelMode)
{
- Process = PsInitialSystemProcess;
- if (Process != CurrentProcess)
+ HandleTable = ObpKernelHandleTable;
+ if (PsGetCurrentProcess() != PsInitialSystemProcess)
{
- KeStackAttachProcess(&Process->Pcb,
+ KeStackAttachProcess(&PsInitialSystemProcess->Pcb,
&ApcState);
AttachedToProcess = TRUE;
}
}
else
{
- Process = CurrentProcess;
- /* mask out the OBJ_KERNEL_HANDLE attribute */
- HandleAttributes &= ~OBJ_KERNEL_HANDLE;
- }
-
- Handle = ExCreateHandle(Process->ObjectTable,
+ HandleTable = PsGetCurrentProcess()->ObjectTable;
+ }
+
+ Handle = ExCreateHandle(HandleTable,
&NewEntry);
if (AttachedToProcess)