wbemprox: Implement Win32_PhysicalMemory.DeviceLocator.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46894
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 66b2b3ea68)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
oldstable
Hans Leidekker 2019-03-25 10:06:04 +01:00 committed by Michael Stefaniuc
parent 8dbcf21fcf
commit 7748bc4e34
2 changed files with 22 additions and 6 deletions

View File

@ -202,6 +202,8 @@ static const WCHAR prop_destinationW[] =
{'D','e','s','t','i','n','a','t','i','o','n',0};
static const WCHAR prop_deviceidW[] =
{'D','e','v','i','c','e','I','d',0};
static const WCHAR prop_devicelocatorW[] =
{'D','e','v','i','c','e','L','o','c','a','t','o','r',0};
static const WCHAR prop_dhcpenabledW[] =
{'D','H','C','P','E','n','a','b','l','e','d',0};
static const WCHAR prop_directionW[] =
@ -613,8 +615,9 @@ static const struct column col_physicalmedia[] =
};
static const struct column col_physicalmemory[] =
{
{ prop_capacityW, CIM_UINT64 },
{ prop_memorytypeW, CIM_UINT16, VT_I4 }
{ prop_capacityW, CIM_UINT64 },
{ prop_devicelocatorW, CIM_STRING },
{ prop_memorytypeW, CIM_UINT16, VT_I4 }
};
static const struct column col_pnpentity[] =
{
@ -1037,8 +1040,9 @@ struct record_physicalmedia
};
struct record_physicalmemory
{
UINT64 capacity;
UINT16 memorytype;
UINT64 capacity;
const WCHAR *devicelocator;
UINT16 memorytype;
};
struct record_pnpentity
{
@ -2608,6 +2612,7 @@ static enum fill_status fill_networkadapterconfig( struct table *table, const st
static enum fill_status fill_physicalmemory( struct table *table, const struct expr *cond )
{
static const WCHAR dimm0W[] = {'D','I','M','M',' ','0',0};
struct record_physicalmemory *rec;
enum fill_status status = FILL_STATUS_UNFILTERED;
UINT row = 0;
@ -2615,8 +2620,9 @@ static enum fill_status fill_physicalmemory( struct table *table, const struct e
if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
rec = (struct record_physicalmemory *)table->data;
rec->capacity = get_total_physical_memory();
rec->memorytype = 9; /* RAM */
rec->capacity = get_total_physical_memory();
rec->devicelocator = heap_strdupW( dimm0W );
rec->memorytype = 9; /* RAM */
if (!match_row( table, row, cond, &status )) free_row_values( table, row );
else row++;

View File

@ -1438,6 +1438,7 @@ static void test_Win32_PhysicalMemory( IWbemServices *services )
{
static const WCHAR capacityW[] = {'C','a','p','a','c','i','t','y',0};
static const WCHAR memorytypeW[] = {'M','e','m','o','r','y','T','y','p','e',0};
static const WCHAR devicelocatorW[] = {'D','e','v','i','c','e','L','o','c','a','t','o','r',0};
static const WCHAR queryW[] =
{'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_',
'P','h','y','s','i','c','a','l','M','e','m','o','r','y',0};
@ -1470,6 +1471,15 @@ static void test_Win32_PhysicalMemory( IWbemServices *services )
trace( "capacity %s\n", wine_dbgstr_w(V_BSTR( &val )) );
VariantClear( &val );
type = 0xdeadbeef;
VariantInit( &val );
hr = IWbemClassObject_Get( obj, devicelocatorW, 0, &val, &type, NULL );
ok( hr == S_OK, "failed to get devicelocator %08x\n", hr );
ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) );
ok( type == CIM_STRING, "unexpected type 0x%x\n", type );
trace( "devicelocator %s\n", wine_dbgstr_w(V_BSTR( &val )) );
VariantClear( &val );
type = 0xdeadbeef;
VariantInit( &val );
hr = IWbemClassObject_Get( obj, memorytypeW, 0, &val, &type, NULL );