Chapter 3  NT Objects and Support for Drivers

This chapter contains the following information:

3.1  NT Components and NT Drivers

3.2  Device Objects and Device Extensions

3.2.1  Defining Device Extensions

3.2.2  Creating a Device Object and Device Extension

3.2.3  Initializing Driver-specific Device Objects and Device Extensions

3.2.4  Setting Up Access to User Buffers

3.2.4.1  Using Buffered I/O

3.2.4.2  Using Direct I/O

3.2.4.3  Using Neither Direct Nor Buffered I/O

3.3  Adapter Objects and DMA

3.3.1  Map Registers

3.3.2  Getting an NT Adapter Object

3.3.3  Splitting Transfer Requests

3.3.4  Using System DMA

3.3.4.1  Packet-Based System DMA

3.3.4.2  Common-Buffer System DMA

3.3.5  Using Busmaster DMA

3.3.5.1  Packet-Based Busmaster DMA

3.3.5.2  Common-Buffer Busmaster DMA

3.4  Controller Objects

3.4.1  Creating a Controller Object with a Controller Extension

3.4.2  Allocating the Controller Object for I/O Operations

3.5  Interrupt Objects

3.5.1  Getting a System-assigned Interrupt Vector, DIRQL, and Processor Mask

3.5.2  Registering an ISR

3.6  DPC Objects

3.6.1  Registering and Queueing a DpcForIsr Routine

3.6.2  Registering and Queueing a CustomDpc Routine

3.7  Timer Objects with Associated DPCs

3.7.1  Registering and Enabling an IoTimer Routine

3.7.2  Registering and Queueing a CustomTimerDpc Routine

3.8  Device Queue Objects and Interlocked Queues

3.8.1  Setting up a Device Queue Object and Queueing IRPs

3.8.2  Setting up an Interlocked Queue and Queueing IRPs

3.9  Kernel Dispatcher Objects

3.9.1  Timer Objects

3.9.2  Event Objects

3.9.3  Semaphore Objects

3.9.4  Mutex Objects

All NT drivers use certain NT objects. For example, every NT driver except the SCSI and video miniport drivers, as explained in Chapter 2, must create and set up a named device object to represent each logical, virtual, and/or physical device for which it handles IRPs.

Only certain kinds of drivers are required to use particular NT objects, as also mentioned in Chapter 2. For example, whether a given driver uses an NT adapter object depends on whether its device uses DMA.

Use of other NT objects depends on the discretion of the driver designer.

This chapter describes the NT objects that NT drivers must and can use.