+2005-07-28 Peter Ekberg <peda@lysator.liu.se>
+
+ * libltdl/loaders/loadlibrary.c (vm_open): Set the error mode so
+ that no dialog is popped up in case the file given to
+ LoadLibrary is not a dll.
+
2005-07-28 Peter Ekberg <peda@lysator.liu.se>
* config/ltmain.m4sh (func_mode_link) <lib>: Make sure
if (!searchname)
return 0;
-#if defined(__CYGWIN__)
{
- char wpath[MAX_PATH];
- cygwin_conv_to_full_win32_path(searchname, wpath);
- module = LoadLibrary(wpath);
- }
+ /* Silence dialog from LoadLibrary on some failures.
+ No way to get the error mode, but to set it,
+ so set it twice to preserve any previous flags. */
+ UINT errormode = SetErrorMode(SEM_FAILCRITICALERRORS);
+ SetErrorMode(errormode | SEM_FAILCRITICALERRORS);
+
+#if defined(__CYGWIN__)
+ {
+ char wpath[MAX_PATH];
+ cygwin_conv_to_full_win32_path (searchname, wpath);
+ module = LoadLibrary (wpath);
+ }
#else
- module = LoadLibrary (searchname);
+ module = LoadLibrary (searchname);
#endif
+
+ /* Restore the error mode. */
+ SetErrorMode(errormode);
+ }
FREE (searchname);
/* libltdl expects this function to fail if it is unable