Exemple #1
0
        ////

        internal NtStatus MoveFileProxy(string rawFileName, string rawNewFileName, bool rawReplaceIfExisting, DokanFileInfo rawFileInfo)
        {
            try
            {
                NtStatus result = _operations.MoveFile(rawFileName, rawNewFileName, rawReplaceIfExisting, rawFileInfo);
                return(result);
            }
            catch (Exception ex)
            {
                ServiceRegistration.Get <ILogger>().Warn("Dokan exception: ", ex);
                return(DokanResult.InvalidParameter);
            }
        }
Exemple #2
0
        public NtStatus MoveFile(string filename, string newname, bool replace, DokanFileInfo info)
        {
            CacheEntry entry = cache_.Lookup(filename);

            entry.RemoveAllCache();
            entry.Parrent.RemoveFindFilesCache();

            entry = cache_.Lookup(newname);
            entry.RemoveAllCache();
            entry.Parrent.RemoveFindFilesCache();

            return(ope_.MoveFile(filename, newname, replace, info));
        }
Exemple #3
0
        public int MoveFileProxy(IntPtr rawFileName, IntPtr rawNewFileName, int rawReplaceIfExisting, ref DOKAN_FILE_INFO rawFileInfo)
        {
            try
            {
                string file    = GetFileName(rawFileName);
                string newfile = GetFileName(rawNewFileName);

                return(operations.MoveFile(file, newfile, (rawReplaceIfExisting != 0), ConvertFileInfo(ref rawFileInfo)));
            }
            catch (Exception ex)
            {
                Log.ErrorException("MoveFileProxy threw: ", ex);
                return(-1);
            }
        }
Exemple #4
0
        ////

        public int MoveFileProxy(string rawFileName,
                                 string rawNewFileName, bool rawReplaceIfExisting,
                                 DokanFileInfo rawFileInfo)
        {
            try
            {
                return((int)_operations.MoveFile(rawFileName, rawNewFileName, rawReplaceIfExisting,
                                                 rawFileInfo));
            }
            catch
            {
#if DEBUG
                throw;
#endif
                return(ERROR_INVALID_FUNCTION);
            }
        }
Exemple #5
0
        ////

        public NtStatus MoveFileProxy(string rawFileName,
                                      string rawNewFileName, bool rawReplaceIfExisting,
                                      DokanFileInfo rawFileInfo)
        {
            try
            {
                logger.Debug("MoveFileProxy : {0}", rawFileName);
                logger.Debug("\tNewFileName\t{0}", rawNewFileName);
                logger.Debug("\tReplaceIfExisting\t{0}", rawReplaceIfExisting);
                logger.Debug("\tContext\t{0}", rawFileInfo);

                var result = operations.MoveFile(rawFileName, rawNewFileName, rawReplaceIfExisting, rawFileInfo);

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

        public NtStatus MoveFileProxy(string rawFileName,
                                      string rawNewFileName, bool rawReplaceIfExisting,
                                      DokanFileInfo rawFileInfo)
        {
            try
            {
                Trace("\nMoveFileProxy : " + rawFileName);
                Trace("\tNewFileName\t" + rawNewFileName);
                Trace("\tReplaceIfExisting\t" + rawReplaceIfExisting);
                Trace("\tContext\t" + ToTrace(rawFileInfo));

                NtStatus result = operations.MoveFile(rawFileName, rawNewFileName, rawReplaceIfExisting, rawFileInfo);

                Trace("MoveFileProxy : " + rawFileName + " Return : " + result);
                return(result);
            }
#pragma warning disable 0168
            catch (Exception ex)
#pragma warning restore 0168
            {
                Trace("MoveFileProxy : " + rawFileName + " Throw : " + ex.Message);
                return(DokanResult.InvalidParameter);
            }
        }