I/O Manager Routines


Windows Driver Kit: Kernel-Mode Driver Architecture
IoGetCurrentIrpStackLocation

The IoGetCurrentIrpStackLocation routine returns a pointer to the caller's stack location in the given IRP.

PIO_STACK_LOCATION 
  IoGetCurrentIrpStackLocation(
    IN PIRP  Irp
    );

Parameters

Irp
Pointer to the IRP.

Return Value

The routine returns a pointer to the I/O stack location for the driver.

Comments

Every driver must call IoGetCurrentIrpStackLocation with each IRP it is sent in order to get any parameters for the current request. Unless a driver supplies a dispatch routine for each IRP_MJ_XXX code that the driver handles, the driver also must check its I/O stack location in the IRP to determine what operation is being requested.

If a driver is passing the same parameters that it received to the next-lower driver, it should call IoCopyCurrentIrpStackLocationToNext or IoSkipCurrentIrpStackLocation instead of getting a pointer to the next-lower stack location and copying the parameters manually.

Requirements

IRQL: Any level

Headers: Declared in Wdm.h. Include Wdm.h, Ntddk.h, or Ntifs.h.

See Also

IO_STACK_LOCATION, IoCallDriver, IoGetNextIrpStackLocation, IoSetNextIrpStackLocation


Send feedback on this topic
Built on October 01, 2009
Page view tracker