Author: greatlrd
Date: Sun May 7 22:17:50 2006
New Revision: 21835
URL:
http://svn.reactos.ru/svn/reactos?rev=21835&view=rev
Log:
Bug 1456 : patch from w3seek : Fix a bug in CreateDirectoryEx that makes the function
attempt to create the template directory again
Modified:
trunk/reactos/dll/win32/kernel32/file/dir.c
Modified: trunk/reactos/dll/win32/kernel32/file/dir.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/kernel32/file/dir…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/dir.c (original)
+++ trunk/reactos/dll/win32/kernel32/file/dir.c Sun May 7 22:17:50 2006
@@ -192,12 +192,6 @@
}
InitializeObjectAttributes(&ObjectAttributes,
- &NtPathU,
- OBJ_CASE_INSENSITIVE,
- NULL,
- (lpSecurityAttributes ?
lpSecurityAttributes->lpSecurityDescriptor : NULL));
-
- InitializeObjectAttributes(&ObjectAttributes,
&NtTemplatePathU,
OBJ_CASE_INSENSITIVE,
NULL,
@@ -256,7 +250,13 @@
Status = STATUS_OBJECT_NAME_INVALID;
goto Cleanup;
}
-
+
+ InitializeObjectAttributes(&ObjectAttributes,
+ &NtPathU,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ (lpSecurityAttributes ?
lpSecurityAttributes->lpSecurityDescriptor : NULL));
+
/*
* Query the basic file attributes from the template directory
*/
@@ -358,6 +358,7 @@
/*
* Create the new directory
*/
+
Status = NtCreateFile (&DirectoryHandle,
DesiredAccess,
&ObjectAttributes,
@@ -443,7 +444,7 @@
/* FIXME - enumerate and copy the file streams */
}
-
+
/*
* We successfully created the directory and copied all information
* from the template directory
@@ -460,7 +461,7 @@
{
NtClose(TemplateHandle);
}
-
+
RtlFreeHeap (RtlGetProcessHeap (),
0,
NtTemplatePathU.Buffer);