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.
mdb.master
Ka Ho Ng 6 years ago committed by Howard Chu
parent 4f9fe9fcea
commit 22af3288c7
  1. 2
      libraries/liblmdb/mdb.c

@ -4741,7 +4741,7 @@ mdb_env_open2(MDB_env *env, int prev)
env->me_pidquery = PROCESS_QUERY_INFORMATION; env->me_pidquery = PROCESS_QUERY_INFORMATION;
/* Grab functions we need from NTDLL */ /* Grab functions we need from NTDLL */
if (!NtCreateSection) { if (!NtCreateSection) {
HMODULE h = GetModuleHandle("NTDLL.DLL"); HMODULE h = GetModuleHandleW(L"NTDLL.DLL");
if (!h) if (!h)
return MDB_PROBLEM; return MDB_PROBLEM;
NtClose = (NtCloseFunc *)GetProcAddress(h, "NtClose"); NtClose = (NtCloseFunc *)GetProcAddress(h, "NtClose");

Loading…
Cancel
Save