Fixed IRP_MJ_{READ,WRITE} for PAGE_SIZE-unaligned buffers
authorshort <>
Fri, 31 Jan 2003 19:42:02 +0000 (19:42 +0000)
committershort <>
Fri, 31 Jan 2003 19:42:02 +0000 (19:42 +0000)
+debug message for IRP_MJ_{READ,WRITE} handler

src/libcaptive/storage/media.c

index 3fd78f7..9cdb952 100644 (file)
@@ -298,12 +298,16 @@ const struct MajorFunction_READ_WRITE_func_Parameters *Parameters;
                /* See comment at ntoskrnl/io/buildirp.c/IoBuildSynchronousFsdRequestWithMdl()
                 * initialization of 'Irp->UserBuffer'.
                 */
-               g_assert(buffer==Irp->MdlAddress->StartVa || buffer==NULL);
+               g_assert(buffer==MmGetSystemAddressForMdl(Irp->MdlAddress) || buffer==NULL);
                g_assert(Parameters->Length<=MmGetMdlByteCount(Irp->MdlAddress));
                buffer=MmGetSystemAddressForMdl(Irp->MdlAddress);
                }
        g_assert(buffer!=NULL);
 
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: %s: ByteOffset=0x%llX,Length=0x%lX",
+                       G_STRLOC,(IrpStack->MajorFunction==IRP_MJ_READ ? "IRP_MJ_READ" : "IRP_MJ_WRITE"),
+                       (guint64)Parameters->ByteOffset.QuadPart,(gulong)Parameters->Length);
+
        erriostatus=g_io_channel_seek_position(captive_image_iochannel,
                        Parameters->ByteOffset.QuadPart,        /* offset */
                        G_SEEK_SET,     /* type */