[NTVDM] Retrieve the full directory of the current running NTVDM instance, to be...
[reactos.git] / subsystems / mvdm / ntvdm / ntvdm.h
1 /*
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>
7 */
8
9 #ifndef _NTVDM_H_
10 #define _NTVDM_H_
11
12 /* BUILD CONFIGURATION ********************************************************/
13
14 /*
15 * Activate this line if you want to run NTVDM in standalone mode with:
16 * ntvdm.exe <program>
17 */
18 // #define STANDALONE
19
20 /*
21 * Activate this line for Win2k compliancy
22 */
23 // #define WIN2K_COMPLIANT
24
25 /*
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)
29 */
30 // #define ADVANCED_DEBUGGING
31
32 #ifdef ADVANCED_DEBUGGING
33 #define ADVANCED_DEBUGGING_LEVEL 1
34 #endif
35
36
37 /* INCLUDES *******************************************************************/
38
39 #include <stdio.h>
40 #include <stdarg.h>
41 #include <wchar.h>
42
43 #ifndef _countof
44 #define _countof(_Array) (sizeof(_Array) / sizeof(_Array[0]))
45 #endif
46
47 /* PSDK/NDK Headers */
48 #define WIN32_NO_STATUS
49 #include <windef.h>
50 #include <winbase.h>
51 #include <wingdi.h>
52 #include <wincon.h>
53 #include <winnls.h>
54 #include <winreg.h>
55 #include <winuser.h>
56 #include <commdlg.h>
57
58 #include <subsys/win/vdm.h>
59
60 // Do not include stuff that is only defined
61 // for backwards compatibility in nt_vdd.h
62 #define NO_NTVDD_COMPAT
63 #include <vddsvc.h>
64
65 DWORD WINAPI SetLastConsoleEventActive(VOID);
66
67 #define NTOS_MODE_USER
68 #include <ndk/kefuncs.h> // For NtQueryPerformanceCounter()
69 #include <ndk/rtlfuncs.h>
70
71 /* PSEH for SEH Support */
72 #include <pseh/pseh2.h>
73
74 #include <ntstrsafe.h>
75
76
77 /* VARIABLES ******************************************************************/
78
79 typedef struct _NTVDM_SETTINGS
80 {
81 ANSI_STRING BiosFileName;
82 ANSI_STRING RomFiles;
83 UNICODE_STRING FloppyDisks[2];
84 UNICODE_STRING HardDisks[4];
85 } NTVDM_SETTINGS, *PNTVDM_SETTINGS;
86
87 extern NTVDM_SETTINGS GlobalSettings;
88
89 // Command line of NTVDM
90 extern INT NtVdmArgc;
91 extern WCHAR** NtVdmArgv;
92
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.
96
97 extern HWND hConsoleWnd;
98
99
100 /* FUNCTIONS ******************************************************************/
101
102 /*
103 * Interface functions
104 */
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, ...);
109
110 /*static*/ VOID
111 UpdateVdmMenuDisks(VOID);
112
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);
119
120 #endif // _NTVDM_H_
121
122 /* EOF */