You are previewing Windows® 2000 Device Driver Book: A Guide for Programmers, Second Edition, The.
O'Reilly logo
Windows® 2000 Device Driver Book: A Guide for Programmers, Second Edition, The

Book Description

  • The #1 Windows device driver book—fully updated for Windows 2000!

  • Step-by-step planning, implementation, testing, debugging, installation, and distribution

  • Complete coverage of the new Windows Driver Model (WDM)

  • Practical debugging and interactive troubleshooting

  • CD-ROM: Exclusive tools for streamlining driver development, plus extensive C/C++ sample driver library!

  • Windows Driver Model (WDM) for Windows 2000 and 98—in depth!

  • Building drivers that support Plug-and-Play and Power Management

  • Windows Management Instrumentation: logging device errors and events—and interpreting them

  • Constructing safe reentrant driver code

  • Handling time-out conditions safely and effectively

  • Advanced techniques: kernel-mode threads, layered drivers, and more

  • Start-to-finish debugging and troubleshooting techniques

  • Foreword by Andrew Scoppa, UCI Corporation

    The #1 book on Windows driver development—totally updated for Windows 2000!

    With The Windows 2000 Device Driver Book, any experienced Windows programmer can master driver development start to finish: planning, implementation, testing, debugging, installation, and distribution. Totally updated to reflect Microsoft's Windows Driver Model (WDM) for Windows 2000 and 98, this programming bestseller covers everything from architecture to tools, and includes a powerhouse library of exclusive tools and code for streamlining any driver development project.

    You'll start with a high-level overview of WDM components and then move quickly into the details of the development environment and driver installation. Next, master the Windows 2000 I/O Manager, its data structures, and its interaction with drivers. Using extensive practical examples, you'll implement Plug-and-Play and Power Management; construct safe reentrant driver code; use Windows Management Instrumentation to log errors and events, and more.

    The book covers today's most advanced Windows driver development techniques and provides extensive debugging guidance, including crash dump analysis using WinDbg; lists of common bugcheck codes, meanings, and probable causes; and much more.

    About the CD-ROM

    Bonus CD-ROM contains powerful resources for streamlining device driver development!

  • An exclusive Device Driver AppWizard that works with Visual Studio to instantly create your driver's framework

  • A library of complete sample drivers

  • C++ classes to jumpstart any project-including a Unicode string handling class that eliminates tedious, repetitive code

  • An exclusive Driver Installation Utility to simplify initial testing

  • UCI

    UCI Software Training Centers specializes in high-end developer, systems, and Internet Training on Microsoft products and technologies. For more information about training in this topic and others, UCI can be reached at 800-884-1772, or on the Web at

    Table of Contents

    1. Copyright
    2. Foreword
    3. Preface
    4. About the CD-ROM
    5. Introduction to Windows 2000 Drivers
      1. Overall System Architecture
      2. Kernel-Mode I/O Components
      3. Special Driver Architectures
      4. Summary
    6. The Hardware Environment
      1. Hardware Basics
      2. Buses and Windows 2000
      3. Hints for Working with Hardware
      4. Summary
    7. Kernel-Mode I/O Processing
      1. How Kernel-Mode Code Executes
      2. Use of Interrupt Priorities by Windows 2000
      3. Deferred Procedure Calls (DPCs)
      4. Access to User Buffers
      5. Structure of a Kernel-Mode Driver
      6. I/O Processing Sequence
      7. Summary
    8. Drivers and Kernel-Mode Objects
      1. Data Objects and Windows 2000
      2. I/O Request Packets (IRPs)
      3. Driver Objects
      4. Device Objects and Device Extensions
      5. Controller Objects and Controller Extensions
      6. Adapter Objects
      7. Interrupt Objects
      8. Summary
    9. General Development Issues
      1. Driver Design Strategies
      2. Coding Conventions and Techniques
      3. Driver Memory Allocation
      4. Unicode Strings
      5. Interrupt Synchronization
      6. Synchronizing Multiple CPUs
      7. Linked Lists
      8. Summary
    10. Initialization and Cleanup Routines
      1. Writing a DriverEntry Routine
      2. Code Example: Driver Initialization
      3. Writing Reinitialize Routines
      4. Writing an Unload Routine
      5. Code Example: Driver Unload
      6. Writing Shutdown Routines
      7. Testing the Driver
      8. Summary
    11. Driver Dispatch Routines
      1. Announcing Driver Dispatch Routines
      2. Writing Driver Dispatch Routines
      3. Processing Read and Write Requests
      4. Code Example: A Loopback Device
      5. Extending the Dispatch Interface
      6. Testing Driver Dispatch Routines
      7. Summary
    12. Interrupt-Driven I/O
      1. How Programmed I/O Works
      2. Driver Initialization and Cleanup
      3. Writing a Start I/O Routine
      4. Writing an Interrupt Service Routine (ISR)
      5. Writing a DpcForIsr Routine
      6. Some Hardware: The Parallel Port
      7. Code Example: Parallel Port Loopback Driver
      8. Testing the Parallel Port Loopback Driver
      9. Summary
    13. Hardware Initialization
      1. The Plug and Play Architecture: A Brief History
      2. The Role of the Registry for Legacy Drivers
      3. Detecting Devices with Plug and Play
      4. The Role of Driver Layers in Plug and Play
      5. The New WDM IRP Dispatch Functions
      6. Device Enumeration
      7. Device Interfaces
      8. Code Example: A Simple Plug and Play Driver
      9. Summary
    14. Power Management
      1. Hot Plug Devices
      2. OnNow Initiative
      3. Wake Requests
      4. Power Management Issues
      5. Summary
    15. Timers
      1. Handling Device Timeouts
      2. Code Example: Catching Device Timeouts
      3. Managing Devices without Interrupts
      4. Code Example: A Timer-Based Driver
      5. Summary
    16. DMA Drivers
      1. How DMA Works under Windows 2000
      2. Working with Adapter Objects
      3. Writing a Packet-Based Slave DMA Driver
      4. Code Example: A Packet-Based Slave DMA Driver
      5. Writing a Packet-Based Bus Master DMA Driver
      6. Writing a Common Buffer Slave DMA Driver
      7. Writing a Common Buffer Bus Master DMA Driver
      8. Summary
    17. Windows Management and Instrumentation
      1. WMI: The Industry Picture
      2. The WMI Architecture
      3. WMI Summary
      4. Conventional Driver Event Logging
      5. Summary
    18. System Threads
      1. Definition and Use of System Threads
      2. Thread Synchronization
      3. Using Dispatcher Objects
      4. Code Example: A Thread-Based Driver
      5. Summary
    19. Layered Drivers
      1. An Overview of Intermediate Drivers
      2. Writing Layered Drivers
      3. Writing I/O Completion Routines
      4. Allocating Additional IRPs
      5. Writing Filter Drivers
      6. Code Example: A Filter Driver
      7. Writing Tightly Coupled Drivers
      8. Summary
    20. Driver Installation
      1. Installation of a Driver
      2. Auto-Install Using INF Files
      3. Using a Driver INF File
      4. Controlling Driver Load Sequence
      5. Digital Signing of a Driver
      6. Summary
    21. Testing and Debugging Drivers
      1. Guidelines for Driver Testing
      2. Why Drivers Fail
      3. Reading Crash Screens
      4. An Overview of WinDbg
      5. Analyzing a Crash Dump
      6. Interactive Debugging
      7. Writing WinDbg Extensions
      8. Code Example: A WinDbg Extension
      9. Miscellaneous Debugging Techniques
      10. Summary
    22. The Driver Debug Environment
      1. Hardware and Software Requirements
      2. Debug Symbol Files
      3. Enabling Crash Dumps on the Target System
      4. Enabling the Target System's Debug Client
    23. Bugcheck Codes
    24. Building Drivers
      1. The Build Utility
      2. Using Visual Studio to Build Drivers
    25. Bibliography