mt5225 / dokan

Automatically exported from code.google.com/p/dokan
0 stars 0 forks source link

C# DeleteOnClose problem with latest Dokan lib and .net lib #107

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Check if the file can be deleted in my code of delete function
2. delete the file if DeleteOnClose is true in cleanup function
3. Delete the file in file browser

What is the expected output? What do you see instead?
Expect the DeleteOnClose is true in the cleanup function. What i see is 
always false.

What version of the product are you using? On what operating system?
I am using the svn dokan lib and .net lib. My code is in C#. I am using 
windows XP.

Please provide any additional information below.
The latest mirror.exe works great. 

Original issue reported on code.google.com by kinh...@gmail.com on 20 Sep 2009 at 11:34

GoogleCodeExporter commented 9 years ago
The problem lies on Line #92 of the file Proxy.cs
Since Dokan sets DOKAN_FILE_INFO.DeleteOnClose to 16 value of 
DOKAN_DELETE_ON_CLOSE.
(See ---> DOKAN/sys/public.h on line #77)
The line should read something like: 
      fileinfo.DeleteOnClose = info.DeleteOnClose >= 1

The whole block should be as follows: 

        private DokanFileInfo GetFileInfo(ref DOKAN_FILE_INFO info)
        {
            DokanFileInfo fileinfo = null;
            lock (infoTableLock_)
            {
                if (info.Context != 0)
                {
                    infoTable_.TryGetValue(info.Context, out fileinfo);
                }

                if (fileinfo == null)
                {
                    // bug?
                    fileinfo = new DokanFileInfo();
                }

                fileinfo.IsDirectory = info.IsDirectory == 1;
                fileinfo.ProcessId = info.ProcessId;
                fileinfo.DeleteOnClose = info.DeleteOnClose >= 1; // Change is here
            }
            return fileinfo;
        }

Original comment by nzeyiman...@gmail.com on 30 Oct 2009 at 11:00

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by asa...@gmail.com on 25 Feb 2010 at 9:05