IoGetCurrentIrpStackLocation function

The IoGetCurrentIrpStackLocation routine returns a pointer to the caller's I/O stack location in the specified IRP.

Syntax

PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(
  _In_ PIRP Irp
);

Parameters

Irp

A pointer to the IRP.

Return Value

IoGetCurrentIrpStackLocation returns a pointer to an IO_STACK_LOCATION structure that contains the I/O stack location for the driver.

Remarks

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

   
Windows version Available starting with Windows 2000. Available starting with Windows 2000.
Target Platform Desktop
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.exe
IRQL Any level

See Also

IoSetNextIrpStackLocation

IRP

IoGetNextIrpStackLocation

IoCallDriver

IO_STACK_LOCATION

Send comments about this topic to Microsoft