mirror of
https://github.com/reactos/reactos.git
synced 2024-07-28 23:29:19 +00:00
[BASESRV]
- Correctly set the VdmPower flag when the process being started is a NT VDM - Return a correct status code if VDM access is forbidden. svn path=/trunk/; revision=65170
This commit is contained in:
parent
fec7f48782
commit
2420e2ff0d
|
@ -71,7 +71,7 @@ CSR_API(BaseSrvCreateProcess)
|
||||||
HANDLE ProcessHandle, ThreadHandle;
|
HANDLE ProcessHandle, ThreadHandle;
|
||||||
PCSR_THREAD CsrThread;
|
PCSR_THREAD CsrThread;
|
||||||
PCSR_PROCESS Process;
|
PCSR_PROCESS Process;
|
||||||
ULONG Flags = 0, VdmPower = 0, DebugFlags = 0;
|
ULONG Flags = 0, DebugFlags = 0, VdmPower = 0;
|
||||||
|
|
||||||
/* Get the current client thread */
|
/* Get the current client thread */
|
||||||
CsrThread = CsrGetClientThread();
|
CsrThread = CsrGetClientThread();
|
||||||
|
@ -83,6 +83,13 @@ CSR_API(BaseSrvCreateProcess)
|
||||||
Flags = (ULONG_PTR)CreateProcessRequest->ProcessHandle & 3;
|
Flags = (ULONG_PTR)CreateProcessRequest->ProcessHandle & 3;
|
||||||
CreateProcessRequest->ProcessHandle = (HANDLE)((ULONG_PTR)CreateProcessRequest->ProcessHandle & ~3);
|
CreateProcessRequest->ProcessHandle = (HANDLE)((ULONG_PTR)CreateProcessRequest->ProcessHandle & ~3);
|
||||||
|
|
||||||
|
/* Some things should be done if this is a VDM process */
|
||||||
|
if (CreateProcessRequest->VdmBinaryType)
|
||||||
|
{
|
||||||
|
/* We need to set the VDM power later on */
|
||||||
|
VdmPower = 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Duplicate the process handle */
|
/* Duplicate the process handle */
|
||||||
Status = NtDuplicateObject(Process->ProcessHandle,
|
Status = NtDuplicateObject(Process->ProcessHandle,
|
||||||
CreateProcessRequest->ProcessHandle,
|
CreateProcessRequest->ProcessHandle,
|
||||||
|
@ -112,10 +119,9 @@ CSR_API(BaseSrvCreateProcess)
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See if this is a VDM process */
|
/* If this is a VDM process, request VDM power */
|
||||||
if (VdmPower)
|
if (VdmPower)
|
||||||
{
|
{
|
||||||
/* Request VDM powers */
|
|
||||||
Status = NtSetInformationProcess(ProcessHandle,
|
Status = NtSetInformationProcess(ProcessHandle,
|
||||||
ProcessWx86Information,
|
ProcessWx86Information,
|
||||||
&VdmPower,
|
&VdmPower,
|
||||||
|
|
|
@ -576,7 +576,7 @@ CSR_API(BaseSrvCheckVDM)
|
||||||
BOOLEAN NewConsoleRecord = FALSE;
|
BOOLEAN NewConsoleRecord = FALSE;
|
||||||
|
|
||||||
/* Don't do anything if the VDM has been disabled in the registry */
|
/* Don't do anything if the VDM has been disabled in the registry */
|
||||||
if (!BaseSrvIsVdmAllowed()) return STATUS_ACCESS_DENIED;
|
if (!BaseSrvIsVdmAllowed()) return STATUS_VDM_DISALLOWED;
|
||||||
|
|
||||||
/* Validate the message buffers */
|
/* Validate the message buffers */
|
||||||
if (!CsrValidateMessageBuffer(ApiMessage,
|
if (!CsrValidateMessageBuffer(ApiMessage,
|
||||||
|
|
Loading…
Reference in a new issue