pombreda / dokan

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

Saving from Notepad fails on Win7 #111

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This happens with dokan 0.4.2 and when I implement FindFiles instead of
FindFilesWithPattern

The problem seems to be that ERROR_NO_MORE_FILES is return instead of
ERROR_NO_SUCH_FILE.

The following patch for dokan/directory.c fixes the problem for me.

Index: directory.c
===================================================================
--- directory.c (revision 13)
+++ directory.c (working copy)
@@ -546,8 +546,13 @@

        // there is no matched file
        if (index <0) {
-           DbgPrint("  STATUS_NO_MORE_FILES\n");
-           eventInfo->Status = STATUS_NO_MORE_FILES;
+           if (EventContext->Directory.FileIndex == 0) {
+               DbgPrint("  STATUS_NO_SUCH_FILE\n");
+               eventInfo->Status = STATUS_NO_SUCH_FILE;
+           } else {
+               DbgPrint("  STATUS_NO_MORE_FILES\n");
+               eventInfo->Status = STATUS_NO_MORE_FILES;
+           }
            eventInfo->BufferLength = 0;
            eventInfo->Directory.Index = EventContext->Directory.FileIndex;

Original issue reported on code.google.com by t.s.mae...@gmail.com on 7 Oct 2009 at 10:55

GoogleCodeExporter commented 9 years ago
The workaround is to implement FindFilesWithPattern.

Original comment by t.s.mae...@gmail.com on 8 Oct 2009 at 6:50

GoogleCodeExporter commented 9 years ago
Thank you for your patch.
I submitted the fix: http://code.google.com/p/dokan/source/detail?r=42

Original comment by asa...@gmail.com on 19 Oct 2009 at 2:40