Kevin Koltzau : setupapi: Create an empty list when getting device interface classes.

Alexandre Julliard julliard at wine.codeweavers.com
Sat Aug 5 04:41:14 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 93f5e0a7fd9c9f741de4a1faaa8a90ed88a36d60
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=93f5e0a7fd9c9f741de4a1faaa8a90ed88a36d60

Author: Kevin Koltzau <kevin at plop.org>
Date:   Fri Aug  4 16:31:59 2006 -0400

setupapi: Create an empty list when getting device interface classes.

---

 dlls/setupapi/devinst.c |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
index 50d17e5..30ed085 100644
--- a/dlls/setupapi/devinst.c
+++ b/dlls/setupapi/devinst.c
@@ -1013,7 +1013,18 @@ HDEVINFO WINAPI SetupDiGetClassDevsW(
     TRACE("%s %s %p 0x%08lx\n", debugstr_guid(class), debugstr_w(enumstr),
      parent, flags);
 
-    if (enumstr)
+    if(flags & DIGCF_DEVICEINTERFACE)
+    {
+        if(!class)
+            SetLastError(ERROR_INVALID_PARAMETER);
+        else
+        {
+            /* WinXP always succeeds, returns empty list for unknown classes */
+            FIXME(": returning empty list\n");
+            ret = SetupDiCreateDeviceInfoList(class, parent);
+        }
+    }
+    else if (enumstr)
         FIXME(": unimplemented for enumerator strings (%s)\n",
          debugstr_w(enumstr));
     else if (flags & DIGCF_ALLCLASSES)
@@ -1045,7 +1056,7 @@ HDEVINFO WINAPI SetupDiGetClassDevsExW(
  *		SetupDiEnumDeviceInterfaces (SETUPAPI.@)
  */
 BOOL WINAPI SetupDiEnumDeviceInterfaces(
-       HDEVINFO DeviceInfoSet,
+       HDEVINFO devinfo,
        PSP_DEVINFO_DATA DeviceInfoData,
        CONST GUID * InterfaceClassGuid,
        DWORD MemberIndex,
@@ -1053,10 +1064,19 @@ BOOL WINAPI SetupDiEnumDeviceInterfaces(
 {
     BOOL ret = FALSE;
 
-    FIXME("%p, %p, %s, 0x%08lx, %p\n", DeviceInfoSet, DeviceInfoData,
+    FIXME("%p, %p, %s, 0x%08lx, %p\n", devinfo, DeviceInfoData,
      debugstr_guid(InterfaceClassGuid), MemberIndex, DeviceInterfaceData);
 
-    SetLastError(ERROR_INVALID_HANDLE);
+    if (devinfo && devinfo != (HDEVINFO)INVALID_HANDLE_VALUE)
+    {
+        struct DeviceInfoSet *list = (struct DeviceInfoSet *)devinfo;
+        if (list->magic == SETUP_DEVICE_INFO_SET_MAGIC)
+            SetLastError(ERROR_NO_MORE_ITEMS);
+        else
+            SetLastError(ERROR_INVALID_HANDLE);
+    }
+    else
+        SetLastError(ERROR_INVALID_HANDLE);
     return ret;
 }
 




More information about the wine-cvs mailing list