YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense alongwiththisprogram;ifnot,writetotheFreeSoftware
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
if (QueryFullProcessImageName(process, 0, path, &size) == 0)
{
VERBOSE("cannot read process path for pid %lu, last error %lu\n",
pid, GetLastError()); gotoexit;
}
filename= strrchr(path, '\\'); if (filename)
{
filename++; // We are not interested in dump of some processes (my_safe_process.exe,cmd.exe) // since they are only used to start up other programs. // We're interested however in their children; constchar *exclude_programs[] = {"my_safe_process.exe","cmd.exe", 0}; for(size_t i=0; exclude_programs[i]; i++) if (_stricmp(filename, exclude_programs[i]) == 0) gotoexit;
} else
filename= path;
// Íf file with this name exist, generate unique name with .dmp extension if (GetFileAttributes(filename) != INVALID_FILE_ATTRIBUTES)
{ if (!GetTempFileName(".", filename, 0, tmpname))
{
fprintf(stderr, "GetTempFileName failed, last error %lu", GetLastError()); gotoexit;
}
strncat_s(tmpname, ".dmp", sizeof(tmpname));
filename= tmpname;
}
if (!GetCurrentDirectory(MAX_PATH, working_dir))
{
VERBOSE("GetCurrentDirectory failed, last error %lu", GetLastError()); gotoexit;
}
if (file == INVALID_HANDLE_VALUE)
{
VERBOSE("CreateFile() failed for file %s, working dir %s, last error = %lu\n",
filename, working_dir, GetLastError()); gotoexit;
}
if (!MiniDumpWriteDump(process, pid, file, MiniDumpNormal, 0, 0, 0))
{
VERBOSE("Failed to write minidump to %s, working dir %s, last error %lu\n",
filename, working_dir, GetLastError()); gotoexit;
}
VERBOSE("Minidump written to %s, directory %s\n", filename, working_dir);
ret= TRUE; exit: if (process != 0 && process != INVALID_HANDLE_VALUE)
CloseHandle(process);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.