55 RtlInitEmptyAnsiString(&
Settings->BiosFileName,
NULL, 0);
112 DPRINT1(
"Floppy Disk %d -- '%wZ' already configured\n", DiskNumber, &
Settings->FloppyDisks[DiskNumber]);
119 RtlInitEmptyUnicodeString(&
Settings->FloppyDisks[DiskNumber],
NULL, 0);
148 DPRINT1(
"Hard Disk %d -- '%wZ' already configured\n", DiskNumber, &
Settings->HardDisks[DiskNumber]);
155 RtlInitEmptyUnicodeString(&
Settings->HardDisks[DiskNumber],
NULL, 0);
277 DPRINT1(
"NTVDM registry settings cannot be fully initialized, using default ones. Status = 0x%08lx\n",
Status);
313#include "./console/console.c"
328 DPRINT1(
"Shutdown is ongoing...\n");
339 MustShutdown = MustShutdown || Immediate;
351 DPRINT1(
"\n\n\nNTVDM - Exiting...\n\n\n");
362#ifndef WIN2K_COMPLIANT
363 WCHAR StaticBuffer[256];
373#ifndef WIN2K_COMPLIANT
387 Format =
L"DisplayMessage()\nOriginal message is too long and allocating an auxiliary buffer failed.";
404#ifndef WIN2K_COMPLIANT
419 static CHAR CurChar = 0;
422#ifndef WIN2K_COMPLIANT
423 CHAR StaticBuffer[256];
433#ifndef WIN2K_COMPLIANT
447 Format =
"DisplayMessageAnsi()\nOriginal message is too long and allocating an auxiliary buffer failed.";
467 if (*
str ==
'\n' && CurChar !=
'\r')
474#ifndef WIN2K_COMPLIANT
489 wprintf(
L"\nReactOS Virtual DOS Machine\n\n"
490 L"Usage: NTVDM <executable> [<parameters>]\n");
515#ifdef ADVANCED_DEBUGGING
519 printf(
"Waiting for debugger (10 secs)..");
535 "NTVDM - Starting...\n"
536 "Command Line: '%s'\n"
575 wprintf(
L"FATAL: Could not retrieve NTVDM path.\n");
588 wprintf(
L"FATAL: A problem occurred when trying to initialize the console.\n");
595 wprintf(
L"FATAL: Failed to initialize the emulator.\n");
603 wprintf(
L"FATAL: Failed to initialize the VDM BIOS.\n");
ACPI_SIZE strlen(const char *String)
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define ERROR_INSUFFICIENT_BUFFER
BOOLEAN DosShutdown(BOOLEAN Immediate)
#define NT_SUCCESS(StatCode)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
VOID WINAPI ExitProcess(IN UINT uExitCode)
LPSTR WINAPI GetCommandLineA(VOID)
static const WCHAR Cleanup[]
VOID EmulatorTerminate(VOID)
BOOLEAN EmulatorInitialize(HANDLE ConsoleInput, HANDLE ConsoleOutput)
VOID EmulatorCleanup(VOID)
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
_In_ GUID _In_ PVOID ValueData
_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)
_In_ PCWSTR _Inout_ _At_ QueryTable EntryContext
#define RTL_REGISTRY_CONTROL
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlFreeAnsiString(PANSI_STRING AnsiString)
#define RTL_QUERY_REGISTRY_NOEXPAND
#define NtCurrentProcess()
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSTATUS NTAPI NtQueryInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _Out_ PVOID ProcessInformation, _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength)
NTSTRSAFEVAPI RtlStringCchPrintfW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
WCHAR NtVdmPath[MAX_PATH]
static NTSTATUS NTAPI NtVdmConfigureBios(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
static RTL_QUERY_REGISTRY_TABLE NtVdmConfigurationTable[]
VOID VdmShutdown(BOOLEAN Immediate)
static BOOL LoadGlobalSettings(IN PNTVDM_SETTINGS Settings)
static VOID FreeGlobalSettings(IN PNTVDM_SETTINGS Settings)
static VOID ConsoleCleanup(VOID)
VOID PrintMessageAnsi(IN CHAR_PRINT CharPrint, IN LPCSTR Format,...)
static NTSTATUS NTAPI NtVdmConfigureRom(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
static NTSTATUS NTAPI NtVdmConfigureFloppy(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
static NTSTATUS NTAPI NtVdmConfigureHDD(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
NTVDM_SETTINGS GlobalSettings
VOID DisplayMessage(IN LPCWSTR Format,...)
struct _NTVDM_SETTINGS * PNTVDM_SETTINGS
VOID(* CHAR_PRINT)(IN CHAR Character)
BOOLEAN BiosInitialize(IN LPCSTR BiosFileName, IN LPCSTR RomFiles OPTIONAL)
static HANDLE ConsoleOutput
static BOOL ConsoleInit(VOID)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
#define RtlZeroMemory(Destination, Length)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG _Out_opt_ PULONG _Out_opt_ PULONG ValueType
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG ValueLength
DWORD WINAPI GetLastError(void)
BOOL WINAPI IsDebuggerPresent(void)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)