Changeset 1837


Ignore:
Timestamp:
02/12/10 12:50:13 (5 years ago)
Author:
lowjoel
Message:

Allow non-administrators to query disk performance information.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6/Eraser.Util/VolumeInfo.cs

    r1802 r1837  
    643643            } 
    644644 
     645            return OpenHandle(iAccess, share, options); 
     646        } 
     647 
     648        private SafeFileHandle OpenHandle(uint access, FileShare share, FileOptions options) 
     649        { 
    645650            //Sharing mode 
    646651            if ((share & FileShare.Inheritable) != 0) 
     
    655660            if (openPath.Length > 0 && openPath[openPath.Length - 1] == '\\') 
    656661                openPath = openPath.Remove(openPath.Length - 1); 
    657             SafeFileHandle result = NativeMethods.CreateFile(openPath, iAccess, 
     662            SafeFileHandle result = NativeMethods.CreateFile(openPath, access, 
    658663                (uint)share, IntPtr.Zero, (uint)FileMode.Open, (uint)options, IntPtr.Zero); 
    659664            if (result.IsInvalid) 
     
    674679            get 
    675680            { 
    676                 using (SafeFileHandle handle = OpenHandle(FileAccess.Read, 
     681                using (SafeFileHandle handle = OpenHandle(0x80u, 
    677682                    FileShare.ReadWrite, FileOptions.None)) 
    678683                { 
Note: See TracChangeset for help on using the changeset viewer.