https://git.reactos.org/?p=reactos.git;a=commitdiff;h=44a312478d3a2296e3f949b15f7c045478b9b184

commit 44a312478d3a2296e3f949b15f7c045478b9b184
Author:     Eric Kohl <[email protected]>
AuthorDate: Wed Jun 28 23:15:26 2023 +0200
Commit:     Eric Kohl <[email protected]>
CommitDate: Wed Jun 28 23:15:26 2023 +0200

    [UMPNPMGR] OpenConfigurationKey: Open subkeys depending on the 
configuration type
    
    - Boot and Basic Configurations are located in the LogConf subkey.
    - Alloc and filtered Configurations are located in the Control subkey.
---
 base/services/umpnpmgr/rpcserver.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/base/services/umpnpmgr/rpcserver.c 
b/base/services/umpnpmgr/rpcserver.c
index 70acf5e12ba..355bd75e4e3 100644
--- a/base/services/umpnpmgr/rpcserver.c
+++ b/base/services/umpnpmgr/rpcserver.c
@@ -428,9 +428,11 @@ static
 CONFIGRET
 OpenConfigurationKey(
     _In_ LPCWSTR pszDeviceID,
+    _In_ DWORD ulLogConfType,
     _Out_ PHKEY phKey)
 {
     WCHAR szKeyName[MAX_PATH];
+    PCWSTR pszSubKeyName;
     HKEY hInstanceKey;
     DWORD dwError;
 
@@ -447,9 +449,26 @@ OpenConfigurationKey(
     if (dwError != ERROR_SUCCESS)
         return CR_INVALID_DEVINST;
 
+    switch (ulLogConfType)
+    {
+        case BOOT_LOG_CONF:
+        case BASIC_LOG_CONF:
+            pszSubKeyName = L"LogConf";
+            break;
+
+        case ALLOC_LOG_CONF:
+        case FILTERED_LOG_CONF:
+            pszSubKeyName = L"Control";
+            break;
+
+        default:
+            DPRINT1("Unsupported configuration type!\n");
+            return CR_FAILURE;
+    }
+
     /* Create or open the LogConf key */
     dwError = RegCreateKeyExW(hInstanceKey,
-                              L"LogConf",
+                              pszSubKeyName,
                               0,
                               NULL,
                               REG_OPTION_NON_VOLATILE,
@@ -4197,6 +4216,7 @@ PNP_GetFirstLogConf(
         return CR_INVALID_DEVINST;
 
     ret = OpenConfigurationKey(pDeviceID,
+                               ulLogConfType,
                                &hConfigKey);
     if (ret != CR_SUCCESS)
     {
@@ -4297,6 +4317,7 @@ PNP_GetNextLogConf(
         return CR_INVALID_DEVINST;
 
     ret = OpenConfigurationKey(pDeviceID,
+                               ulLogConfType,
                                &hConfigKey);
     if (ret != CR_SUCCESS)
     {
@@ -4445,6 +4466,7 @@ PNP_GetNextResDes(
         return CR_INVALID_DEVINST;
 
     ret = OpenConfigurationKey(pDeviceID,
+                               ulLogConfType,
                                &hConfigKey);
     if (ret != CR_SUCCESS)
     {

Reply via email to