Fix crash if a valid minidump is residing in minidumps folder.
This commit is contained in:
parent
f9e2eeca7b
commit
531fdf0e34
@ -26,7 +26,7 @@ namespace Components
|
|||||||
|
|
||||||
std::string Minidump::ToString()
|
std::string Minidump::ToString()
|
||||||
{
|
{
|
||||||
if (!Minidump::EnsureFileMapping()) return false;
|
if (!this->EnsureFileMapping()) return false;
|
||||||
|
|
||||||
auto pBuf = MapViewOfFile(this->mapFileHandle, FILE_MAP_READ, 0, 0, 0);
|
auto pBuf = MapViewOfFile(this->mapFileHandle, FILE_MAP_READ, 0, 0, 0);
|
||||||
if (pBuf == NULL)
|
if (pBuf == NULL)
|
||||||
@ -48,7 +48,7 @@ namespace Components
|
|||||||
|
|
||||||
bool Minidump::GetStream(MINIDUMP_STREAM_TYPE type, PMINIDUMP_DIRECTORY* directoryPtr, PVOID* streamBeginningPtr, ULONG* streamSizePtr)
|
bool Minidump::GetStream(MINIDUMP_STREAM_TYPE type, PMINIDUMP_DIRECTORY* directoryPtr, PVOID* streamBeginningPtr, ULONG* streamSizePtr)
|
||||||
{
|
{
|
||||||
if (!Minidump::EnsureFileMapping()) return false;
|
if (!this->EnsureFileMapping()) return false;
|
||||||
|
|
||||||
auto pBuf = MapViewOfFile(this->mapFileHandle, FILE_MAP_READ, 0, 0, 0);
|
auto pBuf = MapViewOfFile(this->mapFileHandle, FILE_MAP_READ, 0, 0, 0);
|
||||||
if (pBuf == NULL)
|
if (pBuf == NULL)
|
||||||
@ -110,7 +110,7 @@ namespace Components
|
|||||||
if (this->mapFileHandle == NULL || this->mapFileHandle == INVALID_HANDLE_VALUE)
|
if (this->mapFileHandle == NULL || this->mapFileHandle == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
this->mapFileHandle = CreateFileMappingA(this->fileHandle, NULL, PAGE_READONLY, 0, 0, NULL);
|
this->mapFileHandle = CreateFileMappingA(this->fileHandle, NULL, PAGE_READONLY, 0, 0, NULL);
|
||||||
if (this->mapFileHandle == NULL || this->mapFileHandle == INVALID_HANDLE_VALUE)
|
if (this->mapFileHandle == NULL)
|
||||||
{
|
{
|
||||||
Utils::OutputDebugLastError();
|
Utils::OutputDebugLastError();
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user