MiniDumpWriteDump segfault?
Posted
by
Steven Penny
on Stack Overflow
See other posts from Stack Overflow
or by Steven Penny
Published on 2012-04-07T06:27:12Z
Indexed on
2012/04/10
5:29 UTC
Read the original article
Hit count: 198
I am trying to dump a process, say calc.exe
When I run my program I get
Program received signal SIGSEGV, Segmentation fault.
0x0000000000401640 in MiniDumpWriteDump ()
Here is the code
#include <windows.h>
#include <dbghelp.h>
int main(){
HANDLE hFile = CreateFileA(
"calc.dmp",
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL
);
DWORD procID = 196;
HANDLE hProc = OpenProcess(
PROCESS_ALL_ACCESS,
FALSE,
procID
);
MiniDumpWriteDump(
hProc,
procID,
hFile,
MiniDumpNormal,
NULL,
NULL,
NULL
);
CloseHandle(hFile);
}
© Stack Overflow or respective owner