Alexander Morozov : setupapi: Create DeviceInstance value in registry, delete todo_wine from test.

Alexandre Julliard julliard at winehq.org
Wed Apr 2 06:55:40 CDT 2008


Module: wine
Branch: master
Commit: 997bea9b896fa748d6ec185c5462f11e0326904d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=997bea9b896fa748d6ec185c5462f11e0326904d

Author: Alexander Morozov <amorozov at etersoft.ru>
Date:   Tue Apr  1 14:25:10 2008 +0300

setupapi: Create DeviceInstance value in registry, delete todo_wine from test.

---

 dlls/setupapi/devinst.c       |   31 +++++++++++++++++++++----------
 dlls/setupapi/tests/devinst.c |    2 --
 2 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
index ebfeee0..75cb38b 100644
--- a/dlls/setupapi/devinst.c
+++ b/dlls/setupapi/devinst.c
@@ -2650,20 +2650,31 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyW(
                     samDesired, NULL, &interfKey, NULL);
             if (!l)
             {
-                if (instancePath)
-                {
-                    LONG l;
+                struct DeviceInfo *devInfo =
+                        (struct DeviceInfo *)ifaceInfo->device->Reserved;
 
-                    l = RegCreateKeyExW(interfKey, instancePath, 0, NULL, 0,
-                            samDesired, NULL, &key, NULL);
-                    if (l)
+                l = RegSetValueExW(interfKey, DeviceInstance, 0, REG_SZ,
+                        (BYTE *)devInfo->instanceId,
+                        (lstrlenW(devInfo->instanceId) + 1) * sizeof(WCHAR));
+                if (!l)
+                {
+                    if (instancePath)
                     {
-                        SetLastError(l);
-                        key = INVALID_HANDLE_VALUE;
+                        LONG l;
+
+                        l = RegCreateKeyExW(interfKey, instancePath, 0, NULL, 0,
+                                samDesired, NULL, &key, NULL);
+                        if (l)
+                        {
+                            SetLastError(l);
+                            key = INVALID_HANDLE_VALUE;
+                        }
+                        else if (InfHandle)
+                            FIXME("INF section installation unsupported\n");
                     }
-                    else if (InfHandle)
-                        FIXME("INF section installation unsupported\n");
                 }
+                else
+                    SetLastError(l);
                 RegCloseKey(interfKey);
             }
             else
diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c
index af98eb2..7f63afc 100644
--- a/dlls/setupapi/tests/devinst.c
+++ b/dlls/setupapi/tests/devinst.c
@@ -816,7 +816,6 @@ static void testRegisterAndGetDetail(void)
 
     SetLastError(0xdeadbeef);
     ret = pSetupDiEnumDeviceInterfaces(set, NULL, &guid, 0, &interfaceData);
-    todo_wine
     ok(ret, "SetupDiEnumDeviceInterfaces failed: %08x\n", GetLastError());
     SetLastError(0xdeadbeef);
     ret = pSetupDiGetDeviceInterfaceDetailA(set, &interfaceData, NULL, 0, &dwSize, NULL);
@@ -836,7 +835,6 @@ static void testRegisterAndGetDetail(void)
             ret = pSetupDiGetDeviceInterfaceDetailA(set, &interfaceData,
              detail, dwSize, &dwSize, NULL);
             ok(ret, "SetupDiGetDeviceInterfaceDetailA failed: %08x\n", GetLastError());
-            todo_wine
             ok(!lstrcmpiA(path, detail->DevicePath), "Unexpected path %s\n",
                     detail->DevicePath);
             HeapFree(GetProcessHeap(), 0, detail);




More information about the wine-cvs mailing list