Index: /trunk/MacFaceFloat/MacFaceApp.cs
===================================================================
--- /trunk/MacFaceFloat/MacFaceApp.cs	(revision 80)
+++ /trunk/MacFaceFloat/MacFaceApp.cs	(revision 81)
@@ -54,49 +54,55 @@
 		public void SetupStatisticsForWindows2000()
 		{
-			cpuStats = new CPUStatistics(81);
-			memStats = new MemoryStatistics(81);
-
-			try 
-			{
-				// µÉJE^ðÀsµÄÝé
-				cpuStats.Update();
-				memStats.Update();
-			} 
-			catch (System.ComponentModel.Win32Exception) 
-			{
-				// _¾Á½ÌÅptH[}XJE^ðgíÈ¢û@Ö
-				cpuStats = new CPUStatisticsNtQuerySystemInformation(61);
-				memStats = new MemoryStatisticsGlobalMemoryStatusEx(61);
-			}
-			catch (System.InvalidOperationException) 
-			{
-				// _¾Á½ÌÅptH[}XJE^ðgíÈ¢û@Ö
-				cpuStats = new CPUStatisticsNtQuerySystemInformation(61);
-				memStats = new MemoryStatisticsGlobalMemoryStatusEx(61);
-			}
+//			cpuStats = new CPUStatistics(81);
+//			memStats = new MemoryStatistics(81);
+//
+//			try 
+//			{
+//				// µÉJE^ðÀsµÄÝé
+//				cpuStats.Update();
+//				memStats.Update();
+//			} 
+//			catch (System.ComponentModel.Win32Exception) 
+//			{
+//				// _¾Á½ÌÅptH[}XJE^ðgíÈ¢û@Ö
+//				cpuStats = new CPUStatisticsNtQuerySystemInformation(61);
+//				memStats = new MemoryStatisticsGlobalMemoryStatusEx(61);
+//			}
+//			catch (System.InvalidOperationException) 
+//			{
+//				// _¾Á½ÌÅptH[}XJE^ðgíÈ¢û@Ö
+//				cpuStats = new CPUStatisticsNtQuerySystemInformation(61);
+//				memStats = new MemoryStatisticsGlobalMemoryStatusEx(61);
+//			}
+
+			cpuStats = new CPUStatisticsNtQuerySystemInformation(61);
+			memStats = new MemoryStatisticsNtQuerySystemInformation(61);
 		}
 
 		public void SetupStatisticsForWindowsXP()
 		{
-			cpuStats = new CPUStatistics(81);
-			memStats = new MemoryStatistics(81);
-			try 
-			{
-				// µÉJE^ðÀsµÄÝé
-				cpuStats.Update();
-				memStats.Update();
-			} 
-			catch (System.ComponentModel.Win32Exception) 
-			{
-				// _¾Á½ÌÅptH[}XJE^ðgíÈ¢û@Ö
-				cpuStats = new CPUStatisticsGetSystemTime(61);
-				memStats = new MemoryStatisticsPSAPI(61);
-			}
-			catch (System.InvalidOperationException) 
-			{
-				// _¾Á½ÌÅptH[}XJE^ðgíÈ¢û@Ö
-				cpuStats = new CPUStatisticsGetSystemTime(61);
-				memStats = new MemoryStatisticsPSAPI(61);
-			}
+//			cpuStats = new CPUStatistics(81);
+//			memStats = new MemoryStatistics(81);
+//			try 
+//			{
+//				// µÉJE^ðÀsµÄÝé
+//				cpuStats.Update();
+//				memStats.Update();
+//			} 
+//			catch (System.ComponentModel.Win32Exception) 
+//			{
+//				// _¾Á½ÌÅptH[}XJE^ðgíÈ¢û@Ö
+//				cpuStats = new CPUStatisticsGetSystemTime(61);
+//				memStats = new MemoryStatisticsNtQuerySystemInformation(61);
+//			}
+//			catch (System.InvalidOperationException) 
+//			{
+//				// _¾Á½ÌÅptH[}XJE^ðgíÈ¢û@Ö
+//				cpuStats = new CPUStatisticsGetSystemTime(61);
+//				memStats = new MemoryStatisticsPSAPI(61);
+//			}
+
+			cpuStats = new CPUStatisticsGetSystemTime(61);
+			memStats = new MemoryStatisticsNtQuerySystemInformation(61);
 		}
 
@@ -483,9 +489,11 @@
 						using (StreamWriter sw = new StreamWriter(stream))
 						{
+							Assembly asm = Assembly.GetExecutingAssembly();
+
 							sw.WriteLine("­¶: {0}", DateTime.Now);
 							sw.WriteLine();
 							sw.WriteLine("MacFace for Windows:");
 							sw.WriteLine("========================");
-							sw.WriteLine("o[W: {0}", Application.ProductVersion);
+							sw.WriteLine("o[W: {0}", ((ApplicationVersionStringAttribute)(asm.GetCustomAttributes(typeof(ApplicationVersionStringAttribute), true))[0]).Version);
 							sw.WriteLine("AZu: {0}", Assembly.GetExecutingAssembly().FullName);
 							sw.WriteLine();
Index: /trunk/MacFaceLibrary/MacFaceLibrary.csproj
===================================================================
--- /trunk/MacFaceLibrary/MacFaceLibrary.csproj	(revision 80)
+++ /trunk/MacFaceLibrary/MacFaceLibrary.csproj	(revision 81)
@@ -140,4 +140,9 @@
                 />
                 <File
+                    RelPath = "MemoryStatisticsNtQuerySystemInformation.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "MemoryStatisticsPSAPI.cs"
                     SubType = "Code"
Index: /trunk/MacFaceLibrary/MemoryStatisticsNtQuerySystemInformation.cs
===================================================================
--- /trunk/MacFaceLibrary/MemoryStatisticsNtQuerySystemInformation.cs	(revision 81)
+++ /trunk/MacFaceLibrary/MemoryStatisticsNtQuerySystemInformation.cs	(revision 81)
@@ -0,0 +1,168 @@
+using System;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+namespace MacFace
+{
+	/// <summary>
+	/// MemoryStatisticsNtQuerySystemInformation ÌTvÌà¾Å·B
+	/// </summary>
+	public class MemoryStatisticsNtQuerySystemInformation : MemoryStatistics
+	{
+		
+		public MemoryStatisticsNtQuerySystemInformation(int historySize) : base(historySize)
+		{
+			NextValue();
+		}
+
+		public override ulong CommitLimit 
+		{
+			get
+			{
+				return _commitLimit;
+			}
+		}
+
+		private ulong _commitLimit = 0;
+		private DateTime _prevCollectTime;
+		private UInt32 _prevPagesRead;
+		private UInt32 _prevPagesWritten;
+
+		protected override MemoryUsage NextValue()
+		{
+			Unmanaged.SYSTEM_PERFORMANCE_INFORMATION sysPerfInfo = new MacFace.MemoryStatisticsNtQuerySystemInformation.Unmanaged.SYSTEM_PERFORMANCE_INFORMATION();
+			Int32 sysInfoLen = Marshal.SizeOf(typeof(Unmanaged.SYSTEM_PERFORMANCE_INFORMATION));
+			UInt32 retLen;
+
+			Unmanaged.NtQuerySystemInformation(Unmanaged.SYSTEM_INFORMATION_CLASS.SystemPerformanceInformation,
+				out sysPerfInfo,
+				(UInt32)sysInfoLen,
+				out retLen);
+
+			Int32 pageSize = 4096;
+			
+			_commitLimit = (UInt32)(sysPerfInfo.TotalCommitLimit * pageSize);
+			
+			Int32 pageIn = (Int32)((sysPerfInfo.PagesRead - _prevPagesRead)/ ((TimeSpan)(DateTime.Now - _prevCollectTime)).TotalSeconds);
+			Int32 pageOut = (Int32)((sysPerfInfo.PagefilePagesWritten - _prevPagesWritten)/ ((TimeSpan)(DateTime.Now - _prevCollectTime)).TotalSeconds);
+			_prevCollectTime = DateTime.Now;
+			_prevPagesRead = sysPerfInfo.PagesRead;
+			_prevPagesWritten = sysPerfInfo.PagefilePagesWritten;
+
+			return new MemoryUsage(
+				(Int32)sysPerfInfo.AvailablePages * pageSize,
+				(Int32)sysPerfInfo.TotalCommittedPages * pageSize,
+				pageIn,
+				pageOut,
+				(Int32)sysPerfInfo.MmSystemCachePage * pageSize,
+				(Int32)sysPerfInfo.PagedPoolUsage * pageSize,
+				(Int32)sysPerfInfo.NonPagedPoolUsage * pageSize,
+				(Int32)sysPerfInfo.SystemDriverPage * pageSize,
+				(Int32)sysPerfInfo.SystemCodePage * pageSize);
+		}
+
+		private class Unmanaged
+		{
+			public enum SYSTEM_INFORMATION_CLASS
+			{
+				SystemBasicInformation = 0,
+				SystemPerformanceInformation = 2,
+				SystemTimeOfDayInformation = 3,
+				SystemProcessInformation = 5,
+				SystemProcessorPerformanceInformation = 8,
+				SystemInterruptInformation = 23,
+				SystemExceptionInformation = 33,
+				SystemRegistryQuotaInformation = 37,
+				SystemLookasideInformation = 45
+			}
+
+			[StructLayout(LayoutKind.Sequential)]
+			public struct SYSTEM_PERFORMANCE_INFORMATION 
+			{
+				public Int64  IdleTime;
+				public Int64  ReadTransferCount;
+				public Int64  WriteTransferCount;
+				public Int64  OtherTransferCount;
+				public UInt32 ReadOperationCount;
+				public UInt32 WriteOperationCount;
+				public UInt32 OtherOperationCount;
+				public UInt32 AvailablePages;
+				public UInt32 TotalCommittedPages;
+				public UInt32 TotalCommitLimit;
+				public UInt32 PeakCommitment;
+				public UInt32 PageFaults;
+				public UInt32 WriteCopyFaults;
+				public UInt32 TransitionFaults;
+				public UInt32 CacheTransitionFaults;
+				public UInt32 DemandZeroFaults;
+				public UInt32 PagesRead;
+				public UInt32 PageReadIos;
+				public UInt32 CacheReads;
+				public UInt32 CacheIos;
+				public UInt32 PagefilePagesWritten;
+				public UInt32 PagefilePageWriteIos;
+				public UInt32 MappedFilePagesWritten;
+				public UInt32 MappedFilePageWriteIos;
+				public UInt32 PagedPoolUsage;
+				public UInt32 NonPagedPoolUsage;
+				public UInt32 PagedPoolAllocs;
+				public UInt32 PagedPoolFrees;
+				public UInt32 NonPagedPoolAllocs;
+				public UInt32 NonPagedPoolFrees;
+				public UInt32 TotalFreeSystemPtes;
+				public UInt32 SystemCodePage;
+				public UInt32 TotalSystemDriverPages;
+				public UInt32 TotalSystemCodePages;
+				public UInt32 SmallNonPagedLookasideListAllocateHits;
+				public UInt32 SmallPagedLookasideListAllocateHits;
+				public UInt32 Reserved3;
+				public UInt32 MmSystemCachePage;
+				public UInt32 PagedPoolPage;
+				public UInt32 SystemDriverPage;
+				public UInt32 FastReadNoWait;
+				public UInt32 FastReadWait;
+				public UInt32 FastReadResourceMiss;
+				public UInt32 FastReadNotPossible;
+				public UInt32 FastMdlReadNoWait;
+				public UInt32 FastMdlReadWait;
+				public UInt32 FastMdlReadResourceMiss;
+				public UInt32 FastMdlReadNotPossible;
+				public UInt32 MapDataNoWait;
+				public UInt32 MapDataWait;
+				public UInt32 MapDataNoWaitMiss;
+				public UInt32 MapDataWaitMiss;
+				public UInt32 PinMappedDataCount;
+				public UInt32 PinReadNoWait;
+				public UInt32 PinReadWait;
+				public UInt32 PinReadNoWaitMiss;
+				public UInt32 PinReadWaitMiss;
+				public UInt32 CopyReadNoWait;
+				public UInt32 CopyReadWait;
+				public UInt32 CopyReadNoWaitMiss;
+				public UInt32 CopyReadWaitMiss;
+				public UInt32 MdlReadNoWait;
+				public UInt32 MdlReadWait;
+				public UInt32 MdlReadNoWaitMiss;
+				public UInt32 MdlReadWaitMiss;
+				public UInt32 ReadAheadIos;
+				public UInt32 LazyWriteIos;
+				public UInt32 LazyWritePages;
+				public UInt32 DataFlushes;
+				public UInt32 DataPages;
+				public UInt32 ContextSwitches;
+				public UInt32 FirstLevelTbFills;
+				public UInt32 SecondLevelTbFills;
+				public UInt32 SystemCalls;
+			}
+
+			[DllImport("ntdll.dll")]
+			public extern static UInt32 NtQuerySystemInformation(
+				SYSTEM_INFORMATION_CLASS SystemInformationClass,
+				out SYSTEM_PERFORMANCE_INFORMATION SystemInformation,
+				UInt32 SystemInformationLength,
+				out UInt32 ReturnLength
+				);
+		}
+
+	}
+}
