- CFGMGR32.DLL: Forward implemented functions to SETUPAPI.DLL.
- SETUPAPI.DLL: Use PNP_EnumerateSubKeys to implement
CM_Enumerate_Classes_Ex.
Modified: trunk/reactos/lib/cfgmgr32/cfgmgr32.def
Modified: trunk/reactos/lib/setupapi/cfgmgr.c
_____
Modified: trunk/reactos/lib/cfgmgr32/cfgmgr32.def
--- trunk/reactos/lib/cfgmgr32/cfgmgr32.def 2005-09-11 13:55:23 UTC
(rev 17800)
+++ trunk/reactos/lib/cfgmgr32/cfgmgr32.def 2005-09-11 14:38:57 UTC
(rev 17801)
@@ -41,8 +41,8 @@
;CM_Create_DevNode_ExA
;CM_Create_DevNode_ExW
;CM_Create_Range_List
-;CM_Delete_Class_Key
-;CM_Delete_Class_Key_Ex
+CM_Delete_Class_Key(a)8=SETUPAPI.CM_Delete_Class_Key
+CM_Delete_Class_Key_Ex(a)12=SETUPAPI.CM_Delete_Class_Key_Ex
;CM_Delete_DevNode_Key
;CM_Delete_DevNode_Key_Ex
;CM_Delete_Range
@@ -56,10 +56,10 @@
;CM_Enable_DevNode_Ex
CM_Enumerate_Classes(a)12=SETUPAPI.CM_Enumerate_Classes
CM_Enumerate_Classes_Ex(a)16=SETUPAPI.CM_Enumerate_Classes_Ex
-;CM_Enumerate_EnumeratorsA
-;CM_Enumerate_EnumeratorsW
-;CM_Enumerate_Enumerators_ExA
-;CM_Enumerate_Enumerators_ExW
+CM_Enumerate_EnumeratorsA(a)16=SETUPAPI.CM_Enumerate_EnumeratorsA
+CM_Enumerate_EnumeratorsW(a)16=SETUPAPI.CM_Enumerate_EnumeratorsW
+CM_Enumerate_Enumerators_ExA(a)20=SETUPAPI.CM_Enumerate_Enumerators_ExA
+CM_Enumerate_Enumerators_ExW(a)20=SETUPAPI.CM_Enumerate_Enumerators_ExW
;CM_Find_Range
;CM_First_Range
;CM_Free_Log_Conf
@@ -71,14 +71,14 @@
;CM_Free_Res_Des_Handle
CM_Get_Child(a)12=SETUPAPI.CM_Get_Child
CM_Get_Child_Ex(a)16=SETUPAPI.CM_Get_ChildEx
-;CM_Get_Class_Key_NameA
-;CM_Get_Class_Key_NameW
-;CM_Get_Class_Key_Name_ExA
-;CM_Get_Class_Key_Name_ExW
-;CM_Get_Class_NameA
-;CM_Get_Class_NameW
-;CM_Get_Class_Name_ExA
-;CM_Get_Class_Name_ExW
+CM_Get_Class_Key_NameA(a)16=SETUPAPI.CM_Get_Class_Key_NameA
+CM_Get_Class_Key_NameW(a)16=SETUPAPI.CM_Get_Class_Key_NameW
+CM_Get_Class_Key_Name_ExA(a)20=SETUPAPI.CM_Get_Class_Key_Name_ExA
+CM_Get_Class_Key_Name_ExW(a)20=SETUPAPI.CM_Get_Class_Key_Name_ExW
+CM_Get_Class_NameA(a)16=SETUPAPI.CM_Get_Class_NameA
+CM_Get_Class_NameW(a)16=SETUPAPI.CM_Get_Class_NameW
+CM_Get_Class_Name_ExA(a)20=SETUPAPI.CM_Get_Class_Name_ExA
+CM_Get_Class_Name_ExW(a)20=SETUPAPI.CM_Get_Class_Name_ExW
CM_Get_Depth(a)12=SETUPAPI.CM_Get_Depth
CM_Get_Depth_Ex(a)16=SETUPAPI.CM_Get_Depth_Ex
CM_Get_DevNode_Registry_PropertyA(a)24=SETUPAPI.CM_Get_DevNode_Registry_Pr
opertyA
@@ -186,12 +186,12 @@
;CM_Reset_Children_Marks_Ex
;CM_Run_Detection
;CM_Run_Detection_Ex
-;CM_Set_DevNode_Problem
-;CM_Set_DevNode_Problem_Ex
-;CM_Set_DevNode_Registry_PropertyA
-;CM_Set_DevNode_Registry_PropertyW
-;CM_Set_DevNode_Registry_Property_ExA
-;CM_Set_DevNode_Registry_Property_ExW
+CM_Set_DevNode_Problem(a)12=SETUPAPI.CM_Set_DevNode_Problem
+CM_Set_DevNode_Problem_Ex(a)16=SETUPAPI.CM_Set_DevNode_Problem_Ex
+CM_Set_DevNode_Registry_PropertyA(a)20=SETUPAPI.CM_Set_DevNode_Registry_P
ropertyA
+CM_Set_DevNode_Registry_PropertyW(a)20=SETUPAPI.CM_Set_DevNode_Registry_P
ropertyW
+CM_Set_DevNode_Registry_Property_ExA(a)24=SETUPAPI.CM_Set_DevNode_Registr
y_Property_ExA
+CM_Set_DevNode_Registry_Property_ExW(a)24=SETUPAPI.CM_Set_DevNode_Registr
y_Property_ExW
;CM_Set_HW_Prof
;CM_Set_HW_Prof_Ex
;CM_Set_HW_Prof_FlagsA
_____
Modified: trunk/reactos/lib/setupapi/cfgmgr.c
--- trunk/reactos/lib/setupapi/cfgmgr.c 2005-09-11 13:55:23 UTC (rev
17800)
+++ trunk/reactos/lib/setupapi/cfgmgr.c 2005-09-11 14:38:57 UTC (rev
17801)
@@ -226,46 +226,16 @@
}
-static CONFIGRET GetCmCodeFromErrorCode(DWORD ErrorCode)
-{
- switch (ErrorCode)
- {
- case ERROR_SUCCESS:
- return CR_SUCCESS;
-
- case ERROR_ACCESS_DENIED:
- return CR_ACCESS_DENIED;
-
- case ERROR_INSUFFICIENT_BUFFER:
- return CR_BUFFER_SMALL;
-
- case ERROR_INVALID_DATA:
- return CR_INVALID_DATA;
-
- case ERROR_INVALID_PARAMETER:
- return CR_INVALID_DATA;
-
- case ERROR_NO_MORE_ITEMS:
- return CR_NO_SUCH_VALUE;
-
- case ERROR_NO_SYSTEM_RESOURCES:
- return CR_OUT_OF_MEMORY;
-
- default:
- return CR_FAILURE;
- }
-}
-
-
/***********************************************************************
* CM_Enumerate_Classes_Ex [SETUPAPI.@]
*/
CONFIGRET WINAPI CM_Enumerate_Classes_Ex(
ULONG ulClassIndex, LPGUID ClassGuid, ULONG ulFlags, HMACHINE
hMachine)
{
- HKEY hRelativeKey, hKey;
- DWORD rc;
- WCHAR Buffer[MAX_GUID_STRING_LEN];
+ WCHAR szBuffer[MAX_GUID_STRING_LEN];
+ RPC_BINDING_HANDLE BindingHandle = NULL;
+ CONFIGRET ret = CR_SUCCESS;
+ ULONG ulLength = MAX_GUID_STRING_LEN;
TRACE("%lx %p %lx %p\n", ulClassIndex, ClassGuid, ulFlags,
hMachine);
@@ -277,39 +247,34 @@
if (hMachine != NULL)
{
- FIXME("hMachine argument ignored\n");
- hRelativeKey = HKEY_LOCAL_MACHINE; /* FIXME: use here a field
in hMachine */
+ BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
+ if (BindingHandle == NULL)
+ return CR_FAILURE;
}
else
- hRelativeKey = HKEY_LOCAL_MACHINE;
+ {
+ if (!PnpGetLocalHandles(&BindingHandle, NULL))
+ return CR_FAILURE;
+ }
- rc = RegOpenKeyExW(
- hRelativeKey,
- ControlClass,
- 0, /* options */
- KEY_ENUMERATE_SUB_KEYS,
- &hKey);
- if (rc != ERROR_SUCCESS)
- return GetCmCodeFromErrorCode(rc);
-
- rc = RegEnumKeyW(
- hKey,
- ulClassIndex,
- Buffer,
- sizeof(Buffer) / sizeof(WCHAR));
-
- RegCloseKey(hKey);
-
- if (rc == ERROR_SUCCESS)
+ ret = PNP_EnumerateSubKeys(BindingHandle,
+ PNP_BRANCH_CLASS,
+ ulClassIndex,
+ szBuffer,
+ MAX_GUID_STRING_LEN,
+ &ulLength,
+ ulFlags);
+ if (ret == CR_SUCCESS)
{
/* Remove the {} */
- Buffer[MAX_GUID_STRING_LEN - 2] = UNICODE_NULL;
+ szBuffer[MAX_GUID_STRING_LEN - 2] = UNICODE_NULL;
+
/* Convert the buffer to a GUID */
- if (UuidFromStringW(&Buffer[1], ClassGuid) != RPC_S_OK)
+ if (UuidFromStringW(&szBuffer[1], ClassGuid) != RPC_S_OK)
return CR_FAILURE;
}
- return GetCmCodeFromErrorCode(rc);
+ return ret;
}
Show replies by date