mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[NTVDM] In non-STANDALONE builds, check whether we are started as a VDM and bail out if not.
This commit is contained in:
parent
d6d30f9e05
commit
b849a696ef
1 changed files with 22 additions and 3 deletions
|
@ -20,6 +20,9 @@
|
||||||
|
|
||||||
#include "dos/dem.h"
|
#include "dos/dem.h"
|
||||||
|
|
||||||
|
/* Extra PSDK/NDK Headers */
|
||||||
|
#include <ndk/psfuncs.h>
|
||||||
|
|
||||||
/* VARIABLES ******************************************************************/
|
/* VARIABLES ******************************************************************/
|
||||||
|
|
||||||
NTVDM_SETTINGS GlobalSettings;
|
NTVDM_SETTINGS GlobalSettings;
|
||||||
|
@ -473,9 +476,6 @@ PrintMessageAnsi(IN CHAR_PRINT CharPrint,
|
||||||
INT
|
INT
|
||||||
wmain(INT argc, WCHAR *argv[])
|
wmain(INT argc, WCHAR *argv[])
|
||||||
{
|
{
|
||||||
NtVdmArgc = argc;
|
|
||||||
NtVdmArgv = argv;
|
|
||||||
|
|
||||||
#ifdef STANDALONE
|
#ifdef STANDALONE
|
||||||
|
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
|
@ -485,8 +485,27 @@ wmain(INT argc, WCHAR *argv[])
|
||||||
return 0;
|
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
|
#endif
|
||||||
|
|
||||||
|
NtVdmArgc = argc;
|
||||||
|
NtVdmArgv = argv;
|
||||||
|
|
||||||
#ifdef ADVANCED_DEBUGGING
|
#ifdef ADVANCED_DEBUGGING
|
||||||
{
|
{
|
||||||
INT i = 20;
|
INT i = 20;
|
||||||
|
|
Loading…
Reference in a new issue