From b48ce9212e0e2d44da32090e5a72388bcc2ef1af Mon Sep 17 00:00:00 2001 From: Louis Lenders Date: Mon, 8 Nov 2021 23:26:14 +0100 Subject: [PATCH] wbemprox: Add empty DNSDomain to Win32_NetworkAdapterConfiguration. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51938 Signed-off-by: Louis Lenders Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard (cherry picked from commit d68ea16266eae2108e084f34b4ad4d47a4a51782) Signed-off-by: Michael Stefaniuc --- dlls/wbemprox/builtin.c | 3 +++ dlls/wbemprox/tests/query.c | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 6bb26a9d17b..d5e935063ad 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -214,6 +214,7 @@ static const struct column col_networkadapterconfig[] = { L"DefaultIPGateway", CIM_STRING|CIM_FLAG_ARRAY|COL_FLAG_DYNAMIC }, { L"Description", CIM_STRING|COL_FLAG_DYNAMIC }, { L"DHCPEnabled", CIM_BOOLEAN }, + { L"DNSDomain", CIM_STRING }, { L"DNSHostName", CIM_STRING|COL_FLAG_DYNAMIC }, { L"DNSServerSearchOrder", CIM_STRING|CIM_FLAG_ARRAY|COL_FLAG_DYNAMIC }, { L"Index", CIM_UINT32|COL_FLAG_KEY }, @@ -623,6 +624,7 @@ struct record_networkadapterconfig const struct array *defaultipgateway; const WCHAR *description; int dhcpenabled; + const WCHAR *dnsdomain; const WCHAR *dnshostname; const struct array *dnsserversearchorder; UINT32 index; @@ -2942,6 +2944,7 @@ static enum fill_status fill_networkadapterconfig( struct table *table, const st rec->defaultipgateway = get_defaultipgateway( aa->FirstGatewayAddress ); rec->description = heap_strdupW( aa->Description ); rec->dhcpenabled = -1; + rec->dnsdomain = L""; rec->dnshostname = get_dnshostname( aa->FirstUnicastAddress ); rec->dnsserversearchorder = get_dnsserversearchorder( aa->FirstDnsServerAddress ); rec->index = aa->u.s.IfIndex; diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index b2e2d815e2a..8d2ccc34efd 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -1203,8 +1203,10 @@ static void test_Win32_NetworkAdapterConfiguration( IWbemServices *services ) BSTR wql = SysAllocString( L"wql" ), query = SysAllocString( L"SELECT * FROM Win32_NetworkAdapterConfiguration" ); IEnumWbemClassObject *result; IWbemClassObject *obj; + CIMTYPE type; HRESULT hr; DWORD count; + VARIANT val; hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); ok( hr == S_OK, "got %08x\n", hr ); @@ -1217,6 +1219,16 @@ static void test_Win32_NetworkAdapterConfiguration( IWbemServices *services ) check_property( obj, L"Description", VT_BSTR, CIM_STRING ); check_property( obj, L"Index", VT_I4, CIM_UINT32 ); check_property( obj, L"IPEnabled", VT_BOOL, CIM_BOOLEAN ); + + type = 0xdeadbeef; + VariantInit( &val ); + hr = IWbemClassObject_Get( obj, L"DNSDomain", 0, &val, &type, NULL ); + ok( hr == S_OK, "got %08x\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 0x%x\n", type ); + trace( "DNSDomain %s\n", wine_dbgstr_w(V_BSTR( &val )) ); + VariantClear( &val ); + IWbemClassObject_Release( obj ); }