wbemprox: Implement Win32_QuickFixEngineering.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47755
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2019-09-30 17:12:58 +02:00 committed by Alexandre Julliard
parent 04631f9c6e
commit ca93830fc5
2 changed files with 67 additions and 0 deletions

View File

@ -111,6 +111,8 @@ static const WCHAR class_processor2W[] =
{'C','I','M','_','P','r','o','c','e','s','s','o','r',0};
static const WCHAR class_qualifiersW[] =
{'_','_','Q','U','A','L','I','F','I','E','R','S',0};
static const WCHAR class_quickfixengineeringW[] =
{'W','i','n','3','2','_','Q','u','i','c','k','F','i','x','E','n','g','i','n','e','e','r','i','n','g',0};
static const WCHAR class_sidW[] =
{'W','i','n','3','2','_','S','I','D',0};
static const WCHAR class_sounddeviceW[] =
@ -268,6 +270,8 @@ static const WCHAR prop_graphicsscoreW[] =
{'G','r','a','p','h','i','c','s','S','c','o','r','e',0};
static const WCHAR prop_horizontalresolutionW[] =
{'H','o','r','i','z','o','n','t','a','l','R','e','s','o','l','u','t','i','o','n',0};
static const WCHAR prop_hotfixidW[] =
{'H','o','t','F','i','x','I','D',0};
static const WCHAR prop_idW[] =
{'I','D',0};
static const WCHAR prop_identificationcodeW[] =
@ -754,6 +758,11 @@ static const struct column col_qualifier[] =
{ prop_strvalueW, CIM_STRING },
{ prop_boolvalueW, CIM_BOOLEAN }
};
static const struct column col_quickfixengineering[] =
{
{ prop_captionW, CIM_STRING },
{ prop_hotfixidW, CIM_STRING|COL_FLAG_KEY }
};
static const struct column col_service[] =
{
{ prop_acceptpauseW, CIM_BOOLEAN },
@ -920,6 +929,10 @@ static const WCHAR os_serialnumberW[] =
{'1','2','3','4','5','-','O','E','M','-','1','2','3','4','5','6','7','-','1','2','3','4','5',0};
static const WCHAR physicalmedia_tagW[] =
{'\\','\\','.','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','0',0};
static const WCHAR quickfixengineering_captionW[] =
{'h','t','t','p',':','/','/','w','i','n','e','h','q','.','o','r','g',0};
static const WCHAR quickfixengineering_hotfixidW[] =
{'K','B','1','2','3','4','5','6','7',0};
static const WCHAR sounddevice_productnameW[] =
{'W','i','n','e',' ','A','u','d','i','o',' ','D','e','v','i','c','e',0};
static const WCHAR systemenclosure_systemenclosureW[] =
@ -1224,6 +1237,11 @@ struct record_qualifier
const WCHAR *strvalue;
int boolvalue;
};
struct record_quickfixengineering
{
const WCHAR *caption;
const WCHAR *hotfixid;
};
struct record_service
{
int accept_pause;
@ -1364,6 +1382,10 @@ static const struct record_qualifier data_qualifier[] =
{ class_process_getowner_outW, param_userW, CIM_SINT32, FLAVOR_ID, prop_idW, 0 },
{ class_process_getowner_outW, param_domainW, CIM_SINT32, FLAVOR_ID, prop_idW, 1 }
};
static const struct record_quickfixengineering data_quickfixengineering[] =
{
{ quickfixengineering_captionW, quickfixengineering_hotfixidW },
};
static const struct record_sounddevice data_sounddevice[] =
{
{ sounddevice_productnameW, sounddevice_productnameW, 3 /* enabled */ }
@ -4443,6 +4465,7 @@ static struct table builtin_classes[] =
{ class_processorW, C(col_processor), 0, 0, NULL, fill_processor },
{ class_processor2W, C(col_processor), 0, 0, NULL, fill_processor },
{ class_qualifiersW, C(col_qualifier), D(data_qualifier) },
{ class_quickfixengineeringW, C(col_quickfixengineering), D(data_quickfixengineering) },
{ class_serviceW, C(col_service), 0, 0, NULL, fill_service },
{ class_sidW, C(col_sid), 0, 0, NULL, fill_sid },
{ class_sounddeviceW, C(col_sounddevice), D(data_sounddevice) },

View File

@ -1756,6 +1756,49 @@ static void test_Win32_DisplayControllerConfiguration( IWbemServices *services )
SysFreeString( wql );
}
static void test_Win32_QuickFixEngineering( IWbemServices *services )
{
static const WCHAR captionW[] =
{'C','a','p','t','i','o','n',0};
static const WCHAR hotfixidW[] =
{'H','o','t','F','i','x','I','D',0};
static const WCHAR queryW[] =
{'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_',
'Q','u','i','c','k','F','i','x','E','n','g','i','n','e','e','r','i','n','g',0};
BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW );
IEnumWbemClassObject *result;
IWbemClassObject *obj;
HRESULT hr;
DWORD count, total = 0;
VARIANT caption;
CIMTYPE type;
hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result );
ok( hr == S_OK, "got %08x\n", hr );
for (;;)
{
hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count );
if (hr != S_OK) break;
type = 0xdeadbeef;
VariantInit( &caption );
hr = IWbemClassObject_Get( obj, captionW, 0, &caption, &type, NULL );
ok( hr == S_OK, "failed to get caption %08x\n", hr );
ok( V_VT( &caption ) == VT_BSTR || V_VT( &caption ) == VT_NULL /* winxp */,
"unexpected variant type 0x%x\n", V_VT( &caption ) );
ok( type == CIM_STRING, "unexpected type 0x%x\n", type );
check_property( obj, hotfixidW, VT_BSTR, CIM_STRING );
IWbemClassObject_Release( obj );
if (total++ >= 10) break;
}
IEnumWbemClassObject_Release( result );
SysFreeString( query );
SysFreeString( wql );
}
START_TEST(query)
{
static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2',0};
@ -1804,6 +1847,7 @@ START_TEST(query)
test_Win32_Process( services, FALSE );
test_Win32_Process( services, TRUE );
test_Win32_Processor( services );
test_Win32_QuickFixEngineering( services );
test_Win32_Service( services );
test_Win32_SystemEnclosure( services );
test_Win32_VideoController( services );