Hans Leidekker : wbemprox: Implement Win32_LogicalDisk.Caption.

Alexandre Julliard julliard at winehq.org
Tue Feb 9 15:57:07 CST 2021


Module: wine
Branch: master
Commit: 14905720edf61dd16e9a09ff0bf8612775ba8cf5
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=14905720edf61dd16e9a09ff0bf8612775ba8cf5

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue Feb  9 10:12:54 2021 +0100

wbemprox: Implement Win32_LogicalDisk.Caption.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50643
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

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

diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index b86326327fb..498e3f6fc79 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -177,6 +177,7 @@ static const struct column col_ip4routetable[] =
 };
 static const struct column col_logicaldisk[] =
 {
+    { L"Caption",            CIM_STRING|COL_FLAG_DYNAMIC },
     { L"DeviceId",           CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY },
     { L"DriveType",          CIM_UINT32 },
     { L"FileSystem",         CIM_STRING|COL_FLAG_DYNAMIC },
@@ -585,6 +586,7 @@ struct record_ip4routetable
 };
 struct record_logicaldisk
 {
+    const WCHAR *caption;
     const WCHAR *device_id;
     UINT32       drivetype;
     const WCHAR *filesystem;
@@ -2501,6 +2503,7 @@ static enum fill_status fill_logicaldisk( struct table *table, const struct expr
 
             rec = (struct record_logicaldisk *)(table->data + offset);
             swprintf( device_id, ARRAY_SIZE( device_id ), L"%c:", 'A' + i );
+            rec->caption            = heap_strdupW( device_id );
             rec->device_id          = heap_strdupW( device_id );
             rec->drivetype          = type;
             rec->filesystem         = get_filesystem( root );
diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c
index a0488f40e52..b5de00b5dec 100644
--- a/dlls/wbemprox/tests/query.c
+++ b/dlls/wbemprox/tests/query.c
@@ -1905,6 +1905,33 @@ static void test_SystemRestore( IWbemServices *services )
     SysFreeString( class );
 }
 
+static void test_Win32_LogicalDisk( IWbemServices *services )
+{
+    BSTR wql = SysAllocString( L"wql" );
+    BSTR query = SysAllocString( L"SELECT * FROM Win32_LogicalDisk" );
+    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"Caption", VT_BSTR, CIM_STRING );
+        check_property( obj, L"Name", VT_BSTR, CIM_STRING );
+        IWbemClassObject_Release( obj );
+    }
+
+    IEnumWbemClassObject_Release( result );
+    SysFreeString( query );
+    SysFreeString( wql );
+}
+
 START_TEST(query)
 {
     BSTR path = SysAllocString( L"ROOT\\CIMV2" );
@@ -1955,6 +1982,7 @@ START_TEST(query)
     test_Win32_DiskDrive( services );
     test_Win32_DisplayControllerConfiguration( services );
     test_Win32_IP4RouteTable( services );
+    test_Win32_LogicalDisk( services );
     test_Win32_NetworkAdapter( services );
     test_Win32_NetworkAdapterConfiguration( services );
     test_Win32_OperatingSystem( services );




More information about the wine-cvs mailing list