packages for installation. See installing WDF drivers
packet-based DMA devices, 551, 553
page faults, 42, 45, 48
Driver Verifier IRQL checking, 45, 678, 680, 683–684
paged pool (memory), 43, 48
PAGED_CODE macro, 522
PAGED_CODE_LOCKED macros, 522
paging files, powering down and, 174–176
parallel I/O request dispatching, 56, 259, 385
parameter validation, 62, 242
parent (device property), 146
parentheses errors, 750
ParentObject attribute, 108
parents of objects, 110. See also hierarchy of WDF objects
completed I/O requests, 121
driver-created I/O request objects, 113
memory objects, 325–326
powering down, 173
synchronization scope, 394–396
_part annotation, 761
pass-through commands, 143
PASSIVE_LEVEL IRQLs, 38, 392, 396, 511–512, 513–514
object cleanup, 120–121
synchronizing, 40
VERIFY_IS_IRQL_PASSIVE_LEVEL() macro, 46
PC_LEVEL IRQLs, 511
PCI devices, 168
PdoDeviceInitAPI rule, 848
PDOs (physical device objects), 29, 140, 142
enumeration of child devices, 157–159
power management, 171, 174–175
device enumeration and startup sequence, 183
power-down and removal sequence, 186
software-only drivers, 190
pending I/O requests, 259
performance
annotations in source code, 752–754
checked builds, 700
coding noise, 749–752, 815
filtering PREfast results, 815
WPP trace message execution, 413
periodic callbacks, requesting. See timer objects
physical addressing capability (DMA devices), 554
physical device object (PDO), 29, 140, 142
enumeration of child devices, 157–159
power management, 171, 174–175
device enumeration and startup sequence, 183
power-down and removal sequence, 186
software-only drivers, 190
physical memory, transfers for. See DMA (direct memory access)
pipes, 355. See also USB pipe objects
platform-independent drivers, 533–534
Plug and Play, 36, 165–207
basics of, 167–168
callback sequences, 176–189
driver types and device objects, 144–145
I/O request flow handler, 239
implementing in WDF drivers, 189–190
KMDF drivers for, 134
PnP manager (Windows system), 27, 167
error codes, 666
installing drivers with, 636, 656–657
serialization of callbacks, 385
simple hardware drivers, 194–207
software-only drivers, 190–194
WDF support for, 59–61, 170–176
defaults, 170
Plug and Play capabilities (device property), 146
Plug and Play CPU Test (PNPCPU), 673–674
Plug and Play Driver Test (Pnpdtest), 673
Plug and Play state (device property), 146
PnP. See Plug and Play
PnP manager (Windows system), 27, 167. See also Plug and Play
error codes, 666
installing drivers with, 636, 656–657
PnP/Power model (WDF), 75
PNPCPU utility, 673–674
Pnpdtest.exe, 673
policy, power. See power policy
policy, PREfast integration, 815
pool tags, 442
Pool Tracking option (Driver Verifier), 678, 680
PoolMon utility, 674
pools (memory), 43, 48
PORT mapping. See I/O mapping
__possibly_notnullterminated annotation, 761, 772–773
power capabilities (device property), 146
power-down (device), 178–179
device removal and, 184–187
self-managed I/O during, 300–301
shutdown sequences, 178
POWER_LEVEL IRQLs, 512
power-managed queues, 171, 179, 181–186, 188–189, 195, 257–258
power management, 36, 167–222
basics of, 168–170
callback sequences, 176–189
I/O request flow handler, 239
idle and wake support (KMDF drivers), 207–222
implementing in WDF drivers, 189–190
policy owner DDI rules, 853–855
queue objects and, 171, 196–197, 257–258
serialization of callbacks, 385
simple hardware drivers, 194–207
software-only drivers, 190–194
WDF support for, 59–61, 170–176
defaults, 170
within Windows system architecture, 27
Power Management Test Tool (PwrTest), 674–675
power-pageable devices, 174–176
power policy, 146, 169–170
SetPowerPolicyOwnership method (IWDFDeviceInitialize), 150, 151, 192
WdfDeviceInitSetPowerPolicyEventCallback, 153, 217, 853
WdfDeviceInitSetPowerPolicyOwnership, 143
power policy ownership (device property), 146
power policy state (device property), 146
power state (device property), 146
power states, 168–169
changes, callback sequence and, 177–178
self-managed I/O and, 298
system power state queries, 221
powered-down (off) state, 168
PPM scenario (PwrTest), 675
#pragma warning directives, 750–751
precedence rules errors, detecting with PREfast, 733
preconditions for SDV rules, 854–855
preempted threads, 518
PREfast defect log text output, 740–741
PREfast defect log viewer, 737–740
PREfast for Drivers, 46, 670, 731–822
best practices, 815–818
coding practices to improve results, 748–752
driver annotations, 774–778
basics and conventions, 777–779
conditional, 779–783
constant and non-constant parameters, 788
diagnostic annotations, 789
DO_DEVICE_INITIALIZING annotation, 809
examples, 810–812
floating-point annotations, 801–812
format string annotations, 788
function result annotations, 784
function type class annotations, 799–801
for functions in __try statements, 790
for interlocked operands, 809–810
IRQL annotations, 802–809
memory annotations, 790–792
nonmemory resource annotations, 792–799
pointer annotations, 787–788
type-matching annotations, 785–787
general-purpose annotations, 760–774
how to use, 734–748
how to use annotations, 752–760
how to write and debug annotations, 813–815
Osrusbfx2 sample driver (example), 818–822
preferred functions, annotations for, 789
preprocessing IRPs, 241
priority boost (constant), 292, 509
priority, thread, 508
privacy, trace messages and, 413, 417
processor cache, 556–557
processor-specific IRQLs, 512–517
PROFILE_LEVEL IRQLs, 511
program code. See source code
programming interface (WDF), 54
projects, how to build, 622–624
properties
COM objects, 594
device objects, 145–146
framework objects, 54, 70, 72
WDF, 92
KMDF naming conventions, 104–105
WDF
UMDF naming conventions, 96
property store objects, 99, 447–450
PsCreateSystemThread function, 523
Purge method (IWDFIoQueue), 260
PurgeSynchronously method (IWDFIoQueue), 260
PVOID as parameter type, 787
PwrTest utility, 674–675