Question

This is somewhat complex issue with several questions. Feel free to answer only the questions to which you have an answer.

I have a task to create minidumps in case of Windows exceptions for several of our components, and to support XP SP3 as minimal OS. Components include:

  • Standalone C++ apps
  • CSP and PKCS11 libraries (DLL's) to be used in known browsers
  • one UI and one non-UI service
  • Static libraries, which are used in all previous three points

The requirement is to have something like WER (from XP onward), but to send reports to dedicated vendor server instead of to Microsoft's current Winqual equivalent. It would be really nice the reporting functionality could be wrapped in one static library.

There are issues, though. DLL's are special beasts. How to generate a report only if fault happens in DLL code? Services may also require some special handling, of which I'm currently unaware.

First of all, is there a known open-source library that could help me with this task? If not, I'd have to roll my own.

My first thought is to have a sleeping watchdog thread in each of my modules. This thread just waits on an event, which will be set from unhandled exception filter. The thread would generate the report using MiniDumpWriteDump, send it over the internet and then finish, and in the mentioned filter we would wait for the thread to end, and then terminate the process. Any thoughts on this solution? For instance can Windows service under local system account access the internet at all?

Was it helpful?

Solution

You don't need to create a thread that "waits for an exception".Just register your own Exception handler using UnhandledExceptionFilter. Look at this URL, it is well explain how to take MiniDumpWriteDump when an exception occurs.

Windows services that run under local System credentials don't have network access.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top