Author: ekohl
Date: Sat Jan 16 17:31:58 2010
New Revision: 45107
URL:
http://svn.reactos.org/svn/reactos?rev=45107&view=rev
Log:
Implement CM_Set_HW_Prof[_Ex].
Modified:
trunk/reactos/base/services/umpnpmgr/umpnpmgr.c
trunk/reactos/dll/win32/setupapi/cfgmgr.c
trunk/reactos/dll/win32/setupapi/setupapi.spec
trunk/reactos/include/ddk/cfgmgr32.h
trunk/reactos/include/reactos/idl/pnp.idl
trunk/reactos/include/reactos/wine/cfgmgr32.h
Modified: trunk/reactos/base/services/umpnpmgr/umpnpmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/umpnpmgr/ump…
==============================================================================
--- trunk/reactos/base/services/umpnpmgr/umpnpmgr.c [iso-8859-1] (original)
+++ trunk/reactos/base/services/umpnpmgr/umpnpmgr.c [iso-8859-1] Sat Jan 16 17:31:58 2010
@@ -1809,7 +1809,9 @@
/* Function 55 */
DWORD PNP_SetHwProf(
- handle_t hBinding)
+ handle_t hBinding,
+ DWORD ulHardwareProfile,
+ DWORD ulFlags)
{
UNIMPLEMENTED;
return CR_CALL_NOT_IMPLEMENTED;
Modified: trunk/reactos/dll/win32/setupapi/cfgmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/cfgmgr.…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] Sat Jan 16 17:31:58 2010
@@ -3775,6 +3775,60 @@
/***********************************************************************
+ * 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.@]
*/
CONFIGRET WINAPI CM_Set_HW_Prof_FlagsA(
Modified: trunk/reactos/dll/win32/setupapi/setupapi.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/setupap…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] Sat Jan 16 17:31:58 2010
@@ -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)
Modified: trunk/reactos/include/ddk/cfgmgr32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/cfgmgr32.h?rev…
==============================================================================
--- trunk/reactos/include/ddk/cfgmgr32.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/cfgmgr32.h [iso-8859-1] Sat Jan 16 17:31:58 2010
@@ -2117,8 +2117,20 @@
#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)
Modified: trunk/reactos/include/reactos/idl/pnp.idl
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/idl/pnp.id…
==============================================================================
--- trunk/reactos/include/reactos/idl/pnp.idl [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/idl/pnp.idl [iso-8859-1] Sat Jan 16 17:31:58 2010
@@ -724,7 +724,9 @@
/* Function 55 */
DWORD PNP_SetHwProf(
- [in] handle_t hBinding);
+ [in] handle_t hBinding,
+ [in] DWORD ulHardwareProfile,
+ [in] DWORD ulFlags);
/* Function 56 */
DWORD PNP_QueryArbitratorFreeData(
Modified: trunk/reactos/include/reactos/wine/cfgmgr32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/cfgmg…
==============================================================================
--- trunk/reactos/include/reactos/wine/cfgmgr32.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/wine/cfgmgr32.h [iso-8859-1] Sat Jan 16 17:31:58 2010
@@ -301,6 +301,8 @@
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)