mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 17:10:22 +00:00
- Revert r40484
svn path=/trunk/; revision=40527
This commit is contained in:
parent
75230872e0
commit
e24b445f11
1 changed files with 24 additions and 2 deletions
|
@ -720,12 +720,34 @@ CreateProcessInternalW(HANDLE hToken,
|
|||
|
||||
if (lpCurrentDirectory)
|
||||
{
|
||||
if ((GetFileAttributesW(lpCurrentDirectory) == INVALID_FILE_ATTRIBUTES) ||
|
||||
!(GetFileAttributesW(lpCurrentDirectory) & FILE_ATTRIBUTE_DIRECTORY))
|
||||
LPWSTR FilePart, Buffer = NULL;
|
||||
|
||||
Buffer = RtlAllocateHeap(RtlGetProcessHeap(),
|
||||
0,
|
||||
(MAX_PATH + 1) * sizeof(WCHAR));
|
||||
|
||||
if (!Buffer)
|
||||
{
|
||||
SetLastErrorByStatus(STATUS_NO_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (GetFullPathNameW(lpCurrentDirectory, MAX_PATH, Buffer, &FilePart) > MAX_PATH)
|
||||
{
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
|
||||
SetLastError(ERROR_DIRECTORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((GetFileAttributesW(Buffer) == INVALID_FILE_ATTRIBUTES) ||
|
||||
!(GetFileAttributesW(Buffer) & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
|
||||
SetLastError(ERROR_DIRECTORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue