2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: subsystems/mvdm/ntvdm/ntvdm.h
5 * PURPOSE: Header file to define commonly used stuff
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
12 /* BUILD CONFIGURATION ********************************************************/
15 * Activate this line if you want to run NTVDM in standalone mode with:
21 * Activate this line for Win2k compliancy
23 // #define WIN2K_COMPLIANT
26 * Activate this line if you want advanced hardcoded debug facilities
27 * (called interrupts, etc...), that may break PC-AT compatibility.
28 * USE AT YOUR OWN RISK! (disabled by default)
30 // #define ADVANCED_DEBUGGING
32 #ifdef ADVANCED_DEBUGGING
33 #define ADVANCED_DEBUGGING_LEVEL 1
37 /* INCLUDES *******************************************************************/
44 #define _countof(_Array) (sizeof(_Array) / sizeof(_Array[0]))
47 /* PSDK/NDK Headers */
48 #define WIN32_NO_STATUS
58 #include <subsys/win/vdm.h>
60 // Do not include stuff that is only defined
61 // for backwards compatibility in nt_vdd.h
62 #define NO_NTVDD_COMPAT
65 DWORD WINAPI
SetLastConsoleEventActive(VOID
);
67 #define NTOS_MODE_USER
68 #include <ndk/kefuncs.h> // For NtQueryPerformanceCounter()
69 #include <ndk/rtlfuncs.h>
71 /* PSEH for SEH Support */
72 #include <pseh/pseh2.h>
74 #include <ntstrsafe.h>
77 /* VARIABLES ******************************************************************/
79 typedef struct _NTVDM_SETTINGS
81 ANSI_STRING BiosFileName
;
83 UNICODE_STRING FloppyDisks
[2];
84 UNICODE_STRING HardDisks
[4];
85 } NTVDM_SETTINGS
, *PNTVDM_SETTINGS
;
87 extern NTVDM_SETTINGS GlobalSettings
;
89 // Command line of NTVDM
91 extern WCHAR
** NtVdmArgv
;
93 /* Full directory where NTVDM resides, or the SystemRoot\System32 path */
94 extern WCHAR NtVdmPath
[MAX_PATH
];
95 extern ULONG NtVdmPathSize
; // Length without NULL terminator.
97 extern HWND hConsoleWnd
;
100 /* FUNCTIONS ******************************************************************/
103 * Interface functions
105 typedef VOID (*CHAR_PRINT
)(IN CHAR Character
);
106 VOID
DisplayMessage(IN LPCWSTR Format
, ...);
107 VOID
PrintMessageAnsi(IN CHAR_PRINT CharPrint
,
108 IN LPCSTR Format
, ...);
111 UpdateVdmMenuDisks(VOID
);
113 BOOL
ConsoleAttach(VOID
);
114 VOID
ConsoleDetach(VOID
);
115 VOID
ConsoleReattach(HANDLE ConOutHandle
);
116 BOOL
IsConsoleHandle(HANDLE hHandle
);
117 VOID
MenuEventHandler(PMENU_EVENT_RECORD MenuEvent
);
118 VOID
FocusEventHandler(PFOCUS_EVENT_RECORD FocusEvent
);