mirror of
https://github.com/reactos/reactos.git
synced 2026-06-08 08:52:59 +08:00
[NTVDM] In non-STANDALONE builds, check whether we are started as a VDM and bail out if not.
This commit is contained in:
@@ -20,6 +20,9 @@
|
||||
|
||||
#include "dos/dem.h"
|
||||
|
||||
/* Extra PSDK/NDK Headers */
|
||||
#include <ndk/psfuncs.h>
|
||||
|
||||
/* VARIABLES ******************************************************************/
|
||||
|
||||
NTVDM_SETTINGS GlobalSettings;
|
||||
@@ -473,9 +476,6 @@ PrintMessageAnsi(IN CHAR_PRINT CharPrint,
|
||||
INT
|
||||
wmain(INT argc, WCHAR *argv[])
|
||||
{
|
||||
NtVdmArgc = argc;
|
||||
NtVdmArgv = argv;
|
||||
|
||||
#ifdef STANDALONE
|
||||
|
||||
if (argc < 2)
|
||||
@@ -485,8 +485,27 @@ wmain(INT argc, WCHAR *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/* For non-STANDALONE builds, we must be started as a VDM */
|
||||
NTSTATUS Status;
|
||||
ULONG VdmPower = 0;
|
||||
Status = NtQueryInformationProcess(NtCurrentProcess(),
|
||||
ProcessWx86Information,
|
||||
&VdmPower,
|
||||
sizeof(VdmPower),
|
||||
NULL);
|
||||
if (!NT_SUCCESS(Status) || (VdmPower == 0))
|
||||
{
|
||||
/* Not a VDM, bail out */
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
NtVdmArgc = argc;
|
||||
NtVdmArgv = argv;
|
||||
|
||||
#ifdef ADVANCED_DEBUGGING
|
||||
{
|
||||
INT i = 20;
|
||||
|
||||
Reference in New Issue
Block a user