I wrote a code that is capable to produce coverage data of itself with the map file and without the need of another application debugging it and its also capable of generating a xml report compatible with Cobertura report and OpenCover for further analisis and graphic reports.
Thing is, so far i have to call the function to generate the report manually and the idea is to generate it automatically as soon as the process is exiting.
My first approach was to try and write hooks at RtlExitUserProcess/RtlExitUserThread/ExitProcess but each function cover some specific case, if you force the process to end (kill it using taskkill for example) or close the application console window with CTRL+C the behavior changes.
Is there any way i can create a reliable callback that will be always called when the application is about to end? Just like when you are debugging another app and when the process dies you receive a debug event with detailed information.
Thanks in advance