Export (0) Print
Expand All
Expand Minimize

IoCallDriver routine

The IoCallDriver routine sends an IRP to the driver associated with a specified device object.

Syntax


NTSTATUS IoCallDriver(
  _In_     PDEVICE_OBJECT DeviceObject,
  _Inout_  PIRP Irp
);

Parameters

DeviceObject [in]

Pointer to a device object, representing the target device for the requested I/O operation.

Irp [in, out]

Pointer to the IRP.

Return value

IoCallDriver returns the NTSTATUS value that a lower driver set in the I/O status block for the given request, or STATUS_PENDING if the request was queued for additional processing.

Remarks

Before calling IoCallDriver, the calling driver must set up the I/O stack location in the IRP for the target driver. For more information, see Passing IRPs Down the Driver Stack.

IoCallDriver assigns the DeviceObject input parameter to the DeviceObject member of the IO_STACK_LOCATION structure for the driver being called.

An IRP passed in a call to IoCallDriver becomes inaccessible to the higher-level driver, unless the higher-level driver has called IoSetCompletionRoutine to set up an IoCompletion routine for the IRP. If it has, the IRP input to the IoCompletion routine has its I/O status block set by the lower drivers, and all lower-level drivers' I/O stack locations are filled with zeros.

Drivers for Windows Server 2003, Windows XP, and Windows 2000 must use PoCallDriver rather than IoCallDriver to pass power IRPs (IRP_MJ_POWER). For more information, see Calling IoCallDriver vs. Calling PoCallDriver.

Requirements

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

<= DISPATCH_LEVEL

DDI compliance rules

CompleteRequestStatusCheck, CompletionRoutineRegistered, DeleteDevice, ForwardedAtBadIrql, ForwardedAtBadIrqlAllocate, ForwardedAtBadIrqlFsdAsync, ForwardedAtBadIrqlFsdSync, IoAllocateForward, IoAllocateIrpSignalEventInCompletionTimeout, IoBuildDeviceControlWait, IoBuildDeviceControlWaitTimeout, IoBuildFsdForward, IoBuildSynchronousFsdRequestWait, IoBuildSynchronousFsdRequestWaitTimeout, IoSetCompletionRoutineExCheck, IrpProcessingComplete, LowerDriverReturn, MarkDevicePower, MarkingQueuedIrps, MarkIrpPending, MarkIrpPending2, MarkPower, MarkPowerDown, MarkQueryRelations, MarkStartDevice, PendedCompletedRequest, PendedCompletedRequest2, PendedCompletedRequest3, PendedCompletedRequestEx, PnpIrpCompletion, PowerDownFail, PowerUpFail, RemoveLockForward, RemoveLockForward2, RemoveLockForwardDeviceControl, RemoveLockForwardDeviceControl2, RemoveLockForwardDeviceControlInternal, RemoveLockForwardDeviceControlInternal2, RemoveLockForwardRead, RemoveLockForwardRead2, RemoveLockForwardWrite, RemoveLockForwardWrite2, RemoveLockMnRemove2, RemoveLockMnSurpriseRemove, RemoveLockQueryMnRemove, TargetRelationNeedsRef, WmiForward, HwStorPortProhibitedDDIs

See also

IoAllocateIrp
IoBuildAsynchronousFsdRequest
IoBuildDeviceIoControlRequest
IoBuildSynchronousFsdRequest
IoSetCompletionRoutine
PoCallDriver

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft