[USETUP] Use correct flags for the NtCreateFile call that creates new file directories.
[reactos.git] / base / setup / usetup / filesup.c
index 6094ba3..e0bd0b1 100644 (file)
@@ -30,7 +30,7 @@ SetupCreateSingleDirectory(
     HANDLE DirectoryHandle;
     NTSTATUS Status;
 
-    if(!RtlCreateUnicodeString(&PathName, DirectoryName))
+    if (!RtlCreateUnicodeString(&PathName, DirectoryName))
         return STATUS_NO_MEMORY;
 
     if (PathName.Length > sizeof(WCHAR) &&
@@ -55,14 +55,14 @@ SetupCreateSingleDirectory(
                                NULL);
 
     Status = NtCreateFile(&DirectoryHandle,
-                          DIRECTORY_ALL_ACCESS,
+                          FILE_LIST_DIRECTORY | SYNCHRONIZE,
                           &ObjectAttributes,
                           &IoStatusBlock,
                           NULL,
                           FILE_ATTRIBUTE_DIRECTORY,
                           FILE_SHARE_READ | FILE_SHARE_WRITE,
                           FILE_OPEN_IF,
-                          FILE_DIRECTORY_FILE,
+                          FILE_OPEN_FOR_BACKUP_INTENT | FILE_DIRECTORY_FILE,
                           NULL,
                           0);
     if (NT_SUCCESS(Status))