mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
[NTVDM]: Don't attempt to deinitialize the video console if it wasn't previously initialized.
CORE-10182 #resolve svn path=/trunk/; revision=72007
This commit is contained in:
parent
ad81a85370
commit
79ce70c1dd
1 changed files with 10 additions and 1 deletions
|
@ -806,7 +806,10 @@ VOID VgaConsoleRepaintScreen(PSMALL_RECT Rect)
|
|||
|
||||
BOOLEAN VgaConsoleInitialize(HANDLE TextHandle)
|
||||
{
|
||||
/* Save the default text-mode console output handle */
|
||||
/*
|
||||
* Initialize the console video by saving the default
|
||||
* text-mode console output handle, if it is valid.
|
||||
*/
|
||||
if (!IsConsoleHandle(TextHandle)) return FALSE;
|
||||
TextConsoleBuffer = TextHandle;
|
||||
|
||||
|
@ -814,6 +817,7 @@ BOOLEAN VgaConsoleInitialize(HANDLE TextHandle)
|
|||
if (!GetConsoleCursorInfo(TextConsoleBuffer, &OrgConsoleCursorInfo) ||
|
||||
!GetConsoleScreenBufferInfo(TextConsoleBuffer, &OrgConsoleBufferInfo))
|
||||
{
|
||||
TextConsoleBuffer = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
ConsoleInfo = OrgConsoleBufferInfo;
|
||||
|
@ -826,8 +830,13 @@ BOOLEAN VgaConsoleInitialize(HANDLE TextHandle)
|
|||
|
||||
VOID VgaConsoleCleanup(VOID)
|
||||
{
|
||||
/* If the console video was not initialized, just return */
|
||||
if (!TextConsoleBuffer)
|
||||
return;
|
||||
|
||||
VgaDetachFromConsole();
|
||||
|
||||
// TODO: We need to initialize those events before using them!
|
||||
CloseHandle(AnotherEvent);
|
||||
CloseHandle(EndEvent);
|
||||
CloseHandle(StartEvent);
|
||||
|
|
Loading…
Reference in a new issue