Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
7.8 KiB

  1. <HTML>
  2. <HEAD>
  3. <TITLE>Text-mode Device Console</TITLE>
  4. <META content="text/html; charset=windows-1252" http-equiv=Content-Type>
  5. <META content="Microsoft FrontPage 5.0" name=GENERATOR>
  6. </HEAD>
  7. <BODY link=#0000ff><FONT face=Verdana size=5>
  8. <H2>DevCon Tool</H2></FONT><FONT face=Verdana size=2>
  9. <P><SPAN style="COLOR: #ff0000; FONT-FAMILY: Arial; FONT-SIZE: 10pt">[This is
  10. preliminary documentation and subject to change.]</SPAN></P>
  11. <H3>SUMMARY</H3>
  12. This document accompanies the &quot;DevCon&quot; tool which is a text-mode device
  13. console. The instructions herein apply to the Windows XP operating
  14. system. DevCon has been designed for use on Windows 2000 and Windows XP. It will
  15. not work on Windows 95, Windows 98 or Windows ME.<p>The &quot;DevCon&quot; tool described in this article is a command line
  16. utility that acts as an alternative to Device Manager. It allows individual
  17. devices or groups of devices to be enabled, disabled, restarted, updated, removed and queried. Devcon provides information that is relevant to the developer and thus not
  18. available in Device Manager.<p>DevCon may not be redistributed, but
  19. is available as a debugging and development tool.</FONT> <font face="Verdana" size="2">The
  20. source code for Devcon can be found at src\setup\devcon along with
  21. documentation and may be freely modified for private use.
  22. <H3>USING DEVCON</H3>
  23. <p>Devcon can be found along with this documentation at tools\devcon. Devcon has
  24. built in help that is displayed by typing &quot;devcon help&quot;. Examples on
  25. how to use devcon are described here.<p>Devcon accepts optional switches (-r for
  26. reboot, -m to specify remote machine), a command and arguments related to that
  27. command. Example DevCon commands are:<p><b>devcon find pci\*</b><p>Find and list
  28. all known PCI devices on the local machine (assuming that a device is PCI if it has
  29. a hardware ID that is prefixed by &quot;PCI\&quot;).<p><b>devcon -m:\\foobar
  30. find pci\*</b><p>Find and list all known PCI devices on the machine &quot;foobar&quot; (-m
  31. allows target machine to be specified. IPC access to machine is required).<p><b>devcon
  32. classes</b><p>List all known setup classes. The output contains the short
  33. non-localized name (e.g. &quot;USB&quot;) and the descriptive name (e.g.
  34. &quot;Universal Serial Bus controllers&quot;).<p><b>devcon listclass usb 1394</b><p>List
  35. all present devices for each class named (in this case USB and 1394).<p><b>devcon find =ports *pnp*</b><p>List
  36. present devices that are a member of the &quot;ports&quot; setup class and
  37. contain &quot;PNP&quot; in their hardware ID.<p><b>devcon find =ports @root\*</b><p>List
  38. present devices that are a member of the &quot;ports&quot; setup class and live
  39. in the &quot;root&quot; branch of the enum tree (i.e., the instance ID is
  40. prefixed by &quot;root\&quot;). Note that programmatically, no assumption should
  41. be made about how an instance ID is formatted, and root devices can be
  42. determined by checking device status bits. However this feature has been
  43. provided in devcon to aid in debugging.<p><b>devcon findall =ports</b><p>Lists
  44. non-present devices along with present devices for the ports class. This will
  45. include devices that have been removed, devices that have been moved from one
  46. slot to another, or, in some cases, devices that have been enumerated
  47. differently due to a BIOS change.<p><b>devcon status @pci\*</b><p>Lists the
  48. status of each present device who's instance ID begins with &quot;pci\&quot;.<p><b>devcon status @ACPI\PNP0501\1</b><p>Lists the status of
  49. a specific device instance, in this case an ACPI enumerated serial port.<p><b>devcon resources =ports</b><p>Lists the resources used by
  50. all devices in the ports setup class.<p><b>devcon driverfiles =ports</b><p>Lists
  51. files that are associated with each device in the ports setup class.<p><b>devcon
  52. stack =ports</b><p>Lists the expected driver stack for the device, including
  53. device and class upper/lower filters as well as the controlling service.<p><b>devcon drivernodes
  54. @ROOT\PCI_HAL\PNP0A03</b><p>Lists all compatible drivers for the device
  55. &quot;ROOT\PCI_HAL\PNP0A03&quot;. This can be used to determine why an in-box INF was
  56. chosen in preference to a third party INF.<p><b>devcon remove @usb\*</b><p>Remove all USB
  57. devices. Devices removed will be listed along with removal status.<p><b>devcon
  58. rescan</b><p>Rescan for new Plug&amp;Play devices.<p><b>devcon update mydev.inf
  59. *pnp0501</b><p>Update all devices that match (exactly) the hardware ID *pnp0501
  60. to use the best driver in mydev.inf associated with the hardware ID *pnp0501.
  61. Note that this will force all devices to use the driver in mydev.inf even if
  62. there is a better match already on the system. This is useful for installing
  63. new versions of drivers during development prior to obtaining a signature. It only
  64. affects
  65. the devices that match the specified hardware ID and not child devices. If the
  66. specified INF is unsigned, Windows may display UI appear confirming that the driver should be
  67. installed. If a reboot is required, it will be reported and devcon will return
  68. with errorlevel of 1. Specifying &quot;-r&quot; will cause a reboot to occur
  69. automatically if one is required.<p><b>devcon -r install %windir%\inf\netloop.inf
  70. *MSLOOP</b><p>Install a new instance of the Microsoft loopback adaptor. Install
  71. will allow a &quot;virtual device&quot; such as the loopback adaptor to be
  72. installed by creating a new root-enumerated device node. Reboot the machine
  73. silently if a reboot is required.<p><b>devcon disable *MSLOOP</b><p>Disable all
  74. devices who's hardware ID ends with &quot;MSLOOP&quot; (including *MSLOOP).<p><b>devcon
  75. enable '*MSLOOP</b><p>Enable all devices who's hardware ID <i>is</i> &quot;*MSLOOP&quot;.
  76. The single quote indicates that the hardware ID must be taken literally.<p><b>devcon
  77. restart =net @'ROOT\*MSLOOP\0000</b><p>Restart the loopback adaptor &quot;ROOT\*MSLOOP\0000&quot;.
  78. The single quote indicates that the instance ID must be taken literally.<h4>Notes</h4>
  79. <ul>
  80. <li>Devcon will return an errorlevel for use in scripts. 0 indicates success.
  81. 1 indicates that a reboot is required. 2 indicates a failure. 3 indicates a
  82. syntax error.</li>
  83. <li>If &quot;-r&quot; is specified and a reboot is required, the reboot will
  84. occur without warning once all devices have been processed.</li>
  85. <li>If &quot;-m:\\machine&quot; is specified and the command will not work for
  86. a remote machine, an error will be reported.</li>
  87. <li>Devcon allows wildcards in instance ID's for interactive convenience. No
  88. assumption should be made about the format of an instance ID from machine to
  89. machine and from OS version to OS version.</li>
  90. </ul>
  91. <H3>CODE TOUR</H3>
  92. <H4>File Manifest</H4>
  93. </font><FONT face="Courier" size="3">
  94. <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=0 width="916">
  95. <TR><TD width="151" valign="top"><U>File</u></TD><TD width="755"><u>Description<u></TD></TR>
  96. <TR><TD width="151" valign="top"><i>DevCon.htm</i></TD><TD width="755">Sample tour documentation for this binary (this file).</TD></TR>
  97. <tr>
  98. <TD width="151" valign="top"><i>ia64\DevCon.exe</i></TD><TD width="755">64-bit DevCon tool
  99. binary.</TD>
  100. </tr>
  101. <tr>
  102. <TD width="151" valign="top"><i>i386\DevCon.exe</i></TD><TD width="755">32-bit
  103. DevCon tool binary. This will not function completely on 64-bit Windows.</TD>
  104. </tr>
  105. </TABLE>
  106. <H3>FEEDBACK</H3>
  107. <P>We welcome your comments, problem reports and wish-list requests. Please
  108. submit them by pointing your Internet browser to <A href="http://www.microsoft.com/ddk">http://www.microsoft.com/ddk</A>.
  109. </FONT></P>
  110. <P align=center><FONT face=Verdana size=2><A href="#top">Top of page</A></P></FONT>
  111. <TABLE border=0" cellSpacing="0" width="624">
  112. <TR>
  113. <TD bgColor="#00ffff" height="2" vAlign="middle"></TD></TR></TABLE>
  114. <FONT face="MS Sans Serif" size=1>
  115. <P>&copy; Microsoft Corporation 2001</FONT><FONT face=Verdana size=2>
  116. </P></FONT>
  117. </BODY>