{
DPRINT1("File '%S' does not seem to be a valid PE, bail out\n", PathNameToFile);
Status = STATUS_INVALID_IMAGE_FORMAT;
- goto UnmapFile;
+ goto UnmapCloseFile;
}
/*
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to get version resource for file '%S', Status 0x%08lx\n", PathNameToFile, Status);
- goto UnmapFile;
+ goto UnmapCloseFile;
}
Status = NtVerQueryValue(VersionBuffer, L"\\VarFileInfo\\Translation", &pvData, &BufLen);
if (!NT_SUCCESS(Status))
DPRINT1("No version vendor found for file '%S'\n", PathNameToFile);
-UnmapFile:
+UnmapCloseFile:
/* Finally, unmap and close the file */
- UnMapFile(SectionHandle, ViewBase);
- NtClose(FileHandle);
+ UnMapAndCloseFile(FileHandle, SectionHandle, ViewBase);
return Success;
}