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[] = ...@@ -204,6 +204,8 @@ static const WCHAR prop_destinationW[] =
{'D','e','s','t','i','n','a','t','i','o','n',0}; {'D','e','s','t','i','n','a','t','i','o','n',0};
static const WCHAR prop_deviceidW[] = static const WCHAR prop_deviceidW[] =
{'D','e','v','i','c','e','I','d',0}; {'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[] = static const WCHAR prop_dhcpenabledW[] =
{'D','H','C','P','E','n','a','b','l','e','d',0}; {'D','H','C','P','E','n','a','b','l','e','d',0};
static const WCHAR prop_directionW[] = static const WCHAR prop_directionW[] =
...@@ -617,8 +619,9 @@ static const struct column col_physicalmedia[] = ...@@ -617,8 +619,9 @@ static const struct column col_physicalmedia[] =
}; };
static const struct column col_physicalmemory[] = static const struct column col_physicalmemory[] =
{ {
{ prop_capacityW, CIM_UINT64 }, { prop_capacityW, CIM_UINT64 },
{ prop_memorytypeW, CIM_UINT16, VT_I4 } { prop_devicelocatorW, CIM_STRING },
{ prop_memorytypeW, CIM_UINT16, VT_I4 }
}; };
static const struct column col_pnpentity[] = static const struct column col_pnpentity[] =
{ {
...@@ -1043,8 +1046,9 @@ struct record_physicalmedia ...@@ -1043,8 +1046,9 @@ struct record_physicalmedia
}; };
struct record_physicalmemory struct record_physicalmemory
{ {
UINT64 capacity; UINT64 capacity;
UINT16 memorytype; const WCHAR *devicelocator;
UINT16 memorytype;
}; };
struct record_pnpentity struct record_pnpentity
{ {
...@@ -2639,6 +2643,7 @@ static enum fill_status fill_networkadapterconfig( struct table *table, const st ...@@ -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 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; struct record_physicalmemory *rec;
enum fill_status status = FILL_STATUS_UNFILTERED; enum fill_status status = FILL_STATUS_UNFILTERED;
UINT row = 0; UINT row = 0;
...@@ -2646,8 +2651,9 @@ static enum fill_status fill_physicalmemory( struct table *table, const struct e ...@@ -2646,8 +2651,9 @@ static enum fill_status fill_physicalmemory( struct table *table, const struct e
if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED; if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
rec = (struct record_physicalmemory *)table->data; rec = (struct record_physicalmemory *)table->data;
rec->capacity = get_total_physical_memory(); rec->capacity = get_total_physical_memory();
rec->memorytype = 9; /* RAM */ rec->devicelocator = heap_strdupW( dimm0W );
rec->memorytype = 9; /* RAM */
if (!match_row( table, row, cond, &status )) free_row_values( table, row ); if (!match_row( table, row, cond, &status )) free_row_values( table, row );
else row++; else row++;
......
...@@ -1489,6 +1489,7 @@ static void test_Win32_PhysicalMemory( IWbemServices *services ) ...@@ -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 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 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[] = static const WCHAR queryW[] =
{'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', {'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}; '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 ) ...@@ -1523,6 +1524,15 @@ static void test_Win32_PhysicalMemory( IWbemServices *services )
type = 0xdeadbeef; type = 0xdeadbeef;
VariantInit( &val ); 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 ); hr = IWbemClassObject_Get( obj, memorytypeW, 0, &val, &type, NULL );
ok( hr == S_OK, "failed to get memory type %08x\n", hr ); 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 ) ); 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