mirror of
https://github.com/reactos/reactos.git
synced 2024-08-29 22:58:34 +00:00
- Simplify my last changes. Thanks Goplat ;)
svn path=/trunk/; revision=40484
This commit is contained in:
parent
298432c4ed
commit
f91941a278
|
@ -720,34 +720,12 @@ CreateProcessInternalW(HANDLE hToken,
|
|||
|
||||
if (lpCurrentDirectory)
|
||||
{
|
||||
LPWSTR FilePart, Buffer = NULL;
|
||||
|
||||
Buffer = RtlAllocateHeap(RtlGetProcessHeap(),
|
||||
0,
|
||||
(MAX_PATH + 1) * sizeof(WCHAR));
|
||||
|
||||
if (!Buffer)
|
||||
if ((GetFileAttributesW(lpCurrentDirectory) == INVALID_FILE_ATTRIBUTES) ||
|
||||
!(GetFileAttributesW(lpCurrentDirectory) & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
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