Author: ion
Date: Sun Jul 9 03:02:50 2006
New Revision: 22958
URL:
http://svn.reactos.org/svn/reactos?rev=22958&view=rev
Log:
- A long long time ago there was a stupid kernel that created MDLs for R/W requests even
when the length of the buffer was 0. He had another stupid friend called CDFS which
attempted to read the MDL before checking if the buffer size is also 0. When cdfs's
friend, the kernel, grew smarter and stopped allocating MDLs, cdfs didn't catch on and
cried every time this happened. CDFS now caught up. (thanks to Greatlord for finding the
regression).
Modified:
trunk/reactos/drivers/filesystems/cdfs/rw.c
Modified: trunk/reactos/drivers/filesystems/cdfs/rw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/r…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/rw.c (original)
+++ trunk/reactos/drivers/filesystems/cdfs/rw.c Sun Jul 9 03:02:50 2006
@@ -140,7 +140,7 @@
PDEVICE_EXTENSION DeviceExt;
PIO_STACK_LOCATION Stack;
PFILE_OBJECT FileObject;
- PVOID Buffer;
+ PVOID Buffer = NULL;
ULONG ReadLength;
LARGE_INTEGER ReadOffset;
ULONG ReturnedReadLength = 0;
@@ -154,7 +154,7 @@
ReadLength = Stack->Parameters.Read.Length;
ReadOffset = Stack->Parameters.Read.ByteOffset;
- Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
+ if (ReadLength) Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
Status = CdfsReadFile(DeviceExt,
FileObject,