mirror of
https://github.com/reactos/reactos.git
synced 2024-09-14 06:42:52 +00:00
- Revert r40529
svn path=/trunk/; revision=40532
This commit is contained in:
parent
32414442e2
commit
1487d68971
|
@ -718,6 +718,38 @@ CreateProcessInternalW(HANDLE hToken,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lpCurrentDirectory)
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We're going to modify and mask out flags and stuff in lpStartupInfo,
|
* We're going to modify and mask out flags and stuff in lpStartupInfo,
|
||||||
* so we'll use our own local copy for that.
|
* so we'll use our own local copy for that.
|
||||||
|
|
Loading…
Reference in a new issue