- 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).

svn path=/trunk/; revision=22958
This commit is contained in:
Alex Ionescu 2006-07-08 23:02:50 +00:00
parent 1058843806
commit e7e794c543

View file

@ -140,7 +140,7 @@ CdfsRead(PDEVICE_OBJECT DeviceObject,
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 @@ CdfsRead(PDEVICE_OBJECT DeviceObject,
ReadLength = Stack->Parameters.Read.Length;
ReadOffset = Stack->Parameters.Read.ByteOffset;
Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
if (ReadLength) Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
Status = CdfsReadFile(DeviceExt,
FileObject,