Shutdown the process manager before shutdown the registry.
[reactos.git] / reactos / ntoskrnl / ex / power.c
index 66f6bb3..2c893f9 100644 (file)
@@ -148,15 +148,16 @@ ShutdownThreadMain(PVOID Context)
                                           sizeof(PCH))]);
      }
 
+   PiShutdownProcessManager();
+   Waittime.QuadPart = (LONGLONG)-10000000; /* 1sec */
+   KeDelayExecutionThread(KernelMode, FALSE, &Waittime);
+
    CmShutdownRegistry();
    IoShutdownRegisteredFileSystems();
    IoShutdownRegisteredDevices();
 
-   PiShutdownProcessManager();
    MiShutdownMemoryManager();
 
-   Waittime.QuadPart = (LONGLONG)-10000000; /* 1sec */
-   KeDelayExecutionThread(KernelMode, FALSE, &Waittime);
 
    if (Action == ShutdownNoReboot)
      {