File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,8 +57,18 @@ RtResult<const PInvokeRegistry*> PInvokes::get_pinvoke_by_method(const metadata:
5757 {
5858 // signature: Namespace.Class.Method
5959 sb.clear ();
60+ sb.append_char (' [' );
61+ sb.append_cstr (method->parent ->image ->get_name_no_ext ());
62+ sb.append_char (' ]' );
63+ size_t length = sb.length ();
6064 RET_ERR_ON_FAIL (metadata::MetadataName::append_method_full_name_without_params (sb, method));
61- auto it = g_pinvoke_map.find (sb.as_cstr ());
65+
66+ const char * signature_with_module = sb.as_cstr ();
67+ auto it = g_pinvoke_map.find (signature_with_module);
68+ if (it != g_pinvoke_map.end ())
69+ RET_OK (&it->second );
70+ const char * signature_without_module = sb.as_cstr () + length;
71+ it = g_pinvoke_map.find (signature_without_module);
6272 if (it != g_pinvoke_map.end ())
6373 RET_OK (&it->second );
6474 }
You can’t perform that action at this time.
0 commit comments