From: Hans Leidekker hans@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54030 --- dlls/wbemprox/builtin.c | 69 +++++++++++++++++++++++++++++++++++++ dlls/wbemprox/tests/query.c | 40 +++++++++++++++++++++ 2 files changed, 109 insertions(+)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index faab5d51af6..a2c21a2a6de 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -482,6 +482,13 @@ static const struct column col_videocontroller[] = { L"VideoModeDescription", CIM_STRING|COL_FLAG_DYNAMIC }, { L"VideoProcessor", CIM_STRING|COL_FLAG_DYNAMIC }, }; + +static const struct column col_volume[] = +{ + { L"DeviceId", CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, + { L"DriveLetter", CIM_STRING|COL_FLAG_DYNAMIC }, +}; + static const struct column col_winsat[] = { { L"CPUScore", CIM_REAL32 }, @@ -923,6 +930,13 @@ struct record_videocontroller const WCHAR *videomodedescription; const WCHAR *videoprocessor; }; + +struct record_volume +{ + const WCHAR *deviceid; + const WCHAR *driveletter; +}; + struct record_winsat { FLOAT cpuscore; @@ -4180,6 +4194,60 @@ static enum fill_status fill_videocontroller( struct table *table, const struct return status; }
+static WCHAR *get_volume_driveletter( const WCHAR *volume ) +{ + DWORD len = 0; + WCHAR *ret; + + if (!GetVolumePathNamesForVolumeNameW( volume, NULL, 0, &len ) && GetLastError() != ERROR_MORE_DATA) return NULL; + if (!(ret = malloc( len * sizeof(WCHAR) ))) return NULL; + if (!GetVolumePathNamesForVolumeNameW( volume, ret, len, &len ) || !wcschr( ret, ':' )) + { + free( ret ); + return NULL; + } + wcschr( ret, ':' )[1] = 0; + return ret; +} + +static enum fill_status fill_volume( struct table *table, const struct expr *cond ) +{ + struct record_volume *rec; + enum fill_status status = FILL_STATUS_UNFILTERED; + UINT row = 0, offset = 0; + WCHAR path[MAX_PATH]; + HANDLE handle; + + if (!resize_table( table, 2, sizeof(*rec) )) return FILL_STATUS_FAILED; + + handle = FindFirstVolumeW( path, ARRAY_SIZE(path) ); + while (handle != INVALID_HANDLE_VALUE) + { + if (!resize_table( table, row + 1, sizeof(*rec) )) return FILL_STATUS_FAILED; + + rec = (struct record_volume *)(table->data + offset); + rec->deviceid = wcsdup( path ); + rec->driveletter = get_volume_driveletter( path ); + + if (!match_row( table, row, cond, &status )) free_row_values( table, row ); + else + { + offset += sizeof(*rec); + row++; + } + + if (!FindNextVolumeW( handle, path, ARRAY_SIZE(path) )) + { + FindVolumeClose( handle ); + handle = INVALID_HANDLE_VALUE; + } + } + + TRACE("created %u rows\n", row); + table->num_rows = row; + return status; +} + static WCHAR *get_sounddevice_pnpdeviceid( DXGI_ADAPTER_DESC *desc ) { static const WCHAR fmtW[] = L"HDAUDIO\FUNC_01&VEN_%04X&DEV_%04X&SUBSYS_%08X&REV_%04X\0&DEADBEEF&0&DEAD"; @@ -4262,6 +4330,7 @@ static struct table cimv2_builtin_classes[] = { L"Win32_SoundDevice", C(col_sounddevice), 0, 0, NULL, fill_sounddevice }, { L"Win32_SystemEnclosure", C(col_systemenclosure), 0, 0, NULL, fill_systemenclosure }, { L"Win32_VideoController", C(col_videocontroller), 0, 0, NULL, fill_videocontroller }, + { L"Win32_Volume", C(col_volume), 0, 0, NULL, fill_volume }, { L"Win32_WinSAT", C(col_winsat), D(data_winsat) }, };
diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index 4503ace0b68..f777c2a9c61 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -1752,6 +1752,45 @@ static void test_Win32_VideoController( IWbemServices *services ) SysFreeString( wql ); }
+static void test_Win32_Volume( IWbemServices *services ) +{ + BSTR wql = SysAllocString( L"wql" ), query = SysAllocString( L"SELECT * FROM Win32_Volume" ); + IEnumWbemClassObject *result; + IWbemClassObject *obj; + HRESULT hr; + VARIANT val; + CIMTYPE type; + DWORD count; + + hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); + if (hr != S_OK) + { + win_skip( "Win32_Volume not available\n" ); + return; + } + + for (;;) + { + hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); + if (hr != S_OK) break; + + check_property( obj, L"DeviceID", VT_BSTR, CIM_STRING ); + + type = 0xdeadbeef; + memset( &val, 0, sizeof(val) ); + hr = IWbemClassObject_Get( obj, L"DriveLetter", 0, &val, &type, NULL ); + ok( hr == S_OK, "got %#lx\n", hr ); + ok( V_VT( &val ) == VT_BSTR || V_VT( &val ) == VT_NULL, "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_STRING, "unexpected type %#lx\n", type ); + trace( "driveletter %s\n", wine_dbgstr_w(V_BSTR( &val )) ); + VariantClear( &val ); + } + + IEnumWbemClassObject_Release( result ); + SysFreeString( query ); + SysFreeString( wql ); +} + static void test_Win32_Printer( IWbemServices *services ) { BSTR wql = SysAllocString( L"wql" ), query = SysAllocString( L"SELECT * FROM Win32_Printer" ); @@ -2306,6 +2345,7 @@ START_TEST(query) test_Win32_SoundDevice( services ); test_Win32_SystemEnclosure( services ); test_Win32_VideoController( services ); + test_Win32_Volume( services ); test_Win32_WinSAT( services ); test_SystemRestore( services ); test_empty_namespace( locator );
From: Hans Leidekker hans@codeweavers.com
There's a small chance that a device is added immediately after counting. --- dlls/wbemprox/builtin.c | 45 +++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 24 deletions(-)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index a2c21a2a6de..8f9eaea60f1 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -3161,46 +3161,43 @@ static enum fill_status fill_pnpentity( struct table *table, const struct expr * enum fill_status status = FILL_STATUS_UNFILTERED; HDEVINFO device_info_set; SP_DEVINFO_DATA devinfo = {0}; - DWORD idx; + UINT row = 0, offset = 0; + DWORD idx = 0; + + if (!resize_table( table, 4, sizeof(*rec) )) return FILL_STATUS_FAILED;
device_info_set = SetupDiGetClassDevsW( NULL, NULL, NULL, DIGCF_ALLCLASSES|DIGCF_PRESENT ); + if (device_info_set == INVALID_HANDLE_VALUE) return FILL_STATUS_FAILED;
devinfo.cbSize = sizeof(devinfo); - - idx = 0; - while (SetupDiEnumDeviceInfo( device_info_set, idx++, &devinfo )) - { - /* noop */ - } - - resize_table( table, idx, sizeof(*rec) ); - table->num_rows = 0; - rec = (struct record_pnpentity *)table->data; - - idx = 0; while (SetupDiEnumDeviceInfo( device_info_set, idx++, &devinfo )) { WCHAR device_id[MAX_PATH]; - if (SetupDiGetDeviceInstanceIdW( device_info_set, &devinfo, device_id, - ARRAY_SIZE(device_id), NULL )) + if (SetupDiGetDeviceInstanceIdW( device_info_set, &devinfo, device_id, ARRAY_SIZE(device_id), NULL )) { - rec->device_id = wcsdup( device_id ); + if (!resize_table( table, row + 1, sizeof(*rec) )) + { + SetupDiDestroyDeviceInfoList( device_info_set ); + return FILL_STATUS_FAILED; + } + + rec = (struct record_pnpentity *)(table->data + offset); + rec->device_id = wcsdup( device_id ); rec->manufacturer = L"The Wine Project"; - rec->name = L"Wine PnP Device"; + rec->name = L"Wine PnP Device";
- table->num_rows++; - if (!match_row( table, table->num_rows - 1, cond, &status )) + if (!match_row( table, row, cond, &status )) free_row_values( table, row ); + else { - free_row_values( table, table->num_rows - 1 ); - table->num_rows--; + offset += sizeof(*rec); + row++; } - else - rec++; } } - SetupDiDestroyDeviceInfoList( device_info_set );
+ TRACE("created %u rows\n", row); + table->num_rows = row; return status; }
From: Hans Leidekker hans@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52878 --- dlls/wbemprox/builtin.c | 8 ++ dlls/wbemprox/reg.c | 124 ++++++++++++++++++++++++++++--- dlls/wbemprox/tests/query.c | 43 +++++++++++ dlls/wbemprox/wbemprox_private.h | 1 + 4 files changed, 166 insertions(+), 10 deletions(-)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 8f9eaea60f1..f54a49d3f10 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -422,6 +422,7 @@ static const struct column col_stdregprov[] = { L"CreateKey", CIM_FLAG_ARRAY|COL_FLAG_METHOD }, { L"EnumKey", CIM_FLAG_ARRAY|COL_FLAG_METHOD }, { L"EnumValues", CIM_FLAG_ARRAY|COL_FLAG_METHOD }, + { L"GetBinaryValue", CIM_FLAG_ARRAY|COL_FLAG_METHOD }, { L"GetStringValue", CIM_FLAG_ARRAY|COL_FLAG_METHOD }, { L"SetStringValue", CIM_FLAG_ARRAY|COL_FLAG_METHOD }, { L"SetDWORDValue", CIM_FLAG_ARRAY|COL_FLAG_METHOD }, @@ -871,6 +872,7 @@ struct record_stdregprov class_method *createkey; class_method *enumkey; class_method *enumvalues; + class_method *getbinaryvalue; class_method *getstringvalue; class_method *setstringvalue; class_method *setdwordvalue; @@ -980,6 +982,11 @@ static const struct record_param data_param[] = { L"StdRegProv", L"EnumValues", -1, L"ReturnValue", CIM_UINT32 }, { L"StdRegProv", L"EnumValues", -1, L"sNames", CIM_STRING|CIM_FLAG_ARRAY }, { L"StdRegProv", L"EnumValues", -1, L"Types", CIM_SINT32|CIM_FLAG_ARRAY }, + { L"StdRegProv", L"GetBinaryValue", 1, L"hDefKey", CIM_SINT32, 0x80000002 }, + { L"StdRegProv", L"GetBinaryValue", 1, L"sSubKeyName", CIM_STRING }, + { L"StdRegProv", L"GetBinaryValue", 1, L"sValueName", CIM_STRING }, + { L"StdRegProv", L"GetBinaryValue", -1, L"ReturnValue", CIM_UINT32 }, + { L"StdRegProv", L"GetBinaryValue", -1, L"uValue", CIM_UINT8|CIM_FLAG_ARRAY }, { L"StdRegProv", L"GetStringValue", 1, L"hDefKey", CIM_SINT32, 0x80000002 }, { L"StdRegProv", L"GetStringValue", 1, L"sSubKeyName", CIM_STRING }, { L"StdRegProv", L"GetStringValue", 1, L"sValueName", CIM_STRING }, @@ -1047,6 +1054,7 @@ static const struct record_stdregprov data_stdregprov[] = reg_create_key, reg_enum_key, reg_enum_values, + reg_get_binaryvalue, reg_get_stringvalue, reg_set_stringvalue, reg_set_dwordvalue, diff --git a/dlls/wbemprox/reg.c b/dlls/wbemprox/reg.c index 81ed914ae2f..4092cd90886 100644 --- a/dlls/wbemprox/reg.c +++ b/dlls/wbemprox/reg.c @@ -271,7 +271,7 @@ done: }
static HRESULT enum_values( HKEY root, const WCHAR *subkey, VARIANT *names, VARIANT *types, IWbemContext *context, - VARIANT *retval ) + VARIANT *retval ) { HKEY hkey = NULL; HRESULT hr = S_OK; @@ -386,7 +386,7 @@ done: }
static HRESULT get_stringvalue( HKEY root, const WCHAR *subkey, const WCHAR *name, VARIANT *value, - IWbemContext *context, VARIANT *retval ) + IWbemContext *context, VARIANT *retval ) { DWORD size, mask, flags = RRF_RT_REG_SZ; HRESULT hr = S_OK; @@ -403,13 +403,8 @@ static HRESULT get_stringvalue( HKEY root, const WCHAR *subkey, const WCHAR *nam flags |= RRF_SUBKEY_WOW6432KEY;
if ((res = RegGetValueW( root, subkey, name, flags, NULL, NULL, &size ))) goto done; - if (!(str = SysAllocStringLen( NULL, size / sizeof(WCHAR) - 1 ))) - { - hr = E_OUTOFMEMORY; - goto done; - } - if (!(res = RegGetValueW( root, subkey, name, flags, NULL, str, &size ))) - set_variant( VT_BSTR, 0, str, value ); + if (!(str = SysAllocStringLen( NULL, size / sizeof(WCHAR) - 1 ))) return E_OUTOFMEMORY; + if (!(res = RegGetValueW( root, subkey, name, flags, NULL, str, &size ))) set_variant( VT_BSTR, 0, str, value );
done: set_variant( VT_UI4, res, NULL, retval ); @@ -480,8 +475,117 @@ done: return hr; }
+static HRESULT to_ui1_array( BYTE *value, DWORD size, VARIANT *var ) +{ + SAFEARRAY *sa; + HRESULT hr; + LONG i; + + if (!(sa = SafeArrayCreateVector( VT_UI1, 0, size ))) return E_OUTOFMEMORY; + for (i = 0; i < size; i++) + { + if ((hr = SafeArrayPutElement( sa, &i, &value[i] )) != S_OK) + { + SafeArrayDestroy( sa ); + return hr; + } + } + set_variant( VT_UI1|VT_ARRAY, 0, sa, var ); + return S_OK; +} + +static HRESULT get_binaryvalue( HKEY root, const WCHAR *subkey, const WCHAR *name, VARIANT *value, + IWbemContext *context, VARIANT *retval ) +{ + DWORD size, mask, flags = RRF_RT_REG_BINARY; + HRESULT hr = S_OK; + BYTE *buf = NULL; + LONG res; + + TRACE("%p, %s, %s\n", root, debugstr_w(subkey), debugstr_w(name)); + + 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 (!(buf = malloc( size ))) return E_OUTOFMEMORY; + if (!(res = RegGetValueW( root, subkey, name, flags, NULL, buf, &size ))) hr = to_ui1_array( buf, size, value ); + +done: + set_variant( VT_UI4, res, NULL, retval ); + free( buf ); + return hr; +} + +HRESULT reg_get_binaryvalue( IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out ) +{ + VARIANT defkey, subkey, name, value, retval; + IWbemClassObject *sig, *out_params = NULL; + HRESULT hr; + + TRACE("%p, %p, %p, %p\n", obj, context, in, out); + + hr = IWbemClassObject_Get( in, L"hDefKey", 0, &defkey, NULL, NULL ); + if (hr != S_OK) return hr; + hr = IWbemClassObject_Get( in, L"sSubKeyName", 0, &subkey, NULL, NULL ); + if (hr != S_OK) return hr; + hr = IWbemClassObject_Get( in, L"sValueName", 0, &name, NULL, NULL ); + if (hr != S_OK) + { + VariantClear( &subkey ); + return hr; + } + + hr = create_signature( WBEMPROX_NAMESPACE_CIMV2, L"StdRegProv", L"GetBinaryValue", PARAM_OUT, &sig ); + if (hr != S_OK) + { + VariantClear( &name ); + VariantClear( &subkey ); + return hr; + } + if (out) + { + hr = IWbemClassObject_SpawnInstance( sig, 0, &out_params ); + if (hr != S_OK) + { + VariantClear( &name ); + VariantClear( &subkey ); + IWbemClassObject_Release( sig ); + return hr; + } + } + VariantInit( &value ); + hr = get_binaryvalue( (HKEY)(INT_PTR)V_I4(&defkey), V_BSTR(&subkey), V_BSTR(&name), &value, context, &retval ); + if (hr != S_OK) goto done; + if (out_params) + { + if (!V_UI4( &retval )) + { + hr = IWbemClassObject_Put( out_params, L"uValue", 0, &value, CIM_UINT8|CIM_FLAG_ARRAY ); + if (hr != S_OK) goto done; + } + hr = IWbemClassObject_Put( out_params, L"ReturnValue", 0, &retval, CIM_UINT32 ); + } + +done: + VariantClear( &name ); + VariantClear( &subkey ); + IWbemClassObject_Release( sig ); + if (hr == S_OK && out) + { + *out = out_params; + IWbemClassObject_AddRef( out_params ); + } + if (out_params) IWbemClassObject_Release( out_params ); + return hr; +} + static void set_stringvalue( HKEY root, const WCHAR *subkey, const WCHAR *name, const WCHAR *value, - IWbemContext *context, VARIANT *retval ) + IWbemContext *context, VARIANT *retval ) { HKEY hkey; LONG res; diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index f777c2a9c61..408660cf5f4 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -1042,6 +1042,49 @@ static void test_StdRegProv( IWbemServices *services ) IWbemClassObject_Release( out ); IWbemClassObject_Release( sig_in );
+ hr = IWbemClassObject_GetMethod( reg, L"GetBinaryValue", 0, &sig_in, NULL ); + ok( hr == S_OK, "failed to get GetStringValue method %#lx\n", hr ); + + hr = IWbemClassObject_SpawnInstance( sig_in, 0, &in ); + ok( hr == S_OK, "failed to spawn instance %#lx\n", hr ); + + V_VT( &defkey ) = VT_I4; + V_I4( &defkey ) = 0x80000002; + hr = IWbemClassObject_Put( in, L"hDefKey", 0, &defkey, 0 ); + ok( hr == S_OK, "failed to set root %#lx\n", hr ); + + V_VT( &subkey ) = VT_BSTR; + V_BSTR( &subkey ) = SysAllocString( L"Software\Microsoft\Windows NT\CurrentVersion" ); + hr = IWbemClassObject_Put( in, L"sSubKeyName", 0, &subkey, 0 ); + ok( hr == S_OK, "failed to set subkey %#lx\n", hr ); + + V_VT( &valuename ) = VT_BSTR; + V_BSTR( &valuename ) = SysAllocString( L"DigitalProductId" ); + hr = IWbemClassObject_Put( in, L"sValueName", 0, &valuename, 0 ); + ok( hr == S_OK, "failed to set value name %#lx\n", hr ); + + out = NULL; + method = SysAllocString( L"GetBinaryValue" ); + hr = IWbemServices_ExecMethod( services, class, method, 0, NULL, in, &out, NULL ); + ok( hr == S_OK, "failed to execute method %#lx\n", hr ); + SysFreeString( method ); + + type = 0xdeadbeef; + VariantInit( &retval ); + hr = IWbemClassObject_Get( out, L"ReturnValue", 0, &retval, &type, NULL ); + ok( hr == S_OK, "failed to get return value %#lx\n", hr ); + ok( V_VT( &retval ) == VT_I4, "unexpected variant type %#x\n", V_VT( &retval ) ); + ok( !V_I4( &retval ), "unexpected error %ld\n", V_I4( &retval ) ); + ok( type == CIM_UINT32, "unexpected type %#lx\n", type ); + + check_property( out, L"uValue", VT_UI1|VT_ARRAY, CIM_UINT8|CIM_FLAG_ARRAY ); + + VariantClear( &valuename ); + VariantClear( &subkey ); + IWbemClassObject_Release( in ); + IWbemClassObject_Release( out ); + IWbemClassObject_Release( sig_in ); + IWbemClassObject_Release( reg ); SysFreeString( class ); } diff --git a/dlls/wbemprox/wbemprox_private.h b/dlls/wbemprox/wbemprox_private.h index 893fd922e19..328840e9dfe 100644 --- a/dlls/wbemprox/wbemprox_private.h +++ b/dlls/wbemprox/wbemprox_private.h @@ -259,6 +259,7 @@ HRESULT process_create(IWbemClassObject *obj, IWbemContext *context, IWbemClassO HRESULT reg_create_key(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN; HRESULT reg_enum_key(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN; HRESULT reg_enum_values(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN; +HRESULT reg_get_binaryvalue(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN; HRESULT reg_get_stringvalue(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN; HRESULT reg_set_stringvalue(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN; HRESULT reg_set_dwordvalue(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
From: Hans Leidekker hans@codeweavers.com
--- dlls/wbemprox/reg.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/wbemprox/reg.c b/dlls/wbemprox/reg.c index 4092cd90886..cd7db81aed7 100644 --- a/dlls/wbemprox/reg.c +++ b/dlls/wbemprox/reg.c @@ -75,7 +75,7 @@ static HRESULT to_i4_array( DWORD *values, DWORD count, VARIANT *var ) return S_OK; }
-static unsigned int reg_get_access_mask( IWbemContext *context ) +static unsigned int get_access_mask( IWbemContext *context ) { VARIANT value;
@@ -106,7 +106,7 @@ static HRESULT create_key( HKEY root, const WCHAR *subkey, IWbemContext *context
TRACE("%p, %s\n", root, debugstr_w(subkey));
- res = RegCreateKeyExW( root, subkey, 0, NULL, 0, reg_get_access_mask( context ), NULL, &hkey, NULL ); + res = RegCreateKeyExW( root, subkey, 0, NULL, 0, get_access_mask( context ), NULL, &hkey, NULL ); set_variant( VT_UI4, res, NULL, retval ); if (!res) { @@ -172,7 +172,7 @@ static HRESULT enum_key( HKEY root, const WCHAR *subkey, VARIANT *names, IWbemCo TRACE("%p, %s\n", root, debugstr_w(subkey));
if (!(strings = malloc( count * sizeof(BSTR) ))) return E_OUTOFMEMORY; - if ((res = RegOpenKeyExW( root, subkey, 0, KEY_ENUMERATE_SUB_KEYS | reg_get_access_mask( context ), &hkey ))) + if ((res = RegOpenKeyExW( root, subkey, 0, KEY_ENUMERATE_SUB_KEYS | get_access_mask( context ), &hkey ))) { set_variant( VT_UI4, res, NULL, retval ); free( strings ); @@ -282,7 +282,7 @@ static HRESULT enum_values( HKEY root, const WCHAR *subkey, VARIANT *names, VARI
TRACE("%p, %s\n", root, debugstr_w(subkey));
- if ((res = RegOpenKeyExW( root, subkey, 0, KEY_QUERY_VALUE | reg_get_access_mask( context ), &hkey ))) goto done; + if ((res = RegOpenKeyExW( root, subkey, 0, KEY_QUERY_VALUE | get_access_mask( context ), &hkey ))) goto done; if ((res = RegQueryInfoKeyW( hkey, NULL, NULL, NULL, NULL, NULL, NULL, &count, &buflen, NULL, NULL, NULL ))) goto done;
@@ -395,7 +395,7 @@ static HRESULT get_stringvalue( HKEY root, const WCHAR *subkey, const WCHAR *nam
TRACE("%p, %s, %s\n", root, debugstr_w(subkey), debugstr_w(name));
- mask = reg_get_access_mask( context ); + mask = get_access_mask( context );
if (mask & KEY_WOW64_64KEY) flags |= RRF_SUBKEY_WOW6464KEY; @@ -504,7 +504,7 @@ static HRESULT get_binaryvalue( HKEY root, const WCHAR *subkey, const WCHAR *nam
TRACE("%p, %s, %s\n", root, debugstr_w(subkey), debugstr_w(name));
- mask = reg_get_access_mask( context ); + mask = get_access_mask( context );
if (mask & KEY_WOW64_64KEY) flags |= RRF_SUBKEY_WOW6464KEY; @@ -592,7 +592,7 @@ static void set_stringvalue( HKEY root, const WCHAR *subkey, const WCHAR *name,
TRACE("%p, %s, %s, %s\n", root, debugstr_w(subkey), debugstr_w(name), debugstr_w(value));
- if ((res = RegOpenKeyExW( root, subkey, 0, KEY_SET_VALUE | reg_get_access_mask( context ), &hkey ))) + if ((res = RegOpenKeyExW( root, subkey, 0, KEY_SET_VALUE | get_access_mask( context ), &hkey ))) { set_variant( VT_UI4, res, NULL, retval ); return; @@ -675,7 +675,7 @@ static void set_dwordvalue( HKEY root, const WCHAR *subkey, const WCHAR *name, D
TRACE( "%p, %s, %s, %#lx\n", root, debugstr_w(subkey), debugstr_w(name), value );
- if ((res = RegOpenKeyExW( root, subkey, 0, KEY_SET_VALUE | reg_get_access_mask( context ), &hkey ))) + if ((res = RegOpenKeyExW( root, subkey, 0, KEY_SET_VALUE | get_access_mask( context ), &hkey ))) { set_variant( VT_UI4, res, NULL, retval ); return; @@ -752,7 +752,7 @@ static void delete_key( HKEY root, const WCHAR *subkey, IWbemContext *context, V
TRACE("%p, %s\n", root, debugstr_w(subkey));
- res = RegDeleteKeyExW( root, subkey, reg_get_access_mask( context ), 0 ); + res = RegDeleteKeyExW( root, subkey, get_access_mask( context ), 0 ); set_variant( VT_UI4, res, NULL, retval ); }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=128736
Your paranoid android.
=== w864 (32 bit report) ===
wbemprox: query.c:1077: Test failed: unexpected error 1 query.c:234: Test failed: 1080: unexpected variant type 0x1 query.c:1077: Test failed: unexpected error 1 query.c:234: Test failed: 1080: unexpected variant type 0x1
=== w1064v1507 (32 bit report) ===
wbemprox: query.c:1077: Test failed: unexpected error 1 query.c:234: Test failed: 1080: unexpected variant type 0x1 query.c:1077: Test failed: unexpected error 1 query.c:234: Test failed: 1080: unexpected variant type 0x1
=== w1064v1809 (32 bit report) ===
wbemprox: query.c:1077: Test failed: unexpected error 1 query.c:234: Test failed: 1080: unexpected variant type 0x1 query.c:1077: Test failed: unexpected error 1 query.c:234: Test failed: 1080: unexpected variant type 0x1
=== w1064_tsign (32 bit report) ===
wbemprox: query.c:1077: Test failed: unexpected error 1 query.c:234: Test failed: 1080: unexpected variant type 0x1 query.c:1077: Test failed: unexpected error 1 query.c:234: Test failed: 1080: unexpected variant type 0x1
=== w10pro64 (32 bit report) ===
wbemprox: query.c:1077: Test failed: unexpected error 1 query.c:234: Test failed: 1080: unexpected variant type 0x1 query.c:1077: Test failed: unexpected error 1 query.c:234: Test failed: 1080: unexpected variant type 0x1
Wrt patch 2/4, according to my understanding of setupapi, the device list can't change once it's created.