From c5dad7aefea65f4d61e4ca23bdadf1701148a5f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 18 Jul 2013 00:17:04 +0000 Subject: [PATCH] [NTVDM] Fix the TESTING case, in case you run ntvdm without other parameters. svn path=/branches/ntvdm/; revision=59498 --- subsystems/ntvdm/ntvdm.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/subsystems/ntvdm/ntvdm.c b/subsystems/ntvdm/ntvdm.c index 5f0d0545986..f49856f10bd 100644 --- a/subsystems/ntvdm/ntvdm.c +++ b/subsystems/ntvdm/ntvdm.c @@ -16,6 +16,12 @@ #include "pic.h" #include "ps2.h" +/* + * Activate this line if you want to be able to test NTVDM with: + * ntvdm.exe + */ +// #define TESTING + /* PUBLIC VARIABLES ***********************************************************/ BOOLEAN VdmRunning = TRUE; @@ -84,7 +90,16 @@ INT wmain(INT argc, WCHAR *argv[]) /* The DOS command line must be ASCII */ WideCharToMultiByte(CP_ACP, 0, GetCommandLine(), -1, CommandLine, 128, NULL, NULL); #else - WideCharToMultiByte(CP_ACP, 0, argv[1], -1, CommandLine, 128, NULL, NULL); + if (argc == 2 && argv[1] != NULL) + { + WideCharToMultiByte(CP_ACP, 0, argv[1], -1, CommandLine, 128, NULL, NULL); + } + else + { + wprintf(L"\nReactOS Virtual DOS Machine\n\n" + L"Usage: NTVDM \n"); + return 0; + } #endif if (!EmulatorInitialize())