public override Int32 GetVolumeInfo( out VolumeInfo VolumeInfo) { VolumeInfo = default(VolumeInfo); return(STATUS_SUCCESS); }
public override Int32 SetVolumeLabel( String VolumeLabel, out VolumeInfo VolumeInfo) { this.VolumeLabel = VolumeLabel; return(GetVolumeInfo(out VolumeInfo)); }
public override Int32 GetVolumeInfo( out VolumeInfo VolumeInfo) { VolumeInfo = default(VolumeInfo); VolumeInfo.TotalSize = MaxFileNodes * (UInt64)MaxFileSize; VolumeInfo.FreeSize = (MaxFileNodes - FileNodeMap.Count()) * (UInt64)MaxFileSize; VolumeInfo.SetVolumeLabel(VolumeLabel); return(STATUS_SUCCESS); }
public override Int32 GetVolumeInfo(out VolumeInfo VolumeInfo) { VolumeInfo = default; VolumeInfo.FreeSize = BytesFree; VolumeInfo.TotalSize = BytesInUse + BytesFree; VolumeInfo.SetVolumeLabel(VolumeLabel.Trim(new char[] { '\0', (char)0xff })); return(STATUS_SUCCESS); }
public static void GetStruct( this IVolumeInfo pVolumeInfo, out Fsp.Interop.VolumeInfo VolumeInfo ) { VolumeInfo = default; VolumeInfo.FreeSize = (ulong)pVolumeInfo.FreeSize; VolumeInfo.TotalSize = (ulong)pVolumeInfo.TotalSize; }
public void TestGetVolumeInfo() { //Arrange var v = new Fsp.Interop.VolumeInfo(); var s = new Mock <IWindowsFileSystemBaseWrapper>(); _ = s.Setup(x => x.GetVolumeInfo(out v)).Returns(666); //Act var fs = new WindowsFileSystemBase <TestStorageType>(s.Object); var r = fs.GetVolumeInfo(out v); //Assert Assert.AreEqual(666, r); s.Verify(f => f.GetVolumeInfo(out v), Times.Once()); }
public override Int32 GetVolumeInfo( out VolumeInfo VolumeInfo) { VolumeInfo = default(VolumeInfo); try { DriveInfo Info = new DriveInfo(_Path); VolumeInfo.TotalSize = (UInt64)Info.TotalSize; VolumeInfo.FreeSize = (UInt64)Info.TotalFreeSpace; } catch (ArgumentException) { /* * DriveInfo only supports drives and does not support UNC paths. * It would be better to use GetDiskFreeSpaceEx here. */ } return(STATUS_SUCCESS); }