SUMMARY
By default, the Windows Image Acquisition (WIA) service logs errors to a file named Wiadebug.log in the
Windows_folder folder. This article describes how to enable logging to the Wiadebug.log file.
back to the topEnable Logging Of Wiadebug.log File
The information that the WIA service logs in this file can be very helpful during driver development. The logging level is controlled by an entry in the registry. For WIA, this key resides in the following registry key, where
Module_name is the name of the appropriate binary module:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\StillImage\Debug\Module_name\DebugFlags
For the WIA service, the appropriate binary module is Wiaservc.dll.
The value in
DebugFlags controls the logging level. The following list describes three of the settings:
- 0x00000001: Display error messages.
- 0x00000002: Display warning messages
- 0x00000004: Display trace messages.
The value for
DebugFlags is a flag value; that is, different settings may be read together. To turn on logging for errors, warnings, and traces all at once, set
DebugFlags to
0x0000007.
If you change the value of
DebugFlags, stop the WIA service (stisvc), and then restart it for the changes to take effect.
To stop the Still Image service, open a command prompt, and then run the following command:
net stop stisvc
To start the Still Image service, open a command prompt, and then run the following command:
net start stisvc
NOTE: Excessive logging can lead to a significant decrease in performance. Increase the logging level only when you are attempting to solve a particular problem. After you have corrected the problem, set the logging level to its original level.
back to the topTroubleshooting
The following scenario describes a typical problem, and describes how you can use the information in the Wiadebug.log file to resolve the problem.
Scenario:
You have written a program to test a scanner driver that is under development. For one of the tests, you attempt to set the scanner's dots per inch (dpi) setting to
1200, but you notice that this action produces an error.
The following data is logged in Wiadebug.log:
wiasGetChangedValueLong, validate prop 6147 failed hr: 0x80070057
wiasUpdateScanRect, CheckXResAndUpdate failed (0x80070057)
CDrvWrap::WIA_drvValidateItemProperties, Error calling driver:
drvValidateItemProperties with hr = 0x80070057
NOTE: This behavior is typical if a program writes an invalid value.
These log entries indicate that the driver is reporting that the program wrote an invalid value. It is not clear from this information what the exact problem is. If you increases the WIA logging level to report warnings as well as the errors, the following information is logged in Wiadebug.log:
wiasValidateItemProperties, invalid LIST value for :
propID) Horizontal Resolution, value = 1200
Valid values are:
wiasGetChangedValueLong, validate prop 6147 failed hr: 0x80070057
wiasUpdateScanRect, CheckXResAndUpdate failed (0x80070057)
CDrvWrap::WIA_drvValidateItemProperties, Error calling driver:
drvValidateItemProperties with hr = 0x80070057
NOTE: This behavior is typical if the program writes an invalid value.
The output shows that the Horizontal Resolution property is causing the failure. The program is attempting to set the resolution to
1200, but the list of supported resolutions does not include
1200; therefore the WIA service validation helper (wiasValidateItemProperties) rejects the request to set this value.
Now that you have identified the problem, you can determine whether to revise the driver or the program. If the scanner's specifications allow it to support all resolutions between 100 and 1400 dpi, the driver should be able to handle a request for 1200 dpi. If the scanner does not support this setting, change the program so that it does not attempt to set the Horizontal Resolution to a value that is not valid for this property. In this case, the program should check that a value is valid before attempting to set a property to this value.
back to the top