diff --git a/reactos/base/services/umpnpmgr/umpnpmgr.c b/reactos/base/services/umpnpmgr/umpnpmgr.c index 92972cc2319..7488400a065 100644 --- a/reactos/base/services/umpnpmgr/umpnpmgr.c +++ b/reactos/base/services/umpnpmgr/umpnpmgr.c @@ -1809,7 +1809,9 @@ DWORD PNP_QueryResConfList( /* Function 55 */ DWORD PNP_SetHwProf( - handle_t hBinding) + handle_t hBinding, + DWORD ulHardwareProfile, + DWORD ulFlags) { UNIMPLEMENTED; return CR_CALL_NOT_IMPLEMENTED; diff --git a/reactos/dll/win32/setupapi/cfgmgr.c b/reactos/dll/win32/setupapi/cfgmgr.c index abd4bb11cec..ccff5e652cd 100644 --- a/reactos/dll/win32/setupapi/cfgmgr.c +++ b/reactos/dll/win32/setupapi/cfgmgr.c @@ -3774,6 +3774,60 @@ CONFIGRET WINAPI CM_Set_DevNode_Registry_Property_ExW( } +/*********************************************************************** + * CM_Set_HW_Prof [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Set_HW_Prof( + ULONG ulHardwareProfile, ULONG ulFlags) +{ + TRACE("%lu %lu\n", ulHardwareProfile, ulFlags); + return CM_Set_HW_Prof_Ex(ulHardwareProfile, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Set_HW_Prof_Ex [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Set_HW_Prof_Ex( + ULONG ulHardwareProfile, ULONG ulFlags, HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + CONFIGRET ret; + + TRACE("%lu %lu %lx\n", ulHardwareProfile, ulFlags, hMachine); + + if (!IsUserAdmin()) + return CR_ACCESS_DENIED; + + 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_SetHwProf(BindingHandle, ulHardwareProfile, ulFlags); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + ret = RpcStatusToCmStatus(RpcExceptionCode()); + } + RpcEndExcept; + + return ret; +} + + /*********************************************************************** * CM_Set_HW_Prof_FlagsA [SETUPAPI.@] */ diff --git a/reactos/dll/win32/setupapi/setupapi.spec b/reactos/dll/win32/setupapi/setupapi.spec index 67df3236614..43514139704 100644 --- a/reactos/dll/win32/setupapi/setupapi.spec +++ b/reactos/dll/win32/setupapi/setupapi.spec @@ -192,8 +192,8 @@ @ stdcall CM_Set_DevNode_Registry_PropertyW(long long ptr long long) @ stdcall CM_Set_DevNode_Registry_Property_ExA(long long ptr long long long) @ stdcall CM_Set_DevNode_Registry_Property_ExW(long long ptr long long long) -@ stub CM_Set_HW_Prof -@ stub CM_Set_HW_Prof_Ex +@ stdcall CM_Set_HW_Prof(long long) +@ stdcall CM_Set_HW_Prof_Ex(long long long) @ stdcall CM_Set_HW_Prof_FlagsA(str long long long) @ stdcall CM_Set_HW_Prof_FlagsW(wstr long long long) @ stdcall CM_Set_HW_Prof_Flags_ExA(str long long long long) diff --git a/reactos/include/ddk/cfgmgr32.h b/reactos/include/ddk/cfgmgr32.h index 54133469bc1..5ca47bd7448 100644 --- a/reactos/include/ddk/cfgmgr32.h +++ b/reactos/include/ddk/cfgmgr32.h @@ -2117,8 +2117,20 @@ CM_Set_DevNode_Registry_Property_ExW( #define CM_Set_DevNode_Registry_Property_Ex CM_Set_DevNode_Registry_Property_ExA #endif /* UNICODE */ -/* FIXME: Obsolete CM_Set_HW_Prof */ -/* FIXME: Obsolete CM_Set_HW_Prof_Ex */ +CMAPI +CONFIGRET +WINAPI +CM_Set_HW_Prof( + IN ULONG ulHardwareProfile, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Set_HW_Prof_Ex( + IN ULONG ulHardwareProfile, + IN ULONG ulFlags, + IN HMACHINE hMachine); /* CM_Set_HW_Prof_Flags[_Ex].ulFlags constants */ #define CM_SET_HW_PROF_FLAGS_UI_NOT_OK (0x00000001) diff --git a/reactos/include/reactos/idl/pnp.idl b/reactos/include/reactos/idl/pnp.idl index 5a8214ea223..44fd06a9654 100644 --- a/reactos/include/reactos/idl/pnp.idl +++ b/reactos/include/reactos/idl/pnp.idl @@ -724,7 +724,9 @@ interface pnp /* Function 55 */ DWORD PNP_SetHwProf( - [in] handle_t hBinding); + [in] handle_t hBinding, + [in] DWORD ulHardwareProfile, + [in] DWORD ulFlags); /* Function 56 */ DWORD PNP_QueryArbitratorFreeData( diff --git a/reactos/include/reactos/wine/cfgmgr32.h b/reactos/include/reactos/wine/cfgmgr32.h index fb7c1eb7292..7837f2a485b 100644 --- a/reactos/include/reactos/wine/cfgmgr32.h +++ b/reactos/include/reactos/wine/cfgmgr32.h @@ -301,6 +301,8 @@ CONFIGRET WINAPI CM_Get_First_Log_Conf( PLOG_CONF, DEVINST, ULONG ); CONFIGRET WINAPI CM_Get_First_Log_Conf_Ex( PLOG_CONF, DEVINST, ULONG, HMACHINE ); CONFIGRET WINAPI CM_Get_Global_State( PULONG, ULONG ); CONFIGRET WINAPI CM_Get_Global_State_Ex( PULONG, ULONG, HMACHINE ); +CONFIGRET WINAPI CM_Set_HW_Prof( ULONG, ULONG ); +CONFIGRET WINAPI CM_Set_HW_Prof_Ex( ULONG, ULONG, HMACHINE ); CONFIGRET WINAPI CM_Get_HW_Prof_FlagsA( DEVINSTID_A, ULONG, PULONG, ULONG ); CONFIGRET WINAPI CM_Get_HW_Prof_FlagsW( DEVINSTID_W, ULONG, PULONG, ULONG ); #define CM_Get_HW_Prof_Flags WINELIB_NAME_AW(CM_Get_HW_Prof_Flags)