Both MDL Address and User Buffer valid!

Hi All,

Is it possible to have both Irp->MdlAddress and Irp->UserBuffer valid at a
time?

Actually, in my Filter driver,am getting a Read Irp with the flags (NO_CACHE
set and Paging_IO not set) and Fileobject with Handle_create,
file_o_bufferring, random_access set.

When i set a completion routine for that irp, in my completion routine am
able to see that both Irp->MdlAddress and Irp->UserBuffer are valid and have
the same data?

Is anything wrong with the behaviour or why does the data be there in both
Irp->MdlAddress and Irp->UserBuffer ?

With Regards,
A.Ilamparithi.

A.Ilamparithi wrote:

Hi All,

Is it possible to have both Irp->MdlAddress and Irp->UserBuffer valid at a
time?

Certainly. IIRC, Irp->UserBuffer is set up with the user-mode address of
the user’s buffer irrespective of the type of I/O, and usable only in
the context of the requesting process. You don’t say WHAT"s in it…
just that it’s valid. Does this correspond with what you’re seeing?

And, of course, Irp->MdlAddress is setup with a pointer to an MDL that
provides a context-independent description of the user’s data buffer.

So, sounds to me like your describing an IRP that’s built for Direct I/O.

Peter
OSR