I/O dispatchers, 310–312
I/O manager (Windows system), 27
I/O mapping, 530
I/O processing, 221
adaptive time-outs (UMDF), 297
completion routines (I/O), 34, 47, 238–239. See also completing I/O requests
DMA drivers, 575–577
for I/O requests, 334–336
control requests. See IOCTL (I/O control) requests
event callbacks, 271–291
automatic forwarding, 272–273
for cleanup and close requests, 280–281
for create requests, 273–280
file object creation, 271–272
for read/write and IOCTL requests, 282–291
self-managed, 298
serialization, synchronization scope and, 387–398
queue objects, 56, 98, 130, 147, 253–271
callback objects for, 100
configuration and request types, 254–256
control of, 259–261
creating (KMDF example), 265–267
creating (UMDF example), 261–264
deleting, 116
dispatch types (flow control), 56, 259, 385–386, 388–389
manual, retrieving requests from, 267–271
in object hierarchy, 112–113
power management for, 171, 196–197, 257–258
request completion, 291–293
adaptive time-outs (UMDF), 297
parent objects and, 121
request completion information objects, 98
request completion parameters objects, 98–99
USB targets, 99
request flow, 231–243
through KMDF drivers, 236–237, 309
through UMDF device stack, 234–236, 308
request handlers, 239, 242–243
request objects, 32–33, 98, 243, 322–353
buffers and memory objects, 244–252
callback objects for, 100, 123
canceled. See canceled I/O requests
completing. See completing I/O requests
context data for, 123
creating, 322–323, 346–350
deleting, 112, 116, 118
dispatching with queue objets, 56
file objects created for, 271–272
formatting, 330–336
how to send, 337–353, 376–377
to KMDF drivers, 84
lifetimes, 252–253
memory objects and buffers for, 323–330
in object hierarchy, 112–113
suspension, 293, 296
to UMDF drivers, 80–81
request types, 224–228
requests, unsupported, 503–506
self-managed, 297–305
synchronization. See synchronization
target objects, 57, 98, 147, 307–321
creation and management, 313–321
deleting, 116
UMDF file handle targets, 353–354
UMDF implementation, 310–313
USB targets, 99, 355–376
transfer types, 34–35, 228–231
WDF model, 55–59, 75
Windows model, 31–36
completion processing, 239
I/O target files, 310, 312–313
I/O Verification option (Driver Verifier), 678, 680
IClassFactory interface, 480–481, 603–606
CreateInstance method, 132, 135–137, 480–481, 603, 604–605
Identification impersonation level, 276
IDL (interface definition language), 595–597
idle devices, 174
idle support for KMDF drivers, 207–212, 220
example, 217–220
IDriverEntry interface, 100, 130, 132, 135, 482–483, 610–611
OnDeviceAdd method, 132, 136, 149, 181, 194, 483–484, 598
!IFDEF/!ENDIF macro, 632
IFileCallbackCleanup interface, 100, 281
canceling all I/O requests for files, 351–352
IFileCallbackClose interface, 100, 281
IIDs (interface IDs), 592
IImpersonateCallback interface, 100, 276–277
Impersonate method (IWDFIoRequest), 276–277
impersonation (UMDF drivers), 275–279
implicit order of evaluation, detecting, 742–743
__in annotation, 761–764
IN parameter, 590, 764
INCLUDES macro, 627, 631
INF File Syntax Checker (ChkINF), 671
.inf files (INFs), 48, 477, 489–493, 621, 643
creating, 643–648
duplicate directives in, 665
examples of, 648–653
INF_NAME macro, 631
INFO scenario (PwrTest), 675
inheritance, 587
execution levels, 397
synchronization scope, 394–396
Initialize public helper method, 484–485
initializing device objects, 146–147, 149–157
initializing tracing, 427–429
inline assembler, PREfast and, 750
__inout annotation, 761–764
INOUT parameter, 591, 764
input buffer naming, 247
input-output model for Windows, 31–36
completion processing, 239
input parameter annotations, 761–764
InputBufferAPI rule, 851
installing WDF drivers, 635–666
basics of, 636–637
considerations, 637–642
INFs, creating, 643–648
INFs, examples of, 648–653
methods for, 655–663
package components, 642–643
signing and distributing packages, 653–655
troubleshooting, 663–666
installing WDK, 11–14
intellectual property in trace messages, 413
interface definition language (IDL), 595–597
interface IDs (IIDs), 592
interface pointers as method parameters, 590
interfaces (COM), 587–589
interfaces (WDF)
UMDF framework, 97–101
UMDF naming conventions, 96
interlocked operands, annotations for, 809–810
InterlockedXxx routines, 500
InterlockedIncrement, 609
intermediate power states, 168
internal device I/O control requests, 228, 242
creating, 322
formatting for I/O targets, 332–333
synchronous, 337
internal request handlers, 241
internal trace logger (KMDF), 669–670
Internal.h file, 477
interrupt objects, 103, 114, 147, 538–541
deleting, 116
interrupt request levels. See IRQLs (interrupt request levels)
interrupt service routines. See ISRs
interrupt spin locks, 48, 400. See also spin lock objects
interrupt storms, 543
interrupt transfers (I/O model), 357–358
interruption, thread. See threads
interrupts, 37–39, 48
in data transfer process, 35–36
interrupts and interrupt handling, 537–547. See also IRQLs (interrupt request levels)
deferred processing, 546–547
enabling and disabling interrupts, 541–542
ISRs (interrupt service routines), 48, 544–547
synchronizing, 41
post-interrupt processing, 543
synchronized processing at DIRQL, 547
intra-stack files for I/O targets, 312–313
_INX directive (Makefile.inc), 633
IObjectCleanup interface, 100, 117, 124–125, 454
IOCTL (I/O control) requests, 33, 48, 225–226, 242
control codes for, 226–227, 228
event callbacks for, 282–291
formatting for I/O targets, 331–333, 332–333
internal, 228, 242, 322
synchronous, 337
IoGetDeviceProperty function, 146
IoRegisterPlugPlayNotification function, 503
IoSetCompletionRoutine function, 504–505
IoSetCompletionRoutineEx function, 504–505
IoWmiXxx functions, 442
IPI_LEVEL IRQLs, 512
IPnpCallback interface, 100, 184, 188, 198, 200–201
OnD0Entry method, 172, 181, 194, 198, 200–201
OnD0Exit method, 172, 188, 196, 198, 200–201
OnQueryRemove method, 172, 198
OnQueryStop method, 172, 198
OnSurpriseRemoval method, 172, 187, 198, 200–201
Plug and Play and power callbacks, 172
Skeleton sample driver with, 485
IPnpCallbackHardware interface, 100, 184, 197, 199–200
OnPrepareHardware method, 172, 181, 197, 199
OnReleaseHardware method, 172, 184, 188, 197, 200
Plug and Play and power callbacks, 172
Skeleton sample driver with, 485
IPnpCallbackSelfManagedIo interface, 100, 184, 188, 298–299
Plug and Play and power callbacks, 172
Skeleton sample driver with, 485
IQueueCallbackCreate interface, 100, 274–275
IQueueCallbackDefaultIoControl interface, 100
IQueueCallbackDefaultIoHandler interface, 100, 263, 274, 283, 286, 289
IQueueCallbackDeviceIoControl interface, 286
OnDeviceIoControl method, 287–288, 390
IQueueCallbackIoResume interface, 100, 258
IQueueCallbackIoStop interface, 100, 188, 258
OnIoStop method, 184, 188, 295, 390
IQueueCallbackRead interface, 100, 263, 283
IQueueCallbackRequestCompletion interface, 263
IQueueCallbackState interface, 100
IQueueCallbackStateChange interface, 268
IQueueCallbackWrite interface, 100, 263, 283–284
IRequestCallbackCancel interface, 100
IRequestCallbackRequestCompletion interface, 100, 263, 334
OnCompletion method, 343, 390
IRP Logging option (Driver Verifier), 678
IRPs (I/O request packets), 31, 33–34, 48, 227–228
IRP_MJ_CLEANUP code, 227, 241, 242
IRP_MJ_CLOSE code, 227, 241, 242
IRP_MJ_CREATE code, 227, 241, 242
IRP_MJ_DEVICE_CONTROL code, 227, 241, 242
IRP_MJ_INTERNAL_DEVICE_CONTROL code, 228, 241, 242
IRP_MJ_PNP code, 228
IRP_MJ_POWER code, 228
IRP_MJ_READ code, 228, 241, 242
IRP_MJ_SHUTDOWN code, 228
IRP_MJ_SYSTEM_CONTROL code, 228, 464–465
IRP_MJ_WRITE code, 228, 241, 242
preprocessing, 241
request flow, 233
transfer types and, 229–230
types of information in, 34
!irql debugger command, 522
IRQLs (interrupt request levels), 37–38, 48, 511–518. See also entries at interrupt
annotations, 802–809
incorrect, calling functions as, 743–744
interruption scenarios, 518–523
page faults and, 42
processor- and thread-specific, 512–517
IsEqualIID utility, 610
isFunctionClass$ function, 783
IsInEndPoint method (IWDFUsbTargetPipe), 364
isochronous transfers (I/O model), 357–358
IsOutEndPoint method (IWDFUsbTargetPipe), 364
ISRs (interrupt service routines), 48, 544–547
synchronizing, 41
IUnknown interface, 99, 480, 482, 587, 589
how to implement, 608–611
IWDFDevice interface, 69, 97
ConfigureRequestDispatching method, 263–264
CreateDeviceInterface method, 152
CreateIoQueue method, 197, 198, 261
CreateRequest method, 322, 598–599
GetDefaultIoTarget method, 313
IWDFDeviceInitialize interface, 146, 149–151
AutoForwardCreateCleanupClose method, 150, 272, 274, 281
SetFilter method, 150, 151, 192
SetLockingConstraint method, 150, 151, 390
SetPowerPolicyOwnership method, 150, 151, 192
IWDFDriver interface, 97
CrateWdfMemory method, 327
CreatePreallocatedWdfMemory method, 327, 329, 443–444
CreateWdfMemory method, 443
IWDFDriverCreatedFile interface, 98
IWDFFile interface, 98
intra-stack files for I/O targets, 312–313
IWDFFileHandleTargetFactory interface, 97, 353–354
IWDFIoQueue interface, 98, 260, 268
ConfigureRequestDispatching method, 263–264
IWDFIoRequest interface, 69, 98, 292, 371
CancelSentRequest and CancelSentRequestsForFile method, 351
FormatUsingCurrentType method, 331
MarkCancelable, 294
memory object methods, 245–246
Send method, 337, 343
SetCompletionCallback method, 334
UnmarkCancelable, 294
IWDFIoTarget interface, 98, 331–332
IWDFIoTargetStateManagement interface, 98, 319–320
IWDFMemory interface, 98, 245–247, 443–444
IWDFNamedPropertyStore interface, 99, 448
IWDFObject interface, 97
AcquireLock and ReleaseLock methods, 386
CreateWdfFile method, 312
DeleteWdfObject method, 115, 313, 353
IWDFRequestCompletionParams interface, 98, 336, 371
IWDFTargetPipe interface, 99
IWDFUsbCompletionParams interface, 371
IWDFUsbInterface interface, 99, 359, 361, 363
IWDFUsbRequestCompletionParams interface, 99
IWDFUsbTargetDevice interface, 99, 359
IWDFUsbTargetFactory interface, 359, 362
IWDFUsbTargetPipe interface, 359