Changeset 43547 in vbox for trunk/src/VBox
- Timestamp:
- Oct 5, 2012 10:26:16 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/win/PerformanceWin.cpp
r35368 r43547 301 301 int CollectorWin::getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available) 302 302 { 303 MEMORYSTATUSEX mstat;304 305 mstat.dwLength = sizeof(mstat);306 if (GlobalMemoryStatusEx(&mstat))307 {308 *total = (ULONG)( mstat.ullTotalPhys / 1024);309 *available = (ULONG)( mstat.ullAvailPhys / 1024 );310 *used = *total - *available;311 }312 else313 return RTErrConvertFromWin32(GetLastError());314 315 return VINF_SUCCESS;303 uint64_t cb; 304 int rc = RTSystemQueryTotalRam(&cb); 305 if (RT_SUCCESS(rc)) 306 { 307 *total = (ULONG)(cb / 1024); 308 rc = RTSystemQueryAvailableRam(&cb); 309 if (RT_SUCCESS(rc)) 310 { 311 *available = (ULONG)(cb / 1024); 312 *used = *total - *available; 313 } 314 } 315 return rc; 316 316 } 317 317
Note:
See TracChangeset
for help on using the changeset viewer.