[Mono-dev] Mono on wine redux
Miguel de Icaza
Miguel at novell.com
Thu Apr 17 13:47:32 EDT 2008
Well, that was fast. Congrats Kornel!
From: Kornél Pál <kornelpal at gmail.com>
Cc: <mono-devel-list at lists.ximian.com>
To: Miguel de Icaza <Miguel at novell.com>
Sent: 4/17/2008 3:17:24 AM
Subject: Re: [Mono-dev] Mono on wine redux
> From: "Miguel de Icaza" <miguel at novell.com>
>> But what percent of .net apps are pure? If that fraction is small,
>> as I suspect it is, then for Mono to really rock the world, it's going
>> to have to tackle impure apps, too. That is of course incredibly
>> and would require considerable cooperation between the Mono and Wine
> It is very hard to run into a mixed-mode assembly in the wild; They do
> happen, but they are rare. I can only think of three projects that had
> needed them in the history of Mono.
I've done some work on this. And actually I managed to run mixed-mode
Note that it is only possible on Windows because native code is usually
platform (arch and OS as well) dependent.
I implemented support for loading image files using LoadLibrary so that the
NT loader will take care of the image patching. I also had to patch the
in-memory image of mscoree.dll so that export address table point to
functions in mono.dll that is required for LoadLibrary support. This also
will enable Wine (and Windows is someone is willing to replace or modify his
on-disk mscoree.dll image) to execute managed images using CreateProcess
without creating a mono.exe child process. This was the hardest part.
IJW thunks (managed-to-native) are really P/Invoke methods with function RVA
stored in method body RVA so it was very easy to implement, I only had to
remove code preventing IJW from work.
V-table fixups (native-to-managed) are not difficult either but requires
it's own wrapper methods so my current implementation probably will need
Note that this still will not make Mono able to use MSVCRT because that uses
unmanaged API of .NET Framework that isn't implemented by Mono.
I am stilll working on a cleaned-up patch but will send to the list soon.
More information about the Mono-devel-list