]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#8978 Fix mdb_env_open2() failing when getting handle for NTDLL.dll
authorKa Ho Ng <khng300@gmail.com>
Sun, 17 Feb 2019 15:59:56 +0000 (23:59 +0800)
committerHoward Chu <hyc@openldap.org>
Sat, 10 Oct 2020 12:23:54 +0000 (13:23 +0100)
Always call GetModuleHandleW() with Unicode string, as mdb_fopen() is
calling CreateFileW() already.

libraries/liblmdb/mdb.c

index 13be4b128fc07cfddabd7296d4b506b9d360ce6a..68b754905bf95b05593be0a9937bae011bdd0a61 100644 (file)
@@ -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");