O'Reilly logo

Windows® via C/C++, Fifth Edition by Christophe Nasarre, Jeffrey Richter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Programmatic Windows Error Reporting

Exported by kernel32.dll and defined in werapi.h, the following function lets you change a couple of options for your process:

HRESULT WerSetFlags(DWORD dwFlags);

Table 26-2 lists the four available cumulative options.

Table 26-2. Details of the WerSetFlags Parameter

WER_FAULT_REPORTING_* Options

Description

FLAG_NOHEAP = 1

When a report is generated, it will not contain the heap content. This might be useful to limit the size of reports.

FLAG_DISABLE_THREAD_SUSPENSION = 4

By default, WER suspends all threads in an interactive process so that other threads can’t corrupt data further while an application is faulting. This flag tells WER not to suspend the other threads and is potentially a dangerous flag to use.

FLAG_QUEUE ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required