VOID NTAPI PopShutdownHandler(VOID) { PUCHAR Logo1, Logo2; ULONG i; /* Stop all interrupts */ KeRaiseIrqlToDpcLevel(); _disable(); /* Do we have boot video */ if (InbvIsBootDriverInstalled()) { /* Yes we do, cleanup for shutdown screen */ if (!InbvCheckDisplayOwnership()) InbvAcquireDisplayOwnership(); InbvResetDisplay(); InbvSolidColorFill(0, 0, 639, 479, 0); InbvEnableDisplayString(TRUE); InbvSetScrollRegion(0, 0, 639, 479); /* Display shutdown logo and message */ Logo1 = InbvGetResourceAddress(IDB_SHUTDOWN_MSG); Logo2 = InbvGetResourceAddress(IDB_DEFAULT_LOGO); if ((Logo1) && (Logo2)) { InbvBitBlt(Logo1, 220, 352); InbvBitBlt(Logo2, 222, 111); } } else { /* Do it in text-mode */ for (i = 0; i < 25; i++) InbvDisplayString("\r\n"); InbvDisplayString(" "); InbvDisplayString("The system may be powered off now.\r\n"); } /* Hang the system */ for (;;) HalHaltSystem(); }
VOID KiBugCheckDebugBreak ( IN ULONG BreakStatus ) { do { try { // // Issue a breakpoint // DbgBreakPointWithStatus (BreakStatus); } except(EXCEPTION_EXECUTE_HANDLER) { // // Failure to issue breakpoint, halt the system // try { HalHaltSystem(); } except(EXCEPTION_EXECUTE_HANDLER) { for (;;) { } } for (;;) { } } } while (BreakStatus != DBG_STATUS_BUGCHECK_FIRST); }
VOID NTAPI KiBugCheckDebugBreak(IN ULONG StatusCode) { /* * Wrap this in SEH so we don't crash if * there is no debugger or if it disconnected */ DoBreak: _SEH2_TRY { /* Breakpoint */ DbgBreakPointWithStatus(StatusCode); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { /* No debugger, halt the CPU */ HalHaltSystem(); } _SEH2_END; /* Break again if this wasn't first try */ if (StatusCode != DBG_STATUS_BUGCHECK_FIRST) goto DoBreak; }