[Mono-dev] [PATCH] Adding to the PInvoke search path.

Bill Holmes billholmes54 at gmail.com
Mon Jun 1 12:41:28 EDT 2009


Hi,

The attached patch was discussed on IRC last week.  We found that
MS.Net uses the directory of the declaring assembly when searching for
shared libraries to invoke unmanaged code.

The outcome of the conversation was that we did not want the behavior
by default in Mono.  However an environment variable could control
this behavior.

Whit this patch setting MONO_PINVOKE_SEARCH to USE_ASSEMBLY_PATH will
enable this.

-bill

2009-06-01  Bill Holmes  <billholmes54 at gmail.com>

	* loader.c (mono_loader_init): Check for and process
	  the MONO_PINVOKE_SEARCH environment variable.

	* loader.c (mono_lookup_pinvoke_call): If MONO_PINVOKE_SEARCH
	  is set to USE_ASSEMBLY_PATH, add the declaring assembly
	  directory to resolve shared libraries.

	Code is contributed under MIT/X11 license.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mono_pinvoke_search.patch
Type: application/octet-stream
Size: 2953 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090601/be43e957/attachment.obj 


More information about the Mono-devel-list mailing list