wbemprox: Handle __ProviderArchitecture in GetStringValue().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
447d3e1127
commit
8bf540d67c
|
@ -384,22 +384,30 @@ done:
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT get_stringvalue( HKEY root, const WCHAR *subkey, const WCHAR *name, VARIANT *value, VARIANT *retval )
|
static HRESULT get_stringvalue( HKEY root, const WCHAR *subkey, const WCHAR *name, VARIANT *value,
|
||||||
|
IWbemContext *context, VARIANT *retval )
|
||||||
{
|
{
|
||||||
|
DWORD size, mask, flags = RRF_RT_REG_SZ;
|
||||||
HRESULT hr = S_OK;
|
HRESULT hr = S_OK;
|
||||||
BSTR str = NULL;
|
BSTR str = NULL;
|
||||||
DWORD size;
|
|
||||||
LONG res;
|
LONG res;
|
||||||
|
|
||||||
TRACE("%p, %s, %s\n", root, debugstr_w(subkey), debugstr_w(name));
|
TRACE("%p, %s, %s\n", root, debugstr_w(subkey), debugstr_w(name));
|
||||||
|
|
||||||
if ((res = RegGetValueW( root, subkey, name, RRF_RT_REG_SZ, NULL, NULL, &size ))) goto done;
|
mask = reg_get_access_mask( context );
|
||||||
|
|
||||||
|
if (mask & KEY_WOW64_64KEY)
|
||||||
|
flags |= RRF_SUBKEY_WOW6464KEY;
|
||||||
|
else if (mask & KEY_WOW64_32KEY)
|
||||||
|
flags |= RRF_SUBKEY_WOW6432KEY;
|
||||||
|
|
||||||
|
if ((res = RegGetValueW( root, subkey, name, flags, NULL, NULL, &size ))) goto done;
|
||||||
if (!(str = SysAllocStringLen( NULL, size / sizeof(WCHAR) - 1 )))
|
if (!(str = SysAllocStringLen( NULL, size / sizeof(WCHAR) - 1 )))
|
||||||
{
|
{
|
||||||
hr = E_OUTOFMEMORY;
|
hr = E_OUTOFMEMORY;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (!(res = RegGetValueW( root, subkey, name, RRF_RT_REG_SZ, NULL, str, &size )))
|
if (!(res = RegGetValueW( root, subkey, name, flags, NULL, str, &size )))
|
||||||
set_variant( VT_BSTR, 0, str, value );
|
set_variant( VT_BSTR, 0, str, value );
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
@ -442,7 +450,7 @@ HRESULT reg_get_stringvalue( IWbemClassObject *obj, IWbemContext *context, IWbem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VariantInit( &value );
|
VariantInit( &value );
|
||||||
hr = get_stringvalue( (HKEY)(INT_PTR)V_I4(&defkey), V_BSTR(&subkey), V_BSTR(&name), &value, &retval );
|
hr = get_stringvalue( (HKEY)(INT_PTR)V_I4(&defkey), V_BSTR(&subkey), V_BSTR(&name), &value, context, &retval );
|
||||||
if (hr != S_OK) goto done;
|
if (hr != S_OK) goto done;
|
||||||
if (out_params)
|
if (out_params)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue