The attributes of a logical disk. Windows only.
Inheritance: Attributes
コード例 #1
0
		public WinLogicalDisk(ManagementObject mo) {
			Attributes = new LogicalDiskAttributes(mo);
			Handle = Win32.CreateFile(@"\\.\" + Attributes.DeviceID, EFileAccess.GenericRead, EFileShare.Read | EFileShare.Write | EFileShare.Delete, IntPtr.Zero, ECreationDisposition.OpenExisting, EFileAttributes.None, IntPtr.Zero);

			if (Handle.IsInvalid) {
				throw new Exception("Failed to get a handle to the logical volume. " + Marshal.GetLastWin32Error());
			}
			_size = Util.GetDiskSize(Handle);
			_fileSystem = FileSystem.TryLoad(this);
		}
コード例 #2
0
        public WinLogicalDisk(ManagementObject mo)
        {
            Attributes = new LogicalDiskAttributes(mo);
            Handle     = Win32.CreateFile(@"\\.\" + Attributes.DeviceID, EFileAccess.GenericRead, EFileShare.Read | EFileShare.Write | EFileShare.Delete, IntPtr.Zero, ECreationDisposition.OpenExisting, EFileAttributes.None, IntPtr.Zero);

            if (Handle.IsInvalid)
            {
                throw new Exception("Failed to get a handle to the logical volume. " + Marshal.GetLastWin32Error());
            }
            _size       = Util.GetDiskSize(Handle);
            _fileSystem = FileSystem.TryLoad(this);
        }