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 CAPAPABILITIES 601
USB ENDPOINTS 602
WMI SUPPORT 603
PARAMETERS FOR THE INF FILE 604
NOW WHAT? 605
Index 607