wbemprox: Implement some properties of Win32_ComputerSystem and Win32_DiskPartition. (try 4)
Kim Jung Eon (김중언)
admin at mog422.net
Mon Apr 8 03:23:17 CDT 2013
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20130408/95638531/attachment-0001.html>
-------------- next part --------------
From b23684909fd5d58200dc6324438cec5c4cf22097 Mon Sep 17 00:00:00 2001
From: Kim Jung Eon <admin at mog422.net>
Date: Mon, 8 Apr 2013 17:21:29 +0900
Subject: wbemprox: Implement some properties of Win32_ComputerSystem and
Win32_DiskPartition.
---
dlls/wbemprox/builtin.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index f48eaff..8b3e3c3 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[] =
@@ -239,6 +241,7 @@ static const struct column col_compsys[] =
{ prop_domainroleW, CIM_UINT16 },
{ prop_manufacturerW, CIM_STRING },
{ prop_modelW, CIM_STRING },
+ { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC },
{ prop_numlogicalprocessorsW, CIM_UINT32, VT_I4 },
{ prop_numprocessorsW, CIM_UINT32, VT_I4 },
{ prop_totalphysicalmemoryW, CIM_UINT64 }
@@ -246,6 +249,7 @@ static const struct column col_compsys[] =
static const struct column col_diskdrive[] =
{
{ prop_deviceidW, CIM_STRING|COL_FLAG_KEY },
+ { prop_indexW, CIM_UINT32, VT_I4 },
{ prop_manufacturerW, CIM_STRING },
{ prop_modelW, CIM_STRING },
{ prop_serialnumberW, CIM_STRING }
@@ -253,6 +257,7 @@ static const struct column col_diskdrive[] =
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','\\',
@@ -456,6 +463,7 @@ struct record_computersystem
UINT16 domainrole;
const WCHAR *manufacturer;
const WCHAR *model;
+ const WCHAR *name;
UINT32 num_logical_processors;
UINT32 num_processors;
UINT64 total_physical_memory;
@@ -463,6 +471,7 @@ struct record_computersystem
struct record_diskdrive
{
const WCHAR *device_id;
+ UINT32 index;
const WCHAR *manufacturer;
const WCHAR *name;
const WCHAR *serialnumber;
@@ -470,6 +479,7 @@ struct record_diskdrive
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, 0, diskdrive_manufacturerW, diskdrive_modelW, diskdrive_serialW }
};
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;
@@ -738,6 +758,7 @@ static void fill_compsys( struct table *table )
rec->domainrole = 0; /* standalone workstation */
rec->manufacturer = compsys_manufacturerW;
rec->model = compsys_modelW;
+ rec->name = get_computername();
rec->num_logical_processors = get_logical_processor_count();
rec->num_processors = get_processor_count();
rec->total_physical_memory = get_total_physical_memory();
@@ -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