mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 16:07:05 -06:00
9.06 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
829409452d
commit
c99f3ebdd6
@@ -2,6 +2,8 @@
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "../Common/Defs.h"
|
||||
|
||||
#include "System.h"
|
||||
|
||||
namespace NWindows {
|
||||
@@ -14,6 +16,8 @@ UInt32 GetNumberOfProcessors()
|
||||
return (UInt32)systemInfo.dwNumberOfProcessors;
|
||||
}
|
||||
|
||||
#ifndef UNDER_CE
|
||||
|
||||
#if !defined(_WIN64) && defined(__GNUC__)
|
||||
|
||||
typedef struct _MY_MEMORYSTATUSEX {
|
||||
@@ -37,26 +41,30 @@ typedef struct _MY_MEMORYSTATUSEX {
|
||||
|
||||
typedef BOOL (WINAPI *GlobalMemoryStatusExP)(MY_LPMEMORYSTATUSEX lpBuffer);
|
||||
|
||||
#endif
|
||||
|
||||
UInt64 GetRamSize()
|
||||
{
|
||||
#ifndef UNDER_CE
|
||||
MY_MEMORYSTATUSEX stat;
|
||||
stat.dwLength = sizeof(stat);
|
||||
#endif
|
||||
#ifdef _WIN64
|
||||
if (!::GlobalMemoryStatusEx(&stat))
|
||||
return 0;
|
||||
return stat.ullTotalPhys;
|
||||
return MyMin(stat.ullTotalVirtual, stat.ullTotalPhys);
|
||||
#else
|
||||
#ifndef UNDER_CE
|
||||
GlobalMemoryStatusExP globalMemoryStatusEx = (GlobalMemoryStatusExP)
|
||||
::GetProcAddress(::GetModuleHandle(TEXT("kernel32.dll")),
|
||||
"GlobalMemoryStatusEx");
|
||||
if (globalMemoryStatusEx != 0)
|
||||
if (globalMemoryStatusEx(&stat))
|
||||
return stat.ullTotalPhys;
|
||||
::GetProcAddress(::GetModuleHandle(TEXT("kernel32.dll")), "GlobalMemoryStatusEx");
|
||||
if (globalMemoryStatusEx != 0 && globalMemoryStatusEx(&stat))
|
||||
return MyMin(stat.ullTotalVirtual, stat.ullTotalPhys);
|
||||
#endif
|
||||
{
|
||||
MEMORYSTATUS stat;
|
||||
stat.dwLength = sizeof(stat);
|
||||
GlobalMemoryStatus(&stat);
|
||||
return stat.dwTotalPhys;
|
||||
::GlobalMemoryStatus(&stat);
|
||||
return MyMin(stat.dwTotalVirtual, stat.dwTotalPhys);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user