various fixes

svn path=/trunk/; revision=2753
This commit is contained in:
KJK::Hyperion 2002-03-21 22:43:13 +00:00
parent acbed041bb
commit 01011e86cc

View file

@ -1,4 +1,4 @@
/* $Id: pdata.c,v 1.2 2002/03/11 20:45:07 hyperion Exp $ /* $Id: pdata.c,v 1.3 2002/03/21 22:43:13 hyperion Exp $
*/ */
/* /*
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
@ -31,12 +31,13 @@ __PdxProcessDataToProcessParameters
IN PUNICODE_STRING ImageFile IN PUNICODE_STRING ImageFile
) )
{ {
NTSTATUS nErrCode;
UNICODE_STRING wstrEmpty = {0, 0, NULL}; UNICODE_STRING wstrEmpty = {0, 0, NULL};
UNICODE_STRING wstrCommandLine = {0, 0, NULL}; UNICODE_STRING wstrCommandLine = {0, 0, NULL};
NTSTATUS nErrCode;
__fildes_t * fdDescriptor; __fildes_t * fdDescriptor;
int i; int i;
/* RtlInitUnicodeString(&wstrEmpty, L""); */
/* TODO: error checking */ /* TODO: error checking */
/* build the command line string from argument count and argument vector */ /* build the command line string from argument count and argument vector */
@ -102,19 +103,11 @@ __PdxProcessDataToProcessParameters
} }
} }
#ifndef NDEBUG nErrCode = RtlCreateProcessParameters
wstrCommandLine.MaximumLength = wstrCommandLine.Length + sizeof(WCHAR);
wstrCommandLine.Buffer = __realloc(wstrCommandLine.Buffer, wstrCommandLine.MaximumLength);
wstrCommandLine.Buffer[wstrCommandLine.Length / sizeof(WCHAR)] = 0;
INFO("command line is \"%ls\"\n", wstrCommandLine.Buffer);
#endif
RtlCreateProcessParameters
( (
ProcessParameters, ProcessParameters,
ImageFile, ImageFile,
&wstrEmpty, NULL,
&wstrEmpty, &wstrEmpty,
&wstrCommandLine, &wstrCommandLine,
0, 0,
@ -304,7 +297,7 @@ __PdxSerializeProcessData
__free(pnArgLengths); __free(pnArgLengths);
__free(pnEnvVarsLengths); __free(pnEnvVarsLengths);
*SerializedProcessData = 0; *SerializedProcessData = 0;
return; return nErrCode;
} }
INFO("%d bytes actually allocated\n", ulAllocSize); INFO("%d bytes actually allocated\n", ulAllocSize);
@ -478,6 +471,8 @@ __PdxSerializeProcessData
/* success */ /* success */
*SerializedProcessData = pspdProcessData; *SerializedProcessData = pspdProcessData;
return (STATUS_SUCCESS);
} }
/* unserialize a process data block. Dynamic data will be moved into the default /* unserialize a process data block. Dynamic data will be moved into the default