METHOD_IN_DIRECT

Hello.
Can I use METHOD_IN_DIRECT and METHOD_OUT_DIRECT together. When I want to send and receive buffer from driver.
like this
#define MY_IOCTL CTL_CODE(FILE_DEVICE_NETWORK, 0x800, METHOD_IN_DIRECT | METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
The CTL_CODE macro defines 2 bits for this, so I think we can’t assign both methods. Then, how to send and receive buffers to and from the driver using a single IRP.

If it is writable it is readable.

No, you can’t use them together. Those are not bits, they are enumerations. In fact, that particular combination would be very bad, because METHOD_IN_DIRECT (1) ored with METHOD_OUT_DIRECT (2) gives you 3, which is METHOD_NEITHER. And nobody wants that.

However, for all practical purposes, the two are identical.

Thanks everyone