From 52d93be892ef1c8af4003f462e2d46abea722f08 Mon Sep 17 00:00:00 2001 From: Sir Richard Date: Wed, 3 Mar 2010 05:10:38 +0000 Subject: [PATCH] [NTOS]: Do the "funny message" (not really funny, my apologies) shenanigans after the system components have shutdown, and reset the display and call the HAL at least at DPC level (should probably do it at HIGH IRQL, really). This way, we can avoid the context switch to another process while the HAL is executing the BIOS reset display call (done solely for the benefit of the "funny messages", as the video card driver usually resets the display) and thus avoid the "invalid V86 opcode" message sometimes appearing on shutdown. Did you know the "funny messages" take up more storage space than an average embedded micro-controller OS? svn path=/trunk/; revision=45777 --- reactos/ntoskrnl/ex/shutdown.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/reactos/ntoskrnl/ex/shutdown.c b/reactos/ntoskrnl/ex/shutdown.c index 680a9c7c0b3..83dd520d095 100644 --- a/reactos/ntoskrnl/ex/shutdown.c +++ b/reactos/ntoskrnl/ex/shutdown.c @@ -139,6 +139,16 @@ ShutdownThreadMain(PVOID Context) /* Run the thread on the boot processor */ KeSetSystemAffinityThread(1); + PspShutdownProcessManager(); + + CmShutdownSystem(); + IoShutdownRegisteredFileSystems(); + IoShutdownRegisteredDevices(); + + ZwQuerySystemTime(&Now); + + KeRaiseIrqlToDpcLevel(); + if (InbvIsBootDriverInstalled()) { InbvAcquireDisplayOwnership(); @@ -152,19 +162,12 @@ ShutdownThreadMain(PVOID Context) if (Action == ShutdownNoReboot) { - ZwQuerySystemTime(&Now); Now.u.LowPart = Now.u.LowPart >> 8; /* Seems to give a somewhat better "random" number */ HalDisplayString(FamousLastWords[Now.u.LowPart % (sizeof(FamousLastWords) / sizeof(PCH))]); } - - PspShutdownProcessManager(); - - CmShutdownSystem(); - IoShutdownRegisteredFileSystems(); - IoShutdownRegisteredDevices(); - + if (Action == ShutdownNoReboot) { HalDisplayString("\nYou can switch off your computer now\n"); -- 2.17.1