[USETUP] Explicitly use the REG_OPTION_(NON_)VOLATILE flags in NtCreateKey calls.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 11 Jun 2017 23:47:11 +0000 (23:47 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 24 Oct 2018 22:58:21 +0000 (00:58 +0200)
svn path=/branches/setup_improvements/; revision=75007

base/setup/usetup/devinst.c
base/setup/usetup/mui.c

index b1e4baf..bd9af3a 100644 (file)
@@ -98,7 +98,7 @@ InstallDriver(
     /* Create service key */
     RtlInitUnicodeString(&StringU, Driver);
     InitializeObjectAttributes(&ObjectAttributes, &StringU, 0, hServices, NULL);
-    Status = NtCreateKey(&hService, KEY_SET_VALUE, &ObjectAttributes, 0, NULL, 0, &Disposition);
+    Status = NtCreateKey(&hService, KEY_SET_VALUE, &ObjectAttributes, 0, NULL, REG_OPTION_NON_VOLATILE, &Disposition);
     if (!NT_SUCCESS(Status))
     {
         DPRINT1("NtCreateKey('%wZ') failed with status 0x%08x\n", &StringU, Status);
@@ -342,7 +342,7 @@ EventThread(IN LPVOID lpParameter)
     }
 
     InitializeObjectAttributes(&ObjectAttributes, &ServicesU, OBJ_CASE_INSENSITIVE, NULL, NULL);
-    Status = NtCreateKey(&hServices, KEY_ALL_ACCESS, &ObjectAttributes, 0, NULL, 0, NULL);
+    Status = NtCreateKey(&hServices, KEY_ALL_ACCESS, &ObjectAttributes, 0, NULL, REG_OPTION_NON_VOLATILE, NULL);
     if (!NT_SUCCESS(Status))
     {
         DPRINT1("NtCreateKey('%wZ') failed with status 0x%08lx\n", &ServicesU, Status);
index a983f0f..93b2fea 100644 (file)
@@ -309,7 +309,7 @@ AddHotkeySettings(
                           &ObjectAttributes,
                           0,
                           NULL,
-                          0,
+                          REG_OPTION_NON_VOLATILE,
                           &Disposition);
 
     if(!NT_SUCCESS(Status))
@@ -401,7 +401,7 @@ AddKbLayoutsToRegistry(
                           &ObjectAttributes,
                           0,
                           NULL,
-                          0,
+                          REG_OPTION_NON_VOLATILE,
                           &Disposition);
 
     if(NT_SUCCESS(Status))
@@ -433,7 +433,7 @@ AddKbLayoutsToRegistry(
                          &ObjectAttributes,
                          0,
                          NULL,
-                         0,
+                         REG_OPTION_NON_VOLATILE,
                          &Disposition);
 
     if (!NT_SUCCESS(Status))
@@ -454,7 +454,7 @@ AddKbLayoutsToRegistry(
                           &ObjectAttributes,
                           0,
                           NULL,
-                          0,
+                          REG_OPTION_NON_VOLATILE,
                           &Disposition);
 
     if(!NT_SUCCESS(Status))