IoStartNextPacket - NtDoc

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

VOID IoStartNextPacket(
  [in] PDEVICE_OBJECT DeviceObject,
  [in] BOOLEAN        Cancelable
);

View the official Windows Driver Kit DDI reference
// wdm.h

VOID IoStartNextPacket(
  [in] PDEVICE_OBJECT DeviceObject,
  [in] BOOLEAN        Cancelable
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-ntifs-iostartnextpacket)

IoStartNextPacket function (ntifs.h)

Description

The IoStartNextPacket routine dequeues the next IRP, if any, from the given device object's associated device queue and calls the driver's StartIo routine.

Parameters

DeviceObject [in]

Pointer to the device object for which the IRP is to be dequeued.

Cancelable [in]

Specifies whether IRPs in the device queue can be canceled.

Remarks

If there are no IRPs currently in the device queue for the target DeviceObject, this routine simply returns control to the caller.

If the driver passed a pointer to a cancel routine when it called IoStartPacket, it should pass TRUE in this routine's Cancelable parameter. If Cancelable is TRUE, the I/O manager will use the cancel spin lock to protect the device queue and the current IRP.

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

Drivers that call IoStartNextPacket from their StartIo routine should be aware of recursion issues. If a driver can call IoStartNextPacket on a large number of requests in succession from its StartIo routine (for example, when a device error occurs and the driver is clearing out it device queue), you should set the DeferredStartIo attribute for the device by using IoSetStartIoAttributes routine. This attribute ensures that the next packet will not be issued until the previous StartIo call returns.

Callers of IoStartNextPacket must be running at IRQL = DISPATCH_LEVEL. Usually, this routine is called from a device driver's DpcForIsr or CustomDpc routine, both of which are run at IRQL = DISPATCH_LEVEL.

See also

DEVICE_OBJECT

IoSetStartIoAttributes

IoStartNextPacketByKey

IoStartPacket


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

IoStartNextPacket function (wdm.h)

Description

The IoStartNextPacket routine dequeues the next IRP, if any, from the given device object's associated device queue and calls the driver's StartIo routine.

Parameters

DeviceObject [in]

Pointer to the device object for which the IRP is to be dequeued.

Cancelable [in]

Specifies whether IRPs in the device queue can be canceled.

Remarks

If there are no IRPs currently in the device queue for the target DeviceObject, this routine simply returns control to the caller.

If the driver passed a pointer to a cancel routine when it called IoStartPacket, it should pass TRUE in the Cancelable parameter. If Cancelable is TRUE, the I/O manager will use the cancel spin lock to protect the device queue and the current IRP.

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

Drivers that call IoStartNextPacket from their StartIo routine should be aware of recursion issues. If a driver can call IoStartNextPacket on a large number of requests in succession from its StartIo routine (for example, when a device error occurs and the driver is clearing out it device queue), you should set the DeferredStartIo attribute for the device by using IoSetStartIoAttributes routine. This attribute ensures that the next packet will not be issued until the previous StartIo call returns.

Callers of IoStartNextPacket must be running at IRQL = DISPATCH_LEVEL. Usually, this routine is called from a device driver's DpcForIsr or CustomDpc routine, both of which are run at IRQL = DISPATCH_LEVEL.

See also

DEVICE_OBJECT

IoSetStartIoAttributes

IoStartNextPacketByKey

IoStartPacket