If the dllname for a dllimport is a full path, try that exact path before anything...
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Thu, 10 May 2012 14:37:54 +0000 (16:37 +0200)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Thu, 10 May 2012 23:06:42 +0000 (01:06 +0200)
mono/metadata/loader.c

index d69095a6665d2817443b25358ac15a352c1d75eb..0774b82ae422e1f1859d2567a3817ec31f175574 100644 (file)
@@ -1387,6 +1387,18 @@ mono_lookup_pinvoke_call (MonoMethod *method, const char **exc_class, const char
 #endif
                }
 
+               if (!module && g_path_is_absolute (file_name)) {
+                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT,
+                                       "DllImport loading: '%s'.", file_name);
+                       module = cached_module_load (file_name, MONO_DL_LAZY, &error_msg);
+                       if (!module) {
+                               mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT,
+                                               "DllImport error loading library '%s'.",
+                                               error_msg);
+                               g_free (error_msg);
+                       }
+               }
+
                if (!module) {
                        void *iter = NULL;
                        char *mdirname = g_path_get_dirname (image->name);