Exemplo n.º 1
0
        public override Int32 GetVolumeInfo(
            out VolumeInfo VolumeInfo)
        {
            VolumeInfo = default(VolumeInfo);

            return(STATUS_SUCCESS);
        }
Exemplo n.º 2
0
 public override Int32 SetVolumeLabel(
     String VolumeLabel,
     out VolumeInfo VolumeInfo)
 {
     this.VolumeLabel = VolumeLabel;
     return(GetVolumeInfo(out VolumeInfo));
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 public static void GetStruct(
     this IVolumeInfo pVolumeInfo,
     out Fsp.Interop.VolumeInfo VolumeInfo
     )
 {
     VolumeInfo           = default;
     VolumeInfo.FreeSize  = (ulong)pVolumeInfo.FreeSize;
     VolumeInfo.TotalSize = (ulong)pVolumeInfo.TotalSize;
 }
Exemplo n.º 6
0
        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());
        }
Exemplo n.º 7
0
 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);
 }