Commit 29f33e7b authored by Ka Ho Ng's avatar Ka Ho Ng Committed by Howard Chu
Browse files

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.
parent a51fb486
...@@ -5053,7 +5053,7 @@ mdb_env_open2(MDB_env *env, int prev) ...@@ -5053,7 +5053,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");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment