#ifdef _WIN32
WSADATA wsaData;
+ typedef BOOL (*SetDllDirectoryHandler)(LPCTSTR);
+ SetDllDirectoryHandler PSetDllDirectory;
#else
struct sigaction action, oldaction;
#endif
struct utsname osinfo;
#endif
+ if (PSetDllDirectory = (SetDllDirectoryHandler) GetProcAddress(GetModuleHandle(_T("kernel32.dll")), "SetDllDirectoryW")) {
+ PSetDllDirectory(_T(""));
+ /* XXX - Exit on failure? */
+ }
+
#ifdef HAVE_PCAP_REMOTE
#define OPTSTRING_A "A:"
#define OPTSTRING_r "r"
static gboolean has_console; /* TRUE if app has console */
static void destroy_console(void);
static gboolean stdin_capture = FALSE; /* Don't grab stdin & stdout if TRUE */
+static gboolean dll_set = FALSE; /* Did we sucessfully trim our DLL path? */
#endif
static void console_log_handler(const char *log_domain,
GLogLevelFlags log_level, const char *message, gpointer user_data);
argv[i] = g_strdup(utf_16to8(wc_argv[i]));
}
} /* XXX else bail because something is horribly, horribly wrong? */
+
+ if (!dll_set) {
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "SetDllDirectory failed (%d)!\n", GetLastError());
+ /* XXX - Exit? */
+ }
#endif /* _WIN32 */
/*
argv++;
}
-
-
if (argc != 0) {
/*
* Extra command line arguments were specified; complain.
int nCmdShow)
{
INITCOMMONCONTROLSEX comm_ctrl;
+ typedef BOOL (*SetDllDirectoryHandler)(LPCTSTR);
+ SetDllDirectoryHandler PSetDllDirectory;
+
+ if (PSetDllDirectory = (SetDllDirectoryHandler) GetProcAddress(GetModuleHandle(_T("kernel32.dll")), "SetDllDirectoryW")) {
+ dll_set = PSetDllDirectory(_T(""));
+ }
/* Initialize our controls. Required for native Windows file dialogs. */
memset (&comm_ctrl, 0, sizeof(comm_ctrl));