diff --git a/reactos/base/services/umpnpmgr/umpnpmgr.c b/reactos/base/services/umpnpmgr/umpnpmgr.c index 53e10003b0e..7e626c4d0aa 100644 --- a/reactos/base/services/umpnpmgr/umpnpmgr.c +++ b/reactos/base/services/umpnpmgr/umpnpmgr.c @@ -1284,7 +1284,7 @@ PNP_FreeLogConf(handle_t BindingHandle, } -/* Function 42 */ +/* Function 44 */ CONFIGRET PNP_GetFirstLogConf(handle_t BindingHandle, wchar_t *DeviceInstance, @@ -1304,6 +1304,27 @@ PNP_GetFirstLogConf(handle_t BindingHandle, } +/* Function 45 */ +CONFIGRET +PNP_GetNextLogConf(handle_t BindingHandle, + wchar_t *DeviceInstance, + ULONG ulLogConfType, + ULONG ulCurrentTag, + ULONG *pulNextTag, + ULONG ulFlags) +{ + CONFIGRET ret = CR_SUCCESS; + + DPRINT1("PNP_GetNextLogConf() called\n"); + + *pulNextTag = 0; /* FIXME */ + + DPRINT1("PNP_GetNextLogConf() done (returns %lx)\n", ret); + + return ret; +} + + /* Function 58 */ CONFIGRET PNP_RunDetection(handle_t BindingHandle, diff --git a/reactos/dll/win32/cfgmgr32/cfgmgr32.def b/reactos/dll/win32/cfgmgr32/cfgmgr32.def index a1e20021a9d..325b0243d54 100644 --- a/reactos/dll/win32/cfgmgr32/cfgmgr32.def +++ b/reactos/dll/win32/cfgmgr32/cfgmgr32.def @@ -25,14 +25,12 @@ CMP_Report_LogOn = SETUPAPI.CMP_Report_LogOn ;CMP_UnregisterNotification ;CMP_WaitNoPendingInstallEvents ;CMP_WaitServices -;CM_Add_Empty_Log_Conf=SETUPAPI.CM_Add_Empty_Log_Conf -;CM_Add_Empty_Log_Conf_Ex=SETUPAPI.CM_Add_Empty_Log_Conf_Ex +CM_Add_Empty_Log_Conf=SETUPAPI.CM_Add_Empty_Log_Conf +CM_Add_Empty_Log_Conf_Ex=SETUPAPI.CM_Add_Empty_Log_Conf_Ex CM_Add_IDA=SETUPAPI.CM_Add_IDA CM_Add_IDW=SETUPAPI.CM_Add_IDW CM_Add_ID_ExA=SETUPAPI.CM_Add_ID_ExA CM_Add_ID_ExW=SETUPAPI.CM_Add_ID_ExW -CM_Add_Empty_Log_Conf=SETUPAPI.CM_Add_Empty_Log_Conf -CM_Add_Empty_Log_Conf_Ex=SETUPAPI.CM_Add_Empty_Log_Conf_Ex CM_Add_IDA=SETUPAPI.CM_Add_IDA CM_Add_IDW=SETUPAPI.CM_Add_IDW CM_Add_ID_ExA=SETUPAPI.CM_Add_ID_ExA @@ -133,8 +131,8 @@ CM_Get_HW_Prof_Flags_ExW=SETUPAPI.CM_Get_HW_Prof_Flags_ExW ;CM_Get_Hardware_Profile_Info_ExW ;CM_Get_Log_Conf_Priority ;CM_Get_Log_Conf_Priority_Ex -;CM_Get_Next_Log_Conf -;CM_Get_Next_Log_Conf_Ex +CM_Get_Next_Log_Conf=SETUPAPI.CM_Get_Next_Log_Conf +CM_Get_Next_Log_Conf_Ex=SETUPAPI.CM_Get_Next_Log_Conf_Ex ;CM_Get_Next_Res_Des ;CM_Get_Next_Res_Des_Ex CM_Get_Parent=SETUPAPI.CM_Get_Parent diff --git a/reactos/dll/win32/setupapi/cfgmgr.c b/reactos/dll/win32/setupapi/cfgmgr.c index 156b032c2e2..e7f94cab813 100644 --- a/reactos/dll/win32/setupapi/cfgmgr.c +++ b/reactos/dll/win32/setupapi/cfgmgr.c @@ -2162,6 +2162,91 @@ CONFIGRET WINAPI CM_Get_HW_Prof_Flags_ExW( } +/*********************************************************************** + * CM_Get_Next_Log_Conf [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Next_Log_Conf( + PLOG_CONF plcLogConf, LOG_CONF lcLogConf, ULONG ulFlags) +{ + TRACE("%p %p %lx\n", plcLogConf, lcLogConf, ulFlags); + return CM_Get_Next_Log_Conf_Ex(plcLogConf, lcLogConf, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Get_Next_Log_Conf_Ex [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Next_Log_Conf_Ex( + PLOG_CONF plcLogConf, LOG_CONF lcLogConf, ULONG ulFlags, + HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + HSTRING_TABLE StringTable = NULL; + PLOG_CONF_INFO pLogConfInfo; + PLOG_CONF_INFO pNewLogConfInfo; + ULONG ulNewTag; + LPWSTR lpDevInst; + CONFIGRET ret; + + FIXME("%p %p %lx %lx\n", plcLogConf, lcLogConf, ulFlags, hMachine); + + if (plcLogConf) + *plcLogConf = 0; + + pLogConfInfo = (PLOG_CONF_INFO)lcLogConf; + if (pLogConfInfo == NULL || pLogConfInfo->ulMagic != LOG_CONF_MAGIC) + return CR_INVALID_LOG_CONF; + + if (ulFlags != 0) + return CR_INVALID_FLAG; + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + + StringTable = ((PMACHINE_INFO)hMachine)->StringTable; + if (StringTable == 0) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, &StringTable)) + return CR_FAILURE; + } + + lpDevInst = StringTableStringFromId(StringTable, pLogConfInfo->dnDevInst); + if (lpDevInst == NULL) + return CR_INVALID_DEVNODE; + + ret = PNP_GetNextLogConf(BindingHandle, + lpDevInst, + pLogConfInfo->ulFlags, + pLogConfInfo->ulTag, + &ulNewTag, + 0); + if (ret != CR_SUCCESS) + return ret; + + if (plcLogConf) + { + pNewLogConfInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(LOG_CONF_INFO)); + if (pNewLogConfInfo == NULL) + return CR_OUT_OF_MEMORY; + + pNewLogConfInfo->ulMagic = LOG_CONF_MAGIC; + pNewLogConfInfo->dnDevInst = pLogConfInfo->dnDevInst; + pNewLogConfInfo->ulFlags = pLogConfInfo->ulFlags; + pNewLogConfInfo->ulTag = ulNewTag; + + *plcLogConf = (LOG_CONF)pNewLogConfInfo; + } + + return CR_SUCCESS; +} + + /*********************************************************************** * CM_Get_Parent [SETUPAPI.@] */ diff --git a/reactos/dll/win32/setupapi/setupapi.spec b/reactos/dll/win32/setupapi/setupapi.spec index a7beb94c5aa..01a1076753b 100644 --- a/reactos/dll/win32/setupapi/setupapi.spec +++ b/reactos/dll/win32/setupapi/setupapi.spec @@ -111,8 +111,8 @@ @ stub CM_Get_Hardware_Profile_Info_ExW @ stub CM_Get_Log_Conf_Priority @ stub CM_Get_Log_Conf_Priority_Ex -@ stub CM_Get_Next_Log_Conf -@ stub CM_Get_Next_Log_Conf_Ex +@ stdcall CM_Get_Next_Log_Conf(ptr ptr long) +@ stdcall CM_Get_Next_Log_Conf_Ex(ptr ptr long long) @ stub CM_Get_Next_Res_Des @ stub CM_Get_Next_Res_Des_Ex @ stdcall CM_Get_Parent(ptr long long) diff --git a/reactos/include/reactos/idl/pnp.idl b/reactos/include/reactos/idl/pnp.idl index d19c04992c1..eae1cc02c16 100644 --- a/reactos/include/reactos/idl/pnp.idl +++ b/reactos/include/reactos/idl/pnp.idl @@ -219,6 +219,14 @@ interface pnp [out] ULONG *pulLogConfTag, [in] ULONG ulFlags); + /* Function 45 */ + CONFIGRET PNP_GetNextLogConf(handle_t BindingHandle, + [in, string] wchar_t *DeviceInstance, + [in] ULONG ulLogConfType, + [in] ULONG ulCurrentTag, + [out] ULONG *pulNextTag, + [in] ULONG ulFlags); + /* Function 58 */ CONFIGRET PNP_RunDetection(handle_t BindingHandle, [in] unsigned long Flags); diff --git a/reactos/include/reactos/wine/cfgmgr32.h b/reactos/include/reactos/wine/cfgmgr32.h index eade8a52d57..67d4237b453 100644 --- a/reactos/include/reactos/wine/cfgmgr32.h +++ b/reactos/include/reactos/wine/cfgmgr32.h @@ -307,6 +307,8 @@ CONFIGRET WINAPI CM_Get_HW_Prof_FlagsW( DEVINSTID_W, ULONG, PULONG, ULONG ); CONFIGRET WINAPI CM_Get_HW_Prof_Flags_ExA( DEVINSTID_A, ULONG, PULONG, ULONG, HMACHINE ); CONFIGRET WINAPI CM_Get_HW_Prof_Flags_ExW( DEVINSTID_W, ULONG, PULONG, ULONG, HMACHINE ); #define CM_Get_HW_Prof_Flags_Ex WINELIB_NAME_AW(CM_Get_HW_Prof_Flags_Ex) +CONFIGRET WINAPI CM_Get_Next_Log_Conf( PLOG_CONF, LOG_CONF, ULONG ); +CONFIGRET WINAPI CM_Get_Next_Log_Conf_Ex( PLOG_CONF, LOG_CONF, ULONG, HMACHINE ); CONFIGRET WINAPI CM_Get_Parent( PDEVINST, DEVINST, ULONG ); CONFIGRET WINAPI CM_Get_Parent_Ex( PDEVINST, DEVINST, ULONG, HMACHINE ); CONFIGRET WINAPI CM_Get_Sibling( PDEVINST, DEVINST, ULONG );