IoStartPacket function

The IoStartPacket routine calls the driver's StartIo routine with the given IRP or inserts the IRP into the device queue associated with the given device object if the device is already busy.

Syntax

void IoStartPacket(
  PDEVICE_OBJECT DeviceObject,
  PIRP           Irp,
  PULONG         Key,
  PDRIVER_CANCEL CancelFunction
);

Parameters

DeviceObject

Pointer to the target device object for the IRP.

Irp

Pointer to the IRP to be processed.

Key

Pointer to a value that determines where to insert the packet into the device queue. If this is zero, the packet is inserted at the tail of the device queue.

CancelFunction

Specifies the entry point for a driver-supplied Cancel routine.

Return Value

None

Remarks

If the driver is already busy processing a request for the target device object, then the packet is queued in the device queue. Otherwise, this routine calls the driver's StartIo routine with the specified IRP.

If a non-NULL CancelFunction pointer is supplied, it is set in the IRP so the driver's Cancel routine is called if the IRP is canceled before its completion.

Drivers that do not have a StartIo routine cannot call IoStartPacket.

Callers of IoStartPacket must be running at IRQL <= DISPATCH_LEVEL. Usually, this routine is called from a device driver's Dispatch routine at IRQL = PASSIVE_LEVEL.

Requirements

   
Minimum supported client Available starting with Windows 2000.
Target Platform Universal
Header ntifs.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL "<= DISPATCH_LEVEL (see Remarks section)"

See Also

DEVICE_OBJECT

IoMarkIrpPending

IoSetCancelRoutine

IoStartNextPacket

IoStartNextPacketByKey