svn path=/trunk/; revision=74702
LPPROCESS_INFORMATION lpProcessInformation,
PHANDLE hNewToken)
{
LPPROCESS_INFORMATION lpProcessInformation,
PHANDLE hNewToken)
{
- PUNICODE_STRING CommandLine = NULL;
- UNICODE_STRING DummyString;
- UNICODE_STRING LiveCommandLine;
+ UNICODE_STRING CommandLine;
UNICODE_STRING ApplicationName;
UNICODE_STRING CurrentDirectory;
BOOL bRetVal;
UNICODE_STRING ApplicationName;
UNICODE_STRING CurrentDirectory;
BOOL bRetVal;
RtlMoveMemory(&StartupInfo, lpStartupInfo, sizeof(*lpStartupInfo));
/* Initialize all strings to nothing */
RtlMoveMemory(&StartupInfo, lpStartupInfo, sizeof(*lpStartupInfo));
/* Initialize all strings to nothing */
- LiveCommandLine.Buffer = NULL;
- DummyString.Buffer = NULL;
+ CommandLine.Buffer = NULL;
ApplicationName.Buffer = NULL;
CurrentDirectory.Buffer = NULL;
StartupInfo.lpDesktop = NULL;
ApplicationName.Buffer = NULL;
CurrentDirectory.Buffer = NULL;
StartupInfo.lpDesktop = NULL;
/* Convert the Command line */
if (lpCommandLine)
{
/* Convert the Command line */
if (lpCommandLine)
{
- /* If it's too long, then we'll have a problem */
- if ((strlen(lpCommandLine) + 1) * sizeof(WCHAR) <
- NtCurrentTeb()->StaticUnicodeString.MaximumLength)
- {
- /* Cache it in the TEB */
- CommandLine = Basep8BitStringToStaticUnicodeString(lpCommandLine);
- }
- else
- {
- /* Use a dynamic version */
- Basep8BitStringToDynamicUnicodeString(&LiveCommandLine,
- lpCommandLine);
- }
- }
- else
- {
- /* The logic below will use CommandLine, so we must make it valid */
- CommandLine = &DummyString;
+ Basep8BitStringToDynamicUnicodeString(&CommandLine,
+ lpCommandLine);
}
/* Convert the Name and Directory */
}
/* Convert the Name and Directory */
/* Call the Unicode function */
bRetVal = CreateProcessInternalW(hToken,
ApplicationName.Buffer,
/* Call the Unicode function */
bRetVal = CreateProcessInternalW(hToken,
ApplicationName.Buffer,
- LiveCommandLine.Buffer ?
- LiveCommandLine.Buffer : CommandLine->Buffer,
lpProcessAttributes,
lpThreadAttributes,
bInheritHandles,
lpProcessAttributes,
lpThreadAttributes,
bInheritHandles,
/* Clean up */
RtlFreeUnicodeString(&ApplicationName);
/* Clean up */
RtlFreeUnicodeString(&ApplicationName);
- RtlFreeUnicodeString(&LiveCommandLine);
+ RtlFreeUnicodeString(&CommandLine);
RtlFreeUnicodeString(&CurrentDirectory);
RtlFreeHeap(RtlGetProcessHeap(), 0, StartupInfo.lpDesktop);
RtlFreeHeap(RtlGetProcessHeap(), 0, StartupInfo.lpReserved);
RtlFreeUnicodeString(&CurrentDirectory);
RtlFreeHeap(RtlGetProcessHeap(), 0, StartupInfo.lpDesktop);
RtlFreeHeap(RtlGetProcessHeap(), 0, StartupInfo.lpReserved);