ReactOS  0.4.14-dev-608-gd495a4f
console.c File Reference
#include "resource.h"
Include dependency graph for console.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _VDM_MENUITEM
 

Typedefs

typedef struct _VDM_MENUITEM VDM_MENUITEM
 
typedef struct _VDM_MENUITEMPVDM_MENUITEM
 

Functions

static VOID AppendMenuItems (HMENU hMenu, const VDM_MENUITEM *Items)
 
static BOOL VdmMenuExists (HMENU hConsoleMenu)
 
static VOID UpdateVdmMenuMouse (VOID)
 
VOID UpdateVdmMenuDisks (VOID)
 
static VOID UpdateVdmMenu (VOID)
 
static VOID CreateVdmMenu (HANDLE ConOutHandle)
 
static VOID DestroyVdmMenu (VOID)
 
static VOID CaptureMousePointer (HANDLE ConOutHandle, BOOLEAN Capture)
 
static VOID EnableExtraHardware (HANDLE ConsoleInput)
 
VOID VdmShutdown (BOOLEAN Immediate)
 
static BOOL WINAPI ConsoleCtrlHandler (DWORD ControlType)
 
static VOID ConsoleInitUI (VOID)
 
static VOID ConsoleCleanupUI (VOID)
 
BOOL ConsoleAttach (VOID)
 
VOID ConsoleDetach (VOID)
 
VOID ConsoleReattach (HANDLE ConOutHandle)
 
static BOOL ConsoleInit (VOID)
 
static VOID ConsoleCleanup (VOID)
 
BOOL IsConsoleHandle (HANDLE hHandle)
 
VOID MenuEventHandler (PMENU_EVENT_RECORD MenuEvent)
 
VOID FocusEventHandler (PFOCUS_EVENT_RECORD FocusEvent)
 

Variables

static HANDLE CurrentConsoleOutput = INVALID_HANDLE_VALUE
 
static HANDLE ConsoleInput = INVALID_HANDLE_VALUE
 
static HANDLE ConsoleOutput = INVALID_HANDLE_VALUE
 
static DWORD OrgConsoleInputMode
 
static DWORD OrgConsoleOutputMode
 
HWND hConsoleWnd = NULL
 
static HMENU hConsoleMenu = NULL
 
static INT VdmMenuPos = -1
 
static BOOL CaptureMouse = FALSE
 
static const VDM_MENUITEM VdmMenuItems []
 
static const VDM_MENUITEM VdmMainMenuItems []
 

Typedef Documentation

◆ PVDM_MENUITEM

◆ VDM_MENUITEM

Function Documentation

◆ AppendMenuItems()

static VOID AppendMenuItems ( HMENU  hMenu,
const VDM_MENUITEM Items 
)
static

Definition at line 58 of file console.c.

60 {
61  UINT i = 0;
62  WCHAR szMenuString[256];
63  HMENU hSubMenu;
64 
65  do
66  {
67  if (Items[i].uID != (UINT)-1)
68  {
70  Items[i].uID,
71  szMenuString,
72  ARRAYSIZE(szMenuString)) > 0)
73  {
74  if (Items[i].SubMenu != NULL)
75  {
76  hSubMenu = CreatePopupMenu();
77  if (hSubMenu != NULL)
78  {
79  AppendMenuItems(hSubMenu, Items[i].SubMenu);
80 
81  if (!AppendMenuW(hMenu,
83  (UINT_PTR)hSubMenu,
84  szMenuString))
85  {
86  DestroyMenu(hSubMenu);
87  }
88  }
89  }
90  else
91  {
92  AppendMenuW(hMenu,
93  MF_STRING,
94  Items[i].uCmdID,
95  szMenuString);
96  }
97  }
98  }
99  else
100  {
101  AppendMenuW(hMenu,
102  MF_SEPARATOR,
103  0,
104  NULL);
105  }
106  i++;
107  } while (!(Items[i].uID == 0 && Items[i].SubMenu == NULL && Items[i].uCmdID == 0));
108 }
#define MF_STRING
Definition: winuser.h:138
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
BOOL WINAPI AppendMenuW(_In_ HMENU, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
#define MF_SEPARATOR
Definition: winuser.h:137
static VOID AppendMenuItems(HMENU hMenu, const VDM_MENUITEM *Items)
Definition: console.c:58
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define MF_POPUP
Definition: winuser.h:136
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define GetModuleHandle
Definition: winbase.h:3661
unsigned int UINT
Definition: ndis.h:50
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:846
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

Referenced by CreateVdmMenu().

◆ CaptureMousePointer()

static VOID CaptureMousePointer ( HANDLE  ConOutHandle,
BOOLEAN  Capture 
)
static

Definition at line 288 of file console.c.

289 {
290  static BOOL IsClipped = FALSE; // For debugging purposes
291  UNREFERENCED_PARAMETER(IsClipped);
292 
293  if (Capture)
294  {
295  RECT rcClip;
296 
297  // if (IsClipped) return;
298 
299  /* Be sure the cursor will be hidden */
300  while (ShowConsoleCursor(ConOutHandle, FALSE) >= 0) ;
301 
302  GetClientRect(hConsoleWnd, &rcClip);
303  MapWindowPoints(hConsoleWnd, HWND_DESKTOP /*NULL*/, (LPPOINT)&rcClip, 2 /* Magic value when the LPPOINT parameter is a RECT */);
304  IsClipped = ClipCursor(&rcClip);
305  }
306  else
307  {
308  // if (!IsClipped) return;
309 
310  ClipCursor(NULL);
311  IsClipped = FALSE;
312 
313  /* Be sure the cursor will be shown */
314  while (ShowConsoleCursor(ConOutHandle, TRUE) < 0) ;
315  }
316 }
#define TRUE
Definition: types.h:120
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
HWND hConsoleWnd
Definition: console.c:20
BOOL WINAPI ClipCursor(_In_opt_ LPCRECT)
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
INT WINAPI DECLSPEC_HOTPATCH ShowConsoleCursor(HANDLE hConsoleOutput, BOOL bShow)
Definition: console.c:1073
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define HWND_DESKTOP
Definition: winuser.h:1195

Referenced by ConsoleCleanupUI(), ConsoleReattach(), FocusEventHandler(), and MenuEventHandler().

◆ ConsoleAttach()

BOOL ConsoleAttach ( VOID  )

Definition at line 398 of file console.c.

399 {
400  /* Save the original input and output console modes */
403  {
406  wprintf(L"FATAL: Cannot save console in/out modes\n");
407  return FALSE;
408  }
409 
410  /* Set the console input mode */
413 
414  /* Set the console output mode */
415  // SetConsoleMode(ConsoleOutput, ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT);
416 
417  /* Initialize the UI */
418  ConsoleInitUI();
419 
420  return TRUE;
421 }
static DWORD OrgConsoleOutputMode
Definition: console.c:18
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
static VOID ConsoleInitUI(VOID)
Definition: console.c:382
BOOL WINAPI GetConsoleMode(HANDLE hConsoleHandle, LPDWORD lpMode)
Definition: console.c:1571
#define wprintf(...)
Definition: whoami.c:18
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleMode(HANDLE hConsoleHandle, DWORD dwMode)
Definition: console.c:1608
static VOID EnableExtraHardware(HANDLE ConsoleInput)
Definition: console.c:318
static const WCHAR L[]
Definition: oid.c:1250
#define ENABLE_WINDOW_INPUT
Definition: wincon.h:78
static HANDLE ConsoleOutput
Definition: console.c:17
static DWORD OrgConsoleInputMode
Definition: console.c:18

Referenced by ConsoleInit(), and DosProcessConsoleAttach().

◆ ConsoleCleanup()

static VOID ConsoleCleanup ( VOID  )
static

Definition at line 493 of file console.c.

494 {
495  /* Detach from the console */
496  ConsoleDetach();
497 
498  /* Close the console handles */
501 }
#define CloseHandle
Definition: compat.h:406
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
VOID ConsoleDetach(VOID)
Definition: console.c:424
static HANDLE ConsoleOutput
Definition: console.c:17

◆ ConsoleCleanupUI()

static VOID ConsoleCleanupUI ( VOID  )
static

Definition at line 389 of file console.c.

390 {
391  /* Display again properly the mouse pointer */
393 
394  DestroyVdmMenu();
395 }
static BOOL CaptureMouse
Definition: console.c:23
static HANDLE ConsoleOutput
Definition: console.c:17
static VOID DestroyVdmMenu(VOID)
Definition: console.c:274
static VOID CaptureMousePointer(HANDLE ConOutHandle, BOOLEAN Capture)
Definition: console.c:288

Referenced by ConsoleDetach().

◆ ConsoleCtrlHandler()

static BOOL WINAPI ConsoleCtrlHandler ( DWORD  ControlType)
static

Definition at line 359 of file console.c.

360 {
361  switch (ControlType)
362  {
364  {
365  /* Delayed shutdown */
366  DPRINT1("NTVDM delayed killing in the CTRL_LAST_CLOSE_EVENT CtrlHandler!\n");
368  break;
369  }
370 
371  default:
372  {
373  /* Stop the VDM if the user logs out or closes the console */
374  DPRINT1("Killing NTVDM in the 'default' CtrlHandler!\n");
375  VdmShutdown(TRUE);
376  }
377  }
378  return TRUE;
379 }
#define TRUE
Definition: types.h:120
VOID VdmShutdown(BOOLEAN Immediate)
Definition: ntvdm.c:310
#define CTRL_LAST_CLOSE_EVENT
Definition: wincon.h:68
#define DPRINT1
Definition: precomp.h:8

Referenced by ConsoleInit().

◆ ConsoleDetach()

VOID ConsoleDetach ( VOID  )

Definition at line 424 of file console.c.

425 {
426  /* Cleanup the UI */
428 
429  /* Restore the original input and output console modes */
432 }
static DWORD OrgConsoleOutputMode
Definition: console.c:18
static VOID ConsoleCleanupUI(VOID)
Definition: console.c:389
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleMode(HANDLE hConsoleHandle, DWORD dwMode)
Definition: console.c:1608
static HANDLE ConsoleOutput
Definition: console.c:17
static DWORD OrgConsoleInputMode
Definition: console.c:18

Referenced by ConsoleCleanup(), and DosProcessConsoleDetach().

◆ ConsoleInit()

static BOOL ConsoleInit ( VOID  )
static

Definition at line 446 of file console.c.

447 {
448  /* Set the handler routine */
450 
451  /* Enable the CTRL_LAST_CLOSE_EVENT */
453 
454  /*
455  * NOTE: The CONIN$ and CONOUT$ "virtual" files
456  * always point to non-redirected console handles.
457  */
458 
459  /* Get the input handle to the real console, and check for success */
460  ConsoleInput = CreateFileW(L"CONIN$",
463  NULL,
465  0,
466  NULL);
468  {
469  wprintf(L"FATAL: Cannot retrieve a handle to the console input\n");
470  return FALSE;
471  }
472 
473  /* Get the output handle to the real console, and check for success */
474  ConsoleOutput = CreateFileW(L"CONOUT$",
477  NULL,
479  0,
480  NULL);
482  {
484  wprintf(L"FATAL: Cannot retrieve a handle to the console output\n");
485  return FALSE;
486  }
487 
488  /* Effectively attach to the console */
489  return ConsoleAttach();
490 }
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define wprintf(...)
Definition: whoami.c:18
#define FILE_SHARE_READ
Definition: compat.h:125
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleCtrlHandler(PHANDLER_ROUTINE HandlerRoutine, BOOL Add)
Definition: console.c:2111
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:416
#define OPEN_EXISTING
Definition: compat.h:434
BOOL ConsoleAttach(VOID)
Definition: console.c:398
static const WCHAR L[]
Definition: oid.c:1250
#define GENERIC_READ
Definition: compat.h:124
static BOOL WINAPI ConsoleCtrlHandler(DWORD ControlType)
Definition: console.c:359
DWORD WINAPI SetLastConsoleEventActive(VOID)
Definition: console.c:3142
#define CreateFileW
Definition: compat.h:408
static HANDLE ConsoleOutput
Definition: console.c:17

◆ ConsoleInitUI()

static VOID ConsoleInitUI ( VOID  )
static

Definition at line 382 of file console.c.

383 {
386 }
HWND hConsoleWnd
Definition: console.c:20
static VOID CreateVdmMenu(HANDLE ConOutHandle)
Definition: console.c:203
static HANDLE ConsoleOutput
Definition: console.c:17
HWND WINAPI DECLSPEC_HOTPATCH GetConsoleWindow(VOID)
Definition: console.c:2730

Referenced by ConsoleAttach().

◆ ConsoleReattach()

VOID ConsoleReattach ( HANDLE  ConOutHandle)

Definition at line 435 of file console.c.

436 {
437  DestroyVdmMenu();
438  CurrentConsoleOutput = ConOutHandle;
439  CreateVdmMenu(ConOutHandle);
440 
441  /* Synchronize mouse cursor display with console screenbuffer switches */
443 }
static BOOL CaptureMouse
Definition: console.c:23
static HANDLE CurrentConsoleOutput
Definition: console.c:14
static VOID CreateVdmMenu(HANDLE ConOutHandle)
Definition: console.c:203
static VOID DestroyVdmMenu(VOID)
Definition: console.c:274
static VOID CaptureMousePointer(HANDLE ConOutHandle, BOOLEAN Capture)
Definition: console.c:288

Referenced by SetActiveScreenBuffer().

◆ CreateVdmMenu()

static VOID CreateVdmMenu ( HANDLE  ConOutHandle)
static

Definition at line 203 of file console.c.

204 {
205  HMENU hVdmSubMenu;
206  UINT_PTR ItemID;
207  UINT Pos;
208  USHORT i;
209  WCHAR szNoMedia[100];
210  WCHAR szMenuString1[256], szMenuString2[256];
211 
212  hConsoleMenu = ConsoleMenuControl(ConOutHandle,
215  if (hConsoleMenu == NULL) return;
216 
217  /* Get the position where we are going to insert our menu items */
219 
220  /* Really add the menu if it doesn't already exist (in case eg. NTVDM crashed) */
222  {
223  /* Add all the menu entries */
225 
226  /* Add the removable drives menu entries */
227  hVdmSubMenu = GetSubMenu(hConsoleMenu, VdmMenuPos + 2); // VdmMenuItems
228  Pos = 3; // After the 2 items and the separator in VdmMenuItems
229 
231  IDS_NO_MEDIA,
232  szNoMedia,
233  ARRAYSIZE(szNoMedia));
234 
237  szMenuString1,
238  ARRAYSIZE(szMenuString1));
239 
240  /* Drive 'x' -- Mount */
241  for (i = 0; i < ARRAYSIZE(GlobalSettings.FloppyDisks); ++i)
242  {
243  ItemID = ID_VDM_DRIVES + (2 * i);
244 
245  /* Add the item */
246  _snwprintf(szMenuString2, ARRAYSIZE(szMenuString2), szMenuString1, i, szNoMedia);
247  szMenuString2[ARRAYSIZE(szMenuString2) - 1] = UNICODE_NULL;
248  InsertMenuW(hVdmSubMenu, Pos++, MF_STRING | MF_BYPOSITION, ItemID, szMenuString2);
249  }
250 
253  szMenuString1,
254  ARRAYSIZE(szMenuString1));
255 
256  /* Drive 'x' -- Eject */
257  for (i = 0; i < ARRAYSIZE(GlobalSettings.FloppyDisks); ++i)
258  {
259  ItemID = ID_VDM_DRIVES + (2 * i);
260 
261  /* Add the item */
262  _snwprintf(szMenuString2, ARRAYSIZE(szMenuString2), szMenuString1, i);
263  szMenuString2[ARRAYSIZE(szMenuString2) - 1] = UNICODE_NULL;
264  InsertMenuW(hVdmSubMenu, Pos++, MF_STRING | MF_BYPOSITION, ItemID + 1, szMenuString2);
265  }
266 
267  /* Refresh the menu state */
268  UpdateVdmMenu();
270  }
271 }
BOOL WINAPI DrawMenuBar(_In_ HWND)
HWND hConsoleWnd
Definition: console.c:20
BOOL WINAPI InsertMenuW(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)
ush Pos
Definition: deflate.h:92
#define MF_STRING
Definition: winuser.h:138
#define IDS_VDM_MOUNT_FLOPPY
Definition: resource.h:19
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define ID_VDM_DRIVES
Definition: resource.h:10
#define IDS_NO_MEDIA
Definition: resource.h:23
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
static INT VdmMenuPos
Definition: console.c:22
static BOOL VdmMenuExists(HMENU hConsoleMenu)
Definition: console.c:111
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define UNICODE_NULL
#define MF_BYPOSITION
Definition: winuser.h:203
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
static HMENU hConsoleMenu
Definition: console.c:21
#define IDS_VDM_EJECT_FLOPPY
Definition: resource.h:20
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format,...)
smooth NULL
Definition: ftsmooth.c:416
static VOID AppendMenuItems(HMENU hMenu, const VDM_MENUITEM *Items)
Definition: console.c:58
UNICODE_STRING FloppyDisks[2]
Definition: ntvdm.h:78
static const VDM_MENUITEM VdmMainMenuItems[]
Definition: console.c:48
HMENU WINAPI DECLSPEC_HOTPATCH ConsoleMenuControl(HANDLE hConsoleOutput, DWORD dwCmdIdLow, DWORD dwCmdIdHigh)
Definition: console.c:396
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define GetModuleHandle
Definition: winbase.h:3661
unsigned short USHORT
Definition: pedump.c:61
static VOID UpdateVdmMenu(VOID)
Definition: console.c:196
unsigned int UINT
Definition: ndis.h:50
#define ID_CAPTURE_MOUSE
Definition: resource.h:4
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
NTVDM_SETTINGS GlobalSettings
Definition: ntvdm.c:25

Referenced by ConsoleInitUI(), and ConsoleReattach().

◆ DestroyVdmMenu()

static VOID DestroyVdmMenu ( VOID  )
static

Definition at line 274 of file console.c.

275 {
276  UINT i = 0;
277  const VDM_MENUITEM *Items = VdmMainMenuItems;
278 
279  do
280  {
282  i++;
283  } while (!(Items[i].uID == 0 && Items[i].SubMenu == NULL && Items[i].uCmdID == 0));
284 
286 }
BOOL WINAPI DrawMenuBar(_In_ HWND)
HWND hConsoleWnd
Definition: console.c:20
static INT VdmMenuPos
Definition: console.c:22
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define MF_BYPOSITION
Definition: winuser.h:203
static HMENU hConsoleMenu
Definition: console.c:21
smooth NULL
Definition: ftsmooth.c:416
static const VDM_MENUITEM VdmMainMenuItems[]
Definition: console.c:48
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
unsigned int UINT
Definition: ndis.h:50

Referenced by ConsoleCleanupUI(), and ConsoleReattach().

◆ EnableExtraHardware()

static VOID EnableExtraHardware ( HANDLE  ConsoleInput)
static

Definition at line 318 of file console.c.

319 {
320  DWORD ConInMode;
321 
322  if (GetConsoleMode(ConsoleInput, &ConInMode))
323  {
324 #if 0
325  // GetNumberOfConsoleMouseButtons();
326  // GetSystemMetrics(SM_CMOUSEBUTTONS);
327  // GetSystemMetrics(SM_MOUSEPRESENT);
328  if (MousePresent)
329  {
330 #endif
331  /* Support mouse input events if there is a mouse on the system */
332  ConInMode |= ENABLE_MOUSE_INPUT;
333 #if 0
334  }
335  else
336  {
337  /* Do not support mouse input events if there is no mouse on the system */
338  ConInMode &= ~ENABLE_MOUSE_INPUT;
339  }
340 #endif
341 
342  SetConsoleMode(ConsoleInput, ConInMode);
343  }
344 }
BOOL WINAPI GetConsoleMode(HANDLE hConsoleHandle, LPDWORD lpMode)
Definition: console.c:1571
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleMode(HANDLE hConsoleHandle, DWORD dwMode)
Definition: console.c:1608
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ENABLE_MOUSE_INPUT
Definition: wincon.h:79

Referenced by ConsoleAttach().

◆ FocusEventHandler()

VOID FocusEventHandler ( PFOCUS_EVENT_RECORD  FocusEvent)

Definition at line 600 of file console.c.

601 {
602  /*
603  * If the mouse is captured, release it or recapture it
604  * when we lose or regain focus, respectively.
605  */
606  if (!CaptureMouse) return;
608 }
static BOOL CaptureMouse
Definition: console.c:23
static HANDLE CurrentConsoleOutput
Definition: console.c:14
static VOID CaptureMousePointer(HANDLE ConOutHandle, BOOLEAN Capture)
Definition: console.c:288

Referenced by ConsoleEventThread().

◆ IsConsoleHandle()

BOOL IsConsoleHandle ( HANDLE  hHandle)

Definition at line 503 of file console.c.

504 {
505  DWORD dwMode;
506 
507  /* Check whether the handle may be that of a console... */
508  if ((GetFileType(hHandle) & ~FILE_TYPE_REMOTE) != FILE_TYPE_CHAR)
509  return FALSE;
510 
511  /*
512  * It may be. Perform another test... The idea comes from the
513  * MSDN description of the WriteConsole API:
514  *
515  * "WriteConsole fails if it is used with a standard handle
516  * that is redirected to a file. If an application processes
517  * multilingual output that can be redirected, determine whether
518  * the output handle is a console handle (one method is to call
519  * the GetConsoleMode function and check whether it succeeds).
520  * If the handle is a console handle, call WriteConsole. If the
521  * handle is not a console handle, the output is redirected and
522  * you should call WriteFile to perform the I/O."
523  */
524  return GetConsoleMode(hHandle, &dwMode);
525 }
#define FILE_TYPE_REMOTE
Definition: winbase.h:259
BOOL WINAPI GetConsoleMode(HANDLE hConsoleHandle, LPDWORD lpMode)
Definition: console.c:1571
DWORD WINAPI GetFileType(HANDLE hFile)
Definition: fileinfo.c:419
#define FILE_TYPE_CHAR
Definition: winbase.h:257
unsigned long DWORD
Definition: ntddk_ex.h:95

Referenced by ConRingBell().

◆ MenuEventHandler()

VOID MenuEventHandler ( PMENU_EVENT_RECORD  MenuEvent)

Definition at line 527 of file console.c.

528 {
529  switch (MenuEvent->dwCommandId)
530  {
531  /*
532  * System-defined menu commands
533  */
534 
535  case WM_INITMENU:
536  case WM_MENUSELECT:
537  {
538  /*
539  * If the mouse is captured, release it or recapture it
540  * when the menu opens or closes, respectively.
541  */
542  if (!CaptureMouse) break;
544  break;
545  }
546 
547 
548  /*
549  * User-defined menu commands
550  */
551 
552  case ID_CAPTURE_MOUSE:
556  break;
557 
558  case ID_VDM_DUMPMEM_TXT:
559  DumpMemory(TRUE);
560  break;
561 
562  case ID_VDM_DUMPMEM_BIN:
563  DumpMemory(FALSE);
564  break;
565 
566  /* Drive 0 -- Mount */
567  /* Drive 1 -- Mount */
568  case ID_VDM_DRIVES + 0:
569  case ID_VDM_DRIVES + 2:
570  {
571  ULONG DiskNumber = (MenuEvent->dwCommandId - ID_VDM_DRIVES) / 2;
572  MountFloppy(DiskNumber);
573  break;
574  }
575 
576  /* Drive 0 -- Eject */
577  /* Drive 1 -- Eject */
578  case ID_VDM_DRIVES + 1:
579  case ID_VDM_DRIVES + 3:
580  {
581  ULONG DiskNumber = (MenuEvent->dwCommandId - ID_VDM_DRIVES - 1) / 2;
582  EjectFloppy(DiskNumber);
583  break;
584  }
585 
586  case ID_VDM_QUIT:
587  /* Stop the VDM */
588  // EmulatorTerminate();
589 
590  /* Nothing runs, so exit immediately */
591  DPRINT1("Killing NTVDM via console menu!\n");
592  VdmShutdown(TRUE);
593  break;
594 
595  default:
596  break;
597  }
598 }
#define ID_VDM_DUMPMEM_BIN
Definition: resource.h:6
#define TRUE
Definition: types.h:120
VOID EjectFloppy(IN ULONG DiskNumber)
Definition: emulator.c:467
#define ID_VDM_DUMPMEM_TXT
Definition: resource.h:5
#define ID_VDM_DRIVES
Definition: resource.h:10
VOID VdmShutdown(BOOLEAN Immediate)
Definition: ntvdm.c:310
#define ID_VDM_QUIT
Definition: resource.h:7
static BOOL CaptureMouse
Definition: console.c:23
static HANDLE CurrentConsoleOutput
Definition: console.c:14
#define WM_MENUSELECT
Definition: winuser.h:1729
VOID DumpMemory(BOOLEAN TextFormat)
Definition: emulator.c:369
static VOID UpdateVdmMenuMouse(VOID)
Definition: console.c:130
#define WM_INITMENU
Definition: winuser.h:1727
VOID MountFloppy(IN ULONG DiskNumber)
Definition: emulator.c:413
#define DPRINT1
Definition: precomp.h:8
#define ID_CAPTURE_MOUSE
Definition: resource.h:4
unsigned int ULONG
Definition: retypes.h:1
static VOID CaptureMousePointer(HANDLE ConOutHandle, BOOLEAN Capture)
Definition: console.c:288

Referenced by ConsoleEventThread().

◆ UpdateVdmMenu()

static VOID UpdateVdmMenu ( VOID  )
static

Definition at line 196 of file console.c.

197 {
200 }
static VOID UpdateVdmMenuMouse(VOID)
Definition: console.c:130
VOID UpdateVdmMenuDisks(VOID)
Definition: console.c:146

Referenced by CreateVdmMenu().

◆ UpdateVdmMenuDisks()

VOID UpdateVdmMenuDisks ( VOID  )

Definition at line 146 of file console.c.

147 {
148  UINT_PTR ItemID;
149  USHORT i;
150 
151  WCHAR szNoMedia[100];
152  WCHAR szMenuString1[256], szMenuString2[256];
153 
154  /* Update the disks menu items */
155 
157  IDS_NO_MEDIA,
158  szNoMedia,
159  ARRAYSIZE(szNoMedia));
160 
163  szMenuString1,
164  ARRAYSIZE(szMenuString1));
165 
166  for (i = 0; i < ARRAYSIZE(GlobalSettings.FloppyDisks); ++i)
167  {
168  ItemID = ID_VDM_DRIVES + (2 * i);
169 
170  if (GlobalSettings.FloppyDisks[i].Length != 0 &&
173  {
174  /* Update item text */
175  _snwprintf(szMenuString2, ARRAYSIZE(szMenuString2), szMenuString1, i, GlobalSettings.FloppyDisks[i].Buffer);
176  szMenuString2[ARRAYSIZE(szMenuString2) - 1] = UNICODE_NULL;
177  ModifyMenuW(hConsoleMenu, ItemID, MF_BYCOMMAND | MF_STRING, ItemID, szMenuString2);
178 
179  /* Enable the eject item */
181  }
182  else
183  {
184  /* Update item text */
185  _snwprintf(szMenuString2, ARRAYSIZE(szMenuString2), szMenuString1, i, szNoMedia);
186  szMenuString2[ARRAYSIZE(szMenuString2) - 1] = UNICODE_NULL;
187  ModifyMenuW(hConsoleMenu, ItemID, MF_BYCOMMAND | MF_STRING, ItemID, szMenuString2);
188 
189  /* Disable the eject item */
191  }
192  }
193 }
BOOL WINAPI ModifyMenuW(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)
#define MF_BYCOMMAND
Definition: winuser.h:202
#define MF_STRING
Definition: winuser.h:138
#define IDS_VDM_MOUNT_FLOPPY
Definition: resource.h:19
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define ID_VDM_DRIVES
Definition: resource.h:10
#define IDS_NO_MEDIA
Definition: resource.h:23
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define UNICODE_NULL
static HMENU hConsoleMenu
Definition: console.c:21
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format,...)
smooth NULL
Definition: ftsmooth.c:416
UNICODE_STRING FloppyDisks[2]
Definition: ntvdm.h:78
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MF_ENABLED
Definition: winuser.h:128
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
static const WCHAR L[]
Definition: oid.c:1250
#define GetModuleHandle
Definition: winbase.h:3661
unsigned short USHORT
Definition: pedump.c:61
#define MF_GRAYED
Definition: winuser.h:129
NTVDM_SETTINGS GlobalSettings
Definition: ntvdm.c:25

Referenced by EjectFloppy(), EmulatorInitialize(), MountFloppy(), and UpdateVdmMenu().

◆ UpdateVdmMenuMouse()

static VOID UpdateVdmMenuMouse ( VOID  )
static

Definition at line 130 of file console.c.

131 {
132  WCHAR szMenuString[256];
133 
134  /* Update "Capture/Release mouse" menu item */
137  szMenuString,
138  ARRAYSIZE(szMenuString)) > 0)
139  {
141  MF_BYCOMMAND, ID_CAPTURE_MOUSE, szMenuString);
142  }
143 }
BOOL WINAPI ModifyMenuW(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)
#define MF_BYCOMMAND
Definition: winuser.h:202
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
static BOOL CaptureMouse
Definition: console.c:23
static HMENU hConsoleMenu
Definition: console.c:21
smooth NULL
Definition: ftsmooth.c:416
#define IDS_RELEASE_MOUSE
Definition: resource.h:14
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define IDS_CAPTURE_MOUSE
Definition: resource.h:13
#define GetModuleHandle
Definition: winbase.h:3661
#define ID_CAPTURE_MOUSE
Definition: resource.h:4

Referenced by MenuEventHandler(), and UpdateVdmMenu().

◆ VdmMenuExists()

static BOOL VdmMenuExists ( HMENU  hConsoleMenu)
static

Definition at line 111 of file console.c.

112 {
113  INT MenuPos, i;
114  MenuPos = GetMenuItemCount(hConsoleMenu);
115 
116  /* Check for the presence of one of the VDM menu items */
117  for (i = 0; i <= MenuPos; i++)
118  {
120  {
121  /* Set VdmMenuPos to the position of the existing menu */
122  VdmMenuPos = i - 1;
123  return TRUE;
124  }
125  }
126  return FALSE;
127 }
#define TRUE
Definition: types.h:120
int32_t INT
Definition: typedefs.h:56
static INT VdmMenuPos
Definition: console.c:22
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
static HMENU hConsoleMenu
Definition: console.c:21
UINT WINAPI GetMenuItemID(_In_ HMENU, _In_ int)
#define ID_CAPTURE_MOUSE
Definition: resource.h:4

Referenced by CreateVdmMenu().

◆ VdmShutdown()

VOID VdmShutdown ( BOOLEAN  Immediate)

HACK!! HACK!!

Definition at line 310 of file ntvdm.c.

311 {
312  /*
313  * Immediate = TRUE: Immediate shutdown;
314  * FALSE: Delayed shutdown.
315  */
316  static BOOLEAN MustShutdown = FALSE;
317 
318  /* If a shutdown is ongoing, just return */
319  if (MustShutdown)
320  {
321  DPRINT1("Shutdown is ongoing...\n");
322  Sleep(INFINITE);
323  return;
324  }
325 
326  /* First notify DOS to see whether we can shut down now */
327  MustShutdown = DosShutdown(Immediate);
328  /*
329  * In case we perform an immediate shutdown, or the DOS says
330  * we can shut down, do it now.
331  */
332  MustShutdown = MustShutdown || Immediate;
333 
334  if (MustShutdown)
335  {
337 
338  BiosCleanup();
339  EmulatorCleanup();
340  ConsoleCleanup();
341 
343 
344  DPRINT1("\n\n\nNTVDM - Exiting...\n\n\n");
345  /* Some VDDs rely on the fact that NTVDM calls ExitProcess on Windows */
346  ExitProcess(0);
347  }
348 }
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
BOOLEAN DosShutdown(BOOLEAN Immediate)
Definition: dem.c:1331
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1487
unsigned char BOOLEAN
VOID BiosCleanup(VOID)
Definition: bios.c:153
VOID EmulatorCleanup(VOID)
Definition: emulator.c:639
VOID EmulatorTerminate(VOID)
Definition: emulator.c:503
static VOID ConsoleCleanup(VOID)
#define DPRINT1
Definition: precomp.h:8
static VOID FreeGlobalSettings(IN PNTVDM_SETTINGS Settings)
Definition: ntvdm.c:277
#define INFINITE
Definition: serial.h:102
NTVDM_SETTINGS GlobalSettings
Definition: ntvdm.c:25

Referenced by ConsoleCtrlHandler(), MenuEventHandler(), and wmain().

Variable Documentation

◆ CaptureMouse

BOOL CaptureMouse = FALSE
static

◆ ConsoleInput

Definition at line 16 of file console.c.

◆ ConsoleOutput

◆ CurrentConsoleOutput

HANDLE CurrentConsoleOutput = INVALID_HANDLE_VALUE
static

Definition at line 14 of file console.c.

Referenced by ConsoleReattach(), FocusEventHandler(), and MenuEventHandler().

◆ hConsoleMenu

HMENU hConsoleMenu = NULL
static

◆ hConsoleWnd

HWND hConsoleWnd = NULL

◆ OrgConsoleInputMode

DWORD OrgConsoleInputMode
static

Definition at line 18 of file console.c.

Referenced by ConsoleAttach(), and ConsoleDetach().

◆ OrgConsoleOutputMode

DWORD OrgConsoleOutputMode
static

Definition at line 18 of file console.c.

Referenced by ConsoleAttach(), and ConsoleDetach().

◆ VdmMainMenuItems

const VDM_MENUITEM VdmMainMenuItems[]
static
Initial value:
=
{
{ -1, NULL, 0 },
{ 0, NULL, 0 }
}
static const VDM_MENUITEM VdmMenuItems[]
Definition: console.c:35
smooth NULL
Definition: ftsmooth.c:416
#define IDS_VDM_MENU
Definition: resource.h:15
#define IDS_CAPTURE_MOUSE
Definition: resource.h:13
#define ID_CAPTURE_MOUSE
Definition: resource.h:4

Definition at line 48 of file console.c.

Referenced by CreateVdmMenu(), and DestroyVdmMenu().

◆ VdmMenuItems

const VDM_MENUITEM VdmMenuItems[]
static
Initial value:
=
{
{ -1, NULL, 0 },
{ -1, NULL, 0 },
{ 0, NULL, 0 }
}
#define ID_VDM_DUMPMEM_BIN
Definition: resource.h:6
#define IDS_VDM_DUMPMEM_BIN
Definition: resource.h:18
#define ID_VDM_DUMPMEM_TXT
Definition: resource.h:5
#define ID_VDM_QUIT
Definition: resource.h:7
smooth NULL
Definition: ftsmooth.c:416
#define IDS_VDM_QUIT
Definition: resource.h:21
#define IDS_VDM_DUMPMEM_TXT
Definition: resource.h:17

Definition at line 35 of file console.c.

◆ VdmMenuPos

INT VdmMenuPos = -1
static

Definition at line 22 of file console.c.

Referenced by CreateVdmMenu(), DestroyVdmMenu(), and VdmMenuExists().