Training
Certifications
Books
Special Offers
Community




 
Programming the Microsoft® Windows® Driver Model
Author Walter Oney
Pages 640
Disk 1 Companion CD(s)
Level Intermediate
Published 10/13/1999
ISBN 9780735605886
ISBN-10 0-7356-0588-2
Price(USD) $49.99
To see this book's discounted price, select a reseller below.
 

More Information

About the Book
Table of Contents
Sample Chapter
Index
Related Series
Related Books
About the Author

Support: Book & CD

Rate this book
Barnes Noble Amazon Quantum Books

 

Index


Contents
Note: Page numbers in italics refer to figures or tables.

Special Characters
16-bit Windows applications, I/O operations in, 4-5, 4
64-bit types, 37
1394 devices, 570-71
\?? directory, 52, 53, 57, 70

A
AbortPendingJobs function, 434
AbortRequests function, 238, 259
accessible members, 9
ACPI (Advanced Configuration and Power Interface), 491
AcquireRemoveLock function, 250
AdapterControl routine, 11, 11, 329-30, 333-35, 339
adapter object data structure, 321
AddDevice routine, 21, 48-49, 75, 95, 96, 219, 226, 246, 294, 333, 387-88, 387, 402, 403-6, 446, 456, 514
    creating device objects, 49-51
    introduced, 11, 11
    naming devices
        deciding whether to name or not, 54-56
        device interfaces and, 57-63, 59
        introduced, 51-52, 51
        name creation, 56-57
        symbolic links, 52-54, 53
    other global device initialization
        building the device stack, 68
        clearing the DO_DEVICE_INITIALIZING flag, 68
        initializing default DPC objects, 66
        initializing device extensions, 64-65
        initializing device flags, 67
        introduced, 63-64
        miscellaneous objects, 67
        setting buffer alignment masks, 66-67
        setting initial power states, 68
    status codes in, 75
AddPage function, 577
AddRef method, 476-77
Advanced Configuration and Power Interface (ACPI), 491
Advanced Power Management (APM), 491
Advanced RISC Computing (ARC) architecture, 54
AllocateAdapterChannel function pointer, 321
AllocateAdapterChannel routine, 326-29, 335, 341
AllocateCommonBuffer function pointer, 321
AllocateCommonBuffer routine, 340, 341-42
AllocateFrom functions, 110, 110, 111
alloc_text pragma, 95, 96
AllowRequests function, 238, 260
Anchor Chips USB set, 488-89
ANSI_STRING data structure, 112, 112, 114
ANSI strings, 112-14, 112, 113
AnswerMethod routine, 472
APC_LEVEL IRQL, 135, 135, 162, 164, 192-93, 215, 218
APCs. See asynchronous procedure calls (APCs)
APM (Advanced Power Management), 491
arbitrary thread context, 10, 142
ARC (Advanced RISC Computing) architecture, 54
AreRequestsBeingAborted function, 238, 259-60, 318
arithmetic
    floating-point, 126-27
    interlocked, 164-68, 165
ASSERT macros, 128
asynchronous kernel-mode drivers, 9-10
asynchronous procedure calls (APCs)
    I/O requests and, 160-61
    IRQL and, 135
    thread alerts and, 159-62
AutoLaunch service, 581-87, 588

B
blue screen of death (BSOD), 89-90, 89
books about driver development, 17
BSOD (blue screen of death), 89-90, 89
buffer alignment masks, 66-67
bug checks, 74, 89-90, 89
bulk transfer pipe management, 524-32
bulk transfers, 488, 493, 500-501, 501
bus, defined, 20-21
bus address, 340
bus drivers, 10
bus-master DMA operations, 342-44

C
CacheControlRequest function, 430, 431-34
CancelDeviceWakeupRequest API function, 391
CancelIo routine, 200, 430
CancelRequest function, 238, 239, 256-57
CDeviceList class, 61-63
CDeviceListEntry class, 61-63
CDeviceList::Initialize function, 62-63
CD-ROM, 12-13, 13. See also GENERIC.SYS library; sample code; WDMWIZ.AWX wizard
CFGMGR32 set of APIs, 574
CheckBusyAndStall function, 238, 242, 252, 254, 256
CheckTimer routine, 447, 448
CHKINF utility, 574
CIM (Common Information Model), 452
class drivers, 5, 6, 10-11
class keys, 24, 27-28, 28, 69
CleanupControlRequests function, 434
CleanupRequests function, 238, 257-58
CLOCK1_LEVEL IRQL, 135
CLOCK2_LEVEL IRQL, 135
CloseHandle routine, 415
CM_PARTIAL_RESOURCE_DESCRIPTOR data structure, 290, 290
CM_PARTIAL_RESOURCE_LIST data structure, 290, 290
CM_RESOURCE_LIST data structure, 231, 231
CoCreateInstance routine, 477-78
code. See sample code
code_seg pragma, 96
CoInitializeEx routine, 480
COM (Component Object Model) interfaces, 476-78
common buffer, 322, 339-42
Common Information Model (CIM), 452
companion disc, 12-13, 13. See also GENERIC.SYS library; sample code; WDMWIZ.AWX wizard
compatibility. See Microsoft Windows 98 compatibility notes
compile-time control of pagability, 94-96
CompleteMain routine, 360
CompleteRequest function, 86, 190
Component Object Model (COM) interfaces, 476-78
configuration descriptors, 503, 506-7, 507
ConnectServer method, 477, 480
CONTAINING_RECORD macro, 103, 103, 170
controller and multifunction devices
    creating child device objects, 267-68
    handling child device resources, 277
    handling device removal, 274
    handling IRP_MN_QUERY_DEVICE_RELATIONS minor function code, 276
    handling IRP_MN_QUERY_ID minor function code, 275-76
    introduced, 265-66
    overall architecture, 266
    PDO handling of PnP requests, 270-74, 270
    telling the PnP Manager about our children, 268-70
control pipes, 492
control requests, 534-36, 536, 537
controls, standard, 475, 475
control transfers, 488, 493, 496-500, 498, 499
CoUninitialize routine, 480
CreateEvent routine, 429
CreateFile routine, 208, 324, 415, 541
CreateInstanceEnum routine, 481
CreateInterruptUrb routine, 533
CreateProcess routine, 585
CreatePropertySheetPage routine, 577-78

D
D0, D1, D2, and D3 states, 347-48, 347
data blobs, 114-15, 115
data blocks, standard, 474-75, 474
data buffers, addressing
    buffered method, 293, 294-95
    direct method, 293, 295-98, 296, 296-97
    introduced, 293-94, 293
    neither method, 293, 298
data phase, 494-95, 495
data_seg pragma, 95, 96
dates, timestamps and, 144-45
DbgPrint routine, 127
DbgView utility, 127-28
debugging. See also errors
    Driver Verifier for, 94
    making debugging easier, 127-28
DefaultPnpHandler routine, 263
deferred procedure calls (DPCs), 11, 11, 185-86
    custom DPC objects, 312-13
    importance of, 312
    initializing default DPC objects, 66
    introduced, 308-10, 309
    notification timers used with, 155-56
    scheduling, 310-12
DefineDosDevice routine, 53
Delete functions, 110, 110, 111
DeleteInterruptUrb routine, 533
DeregisterAllInterfaces routine, 234
DestroyContextStructure routine, 551
device and driver layering
    device objects, 38-44, 39, 40, 41-43 (see also filter device objects (FiDOs); functional device objects (FDOs); physical device objects (PDOs))
    driver objects, 35-38, 35, 36, 37
    introduced, 19-22, 20
    system driver loading, 30
        device object interrelations, 30-32, 31, 32, 33
        device stack examination, 33, 34
        introduced, 22
        recursive enumeration, 22-23, 23
        role of the registry, 24-29, 24, 26, 28, 29
DEVICE_CAPABILITIES data structure, 367-68, 368
device descriptors, 503-6, 503, 505
DEVICE_EXTENSION data structure, 64-65
device extensions, initializing, 64-65
device flags, initializing, 67
device identifiers, 566-71, 568
device initialization, global
    building the device stack, 68
    clearing the DO_DEVICE_INITIALIZING flag, 68
    initializing default DPC objects, 66
    initializing device extensions, 64-65
    initializing device flags, 67
    introduced, 63-64
    miscellaneous objects, 67
    setting buffer alignment masks, 66-67
    setting initial power states, 68
DEVICE_INTERFACE_CHANGE_NOTIFICATION data structure, 283-84
device interfaces, 57-63, 59
    enumerating, 61-63
DeviceIoControl API function, 175, 285, 287, 415-18, 416, 525, 535
device IRQL (DIRQL), 8, 135, 170
device naming
    deciding whether to name or not, 54-56
    device interfaces and, 57-63, 59
    introduced, 51-52, 51
    name creation, 56-57
    symbolic links, 52-54, 53
DEVICE_OBJECT data structure, 38-44, 39, 40, 41-43
device object pointers, 219-20
device objects, 38-44, 39, 40, 41-43. See also filter device objects (FiDOs); functional device objects (FDOs); physical device objects (PDOs)
    creating, 49-51
device properties, 588
device stack
    building, 68
    examining with DevView, 33, 34
    implementing, 43-44
device types, unimplemented, 70
device version numbering, 505
DEVQUEUE object
    aborting requests, 259-60
    awaiting the current IRP, 258-59
    cancelling IRPs, 256-58
    dequeuing IRPs, 254-56
    initializing, 251-52
    introduced, 236-37, 236, 237
    queuing IRPs, 252-54
    stalling the IRP queue, 252
    using for IRP queuing and cancellation, 237-40, 238
    using with PnP requests, 240-50, 245
DEVVIEW utility
    introduced, 33, 34
    viewing namespaces with, 51, 51
direct memory access (DMA)
    bus-master operations, 342-44
    introduced, 320-21, 320, 321
    packet-based, 323
    performing DMA transfers
        introduced, 323-32, 325-26
        using GetScatterGatherList routine, 335-37
        using scatter/gather lists, 322, 332-35
        using the system controller, 322, 337-39
    simple bus-master device, 342-44
    slave, 322, 337-39, 340-41
    transfer strategies, 321-23, 323
    using a common buffer, 322, 339-42
DIRQL (device IRQL), 8, 135, 170
disc, 12-13, 13. See also GENERIC.SYS library; sample code; WDMWIZ.AWX wizard
DispatchAny routine, 402
DispatchCleanup routine, 211, 257
DispatchClose routine, 210
DispatchControl function, 434
DispatchCreate routine, 210, 249
DISPATCH_LEVEL IRQL, 8, 93, 100, 126, 134, 135, 135, 136, 136, 137, 138, 139, 140, 141, 143, 145, 147, 148, 149, 153, 165, 170, 171, 183, 188, 192-93, 219, 264-65, 308, 310, 353, 388, 397, 406, 427, 442
DispatchPnP function, 95, 96, 132-33, 405
DispatchPower routine, 94
dispatch routines, IRP
    duties of, 182-83
    forwarding IRPs to, 181-82
DispatchXxx functions, 182
Distributed Management Task Force (DMTF), 452
divisor latch, 307-8
DLLs. See dynamic-link libraries (DLLs)
DmaExecutionRoutine routine, 336
DmaOperations data structure, 321, 321
DMTF (Distributed Management Task Force), 452
DO_DEVICE_INITIALIZING flag, 68
DoEnvironmentSubst API function, 579
DO_POWER_PAGABLE flag, 353, 396-97, 406
doubly-linked lists, 104-6, 104
DpcForIsr routine, 185, 248, 317, 319, 330-32, 336, 339
DPCs. See deferred procedure calls (DPCs)
DpcSpecial function, 186
DriverEntry routine
    differences in Windows 98 and Windows 2000 call, 69
    driver reinitialization routine, 48
    DriverUnload function, 47
    introduced, 11, 11, 44-45, 402-3, 460
    IRPs and, 181
    overview, 45-47
    section placement and, 96
    status codes in, 75
DRIVER_EXTENSION data structure, 37, 37
driver layering. See device and driver layering
DRIVER_OBJECT data structure, 35-38, 35, 36, 37
driver objects, 35-38, 35, 36, 37
DriverUnload routine, 47, 111, 282, 402
Driver Verifier feature of Windows 2000, 94
DUMPBIN utility, 96
dynamic-link libraries (DLLs)
    GENERIC.SYS, 14, 354-55
    WMILIB, 457, 459-60, 485

E
endpoint descriptors, 503, 508-9, 508, 509
endpoints, 492, 496, 496
enumerating device interfaces, 61-63
enumeration, recursive, 22-23, 23
EnumPropPages routine, 577
error handling. See also structured exception handling
    bug checks, 74, 89-90, 89
    introduced, 74
    status codes, 45, 75-77, 75
errors. See also debugging
    errata page for, 17
    logging
        creating error log packets, 406, 408-10, 408
        creating message files, 406, 410-14, 411
        introduced, 406-7, 407
        Windows 98 compatibility notes, 449
EVENTLOG sample, 409, 411-13, 414
ExAcquireFastMutex function, 163, 163, 164
ExAcquireFastMutexUnsafe function, 163, 163, 164
ExAllocateFromNPagedLookasideList function, 110, 110, 111
ExAllocateFromPagedLookasideList function, 110, 110, 111
ExAllocatePool function, 91, 99-100, 100, 101, 539
ExAllocatePoolWithQuota function, 102
ExAllocatePoolWithQuotaTag function, 102
ExAllocatePoolWithTag function, 101-2
exception frames, 77, 79
exception handlers, 79
exceptions, raising, 85-86, 85
__except statement, 79, 81-83, 82, 85
exclusive devices, 50
ExDeleteNPagedLookasideList function, 110, 110, 111
ExDeletePagedLookasideList function, 110, 110, 111
ExecMethod routine, 483
ExecNotificationQueryAsync routine, 483
ExecNotificationQuery routine, 482, 483
ExecuteMethod routine, 472-73
executive work items, 442-45
ExFreePool routine, 86, 91, 100-101, 444, 522
ExFreeToNPagedLookasideList function, 110, 110, 111
ExFreeToPagedLookasideList function, 110, 110, 111
ExGetPreviousMode routine, 162
ExInitializeFastMutex function, 163, 163
ExInitializeNPagedLookasideList function, 110, 110
ExInitializePagedLookasideList function, 110, 110
ExInitializeWorkItem function, 443
ExInterlockedAddLargeInteger function, 165, 167-68
ExInterlockedAddLargeStatistic function, 165, 168
ExInterlockedAddUlong function, 165, 168
ExInterlockedCompareExchange64 function, 165, 168
ExInterlockedInsertHeadList function, 311
ExInterlockedRemoveHeadList function, 435
ExInterlockedXxx functions, 165, 167-68, 170-71, 210
Ex prefix (executive), 72
ExQueueWorkItem function, 444
ExRaiseAccessViolation function, 85
ExRaiseDatatypeMisalignment function, 85
ExRaiseStatus function, 85
ExReleaseFastMutex function, 163, 164
ExReleaseFastMutexUnsafe function, 163, 164
extern "C" declaration, 95
ExTryToAcquireFastMutex function, 163, 164

F
fast mutex objects, 162-64, 162-63, 163
FDO drivers, 21
FDOs. See functional device objects (FDOs)
FEATURE sample, 534-35
FiDOs. See filter device objects (FiDOs)
file objects, 210
files
    accessing
        creating or rewriting files, 124-25
        introduced, 123
        opening existing files for reading, 124
        ZwXxx routine problems, 129
    timing of file operations, 126
file system driver (FSD), 6, 180
filter device objects (FiDOs)
    acronym for, 20
    device object interrelations, 30-32, 31, 32, 33
    introduced, 19, 20, 21
filter drivers
    AddDevice routine, 403-6
    DriverEntry routine, 402-3
    introduced, 10, 399-401, 400, 401, 402
    lower, 400-401, 401, 402
    upper, 400, 400
FilterResourceRequirements substructure, 261
__finally statement, 79-81, 80, 83, 85
floating-point calculations, 126-27
FlushAdapterBuffers function pointer, 321
FlushAdapterBuffers routine, 331, 341
ForwardAndWait function, 227-29, 229, 230, 242, 263, 513
frame master, 556
frames, 494-95, 494, 495
FreeAdapterChannel function pointer, 321
FreeAdapterChannel routine, 339, 341
FreeCommonBuffer function pointer, 321
FreeMapRegisters function pointer, 321
FreeMapRegisters routine, 339, 341
FreeTo functions, 110, 110, 111
friendly names, 63
FSD (file system driver), 6, 180
functional device objects (FDOs)
    acronym for, 20
    device object interrelations, 30-32, 31, 32, 33
    introduced, 19, 20, 21-22
functional stall, 500
FunctionControl routine, 470, 471
function drivers, 10
function pointer tables, 225
functions (devices), 489

G
GenericAcquireRemoveLock function, 250
GenericDispatchPower routine, 354, 366
GENERIC.SYS library, 14, 354-55
GENINF utility, 574
GetCurrentIrp function, 238, 239, 448
GetDmaAlignment function pointer, 321
GetExceptionCode function, 84
GetExceptionInformation function, 84
GetLastError function, 416, 541
Get method, 482
GetOverlappedResult API function, 418
GetScatterGatherList function pointer, 321
GetScatterGatherList routine, 335-37
GetStringDescriptor function, 518-19
GetWindowLong routine, 578
global cancel spin lock, 204
globally unique identifiers (GUIDs), 27, 58-60, 59
grand unified descriptor, 506
guarded body for exception frames, 79
GUIDs (globally unique identifiers), 27, 58-60, 59

H
HAL (hardware abstraction layer), 299-300, 300
HalGetAdapter function, 325
HalGetInterruptVector routine, 231
Hal prefix (hardware abstraction layer), 72-73
HalTranslateBusAddress routine, 231
HandleFilterResources function, 261-63
HandlePowerEvent function, 354-57, 356, 371
HandlerEx function, 582
Handler function, 582
HandleStartDevice function, 224
HandleUsageNotification function, 263-64
handshake phase, 494-95, 495
hardware abstraction layer (HAL), 299-300, 300
hardware (instance) keys, 24-27, 24, 26, 69, 571-74, 572, 588
hardware wizard, 560-61, 561
heap allocator
    ExAllocatePoolWithTag function, 101-2
    introduced, 99-100, 100
    releasing a memory block, 100-101
Hibernate state, 348, 348
highest-level driver, 142-43
HIGH_LEVEL IRQL, 135, 135, 171
hubs, 489
HWPROFILE_CHANGE_NOTIFICATION data structure, 284

I
IDE devices, 569
IDL (Interface Definition Language), 477
idle detection, 391-95, 393
ihere on Soft-Ice/W command, 128
INF files
    device identifiers, 566-71, 568
    hardware registry key, 571-74, 572, 588
    install sections, 561-66, 562, 563, 564
    introduced, 558-61, 558, 559, 561
    tools for, 574-75, 575
InitializeListHead function, 104, 105, 255
InitializeObjectAttributes macro, 117
InitializeQueue function, 238, 240, 251-52
IN keyword, 45
INOUT keyword, 45
InsertHeadList function, 104, 105
InsertTailList function, 104, 105
installing device drivers
    defining device classes
        introduced, 575-76
        other class-specific information, 580-81
        property page providers, 576-80, 588
    INF files
        device identifiers, 566-71, 568
        hardware registry key, 571-74, 572, 588
        install sections, 561-66, 562, 563, 564
        introduced, 558-61, 558, 559, 561
        tools for, 574-75, 575
    introduced, 557
    launching applications
        AutoLaunch service, 581-87, 588
        introduced, 581
        Windows 98 compatibility notes, 588
    Windows 98 compatibility notes
        device properties, 588
        launching applications, 588
        property page providers, 588
        registry usage, 588
install sections (INF files), 561-66, 562, 563, 564
instance (hardware) keys, 24-27, 24, 26, 69, 571-74, 572, 588
Interface Definition Language (IDL), 477
interface descriptors, 503, 507-8
interlocked arithmetic, 164-68, 165
InterlockedCompareExchange function, 165, 166, 311
InterlockedCompareExchangePointer function, 166-67
InterlockedDecrement, 165, 165
InterlockedExchangeAdd function, 165
InterlockedExchange function, 165, 167
InterlockedExchangePointer function, 167
InterlockedIncrement function, 165, 165
interlocked list access, 168-71
InterlockedOr routine, 344
InterlockedXxx functions, 165-67, 165
interruptibility of kernel-mode drivers, 8
interrupt pipe management, 532-34
interrupt request level (IRQL)
    APC_LEVEL, 135, 135, 162, 164, 192-93, 215, 218
    basic synchronization rule, 136
    CLOCK1_LEVEL, 135
    CLOCK2_LEVEL, 135
    compared with thread priorities, 137
    device IRQL (DIRQL), 8, 135, 170
    DISPATCH_LEVEL, 8, 93, 100, 126, 134, 135, 135, 136, 136, 137, 138, 139, 140, 141, 143, 145, 147, 148, 149, 153, 165, 170, 171, 183, 188, 192-93, 219, 264-65, 308, 310, 353, 388, 397, 406, 427, 442
    explicitly controlling, 138-39
    HIGH_LEVEL, 135, 135, 171
    implicitly controlling, 137-38
    interrupt priority in action, 136, 136
    introduced, 131, 134-35, 135
    IPI_LEVEL, 135
    of ISRs, 306
    and paging, 137
    PASSIVE_LEVEL, 8, 134, 135, 136, 136, 137, 138, 143, 147, 150, 155, 165, 192-93, 213, 227, 353, 388, 397, 405, 406, 427, 442, 444
    POWER_LEVEL, 135
    PROFILE_LEVEL, 135, 136
    SYNC_LEVEL, 134
interrupts
    configuring, 303-5
    handling, 306-8
interrupt service routines (ISRs), 11, 11, 184-85
    IRQL of, 306
    programming restrictions in, 306-7
    synchronizing operations with, 307-8
interrupt transfers, 488, 493, 501, 502
IoAcquireCancelSpinLock routine, 256
IoAcquireRemoveLock function, 132, 246, 248, 365, 405, 445, 460
IoAllocateErrorLogEntry function, 409
IoAllocateIrp function, 180, 216-17, 370, 427
IoAllocateMdl function, 296, 297
IoAllocateWorkItem function, 445
IoAttachDeviceToDeviceStack routine, 43, 68, 197, 219, 234, 403
IoBuildAsynchronousFsdRequest function, 180, 212, 212, 217-19
IoBuildDeviceIoControlRequest function, 180, 217, 426, 513
IoBuildPartialMdl function, 296, 530
IoBuildSynchronousFsdRequest function, 180, 212-16, 212, 218
IoCallDriver function, 181-82, 197, 216, 228, 351, 397, 427, 513, 531
IoCancelIrp routine, 200-202, 210, 214, 215, 216, 253, 255, 256, 390, 430, 547, 549
IoCompleteRequest routine, 151-52, 185-86, 189, 190-91, 191, 193, 195-97, 210, 214, 216, 228, 308-9, 310, 365, 435, 448, 459, 530, 531, 554
IoConnectInterrupt routine, 303-5, 307, 314
I/O control (IOCTL) operations
    defining I/O control codes, 418-19, 418
    DeviceIoControl API function, 415-16, 416
    handling IRP_MJ_DEVICE_CONTROL
        internal I/O control operations, 426-28
        introduced, 420-22, 420
        METHOD_BUFFERED buffering method, 422-23, 422
        METHOD_IN_DIRECT and METHOD_OUT_DIRECT buffering methods, 424-25, 424
        METHOD_NEITHER buffering method, 425-26
    introduced, 414-15
    notifying applications of interesting events
        helper routine operation, 431-35
        introduced, 428-30
        working with an asynchronous IOCTL, 430-31
    pending IOCTL operations, 450
    synchronous and asynchronous calls to DeviceIoControl, 416-18
    and Windows 98 virtual device drivers (VxDs), 449-50
IoCopyCurrentIrpStackLocationToNext macro, 198, 272
IoCreateDevice routine, 49-51, 70, 76, 87, 234, 387, 403
IoCreateNotificationEvent routine, 429
IoCreateSymbolicLink routine, 53
IoCreateSynchronizationEvent routine, 429
IoCreateUnprotectedSymbolicLink routine, 53
IOCTL operations. See I/O control (IOCTL) operations
IoDeleteDevice routine, 65, 76, 234
IoDetachDevice routine, 234, 405
IO_ERROR_LOG_PACKET data structure, 408-9, 408
IoFreeIrp routine, 197, 206, 214, 215, 390, 427, 548, 549, 554
IoFreeItem function, 445
IoFreeMdl function, 296
IoGetAttachedDeviceReference routine, 43, 405
IoGetCurrentIrpStackLocation function, 193, 199, 224
IoGetDeviceObjectPointer function, 52, 220, 282
IoGetDeviceProperty routine, 276, 571, 588
IoGetDmaAdapter routine, 321, 324, 325-26, 328, 335, 338, 340
IoInitializeDpcRequest macro or routine, 185, 309
IoInitializeRemoveLock routine, 76, 246
IoInvalidateDeviceRelations function, 235, 270
IoInvalidateDeviceState routine, 235
IoMakeAssociatedIrp function, 180-81, 554
I/O Manager, 2
I/O-mapped devices, 298, 300-302
IoMarkIrpPending routine, 194-97, 434, 531
IoOpenDeviceInterfaceRegistryKey function, 116, 118
IoOpenDeviceRegistryKey function, 116, 118, 588
IopCompleteRequest routine, 218
Io prefix (I/O Manager), 71
IoQueueWorkItem function, 282, 445
IoRegisterDeviceInterface function, 59-60, 76, 87, 278
IoRegisterDriverReinitialization function, 48
IoRegisterPlugPlayNotification routine, 281-82
IoReleaseRemoveLockAndWait function, 247, 287, 405
IoReleaseRemoveLock routine, 246, 248, 249, 327, 365, 445, 460, 529, 549
IO_REMOVE_LOCK object, 245-50, 245
IoReportTargetDeviceChangeAsynchronous function, 285, 287
IoReportTargetDeviceChange function, 285, 287
IoReportXxx routines, 286
IoRequestDpc routine, 309, 310
I/O request packets (IRPs)
    awaiting current, 258-59
    cancelling I/O requests, 200-211, 203, 207, 208, 256-58
    completing I/O requests, 3, 189-97, 189, 191, 194
    delegating to WMILIB, 457-66, 462, 463
    dequeuing, 254-56
    device object pointers and, 219-20
    device power, 375-87, 376, 377, 378, 379, 382, 383, 386, 397
    introduced, 2-3, 21
    IO_STACK_LOCATION data structure, 177-79, 177, 178, 181, 198, 199
    managing
        introduced, 211-12, 212
        using IoAllocateIrp, 180, 216-17
        using IoBuildSynchronousFsdRequest, 180, 212-16, 212, 218
    passing requests down to lower levels, 197-99, 198, 200
    queuing, 252-54
    repeater, 271-74
    stalling the IRP queue, 252
    standard model for processing
        creating IRPs, 180-81
        custom queues, 186-88, 187
        deferred procedure call routine, 185-86
        duties of a dispatch routine, 182-83
        forwarding to a dispatch routine, 181-82
        interrupt service routine, 184-85
        introduced, 179-80, 179
        StartIo routine, 183-84
    structure, 173-77, 174, 176
    system power
        that decrease power, 372-75, 373, 374
        that increase power, 361-72, 361, 362, 368
    using IoBuildAsynchronousFsdRequest, 180, 212, 212, 217-19
    using IoBuildDeviceIoControlRequest, 180, 217
I/O requests. See also I/O request packets (IRPs)
    APCs and, 160-61
    in Windows 98, 4-5, 4
    in Windows 2000, 2-3
IO_RESOURCE_REQUIREMENTS_LIST data structure, 261
I/O resources, defined, 226
IoSetCancelRoutine routine, 204, 253-54, 255, 258, 434, 551
IoSetCompletionRoutine macro, 179, 191-92
IoSetDeviceInterfaceState routine, 60-61, 278
IoSetNextIrpStackLocation routine, 434
IoSkipCurrentIrpStackLocation routine, 199, 352
IO_STACK_LOCATION data structure, 177-79, 177, 178, 181, 198, 199
IoStartNextPacketByKey routine, 205, 206
IoStartNextPacket routine, 138, 185, 201, 202, 205, 206, 211, 239, 308-9, 310
IoStartPacket routine, 138, 183, 201, 211, 239
IoStartTimer routine, 446
IO_STATUS_BLOCK data structure, 174, 175, 189, 190
iostatus data structure, 427
IoStopTimer routine, 446
IoUnregisterPlugPlayNotification routine, 282
IoWMIRegistrationControl routine, 456
IoWriteErrorLogEntry function, 406, 449
IPI_LEVEL IRQL, 135
IRP_MJ_CLEANUP major function code, 178-79, 207, 208, 208, 209, 210, 211, 240, 257, 258, 434
IRP_MJ_CLOSE major function code, 208, 210, 220, 249, 257, 287, 446, 541
IRP_MJ_CREATE major function code, 50, 56, 208, 210, 220, 249, 446, 450, 541
IRP_MJ_DEVICE_CONTROL major function code, 173-74, 175, 212, 394, 420-28, 420, 422, 424
IRP_MJ_FLUSH_BUFFERS major function code, 212
IRP_MJ_INTERNAL_DEVICE_CONTROL major function code, 212, 401, 405, 426, 427, 510, 514, 526, 545
IRP_MJ_PNP major function code, 32, 148, 178, 190, 212, 221, 222, 223-25, 240, 405
IRP_MJ_POWER major function code, 67, 212, 349-53, 350, 351, 352, 370, 388, 389
IRP_MJ_READ major function code, 2, 3, 31-32, 175, 178, 182, 212, 294, 525, 526, 530, 544
IRP_MJ_SHUTDOWN major function code, 212
IRP_MJ_SPECIAL major function code, 186
IRP_MJ_SYSTEM_CONTROL major function code, 456, 469
IRP_MJ_WRITE major function code, 175, 212, 294, 394, 525, 526, 530
IRP_MN_CANCEL_REMOVE_DEVICE minor function code, 222, 244, 270
IRP_MN_CANCEL_STOP_DEVICE minor function code, 222, 242, 270
IRP_MN_CHANGE_SINGLE_INSTANCE minor function code, 456, 462, 464
IRP_MN_CHANGE_SINGLE_ITEM minor function code, 456, 462, 465
IRP_MN_DEVICE_USAGE_NOTIFICATION minor function code, 32, 222, 242, 263, 270
IRP_MN_DISABLE_COLLECTION minor function code, 456, 470
IRP_MN_DISABLE_EVENTS minor function code, 456, 472
IRP_MN_EJECT minor function code, 222, 270
IRP_MN_ENABLE_COLLECTION minor function code, 456, 470
IRP_MN_ENABLE_EVENTS minor function code, 456, 472
IRP_MN_EXECUTE_METHOD minor function code, 456
IRP_MN_FILTER_RESOURCE_REQUIREMENTS minor function code, 222, 261, 270
IRP_MN_POWER_SEQUENCE minor function code, 76-77, 350, 370, 396
IRP_MN_QUERY_ALL_DATA minor function code, 456, 462, 462
IRP_MN_QUERY_BUS_INFORMATION minor function code, 222, 270
IRP_MN_QUERY_CAPABILITIES minor function code, 222, 234, 270, 367
IRP_MN_QUERY_DEVICE_RELATIONS minor function code, 222, 266, 268, 270, 276
IRP_MN_QUERY_DEVICE_TEXT minor function code, 222, 270
IRP_MN_QUERY_ID minor function code, 222, 270, 275-76
IRP_MN_QUERY_INTERFACE minor function code, 222, 270, 277
IRP_MN_QUERY_PNP_DEVICE_STATE minor function code, 222, 270
IRP_MN_QUERY_POWER minor function code, 349, 350, 350, 353, 378, 381, 385, 389
IRP_MN_QUERY_REMOVE_DEVICE minor function code, 222, 243, 270
IRP_MN_QUERY_RESOURCE_REQUIREMENTS minor function code, 222, 270, 277
IRP_MN_QUERY_RESOURCES minor function code, 222, 270
IRP_MN_QUERY_SINGLE_INSTANCE minor function code, 456, 462, 462
IRP_MN_QUERY_STOP_DEVICE minor function code, 222, 241, 270
IRP_MN_READ_CONFIG minor function code, 222, 270
IRP_MN_REGINFO minor function code, 456, 460, 462
IRP_MN_REMOVE_DEVICE minor function code, 178, 221, 222, 233-34, 245, 247, 249, 258, 270, 274, 287, 439, 450
IRP_MN_SET_LOCK minor function code, 222, 270
IRP_MN_SET_POWER minor function code, 349, 350, 351, 353, 378, 378, 381, 382
IRP_MN_START_DEVICE minor function code, 126, 129, 143, 178, 221, 222, 227, 230, 240, 251, 263, 267, 268, 270, 277, 315, 439, 510
IRP_MN_STOP_DEVICE minor function code, 221, 222, 232-33, 241, 243, 258, 270, 439, 524
IRP_MN_SURPRISE_REMOVAL minor function code, 32, 222, 234-35, 270, 287
IRP_MN_WAIT_WAKE minor function code, 350, 389-91, 491, 535
IRP_MN_WRITE_CONFIG minor function code, 222, 270
IRPs. See I/O request packets (IRPs)
IRQL. See interrupt request level (IRQL)
ISAPNP devices, 570
IShellExtInit COM interface, 393
IShellPropSheetExt COM interface, 393
IsListEmpty function, 104, 105
isochronous pipe management
    achieving acceptable performance, 544-46
    handling cancellation of the main IRP, 546-54
    initiating a series of isochronous transfers, 542-43
    introduced, 537, 537
    reserving bandwidth, 538-41, 538, 540
    streaming isochronous transfers, 554
    synchronizing isochronous transfers, 554-56
isochronous transfers, 488, 493, 502, 502
ISRs. See interrupt service routines (ISRs)
IUnknown objects in COM, 476-77
IWbemClassObject interface, 471, 481-82, 484
IWbemLocator interface, 477-78, 480
IWbemObjectSink interface, 483
IWbemServices interface, 479-84

K
KDEVICE_QUEUE object, 186-88, 187, 236, 237
KdPrint macro, 76, 128
KeAcquireSpinLockAtDpcLevel function, 193
KeAcquireSpinLock routine, 141, 171
KeBugcheckEx function, 89-90
KeCancelTimer function, 153
KeClearEvent function, 147, 147, 149-50
KeDelayExecutionThread routine, 158, 315
KeFlushIoBuffers routine, 330, 341
KeInitializeDpc routine, 312
KeInitializeEvent function, 147, 147, 227, 426
KeInitializeMutex function, 152, 152
KeInitializeSemaphore function, 150, 150
KeInitializeSpinLock function, 140-41, 305
KeInitializeTimerEx function, 153, 155, 157
KeInitializeTimer function, 153, 154, 155
KeInsertByKeyDeviceQueue function, 186-87
KeInsertDeviceQueue function, 186-87, 188
KeInsertQueueDpc routine, 312-13
KeLowerIrql routine, 138-39, 188
Ke prefix (Windows NT kernel), 72
KeQuerySystemTime routine, 144
KeRaiseIrql routine, 138-39
KeRaiseIrqlToDpcLevel function, 139
KeReadStateEvent function, 147, 149
KeReadStateMutex function, 152, 152
KeReadStateSemaphore function, 150, 151
KeReadStateTimer function, 153
KeReadStateXxx functions, 145, 149
KeReleaseMutex function, 152, 153
KeReleaseSemaphore function, 150, 151
KeReleaseSpinLock routine, 141
KeRemoveByKeyDeviceQueue function, 186-87
KeRemoveDeviceQueue function, 186-87, 188
KeResetEvent function, 147, 149
KeRestoreFloatingPointState routine, 127
kernel dispatcher objects
    blocking threads, 142-43
    introduced, 141-42, 142
    kernel events, 147-50, 147
    kernel mutexes, 151-53, 152
    kernel semaphores, 150-51, 150
    kernel timers, 153-58, 153
    thread alerts and APCs, 159-62
    using threads for synchronization, 158-59
    waiting on multiple dispatcher objects, 145-47
    waiting on single dispatcher objects, 143-45
kernel events, 147-50, 147
kernel mode, 1-2
kernel-mode address spaces. See user-mode and kernel-mode address spaces
kernel-mode drivers
    attributes
        asynchronous, 9-10
        configurability, 7-8
        interruptibility, 8
        introduced, 7
        multiprocessor-safe, 8-9
        object-based, 9
        packet-driven, 9
        portability, 7
        preemptibility, 8
    introduced, 5, 6
kernel-mode programming environment
    introduced, 71-73, 73
    side effects, 74
    using standard run-time library functions, 73
kernel mutexes, 151-53, 152
kernel semaphores, 150-51, 150
kernel streaming, 542
kernel timers, 153-58, 153
KeSaveFloatingPointState function, 127
KeSetEvent function, 144, 147, 148-49, 160, 195, 229, 255, 429
KeSetImportanceDpc routine, 312
KeSetTargetProcessorDpc routine, 311
KeSetTimerEx function, 153, 154, 155, 441
KeSetTimer function, 153, 154, 155
KeStallExecutionProcessor routine, 158
KeSynchronizeExecution function, 138, 184, 308, 447
KeWaitForMultipleObjects routine, 141, 145-47, 156-57, 438, 441, 450
KeWaitForMutexObject macro, 153
KeWaitForSingleObject routine, 137, 141, 143, 151, 160, 161, 214, 228, 450
KeWaitXxx functions, 148-49, 151, 152, 154, 155, 158
KeXxxDeviceQueue routines, 211
KEY_BASIC_INFORMATION data structure, 122
KEY_FULL_INFORMATION data structure, 121-22, 123
KEY_VALUE_BASIC_INFORMATION data structure, 123
KEY_VALUE_PARTIAL_INFORMATION data structure, 119-20

L
latency period, 347
launching applications
    AutoLaunch service, 581-87, 588
    introduced, 581
    Windows 98 compatibility notes, 588
leap years, 144-45
__leave statement, 88
legacy device drivers, 5, 6
linked lists
    doubly-linked lists, 104-6, 104
    interlocked access, 168-71
    introduced, 102-3, 103
    singly-linked lists, 106-8, 106, 107
    S-Lists, 168-70
LIST_ENTRY data structure, 102
LOCK instruction prefix, 133-34
LogEvent function, 409
logging errors
    creating error log packets, 406, 408-10, 408
    creating message files, 406, 410-14, 411
    introduced, 406-7, 407
    Windows 98 compatibility notes, 449
logical address, 340
lookaside lists, 108-11, 108, 109, 110
LOOPBACK sample, 525-31
lower filter drivers, 400-401, 401, 402
lower filters, 19, 20


Next


Visit Microsoft Press for more information on
Programming the Microsoft Windows Driver Model


Top of Page


Last Updated: Friday, July 6, 2001