While trying to understand how different buffering methods work, I
came across an odd IOCTL, IOCTL_CDROM_RAW_READ. The DDK description
of it seems normal at first. There's Irp->AssociatedIrp.SystemBuffer
for buffered input and Irp->MdlAddress for direct output, and the
IOCTL is defined in the DDK headers to use METHOD_OUT_DIRECT.
That's fine, but the description also says that if the IOCTL is sent
from kernel mode then Type3InputBuffer should be used for input, and
it's not even clear what should be used for output. Type3InputBuffer
is for METHOD_NEITHER, except the IOCTL is already using
METHOD_OUT_DIRECT.
How can an IOCTL like this that mixes two different buffering methods
be sent, and how is the receiver supposed to know which method was
used by the sender?