Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[BRANCHES]
Merge the NTVDM branch back to trunk. New/changed components are: ntvdm, fast486, basesrv,
ntdll, kernel32 and csrsrv.


svn path=/trunk/; revision=63177
  • Loading branch information
reactos573 committed May 6, 2014
2 parents c77fa2a + 8eb1b03 commit c32b8d2
Show file tree
Hide file tree
Showing 112 changed files with 33,406 additions and 603 deletions.
3 changes: 2 additions & 1 deletion reactos/cmake/msvc.cmake
Expand Up @@ -56,7 +56,8 @@ add_compile_flags("/wd4290")
# - C4163: 'identifier': not available as an intrinsic function
# - C4229: modifiers on data are ignored
# - C4700: uninitialized variable usage
add_compile_flags("/we4013 /we4020 /we4022 /we4047 /we4098 /we4113 /we4129 /we4163 /we4229 /we4700")
# - C4603: macro is not defined or definition is different after precompiled header use
add_compile_flags("/we4013 /we4020 /we4022 /we4047 /we4098 /we4113 /we4129 /we4163 /we4229 /we4700 /we4603")

# Enable warnings above the default level, but don't treat them as errors:
# - C4115: named type definition in parentheses
Expand Down
3 changes: 3 additions & 0 deletions reactos/dll/ntdll/csr/capture.c
Expand Up @@ -101,6 +101,9 @@ CsrAllocateCaptureBuffer(IN ULONG ArgumentCount,
/* Align it to a 4-byte boundary */
BufferSize = (BufferSize + 3) & ~3;

/* Add the size of the alignment padding for each argument */
BufferSize += ArgumentCount * 3;

/* Allocate memory from the port heap */
CaptureBuffer = RtlAllocateHeap(CsrPortHeap, HEAP_ZERO_MEMORY, BufferSize);
if (CaptureBuffer == NULL) return NULL;
Expand Down
22 changes: 12 additions & 10 deletions reactos/dll/win32/kernel32/client/proc.c
Expand Up @@ -2301,7 +2301,7 @@ CreateProcessInternalW(IN HANDLE hUserToken,
BOOLEAN InJob, SaferNeeded, UseLargePages, HavePrivilege;
BOOLEAN QuerySection, SkipSaferAndAppCompat;
CONTEXT Context;
BASE_API_MESSAGE CsrMsg;
BASE_API_MESSAGE CsrMsg[2];
PBASE_CREATE_PROCESS CreateProcessMsg;
PCSR_CAPTURE_BUFFER CaptureBuffer;
PVOID BaseAddress, PrivilegeState, RealTimePrivilegeState;
Expand Down Expand Up @@ -2431,8 +2431,8 @@ CreateProcessInternalW(IN HANDLE hUserToken,
IsWowApp = FALSE;

/* Set message structures */
CreateProcessMsg = &CsrMsg.Data.CreateProcessRequest;
CheckVdmMsg = &CsrMsg.Data.CheckVDMRequest;
CreateProcessMsg = &CsrMsg[0].Data.CreateProcessRequest;
CheckVdmMsg = &CsrMsg[1].Data.CheckVDMRequest;

/* Clear the more complex structures by zeroing out their entire memory */
RtlZeroMemory(&Context, sizeof(Context));
Expand Down Expand Up @@ -3197,15 +3197,15 @@ CreateProcessInternalW(IN HANDLE hUserToken,
/* Pick which kind of WOW mode we want to run in */
VdmBinaryType = (dwCreationFlags &
CREATE_SEPARATE_WOW_VDM) ?
BINARY_TYPE_WOW : BINARY_TYPE_SEPARATE_WOW;
BINARY_TYPE_SEPARATE_WOW : BINARY_TYPE_WOW;

/* Get all the VDM settings and current status */
Status = BaseCheckVDM(VdmBinaryType,
lpApplicationName,
lpCommandLine,
lpCurrentDirectory,
&VdmAnsiEnv,
&CsrMsg,
&CsrMsg[1],
&VdmTask,
dwCreationFlags,
&StartupInfo,
Expand Down Expand Up @@ -3342,7 +3342,7 @@ CreateProcessInternalW(IN HANDLE hUserToken,
lpCommandLine,
lpCurrentDirectory,
&VdmAnsiEnv,
&CsrMsg,
&CsrMsg[1],
&VdmTask,
dwCreationFlags,
&StartupInfo,
Expand Down Expand Up @@ -3966,6 +3966,8 @@ CreateProcessInternalW(IN HANDLE hUserToken,
&VdmWaitObject,
VdmTask,
VdmBinaryType);

if (!Result)
{
/* Bail out on failure */
DPRINT1("Failed to update VDM with wait object\n");
Expand Down Expand Up @@ -4335,7 +4337,7 @@ CreateProcessInternalW(IN HANDLE hUserToken,
}

/* We are finally ready to call CSRSS to tell it about our new process! */
CsrClientCallServer((PCSR_API_MESSAGE)&CsrMsg,
CsrClientCallServer((PCSR_API_MESSAGE)&CsrMsg[0],
CaptureBuffer,
CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX,
BasepCreateProcess),
Expand All @@ -4349,12 +4351,12 @@ CreateProcessInternalW(IN HANDLE hUserToken,
}

/* Check if CSRSS failed to accept ownership of the new Windows process */
if (!NT_SUCCESS(CsrMsg.Status))
if (!NT_SUCCESS(CsrMsg[0].Status))
{
/* Terminate the process and enter failure path with the CSRSS status */
DPRINT1("Failed to tell csrss about new process\n");
BaseSetLastNTError(CsrMsg.Status);
NtTerminateProcess(ProcessHandle, CsrMsg.Status);
BaseSetLastNTError(CsrMsg[0].Status);
NtTerminateProcess(ProcessHandle, CsrMsg[0].Status);
Result = FALSE;
goto Quickie;
}
Expand Down

0 comments on commit c32b8d2

Please sign in to comment.