| Foreword | viii |
| Acknowledgments | ix |
| CHAPTER 1 INTRODUCTION | 1 |
| An Overview of the Operating Systems | 1 |
| Windows 2000 Drivers | 5 |
| Sample Code | 12 |
| Organization of This Book | 14 |
| Other Resources | 17 |
| Warning | 18 |
| CHAPTER 2 BASIC STRUCTURE OF A WDM DRIVER | 19 |
| Device and Driver Layering | 19 |
| The DriverEntry Routine | 44 |
| The AddDevice Routine | 48 |
| Windows 98 Compatibility Notes | 69 |
| CHAPTER 3 BASIC PROGRAMMING TECHNIQUES | 71 |
| The Kernel-Mode Programming Environment | 71 |
| Error Handling | 74 |
| Memory Management | 90 |
| String Handling | 111 |
| Miscellaneous Programming Techniques | 115 |
| Windows 98 Compatibility Notes | 129 |
| CHAPTER 4 SYNCHRONIZATION | 131 |
| An Archetypal Synchronization Problem | 132 |
| Interrupt Request Level | 134 |
| Spin Locks | 139 |
| Kernel Dispatcher Objects | 141 |
| Other Kernel-Mode Synchronization Primitives | 162 |
| CHAPTER 5 THE I/O REQUEST PACKET | 173 |
| Data Structures | 173 |
| The "Standard Model" for IRP Processing | 179 |
| Completing I/O Requests | 189 |
| Passing Requests Down to Lower Levels | 197 |
| Cancelling I/O Requests | 200 |
| Managing Your Own IRPs | 211 |
| Loose Ends | 217 |
| CHAPTER 6 PLUG AND PLAY | 221 |
| IRP_MJ_PNP Dispatch Function | 223 |
| Starting and Stopping Your Device | 225 |
| Managing PnP State Transitions | 236 |
| Other Configuration Functionality | 260 |
| Windows 98 Compatibility Notes | 287 |
| CHAPTER 7 READING AND WRITING DATA | 289 |
| Configuring Your Device | 289 |
| Addressing a Data Buffer | 293 |
| Ports and Registers | 298 |
| Servicing an Interrupt | 303 |
| Direct Memory Access | 320 |
| CHAPTER 8 POWER MANAGEMENT | 345 |
| The WDM Power Model | 346 |
| Managing Power Transitions | 353 |
| Additional Power Management Details | 387 |
| Windows 98 Compatibility Notes | 396 |
| CHAPTER 9 SPECIALIZED TOPICS | 399 |
| Filter Drivers | 399 |
| Logging Errors | 406 |
| I/O Control Operations | 414 |
| System Threads | 436 |
| Executive Work Items | 442 |
| Watchdog Timers | 446 |
| Windows 98 Compatibility Notes | 449 |
| CHAPTER 10 WINDOWS MANAGEMENT INSTRUMENTATION | 451 |
| WMI Concepts | 452 |
| WDM Drivers and WMI | 456 |
| User-Mode Applications and WMI | 475 |
| Windows 98 Compatibility Notes | 485 |
| CHAPTER 11 THE UNIVERSAL SERIAL BUS | 487 |
| Programming Architecture | 489 |
| Working with the Bus Driver | 510 |
| CHAPTER 12 INSTALLING DEVICE DRIVERS | 557 |
| The INF File | 558 |
| Defining a Device Class | 575 |
| Launching an Application | 581 |
| Windows 98 Compatibility Notes | 587 |
| Appendix A Coping with Windows 98 Incompatibilities | 589 |
| Defining Stubs for Kernel-Mode Routines | 589 |
| Determining the Operating System Version | 594 |
| Appendix B Using GENERIC.SYS | 595 |
| Appendix C Using WDMWIZ.AWX | 597 |
| Basic Driver Information | 597 |
| DeviceIoControl Codes | 599 |
| I/O Resources | 600 |
| Power Capabilities | 601 |
| USB Endpoints | 602 |
| WMI Support | 603 |
| Parameters for the INF File | 604 |
| Now What? | 605 |
| Index | 607 |