ETHER: Explicitly use GetModuleHandleA API when finding DLL entry points

This commit is contained in:
Mark Pizzolato 2017-05-07 19:00:49 -07:00
parent e7dbc8ea64
commit f5a1048101

View file

@ -1138,8 +1138,8 @@ int load_pcap(void) {
BOOL(WINAPI *p_SetDllDirectory)(LPCTSTR); BOOL(WINAPI *p_SetDllDirectory)(LPCTSTR);
UINT(WINAPI *p_GetSystemDirectory)(LPTSTR lpBuffer, UINT uSize); UINT(WINAPI *p_GetSystemDirectory)(LPTSTR lpBuffer, UINT uSize);
p_SetDllDirectory = (BOOL(WINAPI *)(LPCTSTR)) GetProcAddress(GetModuleHandle("kernel32.dll"), "SetDllDirectoryA"); p_SetDllDirectory = (BOOL(WINAPI *)(LPCTSTR)) GetProcAddress(GetModuleHandleA("kernel32.dll"), "SetDllDirectoryA");
p_GetSystemDirectory = (UINT(WINAPI *)(LPTSTR, UINT)) GetProcAddress(GetModuleHandle("kernel32.dll"), "GetSystemDirectoryA"); p_GetSystemDirectory = (UINT(WINAPI *)(LPTSTR, UINT)) GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetSystemDirectoryA");
if (p_SetDllDirectory && p_GetSystemDirectory) { if (p_SetDllDirectory && p_GetSystemDirectory) {
char npcap_path[512] = ""; char npcap_path[512] = "";