- Implement CM_Get_Device_List_Size_ExW
authorEric Kohl <eric.kohl@reactos.org>
Sat, 24 Sep 2005 09:30:43 +0000 (09:30 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 24 Sep 2005 09:30:43 +0000 (09:30 +0000)
svn path=/trunk/; revision=18023

reactos/include/idl/pnp.idl
reactos/include/wine/cfgmgr32.h
reactos/lib/setupapi/cfgmgr.c
reactos/services/umpnpmgr/umpnpmgr.c

index f4648d4..4178802 100644 (file)
@@ -49,6 +49,17 @@ interface pnp
                                  [out] unsigned long *RequiredLength,\r
                                  [in] DWORD Flags);\r
 \r
+//  CONFIGRET PNP_GetDeviceList(handle_t BindingHandle,\r
+//                              [in, unique, string] wchar_t *Filter,\r
+//                              [out, string, size_is(*Length)] unsigned char *Buffer\r
+//                              [in, out] unsigned long *Length,\r
+//                              [in] DWORD Flags);\r
+\r
+  CONFIGRET PNP_GetDeviceListSize(handle_t BindingHandle,\r
+                                  [in, unique, string] wchar_t *Filter,\r
+                                  [out] unsigned long *Length,\r
+                                  [in] DWORD Flags);\r
+\r
   CONFIGRET PNP_GetDepth(handle_t BindingHandle,\r
                          [in, string] wchar_t *DeviceInstance,\r
                          [out] unsigned long *Depth,\r
index 857e3fc..50dfcb1 100644 (file)
@@ -128,6 +128,17 @@ DECL_WINELIB_CFGMGR32_TYPE_AW(DEVINSTID)
 #define CM_DELETE_CLASS_SUBKEYS 0x00000001
 #define CM_DELETE_CLASS_BITS    0x00000001
 
+/* ulFlags for CM_Get_Device_ID_List and CM_Get_Device_ID_List_Size */
+#define CM_GETIDLIST_FILTER_NONE                (0x00000000)
+#define CM_GETIDLIST_FILTER_ENUMERATOR          (0x00000001)
+#define CM_GETIDLIST_FILTER_SERVICE             (0x00000002)
+#define CM_GETIDLIST_FILTER_EJECTRELATIONS      (0x00000004)
+#define CM_GETIDLIST_FILTER_REMOVALRELATIONS    (0x00000008)
+#define CM_GETIDLIST_FILTER_POWERRELATIONS      (0x00000010)
+#define CM_GETIDLIST_FILTER_BUSRELATIONS        (0x00000020)
+#define CM_GETIDLIST_DONOTGENERATE              (0x10000040)
+#define CM_GETIDLIST_FILTER_BITS                (0x1000007F)
+
 
 CONFIGRET WINAPI CM_Connect_MachineA( PCSTR, PHMACHINE );
 CONFIGRET WINAPI CM_Connect_MachineW( PCWSTR, PHMACHINE );
index 0f3464d..a7befef 100644 (file)
@@ -1195,9 +1195,34 @@ CONFIGRET WINAPI CM_Get_Device_ID_List_Size_ExA(
 CONFIGRET WINAPI CM_Get_Device_ID_List_Size_ExW(
     PULONG pulLen, PCWSTR pszFilter, ULONG ulFlags, HMACHINE hMachine)
 {
+    RPC_BINDING_HANDLE BindingHandle = NULL;
+
     FIXME("%p %s %ld %lx\n", pulLen, debugstr_w(pszFilter), ulFlags, hMachine);
-    *pulLen = 2;
-    return CR_SUCCESS;
+
+    if (pulLen == NULL)
+        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;
+    }
+
+    *pulLen = 0;
+
+    return PNP_GetDeviceListSize(BindingHandle,
+                                 (LPWSTR)pszFilter,
+                                 pulLen,
+                                 ulFlags);
 }
 
 
index cdeb7a7..8fecf2e 100644 (file)
@@ -302,6 +302,21 @@ PNP_EnumerateSubKeys(handle_t BindingHandle,
 }
 
 
+CONFIGRET
+PNP_GetDeviceListSize(handle_t BindingHandle,
+                      wchar_t *Filter,
+                      unsigned long *Length,
+                      DWORD Flags)
+{
+    DPRINT("PNP_GetDeviceListSize() called\n");
+
+    /* FIXME */
+    *Length = 2;
+
+    return CR_SUCCESS;
+}
+
+
 CONFIGRET
 PNP_GetDepth(handle_t BindingHandle,
              wchar_t *DeviceInstance,
@@ -634,6 +649,22 @@ PNP_GetDeviceRegProp(handle_t BindingHandle,
 }
 
 
+CONFIGRET
+PNP_CreateKey(handle_t BindingHandle,
+              wchar_t *SubKey,
+              unsigned long samDesired,
+              unsigned long Flags)
+{
+    CONFIGRET ret = CR_SUCCESS;
+
+    DPRINT("PNP_CreateKey() called\n");
+
+    DPRINT("PNP_CreateKey() done (returns %lx)\n", ret);
+
+    return ret;
+}
+
+
 CONFIGRET
 PNP_GetClassName(handle_t BindingHandle,
                  wchar_t *ClassGuid,