Hardware/HDD/SMART.cs
changeset 195 0ee888c485d5
parent 188 6ce1c13899e1
child 218 194186efdde9
     1.1 --- a/Hardware/HDD/SMART.cs	Tue Sep 21 10:33:28 2010 +0000
     1.2 +++ b/Hardware/HDD/SMART.cs	Tue Sep 21 20:32:36 2010 +0000
     1.3 @@ -36,7 +36,6 @@
     1.4  */
     1.5  
     1.6  using System;
     1.7 -using System.Collections.Generic;
     1.8  using System.Runtime.InteropServices;
     1.9  
    1.10  namespace OpenHardwareMonitor.Hardware.HDD {
    1.11 @@ -90,7 +89,7 @@
    1.12      };
    1.13  
    1.14      [Flags]
    1.15 -    private enum AccessMode : uint {     
    1.16 +    protected enum AccessMode : uint {     
    1.17        Read = 0x80000000,    
    1.18        Write = 0x40000000,     
    1.19        Execute = 0x20000000,     
    1.20 @@ -98,14 +97,14 @@
    1.21      }
    1.22  
    1.23      [Flags]
    1.24 -    private enum ShareMode : uint {
    1.25 +    protected enum ShareMode : uint {
    1.26        None = 0,     
    1.27        Read = 1,     
    1.28        Write = 2,    
    1.29        Delete = 4
    1.30      }
    1.31  
    1.32 -    private enum CreationMode : uint {
    1.33 +    protected enum CreationMode : uint {
    1.34        New = 1,
    1.35        CreateAlways = 2,    
    1.36        OpenExisting = 3,    
    1.37 @@ -114,7 +113,7 @@
    1.38      }
    1.39  
    1.40      [Flags]
    1.41 -    private enum FileAttribute : uint {
    1.42 +    protected enum FileAttribute : uint {
    1.43        Readonly = 0x00000001,
    1.44        Hidden = 0x00000002,
    1.45        System = 0x00000004,
    1.46 @@ -131,14 +130,14 @@
    1.47        Encrypted = 0x00004000,
    1.48      }
    1.49  
    1.50 -    private enum DriveCommand : uint {
    1.51 +    protected enum DriveCommand : uint {
    1.52        GetVersion = 0x00074080,
    1.53        SendDriveCommand = 0x0007c084,
    1.54        ReceiveDriveData = 0x0007c088
    1.55      }
    1.56  
    1.57      [StructLayout(LayoutKind.Sequential, Pack = 1)]
    1.58 -    private struct CommandBlockRegisters {
    1.59 +    protected struct CommandBlockRegisters {
    1.60        public byte Features;         
    1.61        public byte SectorCount;      
    1.62        public byte LBALow;       
    1.63 @@ -150,8 +149,8 @@
    1.64      }
    1.65  
    1.66      [StructLayout(LayoutKind.Sequential, Pack = 1)]
    1.67 -    private struct DriveCommandParameter {
    1.68 -      private uint BufferSize;           
    1.69 +    protected struct DriveCommandParameter {
    1.70 +      public uint BufferSize;           
    1.71        public CommandBlockRegisters Registers;           
    1.72        public byte DriveNumber;   
    1.73        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
    1.74 @@ -159,7 +158,7 @@
    1.75      }
    1.76  
    1.77      [StructLayout(LayoutKind.Sequential, Pack = 1)]
    1.78 -    private struct DriverStatus {
    1.79 +    protected struct DriverStatus {
    1.80        public byte DriverError;   
    1.81        public byte IDEError;             
    1.82        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
    1.83 @@ -167,13 +166,13 @@
    1.84      }
    1.85  
    1.86      [StructLayout(LayoutKind.Sequential, Pack = 1)]
    1.87 -    private struct DriveCommandResult {
    1.88 +    protected struct DriveCommandResult {
    1.89        public uint BufferSize;
    1.90        public DriverStatus DriverStatus;
    1.91      } 
    1.92  
    1.93      [StructLayout(LayoutKind.Sequential, Pack = 1)]
    1.94 -    private struct DriveSmartReadResult {
    1.95 +    protected struct DriveSmartReadResult {
    1.96        public uint BufferSize;           
    1.97        public DriverStatus DriverStatus;
    1.98        public byte Version;
    1.99 @@ -183,7 +182,7 @@
   1.100      }
   1.101  
   1.102      [StructLayout(LayoutKind.Sequential, Pack = 1)]
   1.103 -    private struct Identify {
   1.104 +    protected struct Identify {
   1.105        public ushort GeneralConfiguration;
   1.106        public ushort NumberOfCylinders;
   1.107        public ushort Reserved;
   1.108 @@ -213,7 +212,7 @@
   1.109      }
   1.110  
   1.111      [StructLayout(LayoutKind.Sequential, Pack = 1)]
   1.112 -    private struct DriveIdentifyResult {
   1.113 +    protected struct DriveIdentifyResult {
   1.114        public uint BufferSize;
   1.115        public DriverStatus DriverStatus;
   1.116        public Identify Identify;
   1.117 @@ -312,7 +311,7 @@
   1.118        return NativeMethods.CloseHandle(handle);
   1.119      }
   1.120  
   1.121 -    private static class NativeMethods {
   1.122 +    protected static class NativeMethods {
   1.123        private const string KERNEL = "kernel32.dll";
   1.124  
   1.125        [DllImport(KERNEL, CallingConvention = CallingConvention.Winapi,