mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 19:55:41 +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)
|
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;
|
if (!IsConsoleHandle(TextHandle)) return FALSE;
|
||||||
TextConsoleBuffer = TextHandle;
|
TextConsoleBuffer = TextHandle;
|
||||||
|
|
||||||
|
@ -814,6 +817,7 @@ BOOLEAN VgaConsoleInitialize(HANDLE TextHandle)
|
||||||
if (!GetConsoleCursorInfo(TextConsoleBuffer, &OrgConsoleCursorInfo) ||
|
if (!GetConsoleCursorInfo(TextConsoleBuffer, &OrgConsoleCursorInfo) ||
|
||||||
!GetConsoleScreenBufferInfo(TextConsoleBuffer, &OrgConsoleBufferInfo))
|
!GetConsoleScreenBufferInfo(TextConsoleBuffer, &OrgConsoleBufferInfo))
|
||||||
{
|
{
|
||||||
|
TextConsoleBuffer = NULL;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
ConsoleInfo = OrgConsoleBufferInfo;
|
ConsoleInfo = OrgConsoleBufferInfo;
|
||||||
|
@ -826,8 +830,13 @@ BOOLEAN VgaConsoleInitialize(HANDLE TextHandle)
|
||||||
|
|
||||||
VOID VgaConsoleCleanup(VOID)
|
VOID VgaConsoleCleanup(VOID)
|
||||||
{
|
{
|
||||||
|
/* If the console video was not initialized, just return */
|
||||||
|
if (!TextConsoleBuffer)
|
||||||
|
return;
|
||||||
|
|
||||||
VgaDetachFromConsole();
|
VgaDetachFromConsole();
|
||||||
|
|
||||||
|
// TODO: We need to initialize those events before using them!
|
||||||
CloseHandle(AnotherEvent);
|
CloseHandle(AnotherEvent);
|
||||||
CloseHandle(EndEvent);
|
CloseHandle(EndEvent);
|
||||||
CloseHandle(StartEvent);
|
CloseHandle(StartEvent);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue