Exemple #1
0
        /// <summary>Create instance of device info class by device ID or drive letter</summary>
        /// <param name="deviceId">ID of device</param>
        /// <param name="deviceName">name of device</param>
        /// <param name="accessFlags">Device desired access flags</param>
        /// <param name="shareMode">Opened device share mode</param>
        /// <exception cref="ArgumentException">Device id does not specified</exception>
        public DeviceIoControl(Byte?deviceId, String deviceName, WinAPI.FILE_ACCESS_FLAGS accessFlags, WinAPI.FILE_SHARE shareMode)
        {        //DriveInfo.GetDrives()
            this._deviceId = deviceId;

            if (deviceId.HasValue)
            {
                this._deviceName = DeviceIoControl.GetDeviceName(deviceId.Value);
            }
            else if (!String.IsNullOrEmpty(deviceName))
            {
                Char deviceLetter = Array.Find(deviceName.ToCharArray(), delegate(Char ch) { return(Char.IsLetter(ch)); });
                this._deviceName = String.Format(Constant.DriveWinNTArg1, deviceLetter);
            }
            else
            {
                throw new ArgumentException("Device id does not specified");
            }

            this._deviceHandle = Methods.OpenDevice(this.Name, accessFlags, shareMode);
        }
 /// <summary>Create instance of storage IO commands class</summary>
 /// <param name="device">Device</param>
 internal Storage(DeviceIoControl device)
 {
     this._device = device;
 }
Exemple #3
0
 /// <summary>Create instance of file system IO commands class</summary>
 /// <param name="device">Device</param>
 public FileSystem(DeviceIoControl device)
 {
     this._device = device;
 }
Exemple #4
0
 /// <summary>Create instance of Volume IO control commands</summary>
 /// <param name="device">Device</param>
 internal Volume(DeviceIoControl device)
 {
     this._device = device;
 }
Exemple #5
0
 /// <summary>Create instance of disc IO control commands class</summary>
 /// <param name="device">Device</param>
 internal Disc(DeviceIoControl device)
 {
     this._device = device;
 }
 /// <summary>Create instance of deviceperfomance counters</summary>
 /// <param name="device">device</param>
 internal Performance(DeviceIoControl device)
 {
     this._device = device;
 }
 /// <summary>Create instance of device properties class</summary>
 /// <param name="device">device info</param>
 internal Properties(DeviceIoControl device)
 {
     this._info = device;
 }
 /// <summary>Create instance of S.M.A.R.T. info structure</summary>
 /// <param name="device">Device info</param>
 internal SmartInfo(DeviceIoControl device)
 {
     this._device = device;
 }