Commit c44ab1f0 authored by Ulrich Weigand's avatar Ulrich Weigand Committed by Alexandre Julliard

Don't create thunk for task signal proc, call it directly.

parent f86aab84
......@@ -42,7 +42,7 @@ file krnl386.exe
35 pascal16 GetTaskQueue(word) GetTaskQueue16
36 pascal GetCurrentTask() WIN16_GetCurrentTask
37 pascal GetCurrentPDB() GetCurrentPDB16
38 pascal SetTaskSignalProc(word segptr) THUNK_SetTaskSignalProc
38 pascal SetTaskSignalProc(word segptr) SetTaskSignalProc
41 pascal16 EnableDos() KERNEL_nop
42 pascal16 DisableDos() KERNEL_nop
45 pascal16 LoadModule(str ptr) LoadModule16
......@@ -345,7 +345,7 @@ file krnl386.exe
438 pascal16 _CreateSysLevel(ptr long) _CreateSysLevel
439 pascal16 _EnterSysLevel(ptr) _EnterSysLevel
440 pascal16 _LeaveSysLevel(ptr) _LeaveSysLevel
441 pascal CreateThread16(ptr long segptr segptr long ptr) THUNK_CreateThread16
441 pascal CreateThread16(ptr long segptr segptr long ptr) CreateThread16
442 pascal VWin32_EventCreate() VWin32_EventCreate
443 pascal VWin32_EventDestroy(long) VWin32_EventDestroy
444 pascal16 Local32Info(ptr word) Local32Info16
......
......@@ -81,7 +81,7 @@ typedef struct _TDB
HTASK16 hParent; /* 22 Selector of TDB of parent */
WORD signal_flags; /* 24 Flags for signal handler */
FARPROC16 sighandler WINE_PACKED; /* 26 Signal handler */
USERSIGNALPROC userhandler WINE_PACKED; /* 2a USER signal handler */
FARPROC16 userhandler WINE_PACKED; /* 2a USER signal handler */
FARPROC16 discardhandler WINE_PACKED; /* 2e Handler for GlobalNotify() */
DWORD int0 WINE_PACKED; /* 32 int 0 (divide by 0) handler */
DWORD int2 WINE_PACKED; /* 36 int 2 (NMI) handler */
......@@ -152,6 +152,7 @@ extern HTASK16 TASK_GetNextTask( HTASK16 hTask );
extern void TASK_Reschedule(void);
extern void TASK_CallToStart(void);
extern void TASK_InstallTHHook( THHOOK *pNewThook );
extern void TASK_CallTaskSignalProc( UINT16 uCode, HANDLE16 hTaskOrModule );
extern HQUEUE16 WINAPI SetThreadQueue16( DWORD thread, HQUEUE16 hQueue );
extern HQUEUE16 WINAPI GetThreadQueue16( DWORD thread );
......
......@@ -18,6 +18,8 @@ C_SRCS = \
signal.c \
task.c
GLUE = task.c
all: $(MODULE).o
@MAKE_RULES@
......
......@@ -1290,15 +1290,10 @@ static BOOL16 NE_FreeModule( HMODULE16 hModule, BOOL call_wep )
{
if (pModule->flags & NE_FFLAGS_LIBMODULE)
{
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
MODULE_CallWEP( hModule );
/* Free the objects owned by the DLL module */
if (pTask && pTask->userhandler)
pTask->userhandler( hModule, USIG16_DLL_UNLOAD, 0,
pTask->hInstance, pTask->hQueue );
TASK_CallTaskSignalProc( USIG16_DLL_UNLOAD, hModule );
PROCESS_CallUserSignalProc( USIG_DLL_UNLOAD_WIN16, hModule );
}
else
......
......@@ -613,9 +613,7 @@ static BOOL NE_InitDLL( TDB* pTask, NE_MODULE *pModule )
(pModule->flags & NE_FFLAGS_WIN32)) return TRUE; /*not a library*/
/* Call USER signal handler for Win3.1 compatibility. */
if (pTask && pTask->userhandler)
pTask->userhandler( pModule->self, USIG16_DLL_LOAD, 0,
pTask->hInstance, pTask->hQueue );
TASK_CallTaskSignalProc( USIG16_DLL_LOAD, pModule->self );
if (!pModule->cs) return TRUE; /* no initialization code */
......
......@@ -467,10 +467,7 @@ void TASK_KillTask( HTASK16 hTask )
/* Perform USER cleanup */
if (pTask->userhandler)
pTask->userhandler( hTask, USIG16_TERMINATION, 0,
pTask->hInstance, pTask->hQueue );
TASK_CallTaskSignalProc( USIG16_TERMINATION, hTask );
PROCESS_CallUserSignalProc( USIG_PROCESS_EXIT, 0 );
PROCESS_CallUserSignalProc( USIG_THREAD_EXIT, 0 ); /* FIXME */
PROCESS_CallUserSignalProc( USIG_PROCESS_DESTROY, 0 );
......@@ -1447,8 +1444,6 @@ BOOL16 WINAPI IsWinOldApTask16( HTASK16 hTask )
/***********************************************************************
* SetTaskSignalProc (KERNEL.38)
*
* Real 16-bit interface is provided by the THUNK_SetTaskSignalProc.
*/
FARPROC16 WINAPI SetTaskSignalProc( HTASK16 hTask, FARPROC16 proc )
{
......@@ -1457,11 +1452,26 @@ FARPROC16 WINAPI SetTaskSignalProc( HTASK16 hTask, FARPROC16 proc )
if (!hTask) hTask = GetCurrentTask();
if (!(pTask = (TDB *)GlobalLock16( hTask ))) return NULL;
oldProc = (FARPROC16)pTask->userhandler;
pTask->userhandler = (USERSIGNALPROC)proc;
oldProc = pTask->userhandler;
pTask->userhandler = proc;
return oldProc;
}
/***********************************************************************
* TASK_CallTaskSignalProc
*/
/* ### start build ### */
extern WORD CALLBACK TASK_CallTo16_word_wwwww(FARPROC16,WORD,WORD,WORD,WORD,WORD);
/* ### stop build ### */
void TASK_CallTaskSignalProc( UINT16 uCode, HANDLE16 hTaskOrModule )
{
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
if ( !pTask || !pTask->userhandler ) return;
TASK_CallTo16_word_wwwww( pTask->userhandler,
hTaskOrModule, uCode, 0,
pTask->hInstance, pTask->hQueue );
}
/***********************************************************************
* SetSigHandler (KERNEL.140)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment