IoSetNextIrpStackLocation - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdm.h

VOID IoSetNextIrpStackLocation(
  [in, out] PIRP Irp
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdm-iosetnextirpstacklocation)

IoSetNextIrpStackLocation function

Description

The IoSetNextIrpStackLocation routine sets the IRP stack location in a driver-allocated IRP to that of the caller.

Parameters

Irp [in, out]

Pointer to the IRP whose stack location is to be set.

Remarks

In general, this routine is seldom used by drivers. It is primarily used by drivers that require their own stack location in an IRP that they have allocated, on their own, to send to another driver.

IoSetNextIrpStackLocation is generally not needed because either:

Care should be taken if this routine is called, especially when allocating the IRP with IoAllocateIrp or IoMakeAssociatedIrp. The writer of the allocating driver must remember that a caller-specific stack location is not included in the number of stack locations required by the lower-level drivers to which it sends IRPs with IoCallDriver. A driver must explicitly specify a stack location for itself in its call to IoAllocateIrp or IoMakeAssociatedIrp if it calls IoSetNextIrpStackLocation with the IRP returned by either routine.

A driver cannot call IoSetNextIrpStackLocation with any IRP it allocates by calling IoBuildAsynchronousFsdRequest, IoBuildDeviceIoControlRequest, or IoBuildSynchronousFsdRequest.

See also

IO_STACK_LOCATION

IoAllocateIrp

IoBuildAsynchronousFsdRequest

IoBuildDeviceIoControlRequest

IoBuildSynchronousFsdRequest

IoCallDriver

IoSetCompletionRoutine