1.3.1  Driver Routines and I/O Objects

KeSynchronizeExecution

Synchronizes the execution of a driver-supplied SynchCritSection routine with that of the ISR associated with a set of interrupt objects, given a pointer to the interrupt object(s).

IoRequestDpc

Queues a driver-supplied DpcForIsr routine to complete interrupt-driven I/O processing at a lower IRQL.

KeInsertQueueDpc

Queues a DPC to be executed as soon as the IRQL of a processor drops below DISPATCH_LEVEL; returns FALSE if the DPC object is already queued.

KeRemoveQueueDpc

Removes a given DPC object from the DPC queue; returns FALSE if the object was not in the queue.

IoAllocateAdapterChannel

Connects a device object to an adapter object and calls a driver-supplied AdapterControl routine to carry out an I/O operation through the system DMA controller or a busmaster adapter as soon as the appropriate DMA channel is available and/or any necessary map registers are available. (This routine reserves exclusive access to a DMA channel and/or map registers for the specified device.)

IoFreeAdapterChannel

Releases an adapter object, representing a system DMA channel, and optionally releases map registers, if any were allocated.

IoFreeMapRegisters

Releases a set of map registers, saved from a call to IoAllocateAdapterChannel, after the registers have been used by IoMapTransfer and the busmaster DMA transfer is complete.

IoAllocateController

Connects a device object to a controller object and calls a driver-supplied ControllerControl routine to carry out an I/O operation on the device controller as soon as the controller is not busy. (This routine reserves exclusive access to the hardware controller for the specified device.)

IoFreeController

Releases a controller object, provided that all device operations queued to the controller for the current IRP have completed.

IoStartTimer

Enables the timer for a given device object and calls the driver-supplied IoTimer routine once per second thereafter.

IoStopTimer

Disables the timer for a given device object so the driver-supplied IoTimer routine is not called unless the driver re-enables the timer.

KeSetTimer

Sets the absolute or relative interval at which a timer object will be set to the Signaled state and optionally supplies a timer DPC to be executed when the interval expires.

KeSetTimerEx

Sets the absolute or relative interval at which a timer object will be set to the Signaled state, optionally supplies a timer DPC to be executed when the interval expires, and optionally supplies a recurring interval for the timer.

KeCancelTimer

Cancels a timer object before the interval passed to KeSetTimer expires; dequeues a timer DPC before the timer interval, if any was set, expires.

KeReadStateTimer

Returns whether a given timer object is set to the Signaled state.

IoStartPacket

Calls the driver’s StartIo routine with the given IRP for the given device object or inserts the IRP into the device queue if the device is already busy, specifying whether the IRP is cancelable.

IoStartNextPacket

Dequeues the next IRP for a given device object, specifying whether the IRP is cancelable, and calls the driver’s StartIo routine.

IoStartNextPacketByKey

Dequeues the next IRP, according to the specified sort-key value, for a given device object, specifies whether the IRP is cancelable, and calls the driver’s StartIo routine.

IoSetCompletionRoutine

Registers a driver-supplied IoCompletion routine with a given IRP, so the IoCompletion routine is called when the next-lower-level driver has completed the requested operation in one or more of the following ways: successfully, with an error, and/or by cancelling the IRP.

IoSetCancelRoutine

Sets or clears the Cancel routine in an IRP. Setting a Cancel routine makes an IRP cancelable.

KeStallExecutionProcessor

Stalls the caller (a device driver) for a given interval on the current processor.

ExAcquireResourceExclusiveLite

Acquires an initialized resource for exclusive access by the calling thread and optionally waits for the resource to be acquired.

ExTryToAcquireResourceExclusiveLite

Either acquires a given resource for exclusive access immediately or returns FALSE.

ExAcquireResourceSharedLite

Acquires an initialized resource for shared access by the calling thread and optionally waits for the resource to be acquired.

ExAcquireSharedStarveExclusive

Acquires a given resource for shared access without waiting for any pending attempts to acquire exclusive access to the same resource.

ExAcquireSharedWaitForExclusive

Acquires a given resource for shared access, optionally waiting for any pending exclusive waiters to acquire and release the resource first.

ExReleaseResourceForThreadLite

Releases a given resource that was acquired by the given thread.

ZwReadFile

Reads data from an open file. If the caller opened the file object with certain parameters, the caller can wait on the file handle for completion of the I/O.

ZwWriteFile

Writes data to an open file. If the caller opened the file object with certain parameters, the caller can wait on the file handle for completion of the I/O.