Customizing All Problem Reports Within a Process

Sometimes, you might want your application to perform custom error reporting by calling various WER functions. Here are three examples of when you want to take advantage of this:

  • You are writing your own unhandled exception filter.

  • You want your application to generate a report even though an unhandled exception hasn’t occurred.

  • You want to add more information to the report.

A simple way to customize all problem reports is to indicate what data blocks or arbitrary files you want added to every problem report generated for your process. To add an arbitrary data block, you simply call

HRESULT WerRegisterMemoryBlock(PVOID pvAddress, DWORD dwSize);

You pass the address of your memory block for the pvAddress ...

Get Windows® via C/C++, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.