From 627c9073c746730b0dc6bc46314bdcf0ac568ae0 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 28 Mar 2001 18:47:05 +0000 Subject: [PATCH] Don't load user32 too early on for 16-bit apps, so that app-specific config can be available while loading it. --- loader/task.c | 17 ++++++++++++++--- miscemu/main.c | 19 +++++++++---------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/loader/task.c b/loader/task.c index ac86874ca7..52e1270b9c 100644 --- a/loader/task.c +++ b/loader/task.c @@ -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; } diff --git a/miscemu/main.c b/miscemu/main.c index 942b31563e..1b9e740ef6 100644 --- a/miscemu/main.c +++ b/miscemu/main.c @@ -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 ); -- 2.32.0.93.g670b81a890