Cancel.exe Self Queued Cancel and Cleanup Routines
ID: Q188276
|
The information in this article applies to:
-
Microsoft Win32 Device Driver Kit (DDK) for Windows NT, version 4.0
SUMMARY
Cancel.exe is a sample that demonstrates how the cancel and cleanup driver
uses new IRP cancellation technique that minimizes the use of global cancel
spinlock, thereby reducing contention and improving overall system
performance. It also shows how to queue cancelable IRPs in a driver's
private queue and handle the cancelled IRPs in the cancel and cleanup
routine by the new design. The cancel and cleanup driver is functionally
similar to the STARTIO driver, except it manages its own queue instead of
using DeviceObject's internal device queue and
IoStartPacket/IoStartNextPacet system functions.
MORE INFORMATION
The following file is available for download from the Microsoft
Software Library:
Cancel.exe
Release Date: Jul-22-1999
For more information about downloading files from the Microsoft Software
Library, please see the following article in the Microsoft Knowledge Base:
Q119591 How to Obtain Microsoft Support Files from Online Services
Generic Sample CANCEL Driver
The following are included with this file:
- A driver source that demonstrates how to use new IRP cancellation
technique that minimizes the use of global cancel spinlock, thereby
reducing contention and improving overall system performance. It also
shows how to queue cancelable IRPs in a driver's private queue and
handle the cancelled IRPs in the cancel and cleanup routine by the new
design. In purpose, this driver is similar to the STARTIO driver, except
it uses and manages it own queue instead of I/O manager-managed
DeviceObject's internal queue.
- A simple multithreaded Win32 Console application to stress and test the
driver's cancel and cleanup routines.
This sample contains an example of a minimal driver. Neither it nor the
sample programs are intended to be used in a production environment.
Rather, they are intended for educative purposes and as a skeleton driver.
Building the Driver and Examples
To compile the device driver:
- Start the checked or free build environment MS-DOS box.
- Run Build. This starts the Microsoft make routines, which produce log
files called Build.wrn, and Build.log. The .wrn file contains warnings
that no components have been extracted from certain libraries, even if
the build succeeds. If it does succeed, the driver can be found in the
%basedir%\lib\i386\free or %basedir%\lib\i386\checked directory.
- Copy the SYS file to %systemroot%\SYSTEM32\DRIVERS directory where all
the Windows NT device drivers are stored.
To install the Sample driver, use the REGINI utility to create the entries
listed in the .ini file.
Testing
- Restart your computer.
- Start the driver with "net start".
- Run multiple instances of Testapp.c.
- Exit gracefully (enter "q") or press CTRL+C and watch how the driver
cancels all the pending I/Os in the debug trace.
Additional query words:
Keywords : kbfile kbsample kbDDK kbNTOS400
Version : winnt:4.0
Platform : winnt
Issue type :
Last Reviewed: July 21, 1999