Author: hbelusca
Date: Sat Nov 1 17:51:39 2014
New Revision: 65170
URL:
http://svn.reactos.org/svn/reactos?rev=65170&view=rev
Log:
[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.
Modified:
trunk/reactos/subsystems/win/basesrv/proc.c
trunk/reactos/subsystems/win/basesrv/vdm.c
Modified: trunk/reactos/subsystems/win/basesrv/proc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win/basesrv/pro…
==============================================================================
--- trunk/reactos/subsystems/win/basesrv/proc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win/basesrv/proc.c [iso-8859-1] Sat Nov 1 17:51:39 2014
@@ -71,7 +71,7 @@
HANDLE ProcessHandle, ThreadHandle;
PCSR_THREAD CsrThread;
PCSR_PROCESS Process;
- ULONG Flags = 0, VdmPower = 0, DebugFlags = 0;
+ ULONG Flags = 0, DebugFlags = 0, VdmPower = 0;
/* Get the current client thread */
CsrThread = CsrGetClientThread();
@@ -82,6 +82,13 @@
/* Extract the flags out of the process handle */
Flags = (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 */
Status = NtDuplicateObject(Process->ProcessHandle,
@@ -112,10 +119,9 @@
return Status;
}
- /* See if this is a VDM process */
+ /* If this is a VDM process, request VDM power */
if (VdmPower)
{
- /* Request VDM powers */
Status = NtSetInformationProcess(ProcessHandle,
ProcessWx86Information,
&VdmPower,
Modified: trunk/reactos/subsystems/win/basesrv/vdm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win/basesrv/vdm…
==============================================================================
--- trunk/reactos/subsystems/win/basesrv/vdm.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win/basesrv/vdm.c [iso-8859-1] Sat Nov 1 17:51:39 2014
@@ -576,7 +576,7 @@
BOOLEAN NewConsoleRecord = FALSE;
/* 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 */
if (!CsrValidateMessageBuffer(ApiMessage,