Menu

Application Verifier break message

Leaked printer handle detected

Probable cause

An open printer handle was detected when the application terminated. Most likely, the creating thread did not call ClosePrinter() to close the printer handle.

Troubleshooting steps

To troubleshoot this stop,

  • Determine the thread that opened the printer handle by using the second parameter of this verifier stop to provide the stack trace.

  • Dump the stack trace using the dps command in the debugger.

  • Find the first non-winspool and non-vfPrint module name that called vfPrint!VfHookOpenPrinter* or vfPrint!VfHookAddPrinter* - this typically is the 4th or the 6th stack frame in the list.

For example:

Copy Code
=======================================
VERIFIER STOP 0000A000 : pid 0x13E4: Leaked printer handle detected

        0BEFCF8C : Printer handle being leaked.
        02956F50 : Initialization stack trace. Use dps to dump it if not NULL.
        00001698 : Thread id of the thread that opened the handle.
        00000000 : Not used.
=======================================
0:000> dps 02956F50
02956f50  0243527a vfPrint!CItemTracker(void *)::Init+0x6a
02956f54  02434e30 vfPrint!CHandleTracker_t(void *)::Init+0x20
02956f58  02433173 vfPrint!VfHookOpenPrinter2W+0x83
02956f5c  72b16dbf WINSPOOL!OpenPrinterW+0x16   !this is the first caller of vfPrint!VfOpenPrinter*, but it doesn't count because it's from winspool.
02956f60  02433091 vfPrint!VfHookOpenPrinterW+0x71
02956f64  7436e060 PRINTUI!OpenPrinterWrap+0x9b    !this is the suspect, as this is the first non-winspool and non-vfPrint caller of vfPrint!VfHookOpenPrinterW
02956f68  7433fffb PRINTUI!TPrinter::svReopen+0x6c

Information displayed by Application Verifier

Parameter 1 - Printer handle being leaked.

Parameter 2 - Initialization stack trace. Use dps to dump the stack if this parameter is not NULL.

Parameter 3 - Thread id of the thread that opened the handle.

Parameter 4 - Not used.

Additional information

Test Layer:�PrintAPI

Stop code:�0000A000

Severity:�Error

One-time error:�no

Error report:�Break

Log to file:�yes

Create backtrace:�yes