Commit 10cd651e authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Set up exception handler around WEP call.

parent a2302fbe
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <unistd.h> #include <unistd.h>
#include <ctype.h> #include <ctype.h>
#include "winbase.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "wine/library.h" #include "wine/library.h"
#include "winerror.h" #include "winerror.h"
...@@ -38,6 +39,8 @@ ...@@ -38,6 +39,8 @@
#include "snoop.h" #include "snoop.h"
#include "builtin16.h" #include "builtin16.h"
#include "stackframe.h" #include "stackframe.h"
#include "msvcrt/excpt.h"
#include "wine/exception.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(module); WINE_DEFAULT_DEBUG_CHANNEL(module);
...@@ -69,6 +72,16 @@ static HMODULE16 NE_GetModuleByFilename( LPCSTR name ); ...@@ -69,6 +72,16 @@ static HMODULE16 NE_GetModuleByFilename( LPCSTR name );
extern WORD CALLBACK NE_CallTo16_word_w(FARPROC16,WORD); extern WORD CALLBACK NE_CallTo16_word_w(FARPROC16,WORD);
/* ### stop build ### */ /* ### stop build ### */
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ||
GetExceptionCode() == EXCEPTION_PRIV_INSTRUCTION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
/*********************************************************************** /***********************************************************************
* NE_GetPtr * NE_GetPtr
*/ */
...@@ -1240,9 +1253,22 @@ HINSTANCE16 WINAPI LoadLibrary16( LPCSTR libname ) ...@@ -1240,9 +1253,22 @@ HINSTANCE16 WINAPI LoadLibrary16( LPCSTR libname )
*/ */
static BOOL16 MODULE_CallWEP( HMODULE16 hModule ) static BOOL16 MODULE_CallWEP( HMODULE16 hModule )
{ {
BOOL16 ret;
FARPROC16 WEP = GetProcAddress16( hModule, "WEP" ); FARPROC16 WEP = GetProcAddress16( hModule, "WEP" );
if (!WEP) return FALSE; if (!WEP) return FALSE;
return NE_CallTo16_word_w( WEP, WEP_FREE_DLL );
__TRY
{
ret = NE_CallTo16_word_w( WEP, WEP_FREE_DLL );
}
__EXCEPT(page_fault)
{
WARN("Page fault\n");
ret = 0;
}
__ENDTRY
return ret;
} }
......
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