A method and system for verifying computer system drivers such as kernel
mode drivers. A driver verifier sets up tests for specified drivers and
monitors the driver's behavior for selected violations that cause system
crashes. In one test, the driver verifier allocates a driver's memory
pool allocations from a special pool bounded by inaccessible memory space
for testing the driver's accessing memory outside of the allocation. The
driver verifier also marks the space as inaccessible when it is
deallocated, detecting a driver that accesses deallocated space. The
driver verifier may also provide extreme memory pressure on a specific
driver, or randomly fail requests for pool memory. The driver verifier
also checks call parameters for violations, performs checks to ensure a
driver cleans up timers when deallocating memory and cleans up memory and
other resources when unloaded. An I/O verifier is also described for
verifying drivers use of I/O request packets.