Microsoft KB Archive/833909

= How to debug a device installation co-installer =

PSS ID Number: 833909

Article Last Modified on 2/25/2004

-

The information in this article applies to:


 * Microsoft Windows 2000 Professional
 * Microsoft Windows 2000 Professional SP1
 * Microsoft Windows 2000 Professional SP2
 * Microsoft Windows 2000 Professional SP3
 * Microsoft Windows 2000 Professional SP4
 * Microsoft Windows 2000 Server
 * Microsoft Windows Server 2003, Standard Edition
 * Microsoft Windows Server 2003 SP1
 * Microsoft Windows XP Professional
 * Microsoft Windows XP Professional SP1

-



SUMMARY
Some hardware device installation packages include .dll files that are known as co-installers. Co-installers help with the installation of the hardware device. During the development process, the hardware vendor may find it difficult to debug the co-installer code. This difficulty occurs because of how the co-installer is loaded, and because many installation scenarios occur automatically and do not permit developers to break into the running process.

This article describes two methods for debugging the co-installer:
 * Attach the debugger to the Device Manager, and then update the driver.
 * Attach the debugger to a device installation application. When you attach a debugger to the application that installs the device, you can access the co-installer itself.

These procedures assume that you have developed a working driver installation package for your device that uses a co-installer. For more information about how to develop drivers, driver installation packages, and driver installation co-installers, see the Microsoft Windows Driver Development Kit (DDK) documentation.

These examples assume you are using the Microsoft Windows Debugger (Windbg.exe). To install the latest available version of the Windows Debugger, visit the following Microsoft Web site:

http://www.microsoft.com/whdc/ddk/debugging



Debug a co-installer by using the Device Manager
To debug the co-installer, attach the co-installer to the Device Manager, and then run an Update Driver operation. To do this, follow these steps:  Plug in the hardware device, and then cancel the New Hardware Found Wizard (if it appears). Open the Device Manager. To do this, use one of the following methods:  Right-click My Computer, and then click Manage. The Microsoft Management Console (MMC.exe) starts, and it loads the Computer Management snap-in. If you have Administrative Tools configured, click Start, point to All Programs, point to Administrative Tools, and then click Computer Management. In Control Panel, click System.  Right-click the appropriate device, and then click Update Driver.</li> Start the Windows Debugger (Windbg.exe). If the co-installer module is already loaded, go to step 9. Otherwise, follow steps 5 through 8 to trigger a break in execution when the co-installer module is loaded.</li> On the Debug menu, click Event Filters.</li> In the Event Filters dialog box, follow these steps: <ol style="list-style-type: lower-alpha;"> Click Load Module in the list.</li> Under Execution, click Enabled.</li> Under Continue, click Not Handled.</li> Under Argument, type the file name of your co-installer, without the file name extension. For example, for the co-installer Mycoinst.dll, type Mycoinst .</li></ol> </li> Click OK to accept the changes and to set the breakpoint.</li> Resume execution by pressing F5 or by typing g in the command window of the debugger. Execution will break when your co-installer is loaded.</li> Set the required breakpoints in the co-installer module, and then resume execution by pressing F5 or by typing g in the command window of the debugger.</li></ol>

Debug a co-installer by using the DevCon utility
Debug the co-installer by executing the DevCon utility (Devcon.exe) from the Windows Debugger. You must have the DevCon utility from the Windows DDK installed to follow these steps. To order the latest Windows DDK, visit the following Microsoft Web site:

http://www.microsoft.com/whdc/ddk/winddk.mspx

If you have developed a Device Installation Application, use that application in the following steps instead of using the DevCon utility. For more information about developing a Device Installation Application, see the &quot;Writing a Device Installation Application&quot; topic in the DDK documentation. <ol> Plug in the hardware device, and then cancel the New Hardware Found Wizard (if it appears).</li> Start the Windows Debugger (Windbg.exe).</li> On the File menu, click Open Executable.</li> In the Open Executable dialog box, locate Devcon.exe.

Note By default, Devcon.exe is located in the \Tools\DevCon\I386\ folder, where   is the installation folder for the current version of the DDK.</li> In the Arguments box, type update.

Note  is the file name of your Device Installation Information (INF) file, and   is the Hardware ID of your device.</li> In the Start Directory box, type the path of your Device Installation package.</li> <li>Click Open to start the debugging process. The debugger will break into the Devcon.exe process before it installs your driver. If the co-installer module is already loaded, go to step 12. Otherwise, continue with the following steps to trigger a break in execution when the co-installer module is loaded.</li> <li>On the Debug menu, click Event Filters.</li> <li>In the Event Filters dialog box, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>Click Load Module in the list.</li> <li>Under Execution, click Enabled.</li> <li>Under Continue, click Not Handled.</li> <li>Under Argument, type the file name of your co-installer, without the file name extension. For example, for the co-installer Mycoinst.dll, type Mycoinst .</li></ol> </li> <li>Click OK to accept the changes and to set the breakpoint.</li> <li>Resume execution by pressing F5 or by typing g in the command window of the debugger. Execution will break when your co-installer is loaded.</li> <li>Set the required breakpoints in the co-installer module, and then resume execution by pressing F5 or by typing g in the command window of the debugger.</li></ol>

Keywords: kbDDK kbOEM kbDebug kbhowto kbPlugPlay KB833909

Technology: kbwin2000Pro kbwin2000ProSearch kbWin2000ProSP1 kbWin2000ProSP2 kbWin2000ProSP3 kbWin2000ProSP4 kbwin2000Search kbwin2000Serv kbwin2000ServSearch kbWinServ2003Search kbWinServ2003St kbWinXPPro kbWinXPProSearch kbWinXPProSP1 kbWinXPSearch

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.