Commit 66b2b3ea authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wbemprox: Implement Win32_PhysicalMemory.DeviceLocator.

parent 27a7952a
......@@ -204,6 +204,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[] =
......@@ -618,6 +620,7 @@ static const struct column col_physicalmedia[] =
static const struct column col_physicalmemory[] =
{
{ prop_capacityW, CIM_UINT64 },
{ prop_devicelocatorW, CIM_STRING },
{ prop_memorytypeW, CIM_UINT16, VT_I4 }
};
static const struct column col_pnpentity[] =
......@@ -1044,6 +1047,7 @@ struct record_physicalmedia
struct record_physicalmemory
{
UINT64 capacity;
const WCHAR *devicelocator;
UINT16 memorytype;
};
struct record_pnpentity
......@@ -2639,6 +2643,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;
......@@ -2647,6 +2652,7 @@ static enum fill_status fill_physicalmemory( struct table *table, const struct e
rec = (struct record_physicalmemory *)table->data;
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++;
......
......@@ -1489,6 +1489,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};
......@@ -1523,6 +1524,15 @@ static void test_Win32_PhysicalMemory( IWbemServices *services )
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 );
ok( hr == S_OK, "failed to get memory type %08x\n", hr );
ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment