Allow ordinal entry points in windows.
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Fri, 3 Sep 2010 18:58:50 +0000 (14:58 -0400)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Fri, 3 Sep 2010 18:58:50 +0000 (14:58 -0400)
Windows allows entry point names like "#10" which refer to the Nth
function (n > 1 and less than the highest ordinal value in the .def
file).

Fixes bug #636966.

mono/metadata/loader.c

index 77095835bf00f5c6cc43b97dae24b37b9c5ab3f5..4e9a1520805d7b1fc99297083d85d62e953da9f8 100644 (file)
@@ -1404,6 +1404,16 @@ mono_lookup_pinvoke_call (MonoMethod *method, const char **exc_class, const char
                return NULL;
        }
 
+#ifdef TARGET_WIN32
+       if (import && import [0] == '#' && isdigit (import [1])) {
+               char *end;
+               long id;
+
+               id = strtol (import + 1, &end, 10);
+               if (id > 0 && *end == '\0')
+                       import++;
+       }
+#endif
        mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT,
                                "Searching for '%s'.", import);