Commit 1d0dd6d7 authored by Louis Lenders's avatar Louis Lenders Committed by Alexandre Julliard

wbemprox: Add FreeVirtualMemory property to Win32_Operatingsystem.

parent ba8e416e
......@@ -239,6 +239,7 @@ static const struct column col_operatingsystem[] =
{ L"CSName", CIM_STRING|COL_FLAG_DYNAMIC },
{ L"CurrentTimeZone", CIM_SINT16 },
{ L"FreePhysicalMemory", CIM_UINT64 },
{ L"FreeVirtualMemory", CIM_UINT64 },
{ L"InstallDate", CIM_DATETIME },
{ L"LastBootUpTime", CIM_DATETIME|COL_FLAG_DYNAMIC },
{ L"LocalDateTime", CIM_DATETIME|COL_FLAG_DYNAMIC },
......@@ -676,6 +677,7 @@ struct record_operatingsystem
const WCHAR *csname;
INT16 currenttimezone;
UINT64 freephysicalmemory;
UINT64 freevirtualmemory;
const WCHAR *installdate;
const WCHAR *lastbootuptime;
const WCHAR *localdatetime;
......@@ -1572,6 +1574,15 @@ static UINT64 get_available_physical_memory(void)
return status.ullAvailPhys;
}
static UINT64 get_available_virtual_memory(void)
{
MEMORYSTATUSEX status;
status.dwLength = sizeof(status);
if (!GlobalMemoryStatusEx( &status )) return 1024 * 1024 * 1024;
return status.ullAvailVirtual;
}
static WCHAR *get_computername(void)
{
WCHAR *ret;
......@@ -3683,6 +3694,7 @@ static enum fill_status fill_operatingsystem( struct table *table, const struct
rec->csname = get_computername();
rec->currenttimezone = get_currenttimezone();
rec->freephysicalmemory = get_available_physical_memory() / 1024;
rec->freevirtualmemory = get_available_virtual_memory() / 1024;
rec->installdate = L"20140101000000.000000+000";
rec->lastbootuptime = get_lastbootuptime();
rec->localdatetime = get_localdatetime();
......
......@@ -1404,6 +1404,7 @@ static void test_Win32_OperatingSystem( IWbemServices *services )
VariantClear( &val );
check_property( obj, L"FreePhysicalMemory", VT_BSTR, CIM_UINT64 );
check_property( obj, L"FreeVirtualMemory", VT_BSTR, CIM_UINT64 );
check_property( obj, L"Name", VT_BSTR, CIM_STRING );
type = 0xdeadbeef;
......
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