[Exception] Only start crash-helper if *.dmp exist

This commit is contained in:
/dev/root 2017-03-14 18:16:12 +01:00
parent 2af41ee372
commit 37e2dafb00

View File

@ -258,7 +258,13 @@ namespace Components
}); });
#pragma warning(pop) #pragma warning(pop)
if (Utils::IO::FileExists("crash-helper.exe")) // Check if folder exists && crash-helper exists
if (PathIsDirectoryA("minidumps\\") && Utils::IO::FileExists("crash-helper.exe"))
{
// Walk through directory and search for valid minidumps
WIN32_FIND_DATAA ffd;
HANDLE hFind = FindFirstFileA(Utils::String::VA("%s\\*.dmp", "minidumps"), &ffd);
if (hFind != INVALID_HANDLE_VALUE)
{ {
STARTUPINFOA sInfo; STARTUPINFOA sInfo;
PROCESS_INFORMATION pInfo; PROCESS_INFORMATION pInfo;
@ -273,6 +279,7 @@ namespace Components
if (pInfo.hProcess && pInfo.hProcess != INVALID_HANDLE_VALUE) CloseHandle(pInfo.hProcess); if (pInfo.hProcess && pInfo.hProcess != INVALID_HANDLE_VALUE) CloseHandle(pInfo.hProcess);
} }
} }
}
Exception::~Exception() Exception::~Exception()
{ {