Don't load user32 too early on for 16-bit apps, so that app-specific

config can be available while loading it.
This commit is contained in:
Alexandre Julliard 2001-03-28 18:47:05 +00:00
parent dc830b5415
commit 627c9073c7
2 changed files with 23 additions and 13 deletions

View File

@ -1183,11 +1183,22 @@ HANDLE WINAPI GetFastQueue16( void )
TEB *teb = NtCurrentTeb();
if (!teb) return 0;
if (!teb->queue && Callout.InitThreadInput16)
if (!teb->queue)
{
if (!Callout.InitThreadInput16)
{
THUNK_InitCallout();
if (!Callout.InitThreadInput16)
{
FIXME("InitThreadInput16 callout not found, trouble ahead\n");
return 0;
}
}
Callout.InitThreadInput16( 0, THREAD_IsWin16(teb)? 4 : 5 );
if (!teb->queue)
FIXME("(): should initialize thread-local queue, expect failure!\n" );
if (!teb->queue)
FIXME("(): should initialize thread-local queue, expect failure!\n" );
}
return (HANDLE)teb->queue;
}

View File

@ -34,16 +34,6 @@ int WINAPI wine_initial_task( HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, INT
HINSTANCE16 instance;
HMODULE user32;
if (!(user32 = LoadLibraryA( "user32.dll" )))
{
MESSAGE( "Cannot load user32.dll\n" );
ExitProcess( GetLastError() );
}
pGetMessageA = (void *)GetProcAddress( user32, "GetMessageA" );
pTranslateMessage = (void *)GetProcAddress( user32, "TranslateMessage" );
pDispatchMessageA = (void *)GetProcAddress( user32, "DispatchMessageA" );
THUNK_InitCallout();
if ((instance = NE_StartMain( main_exe_name, main_exe_file )) < 32)
{
if (instance == 11) /* try DOS format */
@ -67,6 +57,15 @@ int WINAPI wine_initial_task( HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, INT
/* Start message loop for desktop window */
if (!(user32 = LoadLibraryA( "user32.dll" )))
{
MESSAGE( "Cannot load user32.dll\n" );
ExitProcess( GetLastError() );
}
pGetMessageA = (void *)GetProcAddress( user32, "GetMessageA" );
pTranslateMessage = (void *)GetProcAddress( user32, "TranslateMessage" );
pDispatchMessageA = (void *)GetProcAddress( user32, "DispatchMessageA" );
while ( GetNumTasks16() > 1 && pGetMessageA( &msg, 0, 0, 0 ) )
{
pTranslateMessage( &msg );