IoMakeAssociatedIrp

PIRP
    IoMakeAssociatedIrp(

        IN PIRP  Irp,
        IN CCHAR  StackSize
        );

IoMakeAssociatedIrp allocates and initalizes an IRP to be associated with a master IRP sent to a highest-level driver, allowing the caller to split the original request and send associated IRPs on to lower-level drivers.

Parameters

Irp
Points to the master IRP that was input to a highest-level driver’s Dispatch routine.
StackSize
Specifies the number of stack locations to be allocated for the associated IRP. The value must be at least equal to the StackSize of the next-lower driver’s device object, but the associated IRP can have an additional stack location for the caller.

Return Value

IoMakeAssociatedIrp returns a pointer to the associated IRP or returns a NULL pointer if an IRP cannot be allocated.

Comments

Only a highest-level driver can call this routine.

The I/O Manager completes the master IRP automatically when lower drivers have completed all associated IRPs as long as the caller has not set its IoCompletion routine in an associated IRP and returned STATUS_MORE_PROCESSING_REQUIRED from its IoCompletion routine. In these circumstances, the caller must explicitly complete the master IRP when that driver has determined that all associated IRPs were completed.

Callers of IoMakeAssociatedIrp must be running at IRQL <= DISPATCH_LEVEL.

See Also

IoAllocateIrp, IoBuildAsynchronousFsdRequest, IoBuildDeviceIoControlRequest, IoBuildSynchronousFsdRequest, IoCallDriver, IoSetCompletionRoutine, IRP