Commit 34bd43d9 authored by Sergey Vinokurov's avatar Sergey Vinokurov Committed by Tamar Christina
Browse files

Fix loading of dlls on 32bit windows

The point of fix is to handle case when loaded dll loads no
other dlls, i.e. it's import table is empty.

GHC Trac Issues: #14081
parent 1cdceb9f
......@@ -240,6 +240,13 @@ static void addDLLHandle(pathchar* dll_name, HINSTANCE instance) {
(PIMAGE_IMPORT_DESCRIPTOR)((BYTE *)instance + header->
bool importTableMissing =
header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].Size == 0;
if (importTableMissing) {
/* Ignore these compatibility shims. */
const pathchar* ms_dll = WSTR("api-ms-win-");
const int len = wcslen(ms_dll);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment