[Mono-list] interesting discussion regarding managed dynamic libraries

Ian MacLean ianm@ActiveState.com
Thu, 16 Dec 2004 22:15:11 +0900


Pieter Breed wrote:

>>This is already supported at the IL level.  Google for "Inverse
>>P/Invoke", or see:
>>    
>>
>http://www.blong.com/Conferences/BorCon2004/Interop1/Win32AndDotNetInterop.htm#InversePInvoke
>
>This is a very nice link, thank you. Since our solutions run on Win32
>anyway, I might convince my manager to let me write such an utility as
>is described here ;-)
>
>  
>
>>As Ian MacLean already mentioned, this solution isn't portable as it
>>requires that the native OS linker use PE libraries.
>>    
>>
>
>I am afraid I do not really understand what you mean. What does PE
>have to do with this? AFAIK PE is the format into which windows
>executable files get compiled? IOW - Will one not be able to do the
>same IL modification using mono's diss-assembler and re-assembler?
>
>  
>
PE has everything to do with this as it is a *windows* specific native 
executable format. There is no reason that mono's diss-assembler and 
re-assembler? couldn't be used - however the resultant dll will still 
not be albe to be linked from a linux ( ELF format ) native binary. Its 
the same reason you can't take a windows compiled .dll and link to it 
from a *nix C application.

Since you are running on win32 this might not be a problem for you but 
the solution is not portable to non-windows platforms.

Ian