https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6f185c5fe2e3d65da8add34d906d2dc2ec3561d5

commit 6f185c5fe2e3d65da8add34d906d2dc2ec3561d5
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Wed May 31 04:08:16 2017 +0200
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Sun Jun 3 22:12:46 2018 +0200

    [USETUP] Use correct flags for the NtCreateFile call that creates new file 
directories.
    
    DIRECTORY_ALL_ACCESS is not the correct flag, because it is used with the 
NtCreateDirectoryObject API
    that creates virtual "directories" in the NT object namespace; that's not 
our purpose here.
    
    svn path=/branches/setup_improvements/; revision=74716
---
 base/setup/usetup/filesup.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/base/setup/usetup/filesup.c b/base/setup/usetup/filesup.c
index 6094ba3365..e0bd0b110e 100644
--- a/base/setup/usetup/filesup.c
+++ b/base/setup/usetup/filesup.c
@@ -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))

Reply via email to