Beispiel #1
0
        /// <summary>
        /// Retrieves the device type, device number, and, for a partitionable device, the partition number of a device.
        /// </summary>
        /// <param name="device"><see cref="SystemVolume"/> to query</param>
        /// <returns><see cref="STORAGE_DEVICE_NUMBER"/> structure</returns>
        internal virtual STORAGE_DEVICE_NUMBER GetDeviceNumber(DeviceHandle device)
        {
            DeviceIoControl <STORAGE_DEVICE_NUMBER> deviceControl = new DeviceIoControl <STORAGE_DEVICE_NUMBER>();

            return(deviceControl.GetDataForDevice(device, IoControlCode.IOCTL_STORAGE_GET_DEVICE_NUMBER));
        }
Beispiel #2
0
        /// <summary>
        /// Function will all physical disk that 'volume' is extended/spanned on it
        /// </summary>
        /// <remarks>MSDN: http://msdn.microsoft.com/en-us/library/aa365194(v=vs.85).aspx </remarks>
        /// <param name="device"><see cref="SystemVolume"/> to query</param>
        /// <returns><see cref="VOLUME_DISK_EXTENTS"/> structure that volume extends on</returns>
        internal virtual Nullable <VOLUME_DISK_EXTENTS> GetDiskExtendsForVolume(SystemVolume device)
        {
            DeviceIoControl <VOLUME_DISK_EXTENTS> deviceControl = new DeviceIoControl <VOLUME_DISK_EXTENTS>();

            return(deviceControl.GetDataForDevice(device, IoControlCode.IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS));
        }