[Bug 10467] Making Microsoft .NET 2.0 to work in wine, based on example app FastMD5 1.4 for NET 2.0

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Nov 16 07:49:41 CST 2007


http://bugs.winehq.org/show_bug.cgi?id=10467





--- Comment #2 from Anastasius Focht <focht at gmx.net>  2007-11-16 07:49:40 ---
Hello,

again :-)

Prerequisite: 

1) wine-0.9.49 (or GIT)
2) successful installation of .NET 2.0 Framework
3) "l_intl.nls" copied from windows installation to wine system32
4) PEB loader lock patch from http://bugs.winehq.org/attachment.cgi?id=9195

----

With that stuff in place, starting .NET gui apps will immediately lead to a
crash.

-- snip ---
0:000> .exr -1
ExceptionAddress: 7b841460 (KERNEL32!RaiseException)
   ExceptionCode: e0434f4d (CLR exception)
  ExceptionFlags: 00000001
NumberParameters: 1
   Parameter[0]: 80070057
-- snip ---

Wow .. CLR exception for now :-)
Lets see what kind ...

--- snip ---
0:000> !PrintException
Exception object: 00a17cfc
Exception type: System.ArgumentException
Message: Only TrueType fonts are supported. This is not a TrueType font.
InnerException: <none>
StackTrace (generated):
<none>
StackTraceString: <none>
HResult: 80070057
--- snip ---

Now thats some kind of useful information (although the message is slightly
misleading as found later).
Obligatory CLR stack:

--- snip ---
0:000> !ClrStack
OS Thread Id: 0xf (0)
ESP       EIP     
0034f038 7b8414d8 [HelperMethodFrame: 0034f038] 
0034f0dc 039bd191 System.Drawing.Font.FromLogFont(System.Object, IntPtr)
0034f104 039bca13 System.Drawing.Font.FromHfont(IntPtr)
0034f150 039bc7cb System.Drawing.SystemFonts.get_DefaultFont()
0034f188 039bc2c2 System.Windows.Forms.Control.get_Font()
0034f194 039bc201 System.Windows.Forms.Control.get_FontHeight()
0034f1a4 039bc0ff System.Windows.Forms.TextBoxBase.get_PreferredHeight()
0034f1b8 039bc0b7 System.Windows.Forms.TextBoxBase.get_DefaultSize()
0034f1cc 02fa92ea System.Windows.Forms.Control..ctor(Boolean)
0034f240 039bc041 System.Windows.Forms.TextBoxBase..ctor()
0034f24c 039bbe87 System.Windows.Forms.TextBox..ctor()
0034f250 039ba002 Projekt2.WinForm.InitializeComponent()
0034f3c8 02fa7139 Projekt2.WinForm..ctor()
0034f3d0 02fa710c Projekt2.WinForm.Main()
0034f5e4 79e88f63 [GCFrame: 0034f5e4] 
--- snip ---

Ok, native gdiplus that doesn't like the way  truetype fonts are currently
installed on my system.
Unfortunately you can't use wine gdiplus (builtin) at this point because there
is too much API missing.
.NET "fixes" this issue by using LoadLibraryEx() + direct load path, preventing
builtin load first.

Bascially it enumerates the registry (SOFTWARE\\Microsoft\\Windows
NT\\CurrentVersion\\Fonts) keys and searches "c:\\windows\\fonts" (SearchPathW)
according what it found in registry.
Following keys are queried too: "SOFTWARE\\Microsoft\\Windows
NT\\CurrentVersion\\FontLink\\SystemLink" and "SOFTWARE\\Microsoft\\Windows
NT\\CurrentVersion\\FontSubstitutes"

Fix1: copy the registered truetype fonts from your share\wine\fonts whatever to
windows\fonts.
Be aware .NET apps might use more font variants so it might look very crappy if
only few (fallbacks) are used.

Fix2: copy/install the default windows truetype fonts (all ttf) to your wine
windows\fonts folder and register them in registry (if not done by installer).
You might export "HKLM\Software\Microsoft\WindowsNT\CurrentVersion\Font*" keys
for easier game.

This should fix the font issue and give apps the look'n'feel as in windows.
---------------------------------------

Stay tuned, more goodies to come ...

Regards.


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list