diff options
author | Gerald Combs <gerald@wireshark.org> | 2010-08-27 19:24:44 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2010-08-27 19:24:44 +0000 |
commit | 5aae07254f8000c6f7b40fbe14e2287800e9f38e (patch) | |
tree | 235461f9dab517e630204934e4527b6eeced52d6 /dumpcap.c | |
parent | 9d96012b57cfea4b309ce9ed00d729b73062cc2f (diff) |
Forward-port r33953.
Move the SetDllDirectory calls to ws_init_dll_search_path. If
SetDllDirectory fails, pass the Wireshark program path to
SetCurrentDirectory.
svn path=/trunk/; revision=33958
Diffstat (limited to 'dumpcap.c')
-rw-r--r-- | dumpcap.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -3273,8 +3273,6 @@ main(int argc, char *argv[]) #ifdef _WIN32 WSADATA wsaData; - typedef BOOL (*SetDllDirectoryHandler)(LPCTSTR); - SetDllDirectoryHandler PSetDllDirectory; #else struct sigaction action, oldaction; #endif @@ -3297,10 +3295,11 @@ main(int argc, char *argv[]) #endif #ifdef _WIN32 - if (PSetDllDirectory = (SetDllDirectoryHandler) GetProcAddress(GetModuleHandle(_T("kernel32.dll")), "SetDllDirectoryW")) { - PSetDllDirectory(_T("")); - /* XXX - Exit on failure? */ - } + /* + * Initialize our DLL search path. MUST be called before LoadLibrary + * or g_module_open. + */ + ws_init_dll_search_path(); #endif #ifdef HAVE_PCAP_REMOTE |