Well the good news is that this patch does indeed fix the Callout problem. Unfortunately we are then back to the original font problem, where (at least with the Sun JRE) we just get black squares instead of characters. The IBM JRE still has problems and never even displays the frame for the characters, let alone the characters. But this may still be due to the same underlying problem.
Ulrich Weigand weigand@immd1.informatik.uni-erlangen.de on 28-01-2001 11:43:03 PM
To: gerard.patel@asi.fr (gerard patel) cc: David Goodenough/DGA/GB, wine-devel@winehq.com Subject: Re: Notes and Java test on 20010112.
Gerard Patel wrote:
I did not include the trace as it's rather large (I can mail it to you if you want...) but what happens is clear enough : the main exe loads implicitely KERNEL32 but not USER - USER is loaded implicitely by a DLL loaded by LoadLibrary. So when the kernel initialisation is done, USER is not yet loaded. It's unusual but seems perfectly valid IMO.
What about adding a specific Wine call from User to Kernel to trigger the initialization when USER is loaded ? (maybe there is already an undocumented one - you are the undisputed master here :-))
Hmmm. Strictly speaking, if an app dynamically loads USER, it can also dynamically *unload* USER; we'd have to take care that we invalidate the Callout pointers if this happens.
What do you think about the following solution? It just checks whenever any DLL is loaded or unloaded, whether the Callout pointers need to be updated ...
Bye, Ulrich
diff -ur wine-cvs/if1632/thunk.c wine-uw/if1632/thunk.c --- wine-cvs/if1632/thunk.c Wed Jan 3 22:51:30 2001 +++ wine-uw/if1632/thunk.c Mon Jan 29 00:35:49 2001 @@ -166,7 +166,7 @@ NE_MODULE *pModule;
hModule = GetModuleHandleA( "user32.dll" ); - if ( hModule ) + if ( hModule && !Callout.PeekMessageA ) { #define GETADDR( name ) \ *(FARPROC *)&Callout.name = GetProcAddress( hModule, #name ) @@ -185,10 +185,24 @@ GETADDR( MessageBoxW ); #undef GETADDR } - else WARN("no 32-bit USER\n"); + if ( !hModule && Callout.PeekMessageA ) + { + Callout.PeekMessageA = NULL; + Callout.GetMessageA = NULL; + Callout.SendMessageA = NULL; + Callout.PostMessageA = NULL; + Callout.TranslateMessage = NULL; + Callout.DispatchMessageA = NULL; + Callout.RedrawWindow = NULL; + Callout.WaitForInputIdle = NULL; + Callout.MsgWaitForMultipleObjects = NULL; + Callout.WindowFromDC = NULL; + Callout.MessageBoxA = NULL; + Callout.MessageBoxW = NULL; + }
pModule = NE_GetPtr( GetModuleHandle16( "USER.EXE" ) ); - if ( pModule ) + if ( pModule && !Callout.FinalUserInit16 ) { #define GETADDR( var, name, thk ) \ *(FARPROC *)&Callout.var = THUNK_GetCalloutThunk( pModule, name, \ @@ -201,5 +215,12 @@ GETADDR( UserSignalProc, "SignalProc32", word_lllw ); #undef GETADDR } - else WARN("no 16-bit USER\n"); + if ( !pModule && Callout.FinalUserInit16 ) + { + Callout.FinalUserInit16 = NULL; + Callout.InitThreadInput16 = NULL; + Callout.UserYield16 = NULL; + Callout.DestroyIcon32 = NULL; + Callout.UserSignalProc = NULL; + } } diff -ur wine-cvs/loader/module.c wine-uw/loader/module.c --- wine-cvs/loader/module.c Tue Jan 16 00:29:27 2001 +++ wine-uw/loader/module.c Mon Jan 29 00:30:20 2001 @@ -1432,6 +1432,9 @@ /* decrement the dependencies through the MODULE_FreeLibrary call. */ pwm->refCount++;
+ /* Update the kernel Callout tables */ + THUNK_InitCallout(); + RtlReleasePebLock(); SetLastError( err ); /* restore last error */ HeapFree ( GetProcessHeap(), 0, filename ); @@ -1526,6 +1529,9 @@ HeapFree( GetProcessHeap(), 0, wm->short_filename ); HeapFree( GetProcessHeap(), 0, wm ); } + + /* Update the kernel Callout tables */ + THUNK_InitCallout(); }
/*********************************************************************** diff -ur wine-cvs/miscemu/main.c wine-uw/miscemu/main.c --- wine-cvs/miscemu/main.c Wed Jan 10 02:42:49 2001 +++ wine-uw/miscemu/main.c Mon Jan 29 00:36:05 2001 @@ -34,7 +34,6 @@ MESSAGE( "Cannot load user32.dll\n" ); ExitProcess( GetLastError() ); } - THUNK_InitCallout();
if ((instance = NE_StartMain( main_exe_name, main_exe_file )) < 32) { diff -ur wine-cvs/scheduler/process.c wine-uw/scheduler/process.c --- wine-cvs/scheduler/process.c Sun Jan 28 18:58:09 2001 +++ wine-uw/scheduler/process.c Mon Jan 29 00:36:17 2001 @@ -346,9 +346,6 @@ MODULE_DllProcessAttach( NULL, (LPVOID)1 ); RtlReleasePebLock();
- /* Get pointers to USER routines called by KERNEL */ - THUNK_InitCallout(); - /* Call FinalUserInit routine */ if (Callout.FinalUserInit16) Callout.FinalUserInit16();
-- Dr. Ulrich Weigand weigand@informatik.uni-erlangen.de