Commit fc2c5dfb authored by Andreas Mohr's avatar Andreas Mohr Committed by Alexandre Julliard

Implemented TerminateApp needed for DBase 5.0.

Made FatalAppExit16 honor the SEM_NOGPFAULTERRORBOX error_mode flag.
parent 7a947b34
...@@ -241,6 +241,9 @@ DWORD WINAPI TaskSetCSIP(HTASK16 hTask, WORD wCS, WORD wIP); ...@@ -241,6 +241,9 @@ DWORD WINAPI TaskSetCSIP(HTASK16 hTask, WORD wCS, WORD wIP);
DWORD WINAPI TaskGetCSIP(HTASK16 hTask); DWORD WINAPI TaskGetCSIP(HTASK16 hTask);
BOOL16 WINAPI TaskSwitch(HTASK16 hTask, DWORD dwNewCSIP); BOOL16 WINAPI TaskSwitch(HTASK16 hTask, DWORD dwNewCSIP);
/* flag for TerminateApp16() */
#define NO_UAE_BOX 1
/* mem info */ /* mem info */
typedef struct tagMEMMANINFO { typedef struct tagMEMMANINFO {
......
...@@ -1586,6 +1586,57 @@ BOOL16 WINAPI TaskFindHandle16( TASKENTRY *lpte, HTASK16 hTask ) ...@@ -1586,6 +1586,57 @@ BOOL16 WINAPI TaskFindHandle16( TASKENTRY *lpte, HTASK16 hTask )
} }
/**************************************************************************
* FatalAppExit16 (KERNEL.137)
*/
void WINAPI FatalAppExit16( UINT16 action, LPCSTR str )
{
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
if (!pTask || !(pTask->error_mode & SEM_NOGPFAULTERRORBOX))
{
if (Callout.MessageBoxA)
Callout.MessageBoxA( 0, str, NULL, MB_SYSTEMMODAL | MB_OK );
else
ERR( "%s\n", debugstr_a(str) );
}
ExitThread(0xff);
}
/***********************************************************************
* TerminateApp16 (TOOLHELP.77)
*
* See "Undocumented Windows".
*/
void WINAPI TerminateApp16(HTASK16 hTask, WORD wFlags)
{
if (hTask && hTask != GetCurrentTask())
{
FIXME("cannot terminate task %x\n", hTask);
return;
}
if (wFlags & NO_UAE_BOX)
{
UINT16 old_mode;
old_mode = SetErrorMode16(0);
SetErrorMode16(old_mode|SEM_NOGPFAULTERRORBOX);
}
FatalAppExit16( 0, NULL );
/* hmm, we're still alive ?? */
/* check undocumented flag */
if (!(wFlags & 0x8000))
TASK_CallTaskSignalProc( USIG16_TERMINATION, hTask );
/* UndocWin says to call int 0x21/0x4c exit=0xff here,
but let's just call ExitThread */
ExitThread(0xff);
}
/*********************************************************************** /***********************************************************************
* GetAppCompatFlags16 (KERNEL.354) * GetAppCompatFlags16 (KERNEL.354)
*/ */
......
...@@ -273,16 +273,6 @@ LPTOP_LEVEL_EXCEPTION_FILTER WINAPI SetUnhandledExceptionFilter( ...@@ -273,16 +273,6 @@ LPTOP_LEVEL_EXCEPTION_FILTER WINAPI SetUnhandledExceptionFilter(
/************************************************************************** /**************************************************************************
* FatalAppExit16 (KERNEL.137)
*/
void WINAPI FatalAppExit16( UINT16 action, LPCSTR str )
{
WARN("AppExit\n");
FatalAppExitA( action, str );
}
/**************************************************************************
* FatalAppExitA (KERNEL32.108) * FatalAppExitA (KERNEL32.108)
*/ */
void WINAPI FatalAppExitA( UINT action, LPCSTR str ) void WINAPI FatalAppExitA( UINT action, LPCSTR str )
......
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