Author: hbelusca
Date: Sun Sep 14 00:43:43 2014
New Revision: 64137
URL:
http://svn.reactos.org/svn/reactos?rev=64137&view=rev
Log:
[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).
Modified:
trunk/reactos/subsystems/ntvdm/emulator.c
trunk/reactos/subsystems/ntvdm/hardware/vga.c
trunk/reactos/subsystems/ntvdm/ntvdm.c
trunk/reactos/subsystems/ntvdm/ntvdm.h
Modified: trunk/reactos/subsystems/ntvdm/emulator.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/emulator.…
==============================================================================
--- trunk/reactos/subsystems/ntvdm/emulator.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/emulator.c [iso-8859-1] Sun Sep 14 00:43:43 2014
@@ -355,6 +355,8 @@
_snwprintf(FileName, MAX_PATH, L"memdump%lu.txt", DumpNumber);
++DumpNumber;
+ DPRINT1("Creating memory dump file '%S'...\n", FileName);
+
/* Always create the dump file */
hFile = CreateFileW(FileName,
GENERIC_WRITE,
@@ -415,6 +417,8 @@
/* Close the file */
CloseHandle(hFile);
+
+ DPRINT1("Memory dump done\n");
}
DWORD WINAPI PumpConsoleInput(LPVOID Parameter);
Modified: trunk/reactos/subsystems/ntvdm/hardware/vga.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/hardware/…
==============================================================================
--- trunk/reactos/subsystems/ntvdm/hardware/vga.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/hardware/vga.c [iso-8859-1] Sun Sep 14 00:43:43 2014
@@ -942,6 +942,16 @@
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)
{
DWORD i;
@@ -999,7 +1009,7 @@
ZeroMemory(ConsoleFramebuffer, BitmapInfo->bmiHeader.biSizeImage);
/* Set the active buffer */
- SetConsoleActiveScreenBuffer(GraphicsConsoleBuffer);
+ VgaSetActiveScreenBuffer(GraphicsConsoleBuffer);
/* Set the graphics mode palette */
SetConsolePalette(GraphicsConsoleBuffer,
@@ -1018,7 +1028,7 @@
ReleaseMutex(ConsoleMutex);
/* Switch back to the default console text buffer */
- // SetConsoleActiveScreenBuffer(TextConsoleBuffer);
+ // VgaSetActiveScreenBuffer(TextConsoleBuffer);
/* Cleanup the video data */
CloseHandle(ConsoleMutex);
@@ -1034,7 +1044,7 @@
DPRINT1("VgaEnterTextMode\n");
/* Switch to the text buffer */
- SetConsoleActiveScreenBuffer(TextConsoleBuffer);
+ VgaSetActiveScreenBuffer(TextConsoleBuffer);
/* Adjust the text framebuffer if we changed the resolution */
if (TextResolution.X != Resolution->X ||
@@ -1950,7 +1960,7 @@
SMALL_RECT ConRect;
/* Restore the old screen buffer */
- SetConsoleActiveScreenBuffer(TextConsoleBuffer);
+ VgaSetActiveScreenBuffer(TextConsoleBuffer);
/* Restore the original console size */
ConRect.Left = 0;
@@ -1988,7 +1998,7 @@
/***/ VgaResetPalette(); /***/
/* Switch to the text buffer */
- SetConsoleActiveScreenBuffer(TextConsoleBuffer);
+ VgaSetActiveScreenBuffer(TextConsoleBuffer);
/* Clear the VGA memory */
VgaClearMemory();
Modified: trunk/reactos/subsystems/ntvdm/ntvdm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/ntvdm.c?r…
==============================================================================
--- trunk/reactos/subsystems/ntvdm/ntvdm.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/ntvdm.c [iso-8859-1] Sun Sep 14 00:43:43 2014
@@ -119,7 +119,7 @@
} while (!(Items[i].uID == 0 && Items[i].SubMenu == NULL &&
Items[i].wCmdID == 0));
}
-static VOID
+/*static*/ VOID
CreateVdmMenu(HANDLE ConOutHandle)
{
hConsoleMenu = ConsoleMenuControl(ConOutHandle,
@@ -132,7 +132,7 @@
DrawMenuBar(GetConsoleWindow());
}
-static VOID
+/*static*/ VOID
DestroyVdmMenu(VOID)
{
UINT i = 0;
Modified: trunk/reactos/subsystems/ntvdm/ntvdm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/ntvdm.h?r…
==============================================================================
--- trunk/reactos/subsystems/ntvdm/ntvdm.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/ntvdm.h [iso-8859-1] Sun Sep 14 00:43:43 2014
@@ -48,6 +48,11 @@
VOID DisplayMessage(LPCWSTR Format, ...);
+/*static*/ VOID
+CreateVdmMenu(HANDLE ConOutHandle);
+/*static*/ VOID
+DestroyVdmMenu(VOID);
+
#endif // _NTVDM_H_
/* EOF */