Fix PhInitializeMappedArchive bug when viewing llvm compiled lib files
* mapped library
*
* Copyright (C) 2010 wj32
+ * Copyright (C) 2019 dmex
*
* This file is part of Process Hacker.
*
@@ -100,7 +101,10 @@ NTSTATUS PhInitializeMappedArchive(
if (!NT_SUCCESS(status))
return status;
- if (MappedArchive->SecondLinkerMember.Type != LinkerArchiveMemberType)
+ if (
+ MappedArchive->SecondLinkerMember.Type != LinkerArchiveMemberType &&
+ MappedArchive->SecondLinkerMember.Type != NormalArchiveMemberType // NormalArchiveMemberType might not be correct here but set by LLVM compiled libs (dmex)
+ )
return STATUS_INVALID_PARAMETER;
// Longnames member
@@ -155,7 +159,7 @@ NTSTATUS PhLoadMappedArchive(
if (!NT_SUCCESS(status))
{
- NtUnmapViewOfSection(NtCurrentProcess(), MappedArchive->ViewBase);
+ PhUnloadMappedArchive(MappedArchive);
}
}
