Author: hbelusca
Date: Thu Jul 18 00:17:04 2013
New Revision: 59498
URL:
http://svn.reactos.org/svn/reactos?rev=59498&view=rev
Log:
[NTVDM]
Fix the TESTING case, in case you run ntvdm without other parameters.
Modified:
branches/ntvdm/subsystems/ntvdm/ntvdm.c
Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ntvdm.c?…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/ntvdm.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/ntvdm.c [iso-8859-1] Thu Jul 18 00:17:04 2013
@@ -15,6 +15,12 @@
#include "timer.h"
#include "pic.h"
#include "ps2.h"
+
+/*
+ * Activate this line if you want to be able to test NTVDM with:
+ * ntvdm.exe <program>
+ */
+// #define TESTING
/* PUBLIC VARIABLES ***********************************************************/
@@ -84,7 +90,16 @@
/* 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 <executable>\n");
+ return 0;
+ }
#endif
if (!EmulatorInitialize())