Hans Leidekker : wbemprox: Implement Win32_DesktopMonitor.Name.

Alexandre Julliard julliard at winehq.org
Tue Jun 2 08:11:17 CDT 2020


Module: wine
Branch: stable
Commit: 6fc30a3235d743f8fa506ee22e25fe212ebe9eb0
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6fc30a3235d743f8fa506ee22e25fe212ebe9eb0

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue Feb 25 11:39:52 2020 +0100

wbemprox: Implement Win32_DesktopMonitor.Name.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48646
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 9631a526cfae1bd24d0bc855a5f94e6d80d161af)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/wbemprox/builtin.c     |  3 +++
 dlls/wbemprox/tests/query.c | 27 +++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index 1f8afb46fe..fcabd06837 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -543,6 +543,7 @@ static const struct column col_datafile[] =
 };
 static const struct column col_desktopmonitor[] =
 {
+    { prop_nameW,                  CIM_STRING },
     { prop_pixelsperxlogicalinchW, CIM_UINT32 }
 };
 static const struct column col_directory[] =
@@ -1022,6 +1023,7 @@ struct record_datafile
 };
 struct record_desktopmonitor
 {
+    const WCHAR *name;
     UINT32       pixelsperxlogicalinch;
 };
 struct record_directory
@@ -2413,6 +2415,7 @@ static enum fill_status fill_desktopmonitor( struct table *table, const struct e
     if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
 
     rec = (struct record_desktopmonitor *)table->data;
+    rec->name                  = L"Generic Non-PnP Monitor";
     rec->pixelsperxlogicalinch = get_pixelsperxlogicalinch();
 
     if (match_row( table, row, cond, &status )) row++;
diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c
index 40eaefee4c..0212cdcb69 100644
--- a/dlls/wbemprox/tests/query.c
+++ b/dlls/wbemprox/tests/query.c
@@ -1710,6 +1710,32 @@ static void test_Win32_WinSAT( IWbemServices *services )
     SysFreeString( wql );
 }
 
+static void test_Win32_DesktopMonitor( IWbemServices *services )
+{
+    BSTR wql = SysAllocString( wqlW ), query = SysAllocString( L"SELECT * FROM Win32_DesktopMonitor" );
+    IEnumWbemClassObject *result;
+    IWbemClassObject *obj;
+    HRESULT hr;
+    DWORD count;
+
+    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;
+
+        check_property( obj, L"Name", VT_BSTR, CIM_STRING );
+        check_property( obj, L"PixelsPerXlogicalInch", VT_I4, CIM_UINT32 );
+        IWbemClassObject_Release( obj );
+    }
+
+    IEnumWbemClassObject_Release( result );
+    SysFreeString( query );
+    SysFreeString( wql );
+}
+
 static void test_Win32_DisplayControllerConfiguration( IWbemServices *services )
 {
     static const WCHAR bitsperpixelW[] =
@@ -1835,6 +1861,7 @@ START_TEST(query)
     test_Win32_ComputerSystem( services );
     test_Win32_ComputerSystemProduct( services );
     test_Win32_Bios( services );
+    test_Win32_DesktopMonitor( services );
     test_Win32_DisplayControllerConfiguration( services );
     test_Win32_IP4RouteTable( services );
     test_Win32_OperatingSystem( services );




More information about the wine-cvs mailing list