afnarqui / dokan

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

Cannot save Powerpoint file #130

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a large (4 meg) powerpoint file that is corrupted if I save it
through our dokan file system. I have tracked this down to a write with
length 0 failing, because both the Irp->MdlAddress and the Irp->UserBuffer
ar null. I believe the write should succeed in this case. Here's a patch
that fixes the problem for me:

Index: write.c
===================================================================
--- write.c (revision 67)
+++ write.c (working copy)
@@ -78,6 +78,11 @@
            __leave;
        }

+       if (irpSp->Parameters.Write.Length == 0) {
+           status = STATUS_SUCCESS;
+           __leave;
+       }
+
        if (Irp->MdlAddress) {
            DDbgPrint("  use MdlAddress\n");
            buffer = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority);
@@ -92,11 +97,6 @@
            __leave;
        }

-       if (irpSp->Parameters.Write.Length == 0) {
-           status = STATUS_SUCCESS;
-           __leave;
-       }
-
        // the length of EventContext is sum of length to write and length of
file name
        eventLength = sizeof(EVENT_CONTEXT)
                            + irpSp->Parameters.Write.Length

Original issue reported on code.google.com by t.s.mae...@gmail.com on 2 Feb 2010 at 3:24

GoogleCodeExporter commented 9 years ago
You are right. I fixed it. Thank you for your patch. 

Original comment by asa...@gmail.com on 2 Feb 2010 at 10:57