[GFLAGS] Use the registry access flags passed in
authorMark Jansen <mark.jansen@reactos.org>
Sun, 11 Nov 2018 14:34:59 +0000 (15:34 +0100)
committerMark Jansen <mark.jansen@reactos.org>
Sun, 11 Nov 2018 16:21:16 +0000 (17:21 +0100)
modules/rosapps/applications/cmdutils/gflags/gflags.c

index f97f1f5..a43382c 100644 (file)
@@ -18,7 +18,7 @@ BOOL OpenImageFileExecOptions(IN REGSAM SamDesired, IN OPTIONAL PCWSTR ImageName
     LONG Ret;
     HKEY HandleKey, HandleSubKey;
 
-    Ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, ImageExecOptionsString, 0, KEY_WRITE | KEY_READ, &HandleKey);
+    Ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, ImageExecOptionsString, 0, SamDesired, &HandleKey);
     if (Ret != ERROR_SUCCESS)
     {
         wprintf(L"OpenIFEO: RegOpenKeyEx failed (%d)\n", Ret);
@@ -31,7 +31,7 @@ BOOL OpenImageFileExecOptions(IN REGSAM SamDesired, IN OPTIONAL PCWSTR ImageName
         return TRUE;
     }
 
-    Ret = RegCreateKeyExW(HandleKey, ImageName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_READ, NULL, &HandleSubKey, NULL);
+    Ret = RegCreateKeyExW(HandleKey, ImageName, 0, NULL, REG_OPTION_NON_VOLATILE, SamDesired, NULL, &HandleSubKey, NULL);
     CloseHandle(HandleKey);
 
     if (Ret != ERROR_SUCCESS)