USHORT
IoSizeOfIrp(
IN CCHAR StackSize
);
IoSizeOfIrp determines the size in bytes for an IRP, given the number of stack locations in the IRP.
IoSizeOfIrp returns the size, in bytes, of the IRP.
Callers of IoSizeOfIrp can be running at any IRQL level.
The input StackSize value is either that of the next-lower driver’s device object or one more than that value.