PIRP
IoBuildAsynchronousFsdRequest(
IN ULONG MajorFunction,
IN PDEVICE_OBJECT DeviceObject,
IN OUT PVOID Buffer, /* optional */
IN ULONG Length, /* optional */
IN PLARGE_INTEGER StartingOffset, /* optional */
IN PIO_STATUS_BLOCK IoStatusBlock /* optional */
);
IoBuildAsynchronousFsdRequest allocates and sets up an IRP to be sent to lower-level drivers.
IoBuildAsynchronousFsdRequest returns a pointer to an IRP or a NULL pointer if the IRP cannot be allocated.
Intermediate or highest-level drivers can call IoBuildAsynchronousFsdRequest to set up IRPs for requests sent to lower-level drivers. Such a driver must set its IoCompletion routine in the IRP so the IRP can be deallocated with IoFreeIrp.
The IRP that gets built contains only enough information to get the operation started and to complete the IRP. No other context information is tracked because an asynchronous request is context-independent.
Callers of IoBuildAsynchronousFsdRequest must be running at IRQL <= DISPATCH_LEVEL.
An intermediate or highest-level driver also can call IoBuildDeviceIoControlRequest, IoAllocateIrp, or IoBuildSychronousFsdRequest to set up requests it sends to lower-level drivers. Only a highest-level driver can call IoMakeAssociatedIrp.
IO_STACK_LOCATION, IoAllocateIrp, IoBuildDeviceIoControlRequest, IoBuildSynchronousFsdRequest, IoCallDriver, IoFreeIrp, IoMakeAssociatedIrp, IoSetCompletionRoutine, IRP