Author: dchapyshev
Date: Sat May 9 16:44:39 2009
New Revision: 40867
URL:
http://svn.reactos.org/svn/reactos?rev=40867&view=rev
Log:
- Set error code if directory does not exist
- NtCreateFile -> NtOpenFile
Modified:
trunk/reactos/dll/win32/kernel32/file/dir.c
Modified: trunk/reactos/dll/win32/kernel32/file/dir.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/di…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/dir.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/dir.c [iso-8859-1] Sat May 9 16:44:39 2009
@@ -531,7 +531,10 @@
&NtPathU,
NULL,
NULL))
+ {
+ SetLastError(ERROR_PATH_NOT_FOUND);
return FALSE;
+ }
InitializeObjectAttributes(&ObjectAttributes,
&NtPathU,
@@ -541,21 +544,14 @@
TRACE("NtPathU '%S'\n", NtPathU.Buffer);
- Status = NtCreateFile (&DirectoryHandle,
- DELETE,
- &ObjectAttributes,
- &IoStatusBlock,
- NULL,
- FILE_ATTRIBUTE_DIRECTORY, /* 0x7 */
- 0,
- FILE_OPEN,
- FILE_DIRECTORY_FILE, /* 0x204021 */
- NULL,
- 0);
-
- RtlFreeHeap (RtlGetProcessHeap (),
- 0,
- NtPathU.Buffer);
+ Status = NtOpenFile(&DirectoryHandle,
+ DELETE,
+ &ObjectAttributes,
+ &IoStatusBlock,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT);
+
+ RtlFreeUnicodeString(&NtPathU);
if (!NT_SUCCESS(Status))
{