Troubleshooting Device Installation with the Setupapi log File




старонка2/11
Дата канвертавання22.04.2016
Памер227 Kb.
1   2   3   4   5   6   7   8   9   10   11

4Driver-Installation Sections


SetupAPI adds a driver-installation section for every device that it installs—both during the GUI-mode setup phase of Windows installation and after Windows has been installed. In the former case, the driver-installation sections immediately follow the device-setup class installation sections. In the latter case, the driver-installation sections can appear anywhere after the sections that were added during the Windows installation. Each driver-installation section in a SetupAPI log file contains all the messages that relate to both detecting a device and installing the best compatible driver for that device.

The following example (for a fictitious Oven device) illustrates the main driver-installation messages that SetupAPI typically logs during the GUI-mode setup phase of Windows installation.

[2003/05/22 16:37:16 336.1808 Driver Install]

#-019 Searching for hardware ID(s): Oven_Hardware_ID

#-199 Executing "C:\WINDOWS\system32\setup.exe" with command line: setup –newsetup

#I022 Found "Oven_Hardware_ID" in C:\WINDOWS\inf\Oven_INF_File_Name.inf; Device: "Oven_Device_Description"; Driver: "Oven_Driver_Description"; Provider: "Oven_Provider_Name"; Mfg: "Oven_Manufacturer_Name"; Section name: "Oven_install-section-name".

#I023 Actual install section: [Oven_install-section-name]. Rank: 0x00000000. Effective driver date: 03/15/2003.

#-166 Device install function: DIF_SELECTBESTCOMPATDRV.

. . .

#I121 Device install of "Oven_Device_Instance_ID" finished successfully.


The first line in the example is the section marker, which indicates that the Plug and Play Manager is initiating the installation of a driver for a device. The next line, which contains a #-019 message, reports that the hardware identifier of the device is Oven_Hardware_ID. (The hardware identifier applies either to a root-enumerated device or to a device that was reported to the Plug and Play Manager by the device’s bus driver.)

Continuing on, the #-199 message reports that SetupAPI installed the driver by executing the setup –newsetup command line, which, in turn, indicates that the driver was installed during the GUI-mode setup phase of Windows installation. The #I022 and #I023 messages state the INF file and the particular installation section that supports the device. (In this example, only one INF file matches the device. If more than one file matched the device, they would be stated here.) The #-166 message reports that SetupAPI is processing a DIF_SELECTBESTCOMPATDRV request and, finally, the #I121 message indicates that SetupAPI successfully installed the device.

The previous example provides a broad overview of a driver-installation section. However, each of these sections actually consists of a number of subsections, which correspond to the stages that occur during driver installation. These stages are:


  • Initiating driver installation

  • Finding the drivers that match the device

  • Loading class installers and co-installers

  • Selecting the best compatible driver

  • Allowing installation

  • Installing files

  • Verifying files and pruning the file queue

  • Committing the file queue

  • Registering and reloading co-installers

  • Installing device interfaces

  • Installing the device

  • Finishing the Install Wizard

  • Cleaning up

The following sections in this paper describe each driver-installation subsection in detail. For each subsection, examples of default logging and of the most verbose logging are included. The former apply to the fictitious Oven device, while the latter apply to a fictitious Blender device.



Note

In addition to default logging and the most verbose logging, other logging levels exist that you can set. How to set all the levels is discussed in Appendix A: Setting the SetupAPI Logging Level.



4.1Initiating Driver Installation


The first driver-installation subsection in a SetupAPI log file contains messages that indicate the device’s hardware identifiers, the device’s compatible identifiers, and the type of driver installation. Four types of driver installations exist: GUI-mode, server-side, client-side, and application-specific. A GUI-mode driver installation occurs during the GUI-mode setup phase of Windows installation; the other three driver-installation types occur after the Windows installation.

The following example illustrates what this initiating-driver-installation subsection looks like for a GUI-mode installation of an Oven device, if the default logging level is set.

[2003/05/22 16:37:39 336.1964 Driver Install]

#-019 Searching for hardware ID(s): Oven_Hardware_ID_1,Oven_Hardware_ID_2,Oven_Hardware_ID_3,Oven_Hardware_ID_4

#-018 Searching for compatible ID(s): Oven_Compatible_ID_1,Oven_Compatible_ID_2,Oven_Compatible_ID_3,Oven_Compatible_ID_4

#-199 Executing "C:\WINDOWS\system32\setup.exe" with command line: setup –newsetup


In the previous example, the first line is the marker that designates this section as a driver-installation section. The #-019 message indicates that the Oven device’s parent bus driver reported four hardware identifiers to the Plug and Play Manager, while the #-018 message indicates that the parent bus driver reported four compatible identifiers. The #-199 message indicates that SetupAPI executed the setup –newsetup command line to install the driver, which, in turn, indicates that the driver installation occurred during the GUI-mode setup phase of Windows installation.

For a server-side driver installation, SetupAPI does not log a #-199 message, as shown in the previous example. Instead, it logs a #-198 message, which states that SetupAPI executed services.exe to install the driver, as shown here:

#-198 Command line processed: E:\WINDOWS\system32\services.exe
For a client-side driver installation, SetupAPI logs a #-199 message stating that Windows executed newdev.dll to install the driver, as shown here:

#-199 Executing "E:\WINDOWS\system32\rundll32.exe" with command line: rundll32.exe newdev.dll,ClientSideInstall \\.\pipe\PNP_Device_Install_Pipe_0.{FC06A736-DFBF-4579-A96B-95FCF040BE47}


Finally, if the driver installation is application-specific (in other words, initiated by an installation program), the entire initiating-driver-installation subsection looks a bit different than the previous examples show. This type of driver installation occurs when the installation program calls the UpdateDriverForPlugAndPlayDevices function, which updates the driver for a Plug and Play device. In the following example, the #-199 message reveals that devcon.exe was the installation program that called UpdateDriverForPlugAndPlayDevices; however, any installation program can call this function, and the #-199 message will contain the name of the corresponding executable program.

[2003/05/19 14:41:58 3136.127]

#-199 Executing "y:\idw\devcon.exe" with command line: devcon update E:\WINDOWS\inf\Oven_INF_File_Name.inf Oven_Hardware_ID

@ 14:41:58.318 #I060 Set selected driver.

#-019 Searching for hardware ID(s): Oven_Hardware_ID
Note

For more information on the UpdateDriverForPlugAndPlayDevices function, see “UpdateDriverForPlugAndPlayDevices” in the Windows DDK documentation.



4.1.1Initiating Driver Installation: Verbose Logging


The following example illustrates what the initiating-driver-installation subsection looks like for a Blender device—if the most verbose logging level is set.

[2003/02/18 10:18:56 568.2675 Driver Install]

#-019 Searching for hardware ID(s): Blender_Hardware_ID

#-199 Executing "E:\WINDOWS\system32\setup.exe" with command line: setup -newsetup

@ 10:18:56.437 #V017 Enumerating files "E:\WINDOWS\inf".

@ 10:18:56.437 #V392 Using INF cache "E:\WINDOWS\inf\INFCACHE.1".

@ 10:18:56.437 #V073 Cache: Excluding INF "accessor.inf".

You can check entries of this type to determine if Setup excludes an INF file.

@ 10:18:56.437 #V073 Cache: Excluding INF "activeds.inf".

@ 10:18:56.437 #V073 Cache: Excluding INF "agtinst.inf".

@ 10:18:56.437 #V073 Cache: Excluding INF "apcompat.inf".

@ 10:18:56.609 #T075 Enumerating files: Directory pass completed.


In the previous example, the #V017 through #T075 messages are associated with finding the INF files that match the device.

1   2   3   4   5   6   7   8   9   10   11


База данных защищена авторским правом ©shkola.of.by 2016
звярнуцца да адміністрацыі

    Галоўная старонка