https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8e850d19bceb0a73147ee09c282adeb10850358a

commit 8e850d19bceb0a73147ee09c282adeb10850358a
Author: Eric Kohl <eric.k...@reactos.org>
AuthorDate: Sun Nov 5 09:39:44 2017 +0100

    [SETUPAPI] GetDeviceInstanceKeyPath: Implement the CM_REGISTRY_SOFTWARE | 
CM_REGISTRY_CONFIG part.
---
 dll/win32/setupapi/cfgmgr.c | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/dll/win32/setupapi/cfgmgr.c b/dll/win32/setupapi/cfgmgr.c
index 362d34e14e..e67db054c9 100644
--- a/dll/win32/setupapi/cfgmgr.c
+++ b/dll/win32/setupapi/cfgmgr.c
@@ -210,7 +210,36 @@ GetDeviceInstanceKeyPath(
     if (ulFlags & CM_REGISTRY_SOFTWARE)
     {
         /* Software Key Path */
-        ret = CR_CALL_NOT_IMPLEMENTED;
+
+        if (ulFlags & CM_REGISTRY_CONFIG)
+        {
+            SplitDeviceInstanceId(pszDeviceInst,
+                                  pszBuffer,
+                                  pszInstancePath);
+
+            if (ulHardwareProfile == 0)
+            {
+                wsprintfW(pszKeyPath,
+                          L"%s\\%s\\%s\\%s",
+                          L"System\\CurrentControlSet\\Hardware Profiles",
+                          L"Current",
+                          L"System\\CurrentControlSet\\Control\\Enum",
+                          pszBuffer);
+            }
+            else
+            {
+                wsprintfW(pszKeyPath,
+                          L"%s\\%04lu\\%s\\%s",
+                          L"System\\CurrentControlSet\\Hardware Profiles",
+                          ulHardwareProfile,
+                          L"System\\CurrentControlSet\\Control\\Enum",
+                          pszBuffer);
+            }
+        }
+        else
+        {
+            ret = CR_CALL_NOT_IMPLEMENTED;
+        }
     }
     else
     {

Reply via email to