Three types of data buffers.


Direct I/O: Memory descriptor list, which describes the physical addresses of the requestor’s user mode virtual affresses. I/O manager locks the nonpaged buffer. The address is in IRP’s MdlAddress field. Arbitrary context.


Buffered I/O: The data form the requestor’s buffer may be copied form the requestor’s address space into an intermediate location in system address space. The address is in IRP’s AssocatedIrp.SystemBuffer. Arbitrary context.


Neither I/O: the driver is provided with the requestor’s virtual address of the buffer. This buffer must be use in the calling thread’s context. The address is in IRP’s UserBuffer field.


IOCTL: I/O Functions Codes.

CTL_CODE Method Argument:

METHOD_IN_DIRECT and METHOD_OUT_DIRECT: In function DeviceIOControl(),The inbuffer is buffered I/O and the outbuffer is Direct I/O.  METHOD_IN check outbuffer read access and METHOD_OUT_DIRECT check outbuffer write access.