I have created a device object and attach it to the volume stack. The IO
mode is DO_DIRECT_IO. Now in the read IRP, do i need to check whether the
ByteCount in Irp->MdlAddress is greater than or equal to IoStackLocation->
Parameters.Read.Length.
–
Regards
Rohit Gauba
No. Trust the value in Read.Length. If the I/O manager handed you an MDL it will be the right length. If a driver did then it better be the right length or that driver is the one with the bug.
Note that the MDL could be longer than the read you’ve been issued if the upper driver is doing partial I/O operations into the MLD. You shouldn’t trigger any decisions based on that value but should trust the IRP.
-p
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Rohit
Sent: Tuesday, April 03, 2007 5:07 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Irp->MdlAddress.ByteCount >= IoStackLocation->Parameters.Read.Length???
I have created a device object and attach it to the volume stack. The IO mode is DO_DIRECT_IO. Now in the read IRP, do i need to check whether the ByteCount in Irp->MdlAddress is greater than or equal to IoStackLocation-> Parameters.Read.Length.
–
Regards
Rohit Gauba — Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer