using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;
using System.Diagnostics;
using System.Threading;
using System.Runtime.InteropServices;
using System.Globalization;
namespace Handbrake.Functions
{
class SystemInfo
{
#region CheckRam
private struct MEMORYSTATUS
{
public UInt32 dwLength;
public UInt32 dwMemoryLoad;
public UInt32 dwTotalPhys; // Used
public UInt32 dwAvailPhys;
public UInt32 dwTotalPageFile;
public UInt32 dwAvailPageFile;
public UInt32 dwTotalVirtual;
public UInt32 dwAvailVirtual;
}
[DllImport("kernel32.dll")]
private static extern void GlobalMemoryStatus
(
ref MEMORYSTATUS lpBuffer
);
///
/// Returns the total physical ram in a system
///
///
public uint TotalPhysicalMemory()
{
MEMORYSTATUS memStatus = new MEMORYSTATUS();
GlobalMemoryStatus(ref memStatus);
uint MemoryInfo = memStatus.dwTotalPhys;
MemoryInfo = MemoryInfo / 1024 / 1024;
return MemoryInfo;
}
#endregion
}
}