Module: wine Branch: master Commit: 225f9eb38b92d95d4a6b9ec441740670eb0c40ed URL: https://source.winehq.org/git/wine.git/?a=commit;h=225f9eb38b92d95d4a6b9ec44...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Wed Mar 3 09:05:58 2021 +0300
wbemprox: Handle __ProviderArchitecture in SetDWORDValue().
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Hans Leidekker hans@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wbemprox/reg.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/dlls/wbemprox/reg.c b/dlls/wbemprox/reg.c index 63870bfc52c..edcdb1902f1 100644 --- a/dlls/wbemprox/reg.c +++ b/dlls/wbemprox/reg.c @@ -550,14 +550,23 @@ HRESULT reg_set_stringvalue( IWbemClassObject *obj, IWbemContext *context, IWbem return hr; }
-static void set_dwordvalue( HKEY root, const WCHAR *subkey, const WCHAR *name, DWORD value, VARIANT *retval ) +static void set_dwordvalue( HKEY root, const WCHAR *subkey, const WCHAR *name, DWORD value, IWbemContext *context, + VARIANT *retval ) { + HKEY hkey; LONG res;
TRACE("%p, %s, %s, %#x\n", root, debugstr_w(subkey), debugstr_w(name), value);
- res = RegSetKeyValueW( root, subkey, name, REG_DWORD, &value, sizeof(value) ); + if ((res = RegOpenKeyExW( root, subkey, 0, KEY_SET_VALUE | reg_get_access_mask( context ), &hkey ))) + { + set_variant( VT_UI4, res, NULL, retval ); + return; + } + + res = RegSetKeyValueW( hkey, NULL, name, REG_DWORD, &value, sizeof(value) ); set_variant( VT_UI4, res, NULL, retval ); + RegCloseKey( hkey ); }
HRESULT reg_set_dwordvalue( IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out ) @@ -595,7 +604,7 @@ HRESULT reg_set_dwordvalue( IWbemClassObject *obj, IWbemContext *context, IWbemC return hr; } } - set_dwordvalue( (HKEY)(INT_PTR)V_I4(&defkey), V_BSTR(&subkey), V_BSTR(&name), V_UI4(&value), &retval ); + set_dwordvalue( (HKEY)(INT_PTR)V_I4(&defkey), V_BSTR(&subkey), V_BSTR(&name), V_UI4(&value), context, &retval ); if (out_params) hr = IWbemClassObject_Put( out_params, L"ReturnValue", 0, &retval, CIM_UINT32 );