ReactOS 0.4.15-dev-7961-gdcf9eb0
ntvdm.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: subsystems/mvdm/ntvdm/ntvdm.c
5 * PURPOSE: Virtual DOS Machine
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7 */
8
9/* INCLUDES *******************************************************************/
10
11#include "ntvdm.h"
12
13#define NDEBUG
14#include <debug.h>
15
16#include "emulator.h"
17
18#include "bios/bios.h"
19#include "cpu/cpu.h"
20
21#include "dos/dem.h"
22
23/* Extra PSDK/NDK Headers */
24#include <ndk/psfuncs.h>
25
26/* VARIABLES ******************************************************************/
27
29
30// Command line of NTVDM
33
34/* Full directory where NTVDM resides, or the SystemRoot\System32 path */
36ULONG NtVdmPathSize; // Length without NULL terminator.
37
38/* PRIVATE FUNCTIONS **********************************************************/
39
40static NTSTATUS
48{
50 UNICODE_STRING ValueString;
51
52 /* Check for the type of the value */
53 if (ValueType != REG_SZ)
54 {
55 RtlInitEmptyAnsiString(&Settings->BiosFileName, NULL, 0);
56 return STATUS_SUCCESS;
57 }
58
59 /* Convert the UNICODE string to ANSI and store it */
60 RtlInitEmptyUnicodeString(&ValueString, (PWCHAR)ValueData, ValueLength);
61 ValueString.Length = ValueString.MaximumLength;
62 RtlUnicodeStringToAnsiString(&Settings->BiosFileName, &ValueString, TRUE);
63
64 return STATUS_SUCCESS;
65}
66
67static NTSTATUS
75{
77 UNICODE_STRING ValueString;
78
79 /* Check for the type of the value */
81 {
82 RtlInitEmptyAnsiString(&Settings->RomFiles, NULL, 0);
83 return STATUS_SUCCESS;
84 }
85
86 /* Convert the UNICODE string to ANSI and store it */
87 RtlInitEmptyUnicodeString(&ValueString, (PWCHAR)ValueData, ValueLength);
88 ValueString.Length = ValueString.MaximumLength;
89 RtlUnicodeStringToAnsiString(&Settings->RomFiles, &ValueString, TRUE);
90
91 return STATUS_SUCCESS;
92}
93
94static NTSTATUS
102{
105 ULONG DiskNumber = PtrToUlong(EntryContext);
106
107 ASSERT(DiskNumber < ARRAYSIZE(Settings->FloppyDisks));
108
109 /* Check whether the Hard Disk entry was not already configured */
110 if (Settings->FloppyDisks[DiskNumber].Buffer != NULL)
111 {
112 DPRINT1("Floppy Disk %d -- '%wZ' already configured\n", DiskNumber, &Settings->FloppyDisks[DiskNumber]);
113 return STATUS_SUCCESS;
114 }
115
116 /* Check for the type of the value */
117 if (ValueType != REG_SZ)
118 {
119 RtlInitEmptyUnicodeString(&Settings->FloppyDisks[DiskNumber], NULL, 0);
120 return STATUS_SUCCESS;
121 }
122
123 /* Initialize the string */
124 Success = RtlCreateUnicodeString(&Settings->FloppyDisks[DiskNumber], (PCWSTR)ValueData);
126
127 return STATUS_SUCCESS;
128}
129
130static NTSTATUS
131NTAPI
138{
141 ULONG DiskNumber = PtrToUlong(EntryContext);
142
143 ASSERT(DiskNumber < ARRAYSIZE(Settings->HardDisks));
144
145 /* Check whether the Hard Disk entry was not already configured */
146 if (Settings->HardDisks[DiskNumber].Buffer != NULL)
147 {
148 DPRINT1("Hard Disk %d -- '%wZ' already configured\n", DiskNumber, &Settings->HardDisks[DiskNumber]);
149 return STATUS_SUCCESS;
150 }
151
152 /* Check for the type of the value */
153 if (ValueType != REG_SZ)
154 {
155 RtlInitEmptyUnicodeString(&Settings->HardDisks[DiskNumber], NULL, 0);
156 return STATUS_SUCCESS;
157 }
158
159 /* Initialize the string */
160 Success = RtlCreateUnicodeString(&Settings->HardDisks[DiskNumber], (PCWSTR)ValueData);
162
163 return STATUS_SUCCESS;
164}
165
168{
169 {
171 0,
172 L"BiosFile",
173 NULL,
174 REG_NONE,
175 NULL,
176 0
177 },
178
179 {
182 L"RomFiles",
183 NULL,
184 REG_NONE,
185 NULL,
186 0
187 },
188
189 {
191 0,
192 L"FloppyDisk0",
193 (PVOID)0,
194 REG_NONE,
195 NULL,
196 0
197 },
198
199 {
201 0,
202 L"FloppyDisk1",
203 (PVOID)1,
204 REG_NONE,
205 NULL,
206 0
207 },
208
209 {
211 0,
212 L"HardDisk0",
213 (PVOID)0,
214 REG_NONE,
215 NULL,
216 0
217 },
218
219 {
221 0,
222 L"HardDisk1",
223 (PVOID)1,
224 REG_NONE,
225 NULL,
226 0
227 },
228
229 {
231 0,
232 L"HardDisk2",
233 (PVOID)2,
234 REG_NONE,
235 NULL,
236 0
237 },
238
239 {
241 0,
242 L"HardDisk3",
243 (PVOID)3,
244 REG_NONE,
245 NULL,
246 0
247 },
248
249 /* End of table */
250 {0}
251};
252
253static BOOL
255{
257
259
260 /*
261 * Now we can do:
262 * - CPU core choice
263 * - Video choice
264 * - Sound choice
265 * - Mem?
266 * - ...
267 * - Standalone mode?
268 * - Debug settings
269 */
271 L"NTVDM",
273 Settings,
274 NULL);
275 if (!NT_SUCCESS(Status))
276 {
277 DPRINT1("NTVDM registry settings cannot be fully initialized, using default ones. Status = 0x%08lx\n", Status);
278 }
279
280 return NT_SUCCESS(Status);
281}
282
283static VOID
285{
286 USHORT i;
287
289
290 if (Settings->BiosFileName.Buffer)
291 RtlFreeAnsiString(&Settings->BiosFileName);
292
293 if (Settings->RomFiles.Buffer)
294 RtlFreeAnsiString(&Settings->RomFiles);
295
296 for (i = 0; i < ARRAYSIZE(Settings->FloppyDisks); ++i)
297 {
298 if (Settings->FloppyDisks[i].Buffer)
299 RtlFreeUnicodeString(&Settings->FloppyDisks[i]);
300 }
301
302 for (i = 0; i < ARRAYSIZE(Settings->HardDisks); ++i)
303 {
304 if (Settings->HardDisks[i].Buffer)
305 RtlFreeUnicodeString(&Settings->HardDisks[i]);
306 }
307}
308
309static VOID
311
313#include "./console/console.c"
316/*static*/ VOID
318{
319 /*
320 * Immediate = TRUE: Immediate shutdown;
321 * FALSE: Delayed shutdown.
322 */
323 static BOOLEAN MustShutdown = FALSE;
324
325 /* If a shutdown is ongoing, just return */
326 if (MustShutdown)
327 {
328 DPRINT1("Shutdown is ongoing...\n");
330 return;
331 }
332
333 /* First notify DOS to see whether we can shut down now */
334 MustShutdown = DosShutdown(Immediate);
335 /*
336 * In case we perform an immediate shutdown, or the DOS says
337 * we can shut down, do it now.
338 */
339 MustShutdown = MustShutdown || Immediate;
340
341 if (MustShutdown)
342 {
344
345 BiosCleanup();
348
350
351 DPRINT1("\n\n\nNTVDM - Exiting...\n\n\n");
352 /* Some VDDs rely on the fact that NTVDM calls ExitProcess on Windows */
353 ExitProcess(0);
354 }
355}
356
357/* PUBLIC FUNCTIONS ***********************************************************/
358
359VOID
361{
362#ifndef WIN2K_COMPLIANT
363 WCHAR StaticBuffer[256];
364 LPWSTR Buffer = StaticBuffer; // Use the static buffer by default.
365#else
366 WCHAR Buffer[2048]; // Large enough. If not, increase it by hand.
367#endif
368 size_t MsgLen;
370
372
373#ifndef WIN2K_COMPLIANT
374 /*
375 * Retrieve the message length and if it is too long, allocate
376 * an auxiliary buffer; otherwise use the static buffer.
377 * The string is built to be NULL-terminated.
378 */
379 MsgLen = _vscwprintf(Format, args);
380 if (MsgLen >= ARRAYSIZE(StaticBuffer))
381 {
382 Buffer = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, (MsgLen + 1) * sizeof(WCHAR));
383 if (Buffer == NULL)
384 {
385 /* Allocation failed, use the static buffer and display a suitable error message */
386 Buffer = StaticBuffer;
387 Format = L"DisplayMessage()\nOriginal message is too long and allocating an auxiliary buffer failed.";
388 MsgLen = wcslen(Format);
389 }
390 }
391#else
392 MsgLen = ARRAYSIZE(Buffer) - 1;
393#endif
394
395 RtlZeroMemory(Buffer, (MsgLen + 1) * sizeof(WCHAR));
396 _vsnwprintf(Buffer, MsgLen, Format, args);
397
398 va_end(args);
399
400 /* Display the message */
401 DPRINT1("\n\nNTVDM Subsystem\n%S\n\n", Buffer);
402 MessageBoxW(hConsoleWnd, Buffer, L"NTVDM Subsystem", MB_OK);
403
404#ifndef WIN2K_COMPLIANT
405 /* Free the buffer if needed */
406 if (Buffer != StaticBuffer) RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
407#endif
408}
409
410/*
411 * This function, derived from DisplayMessage, is used by the BIOS and
412 * the DOS to display messages to an output device. A printer function
413 * is given for printing the characters.
414 */
415VOID
417 IN LPCSTR Format, ...)
418{
419 static CHAR CurChar = 0;
420 LPSTR str;
421
422#ifndef WIN2K_COMPLIANT
423 CHAR StaticBuffer[256];
424 LPSTR Buffer = StaticBuffer; // Use the static buffer by default.
425#else
426 CHAR Buffer[2048]; // Large enough. If not, increase it by hand.
427#endif
428 size_t MsgLen;
430
432
433#ifndef WIN2K_COMPLIANT
434 /*
435 * Retrieve the message length and if it is too long, allocate
436 * an auxiliary buffer; otherwise use the static buffer.
437 * The string is built to be NULL-terminated.
438 */
439 MsgLen = _vscprintf(Format, args);
440 if (MsgLen >= ARRAYSIZE(StaticBuffer))
441 {
442 Buffer = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, (MsgLen + 1) * sizeof(CHAR));
443 if (Buffer == NULL)
444 {
445 /* Allocation failed, use the static buffer and display a suitable error message */
446 Buffer = StaticBuffer;
447 Format = "DisplayMessageAnsi()\nOriginal message is too long and allocating an auxiliary buffer failed.";
448 MsgLen = strlen(Format);
449 }
450 }
451#else
452 MsgLen = ARRAYSIZE(Buffer) - 1;
453#endif
454
455 RtlZeroMemory(Buffer, (MsgLen + 1) * sizeof(CHAR));
456 _vsnprintf(Buffer, MsgLen, Format, args);
457
458 va_end(args);
459
460 /* Display the message */
461 // DPRINT1("\n\nNTVDM DOS32\n%s\n\n", Buffer);
462
463 MsgLen = strlen(Buffer);
464 str = Buffer;
465 while (MsgLen--)
466 {
467 if (*str == '\n' && CurChar != '\r')
468 CharPrint('\r');
469
470 CurChar = *str++;
471 CharPrint(CurChar);
472 }
473
474#ifndef WIN2K_COMPLIANT
475 /* Free the buffer if needed */
476 if (Buffer != StaticBuffer) RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
477#endif
478}
479
480INT
482{
484
485#ifdef STANDALONE
486
487 if (argc < 2)
488 {
489 wprintf(L"\nReactOS Virtual DOS Machine\n\n"
490 L"Usage: NTVDM <executable> [<parameters>]\n");
491 return 0;
492 }
493
494#else
495
496 /* For non-STANDALONE builds, we must be started as a VDM */
498 ULONG VdmPower = 0;
501 &VdmPower,
502 sizeof(VdmPower),
503 NULL);
504 if (!NT_SUCCESS(Status) || (VdmPower == 0))
505 {
506 /* Not a VDM, bail out */
507 return 0;
508 }
509
510#endif
511
512 NtVdmArgc = argc;
513 NtVdmArgv = argv;
514
515#ifdef ADVANCED_DEBUGGING
516 {
517 INT i = 20;
518
519 printf("Waiting for debugger (10 secs)..");
520 while (i--)
521 {
522 printf(".");
523 if (IsDebuggerPresent())
524 {
526 break;
527 }
528 Sleep(500);
529 }
530 printf("Continue\n");
531 }
532#endif
533
534 DPRINT1("\n\n\n"
535 "NTVDM - Starting...\n"
536 "Command Line: '%s'\n"
537 "\n\n",
539
540 /*
541 * Retrieve the full directory of the current running NTVDM instance.
542 * In case of failure, use the default SystemRoot\System32 path.
543 */
545 NtVdmPath[_countof(NtVdmPath) - 1] = UNICODE_NULL; // Ensure NULL-termination (see WinXP bug)
546
549 if (Success)
550 {
551 /* Find the last path separator, remove it as well as the file name */
552 PWCHAR pch = wcsrchr(NtVdmPath, L'\\');
553 if (pch)
554 *pch = UNICODE_NULL;
555 }
556 else
557 {
558 /* We failed, use the default SystemRoot\System32 path */
561 if (!Success)
562 {
563 /* We failed again, try to do it ourselves */
564 NtVdmPathSize = (ULONG)wcslen(SharedUserData->NtSystemRoot) + _countof("\\System32") - 1;
566 if (Success)
567 {
570 L"%s\\System32",
571 SharedUserData->NtSystemRoot));
572 }
573 if (!Success)
574 {
575 wprintf(L"FATAL: Could not retrieve NTVDM path.\n");
576 goto Cleanup;
577 }
578 }
579 }
581
582 /* Load the global VDM settings */
584
585 /* Initialize the console */
586 if (!ConsoleInit())
587 {
588 wprintf(L"FATAL: A problem occurred when trying to initialize the console.\n");
589 goto Cleanup;
590 }
591
592 /* Initialize the emulator */
594 {
595 wprintf(L"FATAL: Failed to initialize the emulator.\n");
596 goto Cleanup;
597 }
598
599 /* Initialize the system BIOS and option ROMs */
602 {
603 wprintf(L"FATAL: Failed to initialize the VDM BIOS.\n");
604 goto Cleanup;
605 }
606
607 /* Let's go! Start simulation */
608 CpuSimulate();
609
610 /* Quit the VDM */
611Cleanup:
613 return 0;
614}
615
616/* EOF */
unsigned char BOOLEAN
static int argc
Definition: ServiceArgs.c:12
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:590
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
Definition: bufpool.h:45
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
BOOLEAN DosShutdown(BOOLEAN Immediate)
Definition: dem.c:1331
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define wcsrchr
Definition: compat.h:16
#define MAX_PATH
Definition: compat.h:34
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1487
LPSTR WINAPI GetCommandLineA(VOID)
Definition: proc.c:2003
static const WCHAR Cleanup[]
Definition: register.c:80
#define INFINITE
Definition: serial.h:102
#define PtrToUlong(u)
Definition: config.h:107
VOID EmulatorTerminate(VOID)
Definition: emulator.c:503
BOOLEAN EmulatorInitialize(HANDLE ConsoleInput, HANDLE ConsoleOutput)
Definition: emulator.c:510
VOID EmulatorCleanup(VOID)
Definition: emulator.c:639
@ Success
Definition: eventcreate.c:712
unsigned int BOOL
Definition: ntddk_ex.h:94
#define printf
Definition: freeldr.h:97
Status
Definition: gdiplustypes.h:25
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
_In_ GUID _In_ PVOID ValueData
Definition: hubbusif.h:312
_Check_return_ _CRTIMP int __cdecl _vscprintf(_In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
_CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest, size_t _Count, const wchar_t *_Format, va_list _Args)
_Check_return_ _CRTIMP int __cdecl _vscwprintf(_In_z_ _Printf_format_string_ const wchar_t *_Format, va_list _ArgList)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
NTSYSAPI void WINAPI DbgBreakPoint(void)
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID)
@ ProcessWx86Information
Definition: winternl.h:875
#define REG_SZ
Definition: layer.c:22
#define pch(ap)
Definition: match.c:418
#define ASSERT(a)
Definition: mode.c:44
#define argv
Definition: mplay32.c:18
_In_ PCWSTR _Inout_ _At_ QueryTable EntryContext
Definition: rtlfuncs.h:4207
#define RTL_REGISTRY_CONTROL
Definition: nt_native.h:163
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlFreeAnsiString(PANSI_STRING AnsiString)
#define RTL_QUERY_REGISTRY_NOEXPAND
Definition: nt_native.h:139
#define NtCurrentProcess()
Definition: nt_native.h:1657
#define REG_MULTI_SZ
Definition: nt_native.h:1501
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define REG_NONE
Definition: nt_native.h:1492
#define UNICODE_NULL
NTSTATUS NTAPI NtQueryInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _Out_ PVOID ProcessInformation, _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength)
Definition: query.c:59
NTSTRSAFEVAPI RtlStringCchPrintfW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
Definition: ntstrsafe.h:1110
INT NtVdmArgc
Definition: ntvdm.c:31
WCHAR NtVdmPath[MAX_PATH]
Definition: ntvdm.c:35
static NTSTATUS NTAPI NtVdmConfigureBios(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
Definition: ntvdm.c:42
static RTL_QUERY_REGISTRY_TABLE NtVdmConfigurationTable[]
Definition: ntvdm.c:167
VOID VdmShutdown(BOOLEAN Immediate)
Definition: ntvdm.c:317
static BOOL LoadGlobalSettings(IN PNTVDM_SETTINGS Settings)
Definition: ntvdm.c:254
static VOID FreeGlobalSettings(IN PNTVDM_SETTINGS Settings)
Definition: ntvdm.c:284
static VOID ConsoleCleanup(VOID)
VOID PrintMessageAnsi(IN CHAR_PRINT CharPrint, IN LPCSTR Format,...)
Definition: ntvdm.c:416
ULONG NtVdmPathSize
Definition: ntvdm.c:36
static NTSTATUS NTAPI NtVdmConfigureRom(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
Definition: ntvdm.c:69
static NTSTATUS NTAPI NtVdmConfigureFloppy(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
Definition: ntvdm.c:96
static NTSTATUS NTAPI NtVdmConfigureHDD(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
Definition: ntvdm.c:132
WCHAR ** NtVdmArgv
Definition: ntvdm.c:32
NTVDM_SETTINGS GlobalSettings
Definition: ntvdm.c:28
VOID DisplayMessage(IN LPCWSTR Format,...)
Definition: ntvdm.c:360
struct _NTVDM_SETTINGS * PNTVDM_SETTINGS
#define L(x)
Definition: ntvdm.h:50
VOID(* CHAR_PRINT)(IN CHAR Character)
Definition: ntvdm.h:110
unsigned short USHORT
Definition: pedump.c:61
int wmain()
const WCHAR * str
#define SharedUserData
#define args
Definition: format.c:66
#define STATUS_SUCCESS
Definition: shellext.h:65
#define _countof(array)
Definition: sndvol32.h:68
ANSI_STRING RomFiles
Definition: ntvdm.h:87
ANSI_STRING BiosFileName
Definition: ntvdm.h:86
USHORT MaximumLength
Definition: env_spec_w32.h:370
Definition: match.c:390
BOOLEAN BiosInitialize(IN LPCSTR BiosFileName, IN LPCSTR RomFiles OPTIONAL)
Definition: bios.c:60
VOID BiosCleanup(VOID)
Definition: bios.c:153
HWND hConsoleWnd
Definition: console.c:20
static HANDLE ConsoleOutput
Definition: console.c:17
static BOOL ConsoleInit(VOID)
Definition: console.c:446
VOID CpuSimulate(VOID)
Definition: cpu.c:167
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
uint16_t * PWSTR
Definition: typedefs.h:56
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define NTAPI
Definition: typedefs.h:36
void * PVOID
Definition: typedefs.h:50
int32_t INT
Definition: typedefs.h:58
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings
Definition: wdfdevice.h:2595
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG _Out_opt_ PULONG _Out_opt_ PULONG ValueType
Definition: wdfregistry.h:282
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:243
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG ValueLength
Definition: wdfregistry.h:275
#define wprintf(...)
Definition: whoami.c:18
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
BOOL WINAPI IsDebuggerPresent(void)
Definition: debugger.c:580
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_OK
Definition: winuser.h:790
#define _vsnprintf
Definition: xmlstorage.h:202
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char CHAR
Definition: xmlstorage.h:175