mirror of
https://github.com/reactos/reactos.git
synced 2024-11-05 06:09:58 +00:00
[NTVDM]
- Add DPRINTs to the DumpMemory function. - Use a VgaSetActiveScreenBuffer function to change active screen buffers: it calls the SetConsoleActiveScreenBuffer API but also recreates the VDM console menus, because on windows custom console menus are per-screen-buffer, and not per-console, so that if you set menus when one screen buffer is activated, and if you change it, then your menus become unuseful because for this new active screenbuffer, they are not set. It's completely ridiculous but we need to live with that (on ReactOS we still don't have this behaviour). svn path=/trunk/; revision=64137
This commit is contained in:
parent
75c869d7b5
commit
fe68098da9
4 changed files with 26 additions and 7 deletions
|
@ -355,6 +355,8 @@ VOID DumpMemory(VOID)
|
||||||
_snwprintf(FileName, MAX_PATH, L"memdump%lu.txt", DumpNumber);
|
_snwprintf(FileName, MAX_PATH, L"memdump%lu.txt", DumpNumber);
|
||||||
++DumpNumber;
|
++DumpNumber;
|
||||||
|
|
||||||
|
DPRINT1("Creating memory dump file '%S'...\n", FileName);
|
||||||
|
|
||||||
/* Always create the dump file */
|
/* Always create the dump file */
|
||||||
hFile = CreateFileW(FileName,
|
hFile = CreateFileW(FileName,
|
||||||
GENERIC_WRITE,
|
GENERIC_WRITE,
|
||||||
|
@ -415,6 +417,8 @@ VOID DumpMemory(VOID)
|
||||||
|
|
||||||
/* Close the file */
|
/* Close the file */
|
||||||
CloseHandle(hFile);
|
CloseHandle(hFile);
|
||||||
|
|
||||||
|
DPRINT1("Memory dump done\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD WINAPI PumpConsoleInput(LPVOID Parameter);
|
DWORD WINAPI PumpConsoleInput(LPVOID Parameter);
|
||||||
|
|
|
@ -942,6 +942,16 @@ Cleanup:
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static VOID VgaSetActiveScreenBuffer(HANDLE ScreenBuffer)
|
||||||
|
{
|
||||||
|
/* Set the active buffer */
|
||||||
|
SetConsoleActiveScreenBuffer(ScreenBuffer);
|
||||||
|
|
||||||
|
/* Reinitialize the VDM menu */
|
||||||
|
DestroyVdmMenu();
|
||||||
|
CreateVdmMenu(ScreenBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
static BOOL VgaEnterGraphicsMode(PCOORD Resolution)
|
static BOOL VgaEnterGraphicsMode(PCOORD Resolution)
|
||||||
{
|
{
|
||||||
DWORD i;
|
DWORD i;
|
||||||
|
@ -999,7 +1009,7 @@ static BOOL VgaEnterGraphicsMode(PCOORD Resolution)
|
||||||
ZeroMemory(ConsoleFramebuffer, BitmapInfo->bmiHeader.biSizeImage);
|
ZeroMemory(ConsoleFramebuffer, BitmapInfo->bmiHeader.biSizeImage);
|
||||||
|
|
||||||
/* Set the active buffer */
|
/* Set the active buffer */
|
||||||
SetConsoleActiveScreenBuffer(GraphicsConsoleBuffer);
|
VgaSetActiveScreenBuffer(GraphicsConsoleBuffer);
|
||||||
|
|
||||||
/* Set the graphics mode palette */
|
/* Set the graphics mode palette */
|
||||||
SetConsolePalette(GraphicsConsoleBuffer,
|
SetConsolePalette(GraphicsConsoleBuffer,
|
||||||
|
@ -1018,7 +1028,7 @@ static VOID VgaLeaveGraphicsMode(VOID)
|
||||||
ReleaseMutex(ConsoleMutex);
|
ReleaseMutex(ConsoleMutex);
|
||||||
|
|
||||||
/* Switch back to the default console text buffer */
|
/* Switch back to the default console text buffer */
|
||||||
// SetConsoleActiveScreenBuffer(TextConsoleBuffer);
|
// VgaSetActiveScreenBuffer(TextConsoleBuffer);
|
||||||
|
|
||||||
/* Cleanup the video data */
|
/* Cleanup the video data */
|
||||||
CloseHandle(ConsoleMutex);
|
CloseHandle(ConsoleMutex);
|
||||||
|
@ -1034,7 +1044,7 @@ static BOOL VgaEnterTextMode(PCOORD Resolution)
|
||||||
DPRINT1("VgaEnterTextMode\n");
|
DPRINT1("VgaEnterTextMode\n");
|
||||||
|
|
||||||
/* Switch to the text buffer */
|
/* Switch to the text buffer */
|
||||||
SetConsoleActiveScreenBuffer(TextConsoleBuffer);
|
VgaSetActiveScreenBuffer(TextConsoleBuffer);
|
||||||
|
|
||||||
/* Adjust the text framebuffer if we changed the resolution */
|
/* Adjust the text framebuffer if we changed the resolution */
|
||||||
if (TextResolution.X != Resolution->X ||
|
if (TextResolution.X != Resolution->X ||
|
||||||
|
@ -1950,7 +1960,7 @@ VOID VgaDetachFromConsole(BOOL ChangingMode)
|
||||||
SMALL_RECT ConRect;
|
SMALL_RECT ConRect;
|
||||||
|
|
||||||
/* Restore the old screen buffer */
|
/* Restore the old screen buffer */
|
||||||
SetConsoleActiveScreenBuffer(TextConsoleBuffer);
|
VgaSetActiveScreenBuffer(TextConsoleBuffer);
|
||||||
|
|
||||||
/* Restore the original console size */
|
/* Restore the original console size */
|
||||||
ConRect.Left = 0;
|
ConRect.Left = 0;
|
||||||
|
@ -1988,7 +1998,7 @@ BOOLEAN VgaInitialize(HANDLE TextHandle)
|
||||||
/***/ VgaResetPalette(); /***/
|
/***/ VgaResetPalette(); /***/
|
||||||
|
|
||||||
/* Switch to the text buffer */
|
/* Switch to the text buffer */
|
||||||
SetConsoleActiveScreenBuffer(TextConsoleBuffer);
|
VgaSetActiveScreenBuffer(TextConsoleBuffer);
|
||||||
|
|
||||||
/* Clear the VGA memory */
|
/* Clear the VGA memory */
|
||||||
VgaClearMemory();
|
VgaClearMemory();
|
||||||
|
|
|
@ -119,7 +119,7 @@ AppendMenuItems(HMENU hMenu,
|
||||||
} while (!(Items[i].uID == 0 && Items[i].SubMenu == NULL && Items[i].wCmdID == 0));
|
} while (!(Items[i].uID == 0 && Items[i].SubMenu == NULL && Items[i].wCmdID == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID
|
/*static*/ VOID
|
||||||
CreateVdmMenu(HANDLE ConOutHandle)
|
CreateVdmMenu(HANDLE ConOutHandle)
|
||||||
{
|
{
|
||||||
hConsoleMenu = ConsoleMenuControl(ConOutHandle,
|
hConsoleMenu = ConsoleMenuControl(ConOutHandle,
|
||||||
|
@ -132,7 +132,7 @@ CreateVdmMenu(HANDLE ConOutHandle)
|
||||||
DrawMenuBar(GetConsoleWindow());
|
DrawMenuBar(GetConsoleWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID
|
/*static*/ VOID
|
||||||
DestroyVdmMenu(VOID)
|
DestroyVdmMenu(VOID)
|
||||||
{
|
{
|
||||||
UINT i = 0;
|
UINT i = 0;
|
||||||
|
|
|
@ -48,6 +48,11 @@ extern HANDLE VdmTaskEvent;
|
||||||
|
|
||||||
VOID DisplayMessage(LPCWSTR Format, ...);
|
VOID DisplayMessage(LPCWSTR Format, ...);
|
||||||
|
|
||||||
|
/*static*/ VOID
|
||||||
|
CreateVdmMenu(HANDLE ConOutHandle);
|
||||||
|
/*static*/ VOID
|
||||||
|
DestroyVdmMenu(VOID);
|
||||||
|
|
||||||
#endif // _NTVDM_H_
|
#endif // _NTVDM_H_
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Reference in a new issue