- fixed the way length of msvcrt runtime info is passed
- always return a NULL runtime info buffer in child if parent's runtime info is NULL - fixed typo in startupinfo size
This commit is contained in:
parent
c67bfb2895
commit
4bb5d3ab3e
|
@ -439,13 +439,13 @@ void ENV_CopyStartupInformation(void)
|
||||||
startup_infoW.dwFillAttribute = rupp->dwFillAttribute;
|
startup_infoW.dwFillAttribute = rupp->dwFillAttribute;
|
||||||
startup_infoW.dwFlags = rupp->dwFlags;
|
startup_infoW.dwFlags = rupp->dwFlags;
|
||||||
startup_infoW.wShowWindow = rupp->wShowWindow;
|
startup_infoW.wShowWindow = rupp->wShowWindow;
|
||||||
startup_infoW.cbReserved2 = rupp->RuntimeInfo.Length;
|
startup_infoW.cbReserved2 = rupp->RuntimeInfo.MaximumLength;
|
||||||
startup_infoW.lpReserved2 = (void*)rupp->RuntimeInfo.Buffer;
|
startup_infoW.lpReserved2 = rupp->RuntimeInfo.MaximumLength ? (void*)rupp->RuntimeInfo.Buffer : NULL;
|
||||||
startup_infoW.hStdInput = rupp->hStdInput;
|
startup_infoW.hStdInput = rupp->hStdInput;
|
||||||
startup_infoW.hStdOutput = rupp->hStdOutput;
|
startup_infoW.hStdOutput = rupp->hStdOutput;
|
||||||
startup_infoW.hStdError = rupp->hStdError;
|
startup_infoW.hStdError = rupp->hStdError;
|
||||||
|
|
||||||
startup_infoA.cb = sizeof(startup_infoW);
|
startup_infoA.cb = sizeof(startup_infoA);
|
||||||
startup_infoA.lpReserved = NULL;
|
startup_infoA.lpReserved = NULL;
|
||||||
startup_infoA.lpDesktop = (rupp->Desktop.Length &&
|
startup_infoA.lpDesktop = (rupp->Desktop.Length &&
|
||||||
RtlUnicodeStringToAnsiString( &ansi, &rupp->Desktop, TRUE) == STATUS_SUCCESS) ?
|
RtlUnicodeStringToAnsiString( &ansi, &rupp->Desktop, TRUE) == STATUS_SUCCESS) ?
|
||||||
|
@ -462,8 +462,8 @@ void ENV_CopyStartupInformation(void)
|
||||||
startup_infoA.dwFillAttribute = rupp->dwFillAttribute;
|
startup_infoA.dwFillAttribute = rupp->dwFillAttribute;
|
||||||
startup_infoA.dwFlags = rupp->dwFlags;
|
startup_infoA.dwFlags = rupp->dwFlags;
|
||||||
startup_infoA.wShowWindow = rupp->wShowWindow;
|
startup_infoA.wShowWindow = rupp->wShowWindow;
|
||||||
startup_infoA.cbReserved2 = rupp->RuntimeInfo.Length;
|
startup_infoA.cbReserved2 = rupp->RuntimeInfo.MaximumLength;
|
||||||
startup_infoA.lpReserved2 = (void*)rupp->RuntimeInfo.Buffer;
|
startup_infoA.lpReserved2 = rupp->RuntimeInfo.MaximumLength ? (void*)rupp->RuntimeInfo.Buffer : NULL;
|
||||||
startup_infoA.hStdInput = rupp->hStdInput;
|
startup_infoA.hStdInput = rupp->hStdInput;
|
||||||
startup_infoA.hStdOutput = rupp->hStdOutput;
|
startup_infoA.hStdOutput = rupp->hStdOutput;
|
||||||
startup_infoA.hStdError = rupp->hStdError;
|
startup_infoA.hStdError = rupp->hStdError;
|
||||||
|
|
|
@ -1408,7 +1408,8 @@ static RTL_USER_PROCESS_PARAMETERS *create_user_params( LPCWSTR filename, LPCWST
|
||||||
if (startup->lpTitle) RtlInitUnicodeString( &title, startup->lpTitle );
|
if (startup->lpTitle) RtlInitUnicodeString( &title, startup->lpTitle );
|
||||||
if (startup->lpReserved2 && startup->cbReserved2)
|
if (startup->lpReserved2 && startup->cbReserved2)
|
||||||
{
|
{
|
||||||
runtime.Length = runtime.MaximumLength = startup->cbReserved2;
|
runtime.Length = 0;
|
||||||
|
runtime.MaximumLength = startup->cbReserved2;
|
||||||
runtime.Buffer = (WCHAR*)startup->lpReserved2;
|
runtime.Buffer = (WCHAR*)startup->lpReserved2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -418,6 +418,7 @@ NTSTATUS WINAPI RtlCreateProcessParameters( RTL_USER_PROCESS_PARAMETERS **result
|
||||||
{
|
{
|
||||||
static const WCHAR empty[] = {0};
|
static const WCHAR empty[] = {0};
|
||||||
static const UNICODE_STRING empty_str = { 0, sizeof(empty), (WCHAR *)empty };
|
static const UNICODE_STRING empty_str = { 0, sizeof(empty), (WCHAR *)empty };
|
||||||
|
static const UNICODE_STRING null_str = { 0, 0, NULL };
|
||||||
|
|
||||||
const RTL_USER_PROCESS_PARAMETERS *cur_params;
|
const RTL_USER_PROCESS_PARAMETERS *cur_params;
|
||||||
ULONG size, total_size;
|
ULONG size, total_size;
|
||||||
|
@ -433,7 +434,7 @@ NTSTATUS WINAPI RtlCreateProcessParameters( RTL_USER_PROCESS_PARAMETERS **result
|
||||||
if (!WindowTitle) WindowTitle = &empty_str;
|
if (!WindowTitle) WindowTitle = &empty_str;
|
||||||
if (!Desktop) Desktop = &empty_str;
|
if (!Desktop) Desktop = &empty_str;
|
||||||
if (!ShellInfo) ShellInfo = &empty_str;
|
if (!ShellInfo) ShellInfo = &empty_str;
|
||||||
if (!RuntimeInfo) RuntimeInfo = &empty_str;
|
if (!RuntimeInfo) RuntimeInfo = &null_str;
|
||||||
|
|
||||||
size = (sizeof(RTL_USER_PROCESS_PARAMETERS)
|
size = (sizeof(RTL_USER_PROCESS_PARAMETERS)
|
||||||
+ ImagePathName->MaximumLength
|
+ ImagePathName->MaximumLength
|
||||||
|
|
Loading…
Reference in New Issue