Author: ekohl Date: Sun Feb 20 10:44:30 2011 New Revision: 50829
URL: http://svn.reactos.org/svn/reactos?rev=50829&view=rev Log: [SETUPAPI] Implement CM_Get_Hardware_Profile_Info[_Ex]A/W.
Modified: trunk/reactos/dll/win32/setupapi/cfgmgr.c trunk/reactos/dll/win32/setupapi/setupapi.spec
Modified: trunk/reactos/dll/win32/setupapi/cfgmgr.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/cfgmgr.c... ============================================================================== --- trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] Sun Feb 20 10:44:30 2011 @@ -2627,6 +2627,114 @@ { ret = PNP_HwProfFlags(BindingHandle, PNP_GET_HWPROFFLAGS, szDevInstName, ulHardwareProfile, pulValue, NULL, NULL, 0, 0); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + ret = RpcStatusToCmStatus(RpcExceptionCode()); + } + RpcEndExcept; + + return ret; +} + + +/*********************************************************************** + * CM_Get_Hardware_Profile_InfoA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Hardware_Profile_InfoA( + ULONG ulIndex, PHWPROFILEINFO_A pHWProfileInfo, ULONG ulFlags) +{ + TRACE("%lu %p %lx\n", ulIndex, pHWProfileInfo, ulFlags); + + return CM_Get_Hardware_Profile_Info_ExA(ulIndex, pHWProfileInfo, + ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Get_Hardware_Profile_InfoW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Hardware_Profile_InfoW( + ULONG ulIndex, PHWPROFILEINFO_W pHWProfileInfo, ULONG ulFlags) +{ + TRACE("%lu %p %lx\n", ulIndex, pHWProfileInfo, ulFlags); + + return CM_Get_Hardware_Profile_Info_ExW(ulIndex, pHWProfileInfo, + ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Get_Hardware_Profile_Info_ExA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Hardware_Profile_Info_ExA( + ULONG ulIndex, PHWPROFILEINFO_A pHWProfileInfo, ULONG ulFlags, + HMACHINE hMachine) +{ + HWPROFILEINFO_W LocalProfileInfo; + CONFIGRET ret; + + TRACE("%lu %p %lx %lx\n", ulIndex, pHWProfileInfo, ulFlags, hMachine); + + if (pHWProfileInfo == NULL) + return CR_INVALID_POINTER; + + ret = CM_Get_Hardware_Profile_Info_ExW(ulIndex, &LocalProfileInfo, + ulFlags, hMachine); + if (ret == CR_SUCCESS) + { + pHWProfileInfo->HWPI_ulHWProfile = LocalProfileInfo.HWPI_ulHWProfile; + pHWProfileInfo->HWPI_dwFlags = LocalProfileInfo.HWPI_dwFlags; + + if (WideCharToMultiByte(CP_ACP, + 0, + LocalProfileInfo.HWPI_szFriendlyName, + lstrlenW(LocalProfileInfo.HWPI_szFriendlyName) + 1, + pHWProfileInfo->HWPI_szFriendlyName, + MAX_PROFILE_LEN, + NULL, + NULL) == 0) + ret = CR_FAILURE; + } + + return ret; +} + + +/*********************************************************************** + * CM_Get_Hardware_Profile_Info_ExW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Hardware_Profile_Info_ExW( + ULONG ulIndex, PHWPROFILEINFO_W pHWProfileInfo, ULONG ulFlags, + HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + CONFIGRET ret; + + TRACE("%lu %p %lx %lx\n", ulIndex, pHWProfileInfo, ulFlags, hMachine); + + if (pHWProfileInfo == NULL) + return CR_INVALID_POINTER; + + if (ulFlags != 0) + 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; + } + + RpcTryExcept + { + ret = PNP_GetHwProfInfo(BindingHandle, ulIndex, pHWProfileInfo, + sizeof(HWPROFILEINFO_W), 0); } RpcExcept(EXCEPTION_EXECUTE_HANDLER) {
Modified: trunk/reactos/dll/win32/setupapi/setupapi.spec URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/setupapi... ============================================================================== --- trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] Sun Feb 20 10:44:30 2011 @@ -110,10 +110,10 @@ @ stdcall CM_Get_HW_Prof_FlagsW(wstr long ptr long) @ stdcall CM_Get_HW_Prof_Flags_ExA(str long ptr long long) @ stdcall CM_Get_HW_Prof_Flags_ExW(wstr long ptr long long) -@ stub CM_Get_Hardware_Profile_InfoA -@ stub CM_Get_Hardware_Profile_InfoW -@ stub CM_Get_Hardware_Profile_Info_ExA -@ stub CM_Get_Hardware_Profile_Info_ExW +@ stdcall CM_Get_Hardware_Profile_InfoA(long ptr long) +@ stdcall CM_Get_Hardware_Profile_InfoW(long ptr long) +@ stdcall CM_Get_Hardware_Profile_Info_ExA(long ptr long long) +@ stdcall CM_Get_Hardware_Profile_Info_ExW(long ptr long long) @ stdcall CM_Get_Log_Conf_Priority(ptr ptr long) @ stdcall CM_Get_Log_Conf_Priority_Ex(ptr ptr long long) @ stdcall CM_Get_Next_Log_Conf(ptr ptr long)