在C ++服务和用户模式应用程序崩溃后收集崩溃.dmp和.hdmp文件 [英] Collect crash .dmp and .hdmp files after a crash of C++ service and a user-mode app

查看:503
本文介绍了在C ++服务和用户模式应用程序崩溃后收集崩溃.dmp和.hdmp文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用WinAPIs在C ++ / MFC编码。我的软件包括本地服务和用户模式应用程序,为登录的Windows用户提供用户界面。我正在寻找一种方法来收集.dmp和.hdmp文件中的任何一个模块崩溃的情况下。我知道 WER 据称会收集并提交他们到微软。有没有办法收集这些文件,并将它们保存在硬盘驱动器上?

I'm coding in C++/MFC using WinAPIs. My software consists of a local service and a user-mode app that provides user interface for a logged in Windows user. I'm looking for a way to collect .dmp and .hdmp files in case of crash in either of those modules. I know that WER supposedly collects them and submits them to Microsoft. Is there a way to collect those files and keep them somewhere on the hard drive?

PS。

推荐答案

Windows 2000和XP已使用Windows XP SP3,Vista,7,8保存崩溃转储DrWatson。运行 drwtsn32.exe 允许您获取/配置日志和转储文件的路径。

Windows 2000 and XP already save crash dumps using DrWatson. Running drwtsn32.exe allows you to get/configure the path to the log and the dump files.

Windows Vista +仅使用WER,默认情况下不保存转储,但您可以启用创建用户模式转储

我设置了 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows \Windows错误报告\LocalDumps\DumpType 值为2以保存完整转储,默认情况下存储在%LOCALAPPDATA%\CrashDumps code> C:\Users\dee.earley\AppData\Local\CrashDumps )。

Windows Vista+ only uses WER, which doesn't save a dump by default, but you can enable creation of user mode dumps.
I set the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\DumpType value to 2 to save full dumps which, by default are stored in %LOCALAPPDATA%\CrashDumps (C:\Users\dee.earley\AppData\Local\CrashDumps).

调试器(如 WinDebug )也将允许您捕获用户模式的异常应用程式和服务。

Installing a debugger like WinDebug will also allow you to catch exceptions from user mode apps and the service as they occur.

这篇关于在C ++服务和用户模式应用程序崩溃后收集崩溃.dmp和.hdmp文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆