Author: aandrejevic Date: Fri Oct 4 21:16:58 2013 New Revision: 60526
URL: http://svn.reactos.org/svn/reactos?rev=60526&view=rev Log: [NTVDM] Properly handle the case when the console framebuffer could not be created.
Modified: branches/ntvdm/subsystems/ntvdm/vga.c
Modified: branches/ntvdm/subsystems/ntvdm/vga.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vga.c?rev... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] Fri Oct 4 21:16:58 2013 @@ -488,12 +488,22 @@ if (!(VgaGcRegisters[VGA_GC_MISC_REG] & VGA_GC_MISC_NOALPHA)) { /* Enter new text mode */ - if (!VgaEnterTextMode(&Resolution)) return; + if (!VgaEnterTextMode(&Resolution)) + { + DisplayMessage(L"An unexpected VGA error occurred while switching into text mode."); + VdmRunning = FALSE; + return; + } } else { /* Enter 8-bit graphics mode */ - if (!VgaEnterGraphicsMode(&Resolution)) return; + if (!VgaEnterGraphicsMode(&Resolution)) + { + DisplayMessage(L"An unexpected VGA error occurred while switching into graphics mode."); + VdmRunning = FALSE; + return; + } }
/* Trigger a full update of the screen */ @@ -515,6 +525,12 @@ DWORD Address = (VgaCrtcRegisters[VGA_CRTC_START_ADDR_HIGH_REG] << 8) + VgaCrtcRegisters[VGA_CRTC_START_ADDR_LOW_REG]; DWORD ScanlineSize = (DWORD)VgaCrtcRegisters[VGA_CRTC_OFFSET_REG] * 2; + + /* + * If console framebuffer is NULL, that means something went wrong + * earlier and this is the final display refresh. + */ + if (ConsoleFramebuffer == NULL) return;
/* Check if this is text mode or graphics mode */ if (VgaGcRegisters[VGA_GC_MISC_REG] & VGA_GC_MISC_NOALPHA)