Hans Leidekker : wbemprox: Implement Win32_LogicalDisk::VolumeName.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jan 5 15:01:27 CST 2015


Module: wine
Branch: master
Commit: be6575ef4c25bb0c5e6c88d1e10a01b08bb5cef8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=be6575ef4c25bb0c5e6c88d1e10a01b08bb5cef8

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Mon Jan  5 13:19:28 2015 +0100

wbemprox: Implement Win32_LogicalDisk::VolumeName.

---

 dlls/wbemprox/builtin.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index 6337fef..3158c0e 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -281,6 +281,8 @@ static const WCHAR prop_varianttypeW[] =
     {'V','a','r','i','a','n','t','T','y','p','e',0};
 static const WCHAR prop_versionW[] =
     {'V','e','r','s','i','o','n',0};
+static const WCHAR prop_volumenameW[] =
+    {'V','o','l','u','m','e','N','a','m','e',0};
 static const WCHAR prop_volumeserialnumberW[] =
     {'V','o','l','u','m','e','S','e','r','i','a','l','N','u','m','b','e','r',0};
 
@@ -364,6 +366,7 @@ static const struct column col_logicaldisk[] =
     { prop_freespaceW,          CIM_UINT64 },
     { prop_nameW,               CIM_STRING|COL_FLAG_DYNAMIC },
     { prop_sizeW,               CIM_UINT64 },
+    { prop_volumenameW,         CIM_STRING|COL_FLAG_DYNAMIC },
     { prop_volumeserialnumberW, CIM_STRING|COL_FLAG_DYNAMIC }
 };
 static const struct column col_networkadapter[] =
@@ -677,6 +680,7 @@ struct record_logicaldisk
     UINT64       freespace;
     const WCHAR *name;
     UINT64       size;
+    const WCHAR *volumename;
     const WCHAR *volumeserialnumber;
 };
 struct record_networkadapter
@@ -1650,6 +1654,12 @@ static enum fill_status fill_diskpartition( struct table *table, const struct ex
     return status;
 }
 
+static WCHAR *get_volumename( const WCHAR *root )
+{
+    WCHAR buf[MAX_PATH + 1] = {0};
+    GetVolumeInformationW( root, buf, sizeof(buf)/sizeof(buf[0]), NULL, NULL, NULL, NULL, 0 );
+    return heap_strdupW( buf );
+}
 static WCHAR *get_volumeserialnumber( const WCHAR *root )
 {
     static const WCHAR fmtW[] = {'%','0','8','X',0};
@@ -1692,6 +1702,7 @@ static enum fill_status fill_logicaldisk( struct table *table, const struct expr
             rec->freespace          = get_freespace( root, &size );
             rec->name               = heap_strdupW( device_id );
             rec->size               = size;
+            rec->volumename         = get_volumename( root );
             rec->volumeserialnumber = get_volumeserialnumber( root );
             if (!match_row( table, row, cond, &status ))
             {




More information about the wine-cvs mailing list