//
// Check the Target Processes to see if this is a Wx86 process
//
Status = NtQueryInformationProcess(hProcess,
ProcessWx86Information,
&Wx86Info,
sizeof(Wx86Info),
NULL
);
if (!NT_SUCCESS(Status)) {
leave;
}
Wx86Tib = (PWX86TIB)NtCurrentTeb()->Vdm;
//
// if Wx86 process, setup for emulation
//
if ((ULONG_PTR)Wx86Info == sizeof(WX86TIB)) {
//
// create a WX86Tib and initialize it's Teb->Vdm.
//
Status = BaseCreateWx86Tib(hProcess,
Handle,
(ULONG)((ULONG_PTR)lpStartAddress),
dwStackSize,
0L,
(Wx86Tib &&
Wx86Tib->Size == sizeof(WX86TIB) &&
Wx86Tib->EmulateInitialPc)
);
if (!NT_SUCCESS(Status)) {
leave;
}
bWx86 = TRUE;
}
else if (Wx86Tib && Wx86Tib->EmulateInitialPc) {
//
// if not Wx86 process, and caller wants to call x86 code in that
// process, fail the call.
//
Status = STATUS_ACCESS_DENIED;
leave;
}
#endif // WX86
//
// Call the Windows server to let it know about the
// process.
//
if ( !BaseRunningInServerProcess ) {