From 22af3288c7a5e7130d8031d6c63162018484f8ec Mon Sep 17 00:00:00 2001 From: Ka Ho Ng Date: Sun, 17 Feb 2019 23:59:56 +0800 Subject: [PATCH] ITS#8978 Fix mdb_env_open2() failing when getting handle for NTDLL.dll Always call GetModuleHandleW() with Unicode string, as mdb_fopen() is calling CreateFileW() already. --- libraries/liblmdb/mdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 8e67d59..cfd69f7 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -4741,7 +4741,7 @@ mdb_env_open2(MDB_env *env, int prev) env->me_pidquery = PROCESS_QUERY_INFORMATION; /* Grab functions we need from NTDLL */ if (!NtCreateSection) { - HMODULE h = GetModuleHandle("NTDLL.DLL"); + HMODULE h = GetModuleHandleW(L"NTDLL.DLL"); if (!h) return MDB_PROBLEM; NtClose = (NtCloseFunc *)GetProcAddress(h, "NtClose");