int iFdErr = -1;
pid_t processId;
- char * lpFileName = (char*)InternalMalloc(pThread, MAX_LONGPATH);
+ char * lpFileName;
+ PathCharString lpFileNamePS;
char **lppArgv = NULL;
UINT nArg;
int iRet;
lpApplicationName);
palError = ERROR_INVALID_PARAMETER;
goto InternalCreateProcessExit;
- }
-
- if (NULL == lpFileName)
- {
- palError = ERROR_NOT_ENOUGH_MEMORY;
- goto InternalCreateProcessExit;
}
if (0 != (dwCreationFlags & ~(CREATE_SUSPENDED|CREATE_NEW_CONSOLE)))
}
}
+ lpFileName = lpFileNamePS.OpenStringBuffer(MAX_LONGPATH-1);
if (!getFileName(lpApplicationName, lpCommandLine, lpFileName))
{
ERROR("Can't find executable!\n");
palError = ERROR_FILE_NOT_FOUND;
goto InternalCreateProcessExit;
}
-
+
+ lpFileNamePS.CloseBuffer(MAX_LONGPATH-1);
/* check type of file */
iRet = checkFileType(lpFileName);
if ( PAL_GetPALDirectoryA( lpFileName,
(MAX_LONGPATH - (strlen(PROCESS_PELOADER_FILENAME)+1))))
{
- if ((strcat_s(lpFileName, sizeof(char) * MAX_LONGPATH, "/") != SAFECRT_SUCCESS) ||
- (strcat_s(lpFileName, sizeof(char) * MAX_LONGPATH, PROCESS_PELOADER_FILENAME) != SAFECRT_SUCCESS))
+ if ((strcat_s(lpFileName, lpFileNamePS.GetSizeOf(), "/") != SAFECRT_SUCCESS) ||
+ (strcat_s(lpFileName, lpFileNamePS.GetSizeOf(), PROCESS_PELOADER_FILENAME) != SAFECRT_SUCCESS))
{
ERROR("strcpy_s/strcat_s failed!\n");
palError = ERROR_INTERNAL_ERROR;