Menu

Application Verifier break message

A print driver called TerminateThread

Probable cause

A print driver called TerminateThread, which is used to cause a thread to exit. When this occurs, the target thread has no chance to execute any user-mode code.

Troubleshooting steps

Use the k debugger command to dump the stack trace and identify the routine that called TerminateThread.

Information displayed by Application Verifier

Parameter 1�-�Not used.

Parameter 2�-�Not used.

Parameter 3�-�Not used.

Parameter 4�-�Not used.

Additional information

Stop code:�D02B

When TerminateThread is called, DLLs that are attached to a thread are not notified that the thread is terminating. The system frees the thread's initial stack. TerminateThread is a dangerous function that should be used only in the most extreme cases. TerminateThread can result in the following problems:

  • If the target thread owns a critical section, the critical section will not be released.

  • If the target thread is allocating memory from the heap, the heap lock will not be released.

  • If the target thread is executing certain kernel32 calls when it is terminated, the kernel32 state for the thread's process could be inconsistent.

  • If the target thread is manipulating the global state of a shared DLL, the state of the DLL could be destroyed, which would affect other users of the DLL.