http://bugs.winehq.org/show_bug.cgi?id=11742
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net
--- Comment #6 from Anastasius Focht focht@gmx.net 2008-02-29 15:55:40 --- Hello,
after fixing the .NET 1.x GAC problem, more steps need to be taken to get that app running.
================== Gdiplus: wine loader problem with "native over builtin" and absolute (invalid) paths
Either copy the "C:\windows\Microsoft.NET\Framework\v1.1.4322\gdiplus.dll" into system32 or use 'sh winetricks gdiplus' You must set the load order of this library to "native" only (not "native then builtin").
The reason is the .NET CLR uses its own load strategies. It first tries to load this library with absolute path (built from referencing assembly) but the file doesn't exist in that path.
--- snip --- 0043:Call KERNEL32.LoadLibraryExW(0034e3d8 L"c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\gdiplus.dll",00000000,00000008) ret=791b7b63 ... 0043:trace:module:load_dll looking for L"c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\gdiplus.dll" in L"c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a;.;C:\windows\system32;C:\windows\system;C:\windows;C:\windows\system32;C:\windows" 0043:trace:module:get_load_order looking for L"C:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\gdiplus.dll" 0043:trace:module:get_load_order_value got standard key n,b for L"gdiplus" 0043:trace:module:load_builtin_dll Trying built-in L"gdiplus.dll" .. 0043:trace:module:load_dll Found L"C:\windows\system32\KERNEL32.dll" for L"kernel32.dll" at 0x7b820000, count=-1 0043:trace:module:load_builtin_callback loaded gdiplus.dll 0x158ba0 0x73e30000 0043:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\gdiplus.dll" at 0x73e30000: builtin 0043:trace:module:load_dll Loaded module L"C:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\gdiplus.dll" (builtin) at 0x73e30000 0043:trace:module:process_attach (L"gdiplus.dll",(nil)) - START 0043:trace:module:MODULE_InitDLL (0x73e30000 L"gdiplus.dll",PROCESS_ATTACH,(nil)) - CALL 0043:trace:module:MODULE_InitDLL (0x73e30000,PROCESS_ATTACH,(nil)) - RETURN 1 0043:trace:module:process_attach (L"gdiplus.dll",(nil)) - END 0043:trace:seh:raise_exception code=80000100 flags=1 addr=0x7b841560 0043:trace:seh:raise_exception info[0]=73e4eec0 0043:trace:seh:raise_exception info[1]=73e4fe25 wine: Call from 0x7b841560 to unimplemented function gdiplus.dll.GdipGetFamily, aborting --- snip ---
Offending code
--- snip dlls/ntdll/loader.c --- static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_MODREF** pwm ) .. case LO_NATIVE_BUILTIN: if (!handle) nts = STATUS_DLL_NOT_FOUND; else { nts = load_native_dll( load_path, filename, handle, flags, pwm ); if (nts == STATUS_INVALID_FILE_FOR_SECTION) /* not in PE format, maybe it's a builtin */ nts = load_builtin_dll( load_path, filename, handle, flags, pwm ); } if (nts == STATUS_DLL_NOT_FOUND && loadorder == LO_NATIVE_BUILTIN) nts = load_builtin_dll( load_path, filename, 0, flags, pwm ); break;
.. --- snip dlls/ntdll/loader.c ---
Because of absolute (invalid) load path, load_builtin_dll() is triggered causing the builtin dll to be loaded leading to unimplemented stubs problem - despite native dll present in default search path.
If you set the load order to "native", the LoadLibraryW/load_dll call fails and the .NET CLR then tries to load the library a second time using the standard way, picking up the right (native) one.
--- snip --- 002a:Call KERNEL32.LoadLibraryExW(0034e3d8 L"c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\gdiplus.dll",00000000,00000008) ret=791b7b63 002a:trace:module:load_dll looking for L"c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\gdiplus.dll" in L"c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a;.;C:\windows\system32;C:\windows\system;C:\windows;C:\windows\system32;C:\windows" 002a:trace:module:get_load_order looking for L"C:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\gdiplus.dll" 002a:trace:module:get_load_order_value got standard key n for L"gdiplus" 002a:warn:module:load_dll Failed to load module L"c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\gdiplus.dll"; status=c0000135 002a:Ret KERNEL32.LoadLibraryExW() retval=00000000 ret=791b7b63 002a:Call KERNEL32.LoadLibraryExW(0034e130 L"gdiplus.dll",00000000,00000000) ret=791b7b63 002a:trace:module:load_dll looking for L"gdiplus.dll" in L"C:\Program Files\FASTMD5;.;C:\windows\system32;C:\windows\system;C:\windows;C:\windows\system32;C:\windows" 002a:trace:module:load_dll Found L"C:\windows\system32\Gdiplus.dll" for L"gdiplus.dll" at 0x39800000, count=2 002a:Ret KERNEL32.LoadLibraryExW() retval=39800000 ret=791b7b63 --- snip ---
For this special case of invalid absolute load path, I'd prefer trying native first before builtin (as the load order implies) to give native version a second chance with *default* search path.
Regards