wbemprox: Implement some properties of Win32_ComputerSystem and Win32_DiskPartition.
Kim Jung Eon (김중언)
admin at mog422.net
Sun Apr 7 11:56:46 CDT 2013
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20130408/6d6b051d/attachment-0001.html>
-------------- next part --------------
From 0531e86a28012e426fbe511cfaf104fcd08a2b20 Mon Sep 17 00:00:00 2001
From: mog422 <admin at mog422.net>
Date: Fri, 5 Apr 2013 08:28:43 +0900
Subject: wbemprox: Implement some properties of Win32_ComputerSystem and
Win32_DiskPartition.
---
dlls/wbemprox/builtin.c | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index f48eaff..75f2aff 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -85,6 +85,8 @@ static const WCHAR prop_adapterramW[] =
{'A','d','a','p','t','e','r','R','A','M',0};
static const WCHAR prop_bootableW[] =
{'B','o','o','t','a','b','l','e',0};
+static const WCHAR prop_bootpartitionW[] =
+ {'B','o','o','t','P','a','r','t','i','t','i','o','n',0};
static const WCHAR prop_captionW[] =
{'C','a','p','t','i','o','n',0};
static const WCHAR prop_classW[] =
@@ -241,18 +243,21 @@ static const struct column col_compsys[] =
{ prop_modelW, CIM_STRING },
{ prop_numlogicalprocessorsW, CIM_UINT32, VT_I4 },
{ prop_numprocessorsW, CIM_UINT32, VT_I4 },
- { prop_totalphysicalmemoryW, CIM_UINT64 }
+ { prop_totalphysicalmemoryW, CIM_UINT64 },
+ { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }
};
static const struct column col_diskdrive[] =
{
{ prop_deviceidW, CIM_STRING|COL_FLAG_KEY },
{ prop_manufacturerW, CIM_STRING },
{ prop_modelW, CIM_STRING },
- { prop_serialnumberW, CIM_STRING }
+ { prop_serialnumberW, CIM_STRING },
+ { prop_indexW, CIM_UINT32, VT_I4 }
};
static const struct column col_diskpartition[] =
{
{ prop_bootableW, CIM_BOOLEAN },
+ { prop_bootpartitionW, CIM_BOOLEAN },
{ prop_deviceidW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY },
{ prop_diskindexW, CIM_UINT32, VT_I4 },
{ prop_indexW, CIM_UINT32, VT_I4 },
@@ -409,6 +414,8 @@ static const WCHAR diskdrive_modelW[] =
{'W','i','n','e',' ','D','i','s','k',' ','D','r','i','v','e',0};
static const WCHAR diskdrive_manufacturerW[] =
{'(','S','t','a','n','d','a','r','d',' ','d','i','s','k',' ','d','r','i','v','e','s',')',0};
+static const WCHAR diskdrive_serialW[] =
+ {'W','I','N','E','H','D','I','S','K',0};
static const WCHAR networkadapter_pnpdeviceidW[]=
{'P','C','I','\\','V','E','N','_','8','0','8','6','&','D','E','V','_','1','0','0','E','&',
'S','U','B','S','Y','S','_','0','0','1','E','8','0','8','6','&','R','E','V','_','0','2','\\',
@@ -459,6 +466,7 @@ struct record_computersystem
UINT32 num_logical_processors;
UINT32 num_processors;
UINT64 total_physical_memory;
+ const WCHAR *name;
};
struct record_diskdrive
{
@@ -466,10 +474,12 @@ struct record_diskdrive
const WCHAR *manufacturer;
const WCHAR *name;
const WCHAR *serialnumber;
+ UINT32 index;
};
struct record_diskpartition
{
int bootable;
+ int bootpartition;
const WCHAR *device_id;
UINT32 diskindex;
UINT32 index;
@@ -600,7 +610,7 @@ static const struct record_bios data_bios[] =
};
static const struct record_diskdrive data_diskdrive[] =
{
- { diskdrive_deviceidW, diskdrive_manufacturerW, diskdrive_modelW }
+ { diskdrive_deviceidW, diskdrive_manufacturerW, diskdrive_modelW, diskdrive_serialW, 0 }
};
static const struct record_param data_param[] =
{
@@ -726,6 +736,16 @@ static UINT64 get_total_physical_memory(void)
return status.ullTotalPhys;
}
+static WCHAR *get_computername(void)
+{
+ WCHAR *ret;
+ DWORD size=MAX_COMPUTERNAME_LENGTH;
+
+ if (!(ret = heap_alloc( size * sizeof(WCHAR) ))) return NULL;
+ GetComputerNameW( ret, &size );
+ return ret;
+}
+
static void fill_compsys( struct table *table )
{
struct record_computersystem *rec;
@@ -741,6 +761,7 @@ static void fill_compsys( struct table *table )
rec->num_logical_processors = get_logical_processor_count();
rec->num_processors = get_processor_count();
rec->total_physical_memory = get_total_physical_memory();
+ rec->name = get_computername();
TRACE("created 1 row\n");
table->num_rows = 1;
@@ -807,6 +828,7 @@ static void fill_diskpartition( struct table *table )
}
rec = (struct record_diskpartition *)(table->data + offset);
rec->bootable = (i == 2) ? -1 : 0;
+ rec->bootpartition = (i == 2) ? -1 : 0;
sprintfW( device_id, fmtW, index );
rec->device_id = heap_strdupW( device_id );
rec->diskindex = index;
--
1.7.10.4
More information about the wine-patches
mailing list