Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Irp->AssociatedIrp.SystemBuffer & IOCTL transfer type

360 views
Skip to first unread message

rar...@gmail.com

unread,
Dec 5, 2007, 6:46:13 PM12/5/07
to
If you have an IOCTL declared with a METHOD_XX_DIRECT transfer
type ... what exactly is in
Irp->AssociatedIrp.SystemBuffer when the ioctl comes down into the
drivers control handler ? Being DIRECT transfer type, Irp->MdlAddress
should be the one that contains the correct in/out user buffer. In
the debugger the Irp->AssociatedIrp.SystemBuffer always seems to be a
valid pointer .. hence the question.


Thx
--ks


Don Burn

unread,
Dec 5, 2007, 8:27:53 PM12/5/07
to
The Irp->AssociatedIrp.SystemBuffer contains the input buffer, and the
Irp->MdlAddress contains the output buffer. See
http://msdn2.microsoft.com/en-us/library/ms795857.aspx


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply


<rar...@gmail.com> wrote in message
news:121ed796-c2b3-490a...@e25g2000prg.googlegroups.com...

Maxim S. Shatskih

unread,
Dec 6, 2007, 12:35:34 PM12/6/07
to
Irp->AssociatedIrp.SystemBuffer is always input buffer for
METHOD_XX_DIRECT.
Irp->MdlAddress is always output buffer.

The difference between METHOD_IN_DIRECT and METHOD_OUT_DIRECT is only in
MDL locking style (parameters to MmProbeAndLockPages) used by IO manager.

In one of METHOD_XX_DIRECT, you can update the data described by
Irp->MdlAddress, in another - you cannot.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
ma...@storagecraft.com
http://www.storagecraft.com

<rar...@gmail.com> wrote in message
news:121ed796-c2b3-490a...@e25g2000prg.googlegroups.com...

rar...@gmail.com

unread,
Dec 6, 2007, 3:02:03 PM12/6/07
to
On Dec 6, 9:35 am, "Maxim S. Shatskih" <ma...@storagecraft.com> wrote:
> Irp->AssociatedIrp.SystemBuffer is always input buffer for
> METHOD_XX_DIRECT.
> Irp->MdlAddress is always output buffer.
>
> The difference between METHOD_IN_DIRECT and METHOD_OUT_DIRECT is only in
> MDL locking style (parameters to MmProbeAndLockPages) used by IO manager.
>
> In one of METHOD_XX_DIRECT, you can update the data described by
> Irp->MdlAddress, in another - you cannot.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.comhttp://www.storagecraft.com

>
> <rar...@gmail.com> wrote in message
>
> news:121ed796-c2b3-490a...@e25g2000prg.googlegroups.com...
>
>
>
> > If you have an IOCTL declared with a METHOD_XX_DIRECT transfer
> > type ... what exactly is in
> > Irp->AssociatedIrp.SystemBuffer when the ioctl comes down into the
> > drivers control handler ? Being DIRECT transfer type, Irp->MdlAddress
> > should be the one that contains the correct in/out user buffer. In
> > the debugger the Irp->AssociatedIrp.SystemBuffer always seems to be a
> > valid pointer .. hence the question.
>
> > Thx
> > --ks- Hide quoted text -
>
> - Show quoted text -

Thank you both for that info

--ks

0 new messages