We just released a new version of Application Verifier. As part of this release, we added a number of stops to Print Verifier. Unfortunately, we neglected to document these stops in the recent release of App Verifier. By the time we discovered this mistake, it was too late for the doc writers to update the documentation. We will definitely get this rectified in the next release. But in the meantime, we thought we’d publish the documentation for the new stops here.
Application Verifier break message
Async Notify handle returned by RegisterForPrintAsyncNotifications was not released properly
Handle allocated by RegisterForPrintAsyncNotifications function had not been released until the program exited. Most likely, it needs to be released by calling UnRegisterForPrintAsyncNotifications() before exiting.
To troubleshoot this stop:
o Determine the routine that called winspool to allocate the handle on its behalf by using the second parameter of this verifier stop.
o Dump the initialization stack trace using the dps command in the debugger.
o Find the first non-winspool and non-vfPrint module name that called vfPrint!VfHookRegisterForPrintAsyncNotifications. This routine is typically found in the 3rd stack frame.
Information displayed by Application Verifier
Parameter 1 - Handle value.
Parameter 2 - Initialization stack trace. Use dps to dump the stack trace if it is not NULL.
Parameter 3 - Not used.
Parameter 4 - Not used.
Test Layer: PrintAPI
Stop ID: 0000A020
Stop code: 032
One-time error: no
Error report: None
Log to file: yes
Create backtrace: yes
Attempt to use an invalid handle in UnRegisterForPrintAsyncNotifications.
The handle was not opened by the RegisterForPrintAsyncNotifications Win32 API function.
To troubleshoot this stop, view the stack trace of the routine that attempted this action using the 'k' command in the debugger.
Parameter 2 - Not used.
Stop ID: 0000A021
Stop code: 033
Error report: Break
Attempt to use a closed handle in UnRegisterForPrintAsyncNotifications API function.
An async notify handle was used after it has been closed.
o Use the 'k' command in the debugger to view the current stack trace. This will indicate the routine that tried to use the closed handle.
o Use the 'dps' debugger command on the second parameter of the stop to view the stack trace of the routine that closed the handle.
Parameter 2 - Stack trace of the closing. Use dps to dump the stack trace if it is not NULL.
Stop ID: 0000A022
Stop code: 034
Third-party function reports failure but increases reference count for input interface.
A third-party method receives interface pointer as input. When such method returns a failure code, the interface reference count should remain the same. But in this case the reference count was increased.
To troubleshoot this stop, view the current stack trace using the 'k' command in the debugger.
Format: The %lS method returns %x error code but increases ref count of %lS parameter.
Parameter 1 - Called interface pointer. If NULL, called function is static.
Parameter 2 - Input interface pointer.
Stop ID: 0000A023
Stop code: 035
Windows API function reports failure but increases reference count for input interface.
An API method receives interface pointer as input. When such method returns fail code, interface ref count should remain the same. But in this case reference count was increased. Please report this error to Microsoft because it could be a problem in API code.
Stop ID: 0000A024
Stop code: 036
IPrintAsyncNotifyChannel contract violation by the operating system.
The platform implementation of IPrintAsyncNotifyChannel violated part of the special contract implied or defined by IPrintAsyncNotifyChannel. IPrintAsyncNotifyChannel has special exceptions to AddRef and Release. This requires that the platform calls OnEventNotify and ChannelClosed with the same pointer value as the channel was created with. Please report this error to Microsoft.
Format: %s was called with the wrong interface pointer.
Parameter 1 - Actual interface pointer.
Parameter 2 - Expected interface pointer.
Stop ID: 0000A025
Stop code: 037
IPrintAsyncNotifyChannel contract violation by channel consumer.
On bidirectional channels, calling SendNotification, CloseChannel, or making the final Release on the interface pointer relinquishes 'ownership'. After creating the channel and sending the first notification, you cannot call Release until your callback's OnEventNotify is invoked. If either you invoke CloseChannel or get a ChannelClosed notification, then you must not perform the final Release call.
Format: %s was called, but channel 'ownership' currently belongs to print spooler
Parameter 1 - IPrintAsyncNotifyChannel interface pointer.
Stop ID: 0000A026
Stop code: 038
Race detected during closing of IPrintAsyncNotifyChannel.
This stop indicates that a notification arrives _during_ the call to CloseChannel. If this condition occurs, it may be imposible for the consumer to correctly release the channel.
This stop should not be frequently encountered. It can be prevented by always ensuring a listener is available before a bidirectional channel is created, AND/OR ensuring that no listener can be started before attempting closing a channel that has already sent a notification but not recieved the callback.
Please report this error to Microsoft.
Format: In function %s, a call is already in progress on a different thread. See help for more info.
Parameter 2 - Thread id of member function called.
Parameter 3 - Thread id of callback event function.
Stop ID: 0000A027
Stop code: 039
Calling a print API that makes network calls on a GUI thread. This can lead to unbound in time UI hangs.
A print API was called that makes network calls on a GUI thread. This can lead to unbound in time UI hangs. Typically such APIs need to be called on a worker thread, with no message pumps.
Format: %s was called on a thread that is a GUI thread. This can lead to unbound in time UI hangs.
Parameter 1 - HWND of the top-level visible window.
Parameter 2 - Current thread ID.
Stop ID: 0000A028
Stop code: 040
Calling an API that will pop up user interface is Session0.
A call was made to an API that will pop up user interface is Session0.
Format: The illegal-to-call in Session0 API: %s
Parameter 1 - Not used.
Stop ID: 0000A029
Stop code: 041
A print driver called ExitThread.
A print driver module called ExitThread. When a print driver module calls ExitThread, the thread is exited before any destructors can be called or any other automatic cleanup can be performed. This can lead to undefined behavior. Therefore, print drivers should always return from their thread function.
To troubleshoot this stop, view the current stack trace by using the 'k' command in the debugger to identify the print driver module and routine that invoked ExitThread.
Test Layer: PrintDriver
Stop ID: 0000D02A
Stop code: 042
A print driver called TerminateThread.
A print driver module called TerminateThread. TerminateThread is used to cause a thread to exit. When this occurs, the target thread has no chance to execute any user-mode code. DLLs attached to the thread are not notified that the thread is terminating. The system frees the thread's initial stack. TerminateThread is a dangerous function that should only be used in the most extreme cases.
For example, TerminateThread can result in the following problems:
o If the target thread owns a critical section, the critical section will not be released.
o If the target thread is allocating memory from the heap, the heap lock will not be released.
o If the target thread is executing certain kernel32 calls when it is terminated, the kernel32 state for the thread's process could be inconsistent.
o If the target thread is manipulating the global state of a shared DLL, the state of the DLL could be destroyed, affecting other users of the DLL.
To troubleshoot this stop, view the current stack trace by using the 'k' command in the debugger to identify the print driver module and routine that invoked TerminateThread.
Stop ID: 0000D02B
Stop code: 043