Win32:如何崩溃?
我正在尝试找出 Windows 错误报告的保存位置;我今天早些时候点击了发送,但我忘记了我想要“查看详细信息”,以便我可以检查内存小型转储。
但我找不到它们的存储位置(谷歌也不知道)。
所以我想编写一个会崩溃的虚拟应用程序,显示 WER 对话框,让我单击“查看详细信息”,这样我就可以到达保存转储的文件夹。
我怎样才能在 Windows 上崩溃?
编辑:我问的原因是因为我尝试过堆栈溢出和浮点除以零。 Stack Overflow 使应用程序消失,但没有弹出 WER 对话框。浮点除以零会产生 +INF,但没有例外,也没有崩溃。
i'm trying to figure out where Windows Error Reports are saved; i hit Send on some earlier today, but i forgot that i want to "view the details" so i can examine the memory minidumps.
But i cannot find where they are stored (and google doesn't know).
So i want to write a dummy application that will crash, show the WER dialog, let me click "view the details" so i can get to the folder where the dumps are saved.
How can i crash on Windows?
Edit: The reason i ask is because i've tried overflowing the stack, and floating point dividing by zero. Stack Overflow makes the app vanish, but no WER dialog popped up. Floating point division by zero results in +INF, but no exception, and no crash.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
你们都太啰嗦了! :-)
这是一种紧凑的方法:
You guys are all so verbose! :-)
Here's a compact way to do it:
应该是一个好的开始:
Should be a good start:
您假设内存转储仍然存在。一旦发送,据我所知转储将从机器中删除。
转储本身应该位于 %TEMP% 中的某个位置。
至于崩溃,这并不难,只需做一些导致段错误的事情即可。
You are assuming the memory dumps are still around. Once they are sent, AFAIK the dumps are deleted from the machine.
The dumps themselves should be located in %TEMP% somewhere.
As far as crashing, that's not difficult, just do something that causes a segfault.
不确定这是否会触发错误报告对话框,但您可以尝试除以零。
Not sure if this will trigger the Error Reporting dialog, but you could try division by zero.
官方支持的故意触发崩溃的方法可以在这里找到:
http://msdn.microsoft.com/en-us/library/ff545484(v=VS.85).aspx
基本上:
然后:
无需编程;)这里无需重新发明轮子:)
The officially-supported ways to trigger a crash on purpose can be found here:
http://msdn.microsoft.com/en-us/library/ff545484(v=VS.85).aspx
Basically:
Then:
No programming necessary ;) No wheel reinvention here :)
了解如何使 Windows 崩溃很有趣。但为什么不先看
一下呢?还要注意特定于应用程序的崩溃数据文件夹,我发现例如
和
Interesting to know how to crash Windows. But why not have a look at
first? Look out for application specific crashdata folders as well, I found e.g.
and