[ros-diffs] [ekohl] 49400: [SETUPAPI] Implement CM_Get_Device_ID_List_ExW().

ekohl at svn.reactos.org ekohl at svn.reactos.org
Mon Nov 1 12:39:54 UTC 2010


Author: ekohl
Date: Mon Nov  1 12:39:51 2010
New Revision: 49400

URL: http://svn.reactos.org/svn/reactos?rev=49400&view=rev
Log:
[SETUPAPI]
Implement CM_Get_Device_ID_List_ExW().

Modified:
    trunk/reactos/dll/win32/setupapi/cfgmgr.c

Modified: trunk/reactos/dll/win32/setupapi/cfgmgr.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/cfgmgr.c?rev=49400&r1=49399&r2=49400&view=diff
==============================================================================
--- trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] Mon Nov  1 12:39:51 2010
@@ -1987,10 +1987,47 @@
     PCWSTR pszFilter, PWCHAR Buffer, ULONG BufferLen, ULONG ulFlags,
     HMACHINE hMachine)
 {
-    FIXME("%p %p %ld %ld %lx\n",
+    RPC_BINDING_HANDLE BindingHandle = NULL;
+    CONFIGRET ret;
+
+    TRACE("%p %p %ld %ld %lx\n",
           pszFilter, Buffer, BufferLen, ulFlags, hMachine);
-    memset(Buffer,0,2);
-    return CR_SUCCESS;
+
+    if (Buffer == NULL || BufferLen == 0)
+        return CR_INVALID_POINTER;
+
+    if (ulFlags & ~CM_GETIDLIST_FILTER_BITS)
+        return CR_INVALID_FLAG;
+
+    if (hMachine != NULL)
+    {
+        BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
+        if (BindingHandle == NULL)
+            return CR_FAILURE;
+    }
+    else
+    {
+        if (!PnpGetLocalHandles(&BindingHandle, NULL))
+            return CR_FAILURE;
+    }
+
+    *Buffer = 0;
+
+    RpcTryExcept
+    {
+        ret = PNP_GetDeviceList(BindingHandle,
+                                pszFilter,
+                                Buffer,
+                                &BufferLen,
+                                ulFlags);
+    }
+    RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+    {
+        ret = RpcStatusToCmStatus(RpcExceptionCode());
+    }
+    RpcEndExcept;
+
+    return ret;
 }
 
 




More information about the Ros-diffs mailing list