tuklib_physmem.c (292588) | tuklib_physmem.c (312518) |
---|---|
1/////////////////////////////////////////////////////////////////////////////// 2// 3/// \file tuklib_physmem.c 4/// \brief Get the amount of physical memory 5// 6// Author: Lasse Collin 7// 8// This file has been put into the public domain. --- 72 unchanged lines hidden (view full) --- 81#if defined(_WIN32) || defined(__CYGWIN__) 82 if ((GetVersion() & 0xFF) >= 5) { 83 // Windows 2000 and later have GlobalMemoryStatusEx() which 84 // supports reporting values greater than 4 GiB. To keep the 85 // code working also on older Windows versions, use 86 // GlobalMemoryStatusEx() conditionally. 87 HMODULE kernel32 = GetModuleHandle("kernel32.dll"); 88 if (kernel32 != NULL) { | 1/////////////////////////////////////////////////////////////////////////////// 2// 3/// \file tuklib_physmem.c 4/// \brief Get the amount of physical memory 5// 6// Author: Lasse Collin 7// 8// This file has been put into the public domain. --- 72 unchanged lines hidden (view full) --- 81#if defined(_WIN32) || defined(__CYGWIN__) 82 if ((GetVersion() & 0xFF) >= 5) { 83 // Windows 2000 and later have GlobalMemoryStatusEx() which 84 // supports reporting values greater than 4 GiB. To keep the 85 // code working also on older Windows versions, use 86 // GlobalMemoryStatusEx() conditionally. 87 HMODULE kernel32 = GetModuleHandle("kernel32.dll"); 88 if (kernel32 != NULL) { |
89 BOOL (WINAPI *gmse)(LPMEMORYSTATUSEX) = GetProcAddress( | 89 typedef BOOL (WINAPI *gmse_type)(LPMEMORYSTATUSEX); 90 gmse_type gmse = (gmse_type)GetProcAddress( |
90 kernel32, "GlobalMemoryStatusEx"); 91 if (gmse != NULL) { 92 MEMORYSTATUSEX meminfo; 93 meminfo.dwLength = sizeof(meminfo); 94 if (gmse(&meminfo)) 95 ret = meminfo.ullTotalPhys; 96 } 97 } --- 118 unchanged lines hidden --- | 91 kernel32, "GlobalMemoryStatusEx"); 92 if (gmse != NULL) { 93 MEMORYSTATUSEX meminfo; 94 meminfo.dwLength = sizeof(meminfo); 95 if (gmse(&meminfo)) 96 ret = meminfo.ullTotalPhys; 97 } 98 } --- 118 unchanged lines hidden --- |