- Implement CM_Enumerate_Enumerators[_Ex]A/W
- Fix PNP_EnumerateSubKeys
Modified: trunk/reactos/include/idl/pnp.idl
Modified: trunk/reactos/include/wine/cfgmgr32.h
Modified: trunk/reactos/lib/setupapi/cfgmgr.c
Modified: trunk/reactos/lib/setupapi/setupapi.spec
Modified: trunk/reactos/services/umpnpmgr/umpnpmgr.c
_____
Modified: trunk/reactos/include/idl/pnp.idl
--- trunk/reactos/include/idl/pnp.idl 2005-09-10 18:45:34 UTC (rev
17784)
+++ trunk/reactos/include/idl/pnp.idl 2005-09-10 19:01:44 UTC (rev
17785)
@@ -39,6 +39,8 @@
[in] DWORD Length,
[in] DWORD Flags);
+ cpp_quote("#define PNP_BRANCH_ENUM 1")
+ cpp_quote("#define PNP_BRANCH_CLASS 2")
CONFIGRET PNP_EnumerateSubKeys(handle_t BindingHandle,
[in] unsigned long Branch,
[in] unsigned long Index,
_____
Modified: trunk/reactos/include/wine/cfgmgr32.h
--- trunk/reactos/include/wine/cfgmgr32.h 2005-09-10 18:45:34 UTC
(rev 17784)
+++ trunk/reactos/include/wine/cfgmgr32.h 2005-09-10 19:01:44 UTC
(rev 17785)
@@ -137,6 +137,12 @@
CONFIGRET WINAPI CM_Disconnect_Machine( HMACHINE );
CONFIGRET WINAPI CM_Enumerate_Classes( ULONG, LPGUID, ULONG );
CONFIGRET WINAPI CM_Enumerate_Classes_Ex( ULONG, LPGUID, ULONG,
HMACHINE );
+CONFIGRET WINAPI CM_Enumerate_EnumeratorsA( ULONG, PCHAR, PULONG, ULONG
);
+CONFIGRET WINAPI CM_Enumerate_EnumeratorsW( ULONG, PWCHAR, PULONG,
ULONG );
+#define CM_Enumerate_Enumerators
WINELIB_NAME_AW(CM_Enumerate_Enumerators)
+CONFIGRET WINAPI CM_Enumerate_Enumerators_ExA( ULONG, PCHAR, PULONG,
ULONG, HMACHINE );
+CONFIGRET WINAPI CM_Enumerate_Enumerators_ExW( ULONG, PWCHAR, PULONG,
ULONG, HMACHINE );
+#define CM_Enumerate_Enumerators_Ex
WINELIB_NAME_AW(CM_Enumerate_Enumerators_Ex)
CONFIGRET WINAPI CM_Get_Child( PDEVINST, DEVINST, ULONG );
CONFIGRET WINAPI CM_Get_Child_Ex( PDEVINST, DEVINST, ULONG, HMACHINE );
CONFIGRET WINAPI CM_Get_Class_Key_NameA( LPGUID, LPSTR, PULONG, ULONG
);
_____
Modified: trunk/reactos/lib/setupapi/cfgmgr.c
--- trunk/reactos/lib/setupapi/cfgmgr.c 2005-09-10 18:45:34 UTC (rev
17784)
+++ trunk/reactos/lib/setupapi/cfgmgr.c 2005-09-10 19:01:44 UTC (rev
17785)
@@ -314,6 +314,85 @@
/***********************************************************************
+ * CM_Enumerate_EnumeratorsA [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Enumerate_EnumeratorsA(
+ ULONG ulEnumIndex, PCHAR Buffer, PULONG pulLength, ULONG ulFlags)
+{
+ TRACE("%lu %p %p %lx\n", ulEnumIndex, Buffer, pulLength, ulFlags);
+ return CM_Enumerate_Enumerators_ExA(ulEnumIndex, Buffer, pulLength,
+ ulFlags, NULL);
+}
+
+
+/**********************************************************************
*
+ * CM_Enumerate_EnumeratorsW [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Enumerate_EnumeratorsW(
+ ULONG ulEnumIndex, PWCHAR Buffer, PULONG pulLength, ULONG ulFlags)
+{
+ TRACE("%lu %p %p %lx\n", ulEnumIndex, Buffer, pulLength, ulFlags);
+ return CM_Enumerate_Enumerators_ExW(ulEnumIndex, Buffer, pulLength,
+ ulFlags, NULL);
+}
+
+
+/**********************************************************************
*
+ * CM_Enumerate_Enumerators_ExA [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Enumerate_Enumerators_ExA(
+ ULONG ulEnumIndex, PCHAR Buffer, PULONG pulLength, ULONG ulFlags,
+ HMACHINE hMachine)
+{
+ FIXME("%lu %p %p %lx %lx\n", ulEnumIndex, Buffer, pulLength,
ulFlags,
+ hMachine);
+ return CR_CALL_NOT_IMPLEMENTED;
+}
+
+
+/**********************************************************************
*
+ * CM_Enumerate_Enumerators_ExW [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Enumerate_Enumerators_ExW(
+ ULONG ulEnumIndex, PWCHAR Buffer, PULONG pulLength, ULONG ulFlags,
+ HMACHINE hMachine)
+{
+ RPC_BINDING_HANDLE BindingHandle = NULL;
+
+ FIXME("%lu %p %p %lx %lx\n", ulEnumIndex, Buffer, pulLength,
ulFlags,
+ hMachine);
+
+ if (Buffer == NULL || pulLength == NULL)
+ return CR_INVALID_POINTER;
+
+ if (ulFlags != 0)
+ return CR_INVALID_FLAG;
+
+ Buffer[0] = (WCHAR)0;
+
+ if (hMachine != NULL)
+ {
+ BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
+ if (BindingHandle == NULL)
+ return CR_FAILURE;
+ }
+ else
+ {
+ if (!PnpGetLocalHandles(&BindingHandle, NULL))
+ return CR_FAILURE;
+ }
+
+ return PNP_EnumerateSubKeys(BindingHandle,
+ PNP_BRANCH_ENUM,
+ ulEnumIndex,
+ Buffer,
+ *pulLength,
+ pulLength,
+ ulFlags);
+}
+
+
+/**********************************************************************
*
* CM_Get_Child [SETUPAPI.@]
*/
CONFIGRET WINAPI CM_Get_Child(
_____
Modified: trunk/reactos/lib/setupapi/setupapi.spec
--- trunk/reactos/lib/setupapi/setupapi.spec 2005-09-10 18:45:34 UTC
(rev 17784)
+++ trunk/reactos/lib/setupapi/setupapi.spec 2005-09-10 19:01:44 UTC
(rev 17785)
@@ -40,10 +40,10 @@
@ stub CM_Enable_DevNode_Ex
@ stdcall CM_Enumerate_Classes(long ptr long)
@ stdcall CM_Enumerate_Classes_Ex(long ptr long ptr)
-@ stub CM_Enumerate_EnumeratorsA
-@ stub CM_Enumerate_EnumeratorsW
-@ stub CM_Enumerate_Enumerators_ExA
-@ stub CM_Enumerate_Enumerators_ExW
+@ stdcall CM_Enumerate_EnumeratorsA(long str ptr long)
+@ stdcall CM_Enumerate_EnumeratorsW(long wstr ptr long)
+@ stdcall CM_Enumerate_Enumerators_ExA(long str ptr long long)
+@ stdcall CM_Enumerate_Enumerators_ExW(long wstr ptr long long)
@ stub CM_Find_Range
@ stub CM_First_Range
@ stub CM_Free_Log_Conf
_____
Modified: trunk/reactos/services/umpnpmgr/umpnpmgr.c
--- trunk/reactos/services/umpnpmgr/umpnpmgr.c 2005-09-10 18:45:34 UTC
(rev 17784)
+++ trunk/reactos/services/umpnpmgr/umpnpmgr.c 2005-09-10 19:01:44 UTC
(rev 17785)
@@ -262,15 +262,15 @@
HKEY hKey;
DWORD dwError;
- DPRINT1("PNP_EnumerateSubKeys() called\n");
+ DPRINT("PNP_EnumerateSubKeys() called\n");
switch (Branch)
{
- case 1:
+ case PNP_BRANCH_ENUM:
hKey = hEnumKey;
break;
- case 2:
+ case PNP_BRANCH_CLASS:
hKey = hClassKey;
break;
@@ -289,15 +289,15 @@
NULL);
if (dwError != ERROR_SUCCESS)
{
- ret = CR_FAILURE;
+ ret = (dwError == ERROR_NO_MORE_ITEMS) ? CR_NO_SUCH_VALUE :
CR_FAILURE;
}
-
- DPRINT1("PNP_EnumerateSubKeys() done (returns %lx)\n", ret);
- if (ret == CR_SUCCESS)
+ else
{
- DPRINT1("Sub key: %S\n", Buffer);
+ *RequiredLength++;
}
+ DPRINT("PNP_EnumerateSubKeys() done (returns %lx)\n", ret);
+
return ret;
}