| A new Plug and Play device has been added. | |
| StartIo | A callback to handle IRPs serially. |
| Interrupt Service Routine (ISR) | Called to handle a hardware interrupt. Usually schedules a Deferred Procedure Call to do most interrupt servicing. |
| DpcForIsr | Deferred Procedure Call routine. Starts off another interrupt-driven transfer or completes an I/O request. |
| Critical section routine | Called to synchronize execution on one processor with no interrupts. Called by low IRQL tasks to interact with hardware |
| Cancel | Called to cancel an IRP |
| Completion | Called when a lower-level driver has completed processing an IRP. This lets the current driver do more work. |
| AdapterControl | Called when a DMA adapter channel is available. |
| ControllerControl | Called when a controller becomes free. NT and W2000 only. |
| Timer | A one-second timer callback. |
| CustomTimerDpc | For time-outs of less than one second. |
| CustomDpc | Usually used to handle work queues. |
| Reinitialize | Called if a driver takes a long time to initialize itself. |
| ConfigCallback | Query device hardware description callback. NT and W2000 only. |
| Plug and Play Notification | Called to notify you when devices have arrived, when the hardware profile changes, or when a device is being removed. |
| Callback | W2000 callback object handler |
A driver's DriverEntry routine must set up a series of callbacks for processing IRPs. It also sets the Unload, AddDevice, and StartIo routine callbacks, if these are needed. Table 2.2 shows the common Win32 device I/O functions and their corresponding IRPs. For example, a call to CreateFileends up as a create irp sent to your driver.
Table 2.2 Dispatch routine IRPs
| Win32 function | IRP |
|---|---|
| CreateFile | Create IRP |
| CloseHandle | Close IRP |
| ReadFile, etc. | Read IRP |
| WriteFile, etc. | Write IRP |
| DeviceIoControl | IOCTL IRP |
| Internal IOCTL IRP |
One common IRP cannot be generated from user mode code[1]. The Internal IOCTL IRP can only be generated from within the kernel. This allows drivers to
Вы читаете Writing Windows WDM Device Drivers
