mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:52:56 +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 (lpCurrentDirectory)
|
||||||
{
|
{
|
||||||
if ((GetFileAttributesW(lpCurrentDirectory) == INVALID_FILE_ATTRIBUTES) ||
|
LPWSTR FilePart, Buffer = NULL;
|
||||||
!(GetFileAttributesW(lpCurrentDirectory) & FILE_ATTRIBUTE_DIRECTORY))
|
|
||||||
|
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);
|
SetLastError(ERROR_DIRECTORY);
|
||||||
return FALSE;
|
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…
Add table
Add a link
Reference in a new issue