safe defaults, 62
sample drivers, obtaining, 16–17
saving IRQL, annotations for, 805
scatter/gather technique, 552, 554, 560–562
scheduling threads, 508–509. See also threads
scope, synchronization, 55, 387–398
cancellation of I/O requests, 402–403
KMDF drivers, 391–398
SynchronizationScope attribute, 108, 391
UMDF drivers, 390–391
SDDL (security descriptor definition language), 159–161
SDV Defect Viewer, 844–845
Sdv-map.h file, creating, 837–839, 856–857
SDV (Static Driver Verifier), 670, 823–862
annotating KMDF code for, 832–834
Fail_Driver3 sample driver (example), 855–859
how it works, 825–831
how to run, 834–842
KMDF callback function role types for, 832–834, 860–862
KMDF rules for, 847–855
verification engine operation, 829–831
viewing reports, 842–847
search phase, SLAM engine, 830–831
sections, INF files, 643
security, 61–62
signing driver packages, 653–655
trace messages and, 413, 417
UMDF drivers, 86
security descriptors for device objects, 160–162
SecurityIdentification impersonation level, 276
SecurityImpersonation impersonation level, 276, 278
SECURITY_IMPERSONATION_LEVEL enumeration, 276
self-managed I/O, 297–305
watchdog timer example (KMDF), 301–305
seminars on driver development, 22
send-and-forget flag (I/O completion), 338, 341, 343–345
Send method (IWDFIoRequest), 337, 343
synchronous requests, 339–340, 369–370
sequential I/O request dispatching, 56, 259, 385
serialization, 41, 385
automatic, 395–396, 539
timer objects, 460
synchronization scope and, 387–398
service routines, defined, 49
serviceability, 63–64
ServiceBinary directive, 648
services, drivers vs., 24
Set functions, 96, 104
SetBuffer method (IWDFMemory), 444
SetCompletionCallback method (IWDFIoRequest), 334
SetFilter method (IWDFDeviceInitialize), 150, 151, 192
SetLockingConstraint method (IWDFDeviceInitialize), 150, 151, 390
SetNamedValue method (IWDFNamedPropertyStore), 448, 450
SetPnpCapability method (IWDFDeviceInitialize), 150
SetPowerPolicyOwnership method (IWDFDeviceInitialize), 150, 151, 192
Setup action log, 664
Setup error log, 664
SetupAPI log, 664
SetupDiXxx functions, 146, 498–499
shared data, synchronized access to, 381–383
shutdown (device), 178–179
device removal and, 184–187
self-managed I/O during, 300–301
shutdown sequences, 178
side-by-side operation of major versions, 63–64
side objects (UMDF), 79
signed catalog files, 643, 653–654
specifying in INFs, 654
signing driver packages, 653–655
SimpleIO interface, 675–676
SimpleIOStress interface, 676
64-bit systems, as development requirement, 12
64-bit UMDF drivers, 85
Size attribute, 108
size of KMDF log, controlling, 728
Skeleton.rc file, 477, 488
Skeleton sample driver, 16, 475–493
SLAM verification engine, 829–831
slave devices. See system DMA devices
SLEEP scenario (PwrTest), 675
sleep states, 168
Sleep_Stress_With_IO.wsf script, 676
software-only drivers, Plug and Play and power management, 190–194
software tracing. See tracing
source code
annotations in
best practices, 816–818
driver annotations, 774–778
eliminating coding noise with, 751–752
general-purpose, 760–774
how to use, 752–760
Osrusbfx2 sample driver (example), 818–822
for SDV (Static Driver Verifier), 832–834
noise in, 749–752, 815
startup code, debugging, 706–708, 715
trace message calls in, 431–432. See also tracing
Source Code pane (SDV Defect Viewer), 844
[SourceDisksFiles] section, INF files, 644
[SourceDisksNames] section, INF files, 644
Sources directory, cleaning, 836
Sources file, 621
Fx2_Driver sample driver, 625–628
modifying to run WPP preprocessor, 420–424
Osrusbfx2 sample driver, 630–632
Skeleton sample driver, 477
Sources file (Skeleton sample driver), 486–487
SOURCES macro, 627, 632
Special Pool option (Driver Verifier), 678, 680
specialized I/O targets, 309–310
USB targets, 359–361
spin lock objects, 41, 44–45, 49, 103, 114, 399–401
deleting, 116
interrupt spin locks, 48, 400
synchronized I/O request cancellation, 403–405
spin lock objects (WDFSPINLOCK), 523, 539
splitting I/O requests, 346–350
stability of UMDF drivers, 86
stack. See device stack; driver stack; kernel stack
STAMP directive (Makefile.inc), 629, 633
/standard parameter (Driver Verifier), 680
Start method (IWDFIoQueue), 260
Start method (IWDFIoTargetStateManagement), 319
Started state (I/O targets), 319, 340
startup (device), 178–179
device enumeration and, 180–183
self-managed I/O during, 300
startup code, debugging, 706–708, 715
state
device state, 145
system power state queries, 221
I/O requests, to synchronize cancellation, 403–407
I/O targets, 318–321, 340–341
state machines (KMDF), 72, 171
State pane (SDV Defect Viewer), 844–845
state variables, SDV rules for, 826
static code analysis tools, 669. See also PREfast for Drivers; SDV (Static Driver Verifier)
Static Driver Verifier (SDV), 670, 823–862
annotating KMDF code for, 832–834
Fail_Driver3 sample driver (example), 855–859
how it works, 825–831
how to run, 834–842
KMDF callback function role types for, 832–834, 860–862
KMDF rules for, 847–855
verification engine operation, 829–831
viewing reports, 842–847
static enumeration of child devices, 143
in bus drivers, 157–158
statistic libraries for WDK, 14
STATUS_INVALID_DEVICE_REQUEST status, 503
STATUS_SUCCESS tests, 749
Stop method (IWDFIoQueue), 260
Stop method (IWDFIoTargetStateManagement), 320
Stopped for query-remove state (I/O targets), 319, 340
Stopped state (I/O targets), 319, 340
StopSynchronously method (IWDFIoQueue), 260
storage pass-through commands, 143
string annotations, 771–773
string objects, 103, 114
deleting, 116, 120
[Strings] section, INF files, 644
STRSTR$ function, 783
success codes, 58–59
.SUFFIXES directive (Makefile.inc), 629
__super keyword, 609
surprise removal of device, 178
suspended I/O requests, 293, 296
symbol files, 19, 624, 702–704
symbolic links, 148, 160
SYNCH_LEVEL IRQLs, 512
synchronization, 31–32, 40–41, 49, 379–410. See also asynchronous I/O
collection objects, 457
I/O request cancellation (KMDF), 401–409
I/O requests, 339–340
processing at DIRQL, 547
scope of, 55, 387–398
cancellation of I/O requests, 402–403
KMDF drivers, 391–398
SynchronizationScope attribute, 108, 391
UMDF drivers, 390–391
spin lock objects, 41, 44–45, 49, 103, 114, 399–401
deleting, 116
interrupt spin locks, 48, 400
synchronized I/O request cancellation, 403–405
summary and general tips, 409–410
wait lock objects, 103, 114, 398–399
collection objects, 457
deleting, 116
WDF features, 384–386
WDF object hierarchy, 55
when required, 380–383
synchronization model (device property), 146
SynchronizationScope attribute, 108, 391
syntax misuses, 750
.sys files, 49, 623
system architecture (Windows), 25–27
system DMA devices, 550. See also DMA
System event log, 664
system memory, DMA abstraction and, 556. See also DMA
system power states, 168–169
system requirements for driver development, 12
system stability of UMDF drivers, 86
system thread context, 510