diff options
author | sr55 <[email protected]> | 2010-12-03 20:58:51 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2010-12-03 20:58:51 +0000 |
commit | 5d6b22826353d5028799362292cd85e5da91cfaf (patch) | |
tree | 0378abb65a5d0cc38a159e1e6fbf7fe2a8ccfad5 /win/C#/HandBrake.ApplicationServices/Functions/Win32.cs | |
parent | d46ec09d3c22bdbe00d725794aee4d9d2ade3d8a (diff) |
WinGui:
- Fix Memory Detection on 64bit systems when the system has >4GB of ram.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3698 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/HandBrake.ApplicationServices/Functions/Win32.cs')
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Functions/Win32.cs | 62 |
1 files changed, 18 insertions, 44 deletions
diff --git a/win/C#/HandBrake.ApplicationServices/Functions/Win32.cs b/win/C#/HandBrake.ApplicationServices/Functions/Win32.cs index ce36a9c1f..8cb464b80 100644 --- a/win/C#/HandBrake.ApplicationServices/Functions/Win32.cs +++ b/win/C#/HandBrake.ApplicationServices/Functions/Win32.cs @@ -47,59 +47,33 @@ namespace HandBrake.ApplicationServices.Functions public static extern int ExitWindowsEx(int uFlags, int dwReason);
/// <summary>
- /// System Memory Status
+ /// Memory Status EX Struct
/// </summary>
- public struct MEMORYSTATUS // Unused var's are required here.
+ public struct MEMORYSTATUSEX
{
- /// <summary>
- /// Unknown
- /// </summary>
- public UInt32 dwLength;
-
- /// <summary>
- /// Memory Load
- /// </summary>
- public UInt32 dwMemoryLoad;
-
- /// <summary>
- /// Total Physical Memory
- /// </summary>
- public UInt32 dwTotalPhys; // Used
-
- /// <summary>
- /// Available Physical Memory
- /// </summary>
- public UInt32 dwAvailPhys;
-
- /// <summary>
- /// Total Page File
- /// </summary>
- public UInt32 dwTotalPageFile;
-
- /// <summary>
- /// Available Page File
- /// </summary>
- public UInt32 dwAvailPageFile;
-
- /// <summary>
- /// Total Virtual Memory
- /// </summary>
- public UInt32 dwTotalVirtual;
-
- /// <summary>
- /// Available Virtual Memory
- /// </summary>
- public UInt32 dwAvailVirtual;
+ public int dwLength;
+ public int dwMemoryLoad;
+ public ulong ullTotalPhys;
+ public ulong ullAvailPhys;
+ public ulong ullTotalPageFile;
+ public ulong ullAvailPageFile;
+ public ulong ullTotalVirtual;
+ public ulong ullAvailVirtual;
+ public ulong ullAvailExtendedVirtual;
}
/// <summary>
- /// Global Memory Status
+ /// Get the System Memory information
/// </summary>
/// <param name="lpBuffer">
/// The lp buffer.
/// </param>
- [DllImport("kernel32.dll")]
- public static extern void GlobalMemoryStatus(ref MEMORYSTATUS lpBuffer);
+ /// <returns>
+ /// A boolean.
+ /// </returns>
+ [DllImport("kernel32.dll", SetLastError = true)]
+ public static extern bool GlobalMemoryStatusEx(ref MEMORYSTATUSEX lpBuffer);
+
/// <summary>
/// Generate a Console Ctrl Event
|