예제 #1
0
        ////

        internal NtStatus ReadFileProxy(string rawFileName, byte[] rawBuffer, uint rawBufferLength, ref int rawReadLength, long rawOffset, DokanFileInfo rawFileInfo)
        {
            try
            {
                NtStatus result = _operations.ReadFile(rawFileName, rawBuffer, out rawReadLength, rawOffset, rawFileInfo);
                return(result);
            }
            catch (Exception ex)
            {
                ServiceRegistration.Get <ILogger>().Warn("Dokan exception: ", ex);
                return(DokanResult.InvalidParameter);
            }
        }
예제 #2
0
        ////


        public int ReadFileProxy(string rawFileName, byte[] rawBuffer,
                                 uint rawBufferLength, ref int rawReadLength, long rawOffset,
                                 DokanFileInfo rawFileInfo)
        {
            try
            {
                return((int)_operations.ReadFile(rawFileName, rawBuffer, out rawReadLength, rawOffset,
                                                 rawFileInfo));
            }
            catch
            {
#if DEBUG
                throw;
#endif
                return(ERROR_INVALID_FUNCTION);
            }
        }
예제 #3
0
        ////

        public NtStatus ReadFileProxy(string rawFileName,
                                      byte[] rawBuffer, uint rawBufferLength, ref int rawReadLength, long rawOffset,
                                      DokanFileInfo rawFileInfo)
        {
            try
            {
                logger.Debug("ReadFileProxy : " + rawFileName);
                logger.Debug("\tBufferLength\t" + rawBufferLength);
                logger.Debug("\tOffset\t" + rawOffset);
                logger.Debug("\tContext\t" + rawFileInfo);

                var result = operations.ReadFile(rawFileName, rawBuffer, out rawReadLength, rawOffset, rawFileInfo);

                logger.Debug("ReadFileProxy : " + rawFileName + " Return : " + result + " ReadLength : " + rawReadLength);
                return(result);
            }
            catch (Exception ex)
            {
                logger.Error("ReadFileProxy : {0} Throw : {1}", rawFileName, ex.Message);
                return(DokanResult.InvalidParameter);
            }
        }
        ////

        public NtStatus ReadFileProxy(string rawFileName,
                                      byte[] rawBuffer, uint rawBufferLength, ref int rawReadLength, long rawOffset,
                                      DokanFileInfo rawFileInfo)
        {
            try
            {
                Trace("\nReadFileProxy : " + rawFileName);
                Trace("\tBufferLength\t" + rawBufferLength);
                Trace("\tOffset\t" + rawOffset);
                Trace("\tContext\t" + ToTrace(rawFileInfo));

                NtStatus result = operations.ReadFile(rawFileName, rawBuffer, out rawReadLength, rawOffset, rawFileInfo);

                Trace("ReadFileProxy : " + rawFileName + " Return : " + result + " ReadLength : " + rawReadLength);
                return(result);
            }
#pragma warning disable 0168
            catch (Exception ex)
#pragma warning restore 0168
            {
                Trace("ReadFileProxy : " + rawFileName + " Throw : " + ex.Message);
                return(DokanResult.InvalidParameter);
            }
        }
예제 #5
0
 public NtStatus ReadFile(string filename, byte[] buffer,
                          out int readBytes, long offset, DokanFileInfo info)
 {
     return(ope_.ReadFile(filename, buffer, out readBytes, offset, info));
 }