Use only NtCreateKey and better suited access rights.
authorBrandon Turner <turnerb7@msu.edu>
Thu, 29 Dec 2005 22:54:24 +0000 (22:54 +0000)
committerBrandon Turner <turnerb7@msu.edu>
Thu, 29 Dec 2005 22:54:24 +0000 (22:54 +0000)
svn path=/trunk/; revision=20448

reactos/lib/kernel32/file/move.c

index 723b831..2b93dc1 100644 (file)
@@ -109,24 +109,17 @@ static BOOL add_boot_rename_entry( LPCWSTR source, LPCWSTR dest, DWORD flags )
                                NULL,
                                NULL);
 
                                NULL,
                                NULL);
 
-    Status =  NtOpenKey(&Reboot,
-                                   KEY_ALL_ACCESS,
-                                   &ObjectAttributes);
+     Status = NtCreateKey(&Reboot, 
+                          KEY_QUERY_VALUE | KEY_SET_VALUE,
+                          &ObjectAttributes,
+                          0,
+                          NULL,
+                          REG_OPTION_NON_VOLATILE,
+                          NULL);
 
     if (!NT_SUCCESS(Status))
     {
 
     if (!NT_SUCCESS(Status))
     {
-        Status = NtCreateKey(&Reboot, 
-                             KEY_ALL_ACCESS,
-                             &ObjectAttributes,
-                             0,
-                             NULL,
-                             REG_OPTION_NON_VOLATILE,
-                             NULL);
-    }
-
-    if (!NT_SUCCESS(Status))
-    {
-        DPRINT1("NtCreateKey() failed (Status %lx)\n", Status);
+        DPRINT1("NtCreateKey() failed (Status 0x%lx)\n", Status);
         RtlFreeUnicodeString( &source_name );
         RtlFreeUnicodeString( &dest_name );
         return FALSE;
         RtlFreeUnicodeString( &source_name );
         RtlFreeUnicodeString( &dest_name );
         return FALSE;