Removed a few unnecessary Callouts.
diff --git a/loader/module.c b/loader/module.c
index fcc0eea..692ea11 100644
--- a/loader/module.c
+++ b/loader/module.c
@@ -17,7 +17,6 @@
#include "file.h"
#include "module.h"
#include "debugtools.h"
-#include "callback.h"
#include "wine/server.h"
DEFAULT_DEBUG_CHANNEL(module);
@@ -30,6 +29,25 @@
static int free_lib_count; /* recursion depth of FreeLibrary calls */
static int process_detaching; /* set on process detach to avoid deadlocks with thread detach */
+/***********************************************************************
+ * wait_input_idle
+ *
+ * Wrapper to call WaitForInputIdle USER function
+ */
+typedef DWORD (WINAPI *WaitForInputIdle_ptr)( HANDLE hProcess, DWORD dwTimeOut );
+
+static DWORD wait_input_idle( HANDLE process, DWORD timeout )
+{
+ HMODULE mod = GetModuleHandleA( "user32.dll" );
+ if (mod)
+ {
+ WaitForInputIdle_ptr ptr = (WaitForInputIdle_ptr)GetProcAddress( mod, "WaitForInputIdle" );
+ if (ptr) return ptr( process, timeout );
+ }
+ return 0;
+}
+
+
/*************************************************************************
* MODULE32_LookupHMODULE
* looks for the referenced HMODULE in the current process
@@ -852,8 +870,7 @@
0, NULL, NULL, &startup, &info ))
{
/* Give 30 seconds to the app to come up */
- if (Callout.WaitForInputIdle &&
- Callout.WaitForInputIdle( info.hProcess, 30000 ) == 0xFFFFFFFF)
+ if (wait_input_idle( info.hProcess, 30000 ) == 0xFFFFFFFF)
WARN("WaitForInputIdle failed: Error %ld\n", GetLastError() );
hInstance = (HINSTANCE)33;
/* Close off the handles */
@@ -910,8 +927,7 @@
params->lpEnvAddress, NULL, &startup, &info ))
{
/* Give 30 seconds to the app to come up */
- if (Callout.WaitForInputIdle &&
- Callout.WaitForInputIdle( info.hProcess, 30000 ) == 0xFFFFFFFF )
+ if (wait_input_idle( info.hProcess, 30000 ) == 0xFFFFFFFF )
WARN("WaitForInputIdle failed: Error %ld\n", GetLastError() );
hInstance = (HINSTANCE)33;
/* Close off the handles */
diff --git a/loader/task.c b/loader/task.c
index 856cf50..bdb6009 100644
--- a/loader/task.c
+++ b/loader/task.c
@@ -19,7 +19,6 @@
#include "winsock.h"
#include "wine/winbase16.h"
-#include "callback.h"
#include "drive.h"
#include "file.h"
#include "global.h"
@@ -727,8 +726,20 @@
TDB *pCurTask = TASK_GetCurrent();
if (pCurTask) pCurTask->hYieldTo = 0;
- if (pCurTask && pCurTask->hQueue && Callout.UserYield16) Callout.UserYield16();
- else OldYield16();
+ if (pCurTask && pCurTask->hQueue)
+ {
+ HMODULE mod = GetModuleHandleA( "user32.dll" );
+ if (mod)
+ {
+ FARPROC proc = GetProcAddress( mod, "UserYield16" );
+ if (proc)
+ {
+ proc();
+ return;
+ }
+ }
+ }
+ OldYield16();
}
/***********************************************************************
@@ -1034,27 +1045,10 @@
*/
HANDLE WINAPI GetFastQueue16( void )
{
- TEB *teb = NtCurrentTeb();
- if (!teb) return 0;
+ HANDLE ret = (HANDLE)NtCurrentTeb()->queue;
- if (!teb->queue)
- {
- if (!Callout.InitThreadInput16)
- {
- THUNK_InitCallout();
- if (!Callout.InitThreadInput16)
- {
- FIXME("InitThreadInput16 callout not found, trouble ahead\n");
- return 0;
- }
- }
- Callout.InitThreadInput16( 0, (teb->tibflags & TEBF_WIN32) ? 5 : 4 );
-
- if (!teb->queue)
- FIXME("(): should initialize thread-local queue, expect failure!\n" );
- }
-
- return (HANDLE)teb->queue;
+ if (!ret) FIXME("(): should initialize thread-local queue, expect failure!\n" );
+ return ret;
}
/***********************************************************************