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