http://bugs.winehq.org/show_bug.cgi?id=11742
--- Comment #7 from Anastasius Focht focht@gmx.net 2008-02-29 16:29:07 --- Created an attachment (id=11051) --> (http://bugs.winehq.org/attachment.cgi?id=11051) patch which implements mscoree shim interop ReadXXX and WriteXXX
Hello again,
the next step is essentially the same as the .NET 2.0 fonts problem. I documented it in http://bugs.winehq.org/show_bug.cgi?id=10467#c2
appdb .NET 2.0 howto:
--- snip --- 3. Copy all fonts from a windows partition (from c:\WINDOWS\Fonts) to ~/.wine/drive_c/windows/fonts 4. Save this file http://bugs.winehq.org/attachment.cgi?id=9204 and do "regedit fonts.reg" --- snip ---
After that the app needs one more fix because of native .NET shim (mscoree) insufficiency.
--- snip managed debugger callstack --- System.EntryPointNotFoundException: Unable to find an entry point named ND_WU1 in DLL mscoree.dll. at System.Runtime.InteropServices.Marshal.WriteByte(Object ptr, Int32 ofs, Byte val) at System.Drawing.Font.ToLogFont(Object logFont, Graphics graphics) at System.Drawing.Font.ToLogFont(Object logFont) at System.Drawing.Font.ToHfont() at System.Windows.Forms.FontHandleWrapper..ctor(Font font) at System.Windows.Forms.Control.GetDefaultFontHandleWrapper() at System.Windows.Forms.Control.get_FontHandle() at System.Windows.Forms.Control.get_FontHandle() at System.Windows.Forms.Control.OnHandleCreated(EventArgs e) at System.Windows.Forms.ComboBox.OnHandleCreated(EventArgs e) at System.Windows.Forms.Control.WmCreate(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ComboBox.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) --- snip managed debugger callstack ---
If one looks at wine trace
--- snip --- 0009:Call KERNEL32.GetProcAddress(60b80000,79ba98f7 "ND_RI2") ret=00660ce5 0009:Ret KERNEL32.GetProcAddress() retval=00000000 ret=00660ce5 .. *boom*
0027:Call KERNEL32.GetProcAddress(618c0000,79ba98c7 "ND_RU1") ret=791e0ce5 0027:Ret KERNEL32.GetProcAddress() retval=00000000 ret=791e0ce5 .. *boom* --- snip ---
Wine's mscoree needs some interop stubs - fleshed out of course. You could use native mscoree override but I tend to minimize the native mess as possible.
System.Runtime.InteropServices.Marshal.ReadByte -> ND_RU1 System.Runtime.InteropServices.Marshal.ReadInt16 -> ND_RI2 System.Runtime.InteropServices.Marshal.ReadInt32 -> ND_RI4 System.Runtime.InteropServices.Marshal.ReadInt64 -> ND_RI8
(same goes for WriteXXX -> ND_Wxx)
Thanks to the managed stack frame one can implement these quickly.
With that patch applied this example .NET 1.1 application finally starts successfully. ;-)
Regards