SAMPLE: Dumppci.exe Shows How To Dynamically Load/Unload Driver

Last reviewed: February 4, 1998
Article ID: Q178660
The information in this article applies to:

- Microsoft Win32 Device Development Kit (DDK) for Windows NT, versions

  3.51, 4.00

SUMMARY

Dumppci.exe is a sample Win32 application and kernel-mode drive that demonstrates how to dynamically load or unload a driver, scan all the PCI devices in the system, and display the PCI configuration space for each device.

MORE INFORMATION

The following file is available for download from the Microsoft Software Library:

 ~ Dumppci.exe (size: 33567 bytes) 

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services

Dumppci.exe and Pcidumpr.sys

This is a sample driver that demonstrates the following:

  1. How to dynamically load or unload a driver using the Service Control Manager APIs. These APIs allow you to load a driver without having to modify the registry and reboot the system.

  2. How to scan the PCI slots and locate PCI devices.

  3. How to send data from a kernel-mode driver to a Win32 console mode application.

To run the sample:

  1. Build the driver and the Win32 application. See the DDK documentation for details on creating drivers and Win32 applications from the DDK Build Environment.

  2. Insure that the driver (Pcidumpr.sys) and the Win32 application (Dumppci.exe) are in the same directory.

  3. From a command prompt, type "dumppci" to see the options supported. Currently, you can display the PCI configuration data in either a formatted ("-f" option) or raw ("-r" option) manner.

When the program runs, the driver is automatically loaded and started. The Win32 application sends custom IOCTLs to the driver. The driver then scans all the PCI slots in the system and locates PCI devices. For each PCI device, the driver retrieves the PCI configuration space information and places it in the Win32 application's buffer.

Note that this sample will not work across a network. The driver and Win32 application must reside on the local computer.

Keywords          : NTDDKKMode
Issue type        : kbfile
Solution Type     : kbsample


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 4, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.