From: Ka Ho Ng Date: Sun, 17 Feb 2019 15:59:56 +0000 (+0800) Subject: ITS#8978 Fix mdb_env_open2() failing when getting handle for NTDLL.dll X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29f33e7b3a0be77af2cb7cfc5fdd9e0668dc36e9;p=thirdparty%2Fopenldap.git 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. --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 13be4b128f..68b754905b 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");