From 29f33e7b3a0be77af2cb7cfc5fdd9e0668dc36e9 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 13be4b1..68b7549 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -5053,7 +5053,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");