StartIo routine
The StartIo routine starts the I/O operation described by an IRP.
Syntax
DRIVER_STARTIO StartIo;
VOID StartIo(
__inout struct _DEVICE_OBJECT *DeviceObject,
__inout struct _IRP *Irp
)
{ ... }
Parameters
- DeviceObject [in, out]
-
Caller-supplied pointer to a DEVICE_OBJECT structure. This is the device object for the target device, previously created by the driver's AddDevice routine.
- Irp [in, out]
-
Caller-supplied pointer to an IRP structure that describes the requested I/O operation.
Return value
None
Remarks
A driver's StartIo routine executes in an arbitrary thread context at IRQL = DISPATCH_LEVEL.
The StartIo routine is optional. A driver's StartIo routine, if supplied, should be named XxxStartIo, where Xxx is a driver-specific prefix. The driver's DriverEntry routine must store the StartIo routine's address in DriverObject->DriverStartIo. (If no routine is supplied, this pointer must be NULL.)
A driver can use IoSetStartIoAttributes to set attributes on when its StartIo routine is called.
For detailed information about implementing a driver's StartIo routine, see Writing a StartIo Routine.
Examples
To define a StartIo callback routine that is named MyStartIo, you must first provide a function declaration that Static Driver Verifier (SDV) and other verification tools require, as shown in the following code example:
DRIVER_STARTIO MyStartIo;
Then, implement your callback routine as follows:
VOID
MyStartIo(
_Inout_ struct _DEVICE_OBJECT *DeviceObject,
_Inout_ struct _IRP *Irp
)
{
// Function body
}
The DRIVER_STARTIO function type is defined in the Wdm.h header file. For more information about SDV requirements for function declarations, see Declaring Functions Using Function Role Types for WDM Drivers.
Requirements
|
Header |
|
|---|---|
|
IRQL | Called at DISPATCH_LEVEL. |
Send comments about this topic to Microsoft
Build date: 4/2/2012