예제 #1
0
 public NtStatus GetDiskFreeSpace(
     out long freeBytesAvailable,
     out long totalBytes,
     out long totalFreeBytes,
     DokanFileInfo info)
 {
     return(ope_.GetDiskFreeSpace(out freeBytesAvailable, out totalBytes, out totalFreeBytes, info));
 }
예제 #2
0
        ////

        internal NtStatus GetDiskFreeSpaceProxy(ref long rawFreeBytesAvailable, ref long rawTotalNumberOfBytes, ref long rawTotalNumberOfFreeBytes, DokanFileInfo rawFileInfo)
        {
            try
            {
                NtStatus result = _operations.GetDiskFreeSpace(out rawFreeBytesAvailable, out rawTotalNumberOfBytes, out rawTotalNumberOfFreeBytes, rawFileInfo);
                return(result);
            }
            catch (Exception ex)
            {
                ServiceRegistration.Get <ILogger>().Warn("Dokan exception: ", ex);
                return(DokanResult.InvalidParameter);
            }
        }
예제 #3
0
 public int GetDiskFreeSpaceProxy(ref ulong rawFreeBytesAvailable, ref ulong rawTotalNumberOfBytes,
                                  ref ulong rawTotalNumberOfFreeBytes, ref DOKAN_FILE_INFO rawFileInfo)
 {
     try
     {
         return(operations.GetDiskFreeSpace(ref rawFreeBytesAvailable, ref rawTotalNumberOfBytes,
                                            ref rawTotalNumberOfFreeBytes, ConvertFileInfo(ref rawFileInfo)));
     }
     catch (Exception ex)
     {
         Log.ErrorException("GetDiskFreeSpaceProxy threw: ", ex);
         return(-1);
     }
 }
예제 #4
0
        ////

        public int GetDiskFreeSpaceProxy(ref long rawFreeBytesAvailable, ref long rawTotalNumberOfBytes,
                                         ref long rawTotalNumberOfFreeBytes, DokanFileInfo rawFileInfo)
        {
            try
            {
                return((int)_operations.GetDiskFreeSpace(out rawFreeBytesAvailable, out rawTotalNumberOfBytes,
                                                         out rawTotalNumberOfFreeBytes,
                                                         rawFileInfo));
            }
            catch
            {
#if DEBUG
                throw;
#endif
                return(ERROR_INVALID_FUNCTION);
            }
        }
예제 #5
0
        NtStatus IDokanOperations.GetDiskFreeSpace(out long free, out long total, out long used, IDokanFileInfo info)
        {
            Log("VFS GetDiskFreeSpace");
            if (lastActiveSubsytem != null)
            {
                IDokanOperations ops = GetSubSystemOperations(lastActiveSubsytem);
                if (ops != null)
                {
                    return(ops.GetDiskFreeSpace(out free, out total, out used, info));
                }
            }

            long terabyte = (long)1024 * 1024 * 1024 * 1024;

            total = 10 * terabyte;             //1TB for Explorer to see space
            used  = terabyte;
            free  = total - used;

            return(NtStatus.Success);
        }
예제 #6
0
        DokanError IDokanOperations.GetDiskFreeSpace(out long free, out long total,
                                                     out long used, DokanFileInfo info)
        {
            if (lastActiveSubsytem != null)
            {
                IDokanOperations ops = GetSubSystemOperations(lastActiveSubsytem);
                if (ops != null)
                {
                    return(ops.GetDiskFreeSpace(out free, out total, out used, info));
                }
            }


            free  = 0;
            total = 1024;
            used  = 4;
            free  = total - used;

            return(DokanError.ErrorSuccess);
        }
예제 #7
0
        ////

        public NtStatus GetDiskFreeSpaceProxy(ref long rawFreeBytesAvailable, ref long rawTotalNumberOfBytes, ref long rawTotalNumberOfFreeBytes,
                                              DokanFileInfo rawFileInfo)
        {
            try
            {
                this.logger.Debug("GetDiskFr{0}eeSpaceProxy", "ARG0");
                this.logger.Debug("\tContext\t{0}", this.ToTrace(rawFileInfo));

                NtStatus result = operations.GetDiskFreeSpace(out rawFreeBytesAvailable, out rawTotalNumberOfBytes, out rawTotalNumberOfFreeBytes, rawFileInfo);

                this.logger.Debug("\tFreeBytesAvailable\t{0}", rawFreeBytesAvailable);
                this.logger.Debug("\tTotalNumberOfBytes\t{0}", rawTotalNumberOfBytes);
                this.logger.Debug("\tTotalNumberOfFreeBytes\t{0}", rawTotalNumberOfFreeBytes);
                this.logger.Debug("GetDiskFreeSpaceProxy Return : {0}", result);
                return(result);
            }
            catch (Exception ex)
            {
                this.logger.Error("GetDiskFreeSpaceProxy Throw : {0}", ex.Message);
                return(DokanResult.InvalidParameter);
            }
        }
        ////

        public NtStatus GetDiskFreeSpaceProxy(ref long rawFreeBytesAvailable, ref long rawTotalNumberOfBytes, ref long rawTotalNumberOfFreeBytes,
                                              DokanFileInfo rawFileInfo)
        {
            try
            {
                Trace("\nGetDiskFreeSpaceProxy");
                Trace("\tContext\t" + ToTrace(rawFileInfo));

                NtStatus result = operations.GetDiskFreeSpace(out rawFreeBytesAvailable, out rawTotalNumberOfBytes, out rawTotalNumberOfFreeBytes, rawFileInfo);

                Trace("\tFreeBytesAvailable\t" + rawFreeBytesAvailable);
                Trace("\tTotalNumberOfBytes\t" + rawTotalNumberOfBytes);
                Trace("\tTotalNumberOfFreeBytes\t" + rawTotalNumberOfFreeBytes);
                Trace("GetDiskFreeSpaceProxy Return : " + result);
                return(result);
            }
#pragma warning disable 0168
            catch (Exception ex)
#pragma warning restore 0168
            {
                Trace("GetDiskFreeSpaceProxy Throw : " + ex.Message);
                return(DokanResult.InvalidParameter);
            }
        }