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.
VOID
IoStartNextPacket(
IN PDEVICE_OBJECT DeviceObject,
IN BOOLEAN Cancelable
);
None
Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.
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.
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.