void
mono_dllmap_insert (MonoImage *assembly, const char *dll, const char *func, const char *tdll, const char *tfunc)
LOCKING: Acquires the loader lock.
This function is used to programatically add DllImport remapping in either
a specific assembly, or as a global remapping. This is done by remapping
references in a DllImport attribute from the
dll library name into the
tdll
name. If the
dll name contains the prefix "i:", the comparison of the
library name is done without case sensitivity.
If you pass
func, this is the name of the EntryPoint in a DllImport if specified
or the name of the function as determined by DllImport. If you pass
func, you
must also pass
tfunc which is the name of the target function to invoke on a match.
Example:
mono_dllmap_insert (
NULL
, "i:libdemo.dll",
NULL
, relocated_demo_path,
NULL
);
The above will remap DllImport statments for "libdemo.dll" and "LIBDEMO.DLL" to
the contents of relocated_demo_path for all assemblies in the Mono process.
NOTE: This can be called before the runtime is initialized, for example from
mono_config_parse ().