Cancel.exe Self Queued Cancel and Cleanup Routines

ID: Q188276


The information in this article applies to:


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:

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:

  1. Start the checked or free build environment MS-DOS box.


  2. 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.


  3. 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

  1. Restart your computer.


  2. Start the driver with "net start".


  3. Run multiple instances of Testapp.c.


  4. 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