wbemprox: Add a Win32_LogicalDisk class stub.

John Yani vanuan at gmail.com
Wed Jun 27 03:34:28 CDT 2012


Fixes http://bugs.winehq.org/show_bug.cgi?id=31031
-------------- next part --------------
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index eaffc80..83dab50 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -42,6 +42,8 @@ static const WCHAR class_biosW[] =
     {'W','i','n','3','2','_','B','I','O','S',0};
 static const WCHAR class_compsysW[] =
     {'W','i','n','3','2','_','C','o','m','p','u','t','e','r','S','y','s','t','e','m',0};
+static const WCHAR class_logicaldiskW[] =
+    {'W','i','n','3','2','_','L','o','g','i','c','a','l','D','i','s','k',0};
 static const WCHAR class_networkadapterW[] =
     {'W','i','n','3','2','_','N','e','t','w','o','r','k','A','d','a','p','t','e','r',0};
 static const WCHAR class_osW[] =
@@ -111,6 +113,10 @@ static const struct column col_compsys[] =
     { prop_numlogicalprocessorsW, CIM_UINT32 },
     { prop_numprocessorsW,        CIM_UINT32 }
 };
+static const struct column col_logicaldisk[] =
+{
+    { prop_deviceidW,            CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }
+};
 static const struct column col_networkadapter[] =
 {
     { prop_deviceidW,            CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY },
@@ -187,6 +193,10 @@ struct record_computersystem
     UINT32       num_logical_processors;
     UINT32       num_processors;
 };
+struct record_logicaldisk
+{
+    const WCHAR *device_id;
+};
 struct record_networkadapter
 {
     const WCHAR *device_id;
@@ -253,6 +263,25 @@ static void fill_compsys( struct table *table )
     table->num_rows = 1;
 }
 
+static void fill_logicaldisk( struct table *table )
+{
+    static const WCHAR fmtW[] = {'%','u',0};
+    WCHAR device_id[11];
+    struct record_logicaldisk *rec;
+    UINT num_rows = 1;
+    FIXME("returns a fake logical disks table\n");
+    if (!(table->data = heap_alloc( sizeof(*rec) * num_rows )))
+    {
+        return;
+    }
+    rec = (struct record_networkadapter *)(table->data);
+    sprintfW( device_id, fmtW, 0 );
+    rec->device_id            = heap_strdupW( device_id );
+
+    TRACE("created %u rows\n", num_rows);
+    table->num_rows = num_rows;
+}
+
 static UINT16 get_connection_status( IF_OPER_STATUS status )
 {
     switch (status)
@@ -444,6 +473,7 @@ static struct table classtable[] =
 {
     { class_biosW, SIZEOF(col_bios), col_bios, SIZEOF(data_bios), (BYTE *)data_bios, NULL },
     { class_compsysW, SIZEOF(col_compsys), col_compsys, 0, NULL, fill_compsys },
+    { class_logicaldiskW, SIZEOF(col_logicaldisk), col_logicaldisk, 0, NULL, fill_logicaldisk },
     { class_networkadapterW, SIZEOF(col_networkadapter), col_networkadapter, 0, NULL, fill_networkadapter },
     { class_osW, SIZEOF(col_os), col_os, 0, NULL, fill_os },
     { class_processW, SIZEOF(col_process), col_process, 0, NULL, fill_process },


More information about the wine-patches mailing list