Ejemplo n.º 1
0
 private long GetFreeDiskSpace()
 {
     long num3;
     long num4;
     string pathRoot = Path.GetPathRoot(Path.GetFullPath(this.FullLogFileName));
     long userSpaceFree = -1L;
     new FileIOPermission(FileIOPermissionAccess.PathDiscovery, pathRoot).Demand();
     if (!Microsoft.VisualBasic.CompilerServices.UnsafeNativeMethods.GetDiskFreeSpaceEx(pathRoot, ref userSpaceFree, ref num4, ref num3) || (userSpaceFree <= -1L))
     {
         throw ExceptionUtils.GetWin32Exception("ApplicationLog_FreeSpaceError", new string[0]);
     }
     return userSpaceFree;
 }
 private void Refresh()
 {
     if (this.m_IsOldOS)
     {
         this.m_MemoryStatus = new Microsoft.VisualBasic.CompilerServices.NativeMethods.MEMORYSTATUS();
         Microsoft.VisualBasic.CompilerServices.NativeMethods.GlobalMemoryStatus(ref this.m_MemoryStatus);
     }
     else
     {
         this.m_MemoryStatusEx = new Microsoft.VisualBasic.CompilerServices.NativeMethods.MEMORYSTATUSEX();
         this.m_MemoryStatusEx.Init();
         if (!Microsoft.VisualBasic.CompilerServices.NativeMethods.GlobalMemoryStatusEx(ref this.m_MemoryStatusEx))
         {
             throw ExceptionUtils.GetWin32Exception("DiagnosticInfo_Memory", new string[0]);
         }
     }
 }