Code Example: A Packet-Based Slave DMA Driver

This example is a skeleton of a packet-based driver for a generic slave DMA device. Although it doesn't actually manage a specific kind of hard-ware, it may help in understanding how these drivers work. The completecode for this example is included on the CD that accompanies this book and on the companion website


This excerpt from the driver-specific header file shows the changes that need to be made to the Device Extension structure.

 typedef struct _DEVICE_EXTENSION { ... PDMA_ADAPTER pDmaAdapter; ULONG mapRegisterCount; ULONG dmaChannel; // This is the "handle" assigned to the map registers // when the AdapterControl routine is called back PVOID mapRegisterBase; ...

Get Windows® 2000 Device Driver Book: A Guide for Programmers, Second Edition, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.