- 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
oldstable
Eric Pouech 2004-10-25 21:47:23 +00:00 committed by Alexandre Julliard
parent c67bfb2895
commit 4bb5d3ab3e
3 changed files with 9 additions and 7 deletions

View File

@ -439,13 +439,13 @@ void ENV_CopyStartupInformation(void)
startup_infoW.dwFillAttribute = rupp->dwFillAttribute;
startup_infoW.dwFlags = rupp->dwFlags;
startup_infoW.wShowWindow = rupp->wShowWindow;
startup_infoW.cbReserved2 = rupp->RuntimeInfo.Length;
startup_infoW.lpReserved2 = (void*)rupp->RuntimeInfo.Buffer;
startup_infoW.cbReserved2 = rupp->RuntimeInfo.MaximumLength;
startup_infoW.lpReserved2 = rupp->RuntimeInfo.MaximumLength ? (void*)rupp->RuntimeInfo.Buffer : NULL;
startup_infoW.hStdInput = rupp->hStdInput;
startup_infoW.hStdOutput = rupp->hStdOutput;
startup_infoW.hStdError = rupp->hStdError;
startup_infoA.cb = sizeof(startup_infoW);
startup_infoA.cb = sizeof(startup_infoA);
startup_infoA.lpReserved = NULL;
startup_infoA.lpDesktop = (rupp->Desktop.Length &&
RtlUnicodeStringToAnsiString( &ansi, &rupp->Desktop, TRUE) == STATUS_SUCCESS) ?
@ -462,8 +462,8 @@ void ENV_CopyStartupInformation(void)
startup_infoA.dwFillAttribute = rupp->dwFillAttribute;
startup_infoA.dwFlags = rupp->dwFlags;
startup_infoA.wShowWindow = rupp->wShowWindow;
startup_infoA.cbReserved2 = rupp->RuntimeInfo.Length;
startup_infoA.lpReserved2 = (void*)rupp->RuntimeInfo.Buffer;
startup_infoA.cbReserved2 = rupp->RuntimeInfo.MaximumLength;
startup_infoA.lpReserved2 = rupp->RuntimeInfo.MaximumLength ? (void*)rupp->RuntimeInfo.Buffer : NULL;
startup_infoA.hStdInput = rupp->hStdInput;
startup_infoA.hStdOutput = rupp->hStdOutput;
startup_infoA.hStdError = rupp->hStdError;

View File

@ -1408,7 +1408,8 @@ static RTL_USER_PROCESS_PARAMETERS *create_user_params( LPCWSTR filename, LPCWST
if (startup->lpTitle) RtlInitUnicodeString( &title, startup->lpTitle );
if (startup->lpReserved2 && startup->cbReserved2)
{
runtime.Length = runtime.MaximumLength = startup->cbReserved2;
runtime.Length = 0;
runtime.MaximumLength = startup->cbReserved2;
runtime.Buffer = (WCHAR*)startup->lpReserved2;
}

View File

@ -418,6 +418,7 @@ NTSTATUS WINAPI RtlCreateProcessParameters( RTL_USER_PROCESS_PARAMETERS **result
{
static const WCHAR empty[] = {0};
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;
ULONG size, total_size;
@ -433,7 +434,7 @@ NTSTATUS WINAPI RtlCreateProcessParameters( RTL_USER_PROCESS_PARAMETERS **result
if (!WindowTitle) WindowTitle = &empty_str;
if (!Desktop) Desktop = &empty_str;
if (!ShellInfo) ShellInfo = &empty_str;
if (!RuntimeInfo) RuntimeInfo = &empty_str;
if (!RuntimeInfo) RuntimeInfo = &null_str;
size = (sizeof(RTL_USER_PROCESS_PARAMETERS)
+ ImagePathName->MaximumLength