Troubleshooting Device Installation with the Setupapi log File




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

6.8Service Deletion Pending


If an INF file deletes a service by using a DelService directive, and then it attempts to add the same service by using an AddService directive, SetupAPI will log an error. The following example illustrates the messages that SetupAPI will log under these conditions for a fictitious Blender service. Note that the only way to correct this error is to reboot.

#-035 Processing service Add/Delete section [Blender_Install_Section.Services].

@ 18:28:34.955 #E279 Add Service: Failed to create service "Blender". Error 1072: The specified service has been marked for deletion.

@ 18:28:34.965 #E033 Error 1072: The specified service has been marked for deletion.

@ 18:28:34.975 #E275 Error while installing services. Error 1072: The specified service has been marked for deletion.

@ 18:28:34.985 #T224 Install Device: Cleaning up failed device.

@ 18:28:35.025 #E122 Device install failed. Error 1072: The specified service has been marked for deletion.

@ 18:28:35.035 #T201 Install Device: End.

@ 18:28:35.146 #E154 Class installer failed. Error 1072: The specified service has been marked for deletion.
In the previous example, the #-035 and #E279 messages relate to the INF file adding the Blender service. The #E033 message indicates that the service was previously marked for deletion. Finally, the #E275 through #E154 messages report that device-installation failed and that the service was previously marked for deletion.

6.9Protected System File Replaced


If a device-installation program attempts to replace a protected system file, SetupAPI performs one of the following actions, depending on how the Driver Signing option is set in Device Manager.

  • If Block is set, SetupAPI informs the user that the driver package cannot be installed because it is unsigned.

  • If Warn is set, SetupAPI informs the user that the driver package is unsigned, and it allows the user to cancel the installation.

  • If Ignore is set, SetupAPI changes the Driver Signing option that is applied to the installation from Ignore to Warn. SetupAPI then performs the actions just mentioned for the Warn setting.

SetupAPI logs the following message if it successfully negotiates with Windows File Protection to replace a protected system file.

@ 18:28:35.146 #E243 Exemption obtained for protected system file "…\Some_System_File_Name_And_Extension".
SetupAPI logs the following message if it changes the Driver Signing option that is applied to the installation from Ignore to Warn.

@ 18:28:35.200 #E245 The device installation digital signature failure policy has been elevated from Ignore to Warn due to a proposed replacement of a protected system file.


7Appendix A: Setting the SetupAPI Logging Level


The amount of information that SetupAPI records in the SetupAPI log file depends on the logging level. You can choose the types of errors to log, the verbosity of the messages, and whether to log information to a debugger as well as to the log file. (You can also turn off logging altogether.) You can set the logging level for all device-installation programs or for individual ones.

To set the logging level for all device-installation programs

  1. If the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup registry subkey does not contain a LogLevel entry, create one as a new REG_DWORD value.

  2. Set the value of the LogLevel entry to the logging level that you want.

To set the logging level for an individual device-installation program

  1. If the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\AppLogLevels registry subkey does not exist, create it.

  2. In the subkey, create a new entry as a REG_DWORD value, and name it with the file name of the application's executable program.

  3. Set the value of the entry to the logging level that you want.

The logging level is composed of three parts: the general logging level, the device-installation logging level, and a set of special flags. You can think of the logging level as represented by 0xSSSSDDGG. The lowest 8 bits(GG) contain the general logging level, which controls the types of messages that are logged by the Windows Setup functions. The next higher 8 bits (DD) contain the device-installation logging level, which controls the types of messages that are logged by the device-installation functions. The highest 16 bits (SSSS) contain the special flags, which apply to logging by both the Windows Setup functions and the device-installation functions.

The following table describes the general logging levels.



General logging level

Meaning

    0x00000000

    Set default logging (currently equivalent to the 0x00000020 logging level).

    0x00000001

    Turn off logging by the Windows Setup functions.

    0x00000010

    Log error messages.

    0x00000020

    Log error and warning messages.

    0x00000030

    Log error, warning, and information messages.

    0x00000040

    Log error, warning, information, and verbose messages.

    0x00000050

    Log error, warning, information, verbose, and timing messages.

    0x00000060

    Log error, warning, information, verbose, and timing messages. Include time stamps in all messages.

    0x00000070

    Log error, warning, information, verbose, and timing messages. Include time stamps in all messages. Include additional messages that can slow down the system, such as those for cache hits.

    0x000000FF

    Set the most verbose logging. (Currently, log the same messages as the 0x00000070 logging level does.)

The following table describes the device-installation logging levels.



Device-installation logging level

Meaning

    0x00000000

    Set default logging (currently equivalent to the 0x00003000 level).

    0x00000100

    Turn off logging by the device-installation functions.

    0x00001000

    Log error messages.

    0x00002000

    Log error and warning messages.

    0x00003000

    Log error, warning, and information messages.

    0x00003100

    Log error, warning, and information messages. Include information about matching driver nodes.

    0x00004000

    Log error, warning, information, and verbose messages. Include information about matching driver nodes.

    0x00004100

    Log error, warning, information, and verbose messages. Include information about matching driver nodes and about co-installers.

    0x00005000

    Log error, warning, information, verbose, and timing messages. Include information about matching driver nodes and about co-installers.

    0x00006000

    Log error, warning, information, verbose, and timing messages. Include time stamps in all messages. Include information about matching driver nodes and about co-installers.

    0x00007000

    Log error, warning, information, verbose, and timing messages. Include time stamps in all messages. Include information about matching driver nodes and about co-installers. Include additional messages that can slow down the system, such as those for cache hits.

    0x0000FF00

    Set the most verbose logging. (Currently, log the same messages as the 0x00007000 logging level does.)

The following table describes the special flags.



Special flag

Meaning

    0x08000000

    Add a time stamp to all messages.

    0x10000000

    Log context messages that are normally discarded if the operation does not succeed. Because these messages are normally logged only if the operation does succeed, the use of this flag can cause confusion.

    0x20000000

    Do not flush the logging information to disk after writing each message. Setting this flag increases the logging speed but, if the system crashes, information can be lost. Due to the increase in speed, setting this flag is recommended for use with the verbose logging levels.

    0x40000000

    Do not group messages by section before writing them to the log file. If this flag is set, SetupAPI writes all the messages in chronological order—regardless of the sections that they pertain to—and prefixes each message with its section header. By default, SetupAPI groups all the messages that pertain to a particular section, and then adds the messages in that group to the log file in chronological order. This flag is often confusing, but it can be useful for detecting synchronization problems among SetupAPI operations.

    0x80000000

    Send all the messages to the debugger as well as to the log file.

The most commonly used logging levels are the following:



  • 0x00000000—which specifies default logging with no special flags. This is the level that generated the default-logging examples in this paper.

  • 0x00006060—which causes most messages to be logged. However, this level does not log all the INF files that are included in a search for matching INF files.

  • 0x2000FFFF—which specifies that everything should be logged and that the log file should not be flushed to disk after each message is written. This level is recommended for verbose logging. Note that the 0x0000FFFF logging level was used to generate the verbose-logging examples in this paper.


Caution

Do not use 0xFFFFFFFF. This level turns on all logging, which results in an unreadable log file and some very slow installations.


For more information about the SetupAPI logging levels, see “Using SetupAPI Logging” in the Windows DDK documentation.
1   2   3   4   5   6   7   8   9   10   11


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

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