Another PSEH fix

svn path=/trunk/; revision=9804
This commit is contained in:
KJK::Hyperion 2004-06-21 20:55:16 +00:00
parent d9954bc076
commit bfce2bcf20
4 changed files with 45 additions and 16 deletions

View file

@ -0,0 +1,32 @@
/*
Copyright (c) 2004 KJK::Hyperion
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef KJK_PSEH_EXCPT_H_
#define KJK_PSEH_EXCPT_H_
#define _SEH_CONTINUE_EXECUTION (-1)
#define _SEH_CONTINUE_SEARCH (0)
#define _SEH_EXECUTE_HANDLER (1)
#endif
/* EOF */

View file

@ -24,11 +24,7 @@
#define KJK_PSEH_FRAMEBASED_H_
#include <pseh/framebased/internal.h>
/* Safeguards against broken SDK/CRT headers */
#ifndef _SEH_NO_SYSTEM_HEADERS
# include <excpt.h>
#endif
#include <pseh/excpt.h>
#ifndef offsetof
# include <stddef.h>
@ -81,7 +77,7 @@ static __declspec(noreturn) void __stdcall _SEHCompilerSpecificHandler
#define _SEH_TRY_FINALLY(FINALLY_) \
_SEH_TRY_FILTER_FINALLY \
( \
(_SEHFilter_t)(EXCEPTION_CONTINUE_SEARCH + 1), \
(_SEHFilter_t)(_SEH_CONTINUE_SEARCH + 1), \
(FINALLY_) \
)
@ -93,7 +89,7 @@ static __declspec(noreturn) void __stdcall _SEHCompilerSpecificHandler
#define _SEH_TRY_HANDLE_FINALLY(FINALLY_) \
_SEH_TRY_FILTER_FINALLY \
( \
(_SEHFilter_t)(EXCEPTION_EXECUTE_HANDLER + 1), \
(_SEHFilter_t)(_SEH_EXECUTE_HANDLER + 1), \
(FINALLY_) \
)

View file

@ -25,6 +25,7 @@
#include <windows.h>
#include <pseh/framebased/internal.h>
#include <pseh/excpt.h>
#include <excpt.h>
/* Assembly helpers, see i386/framebased.asm */
@ -78,9 +79,9 @@ int __cdecl _SEHFrameHandler
switch((UINT_PTR)frame->SPF_Handlers->SH_Filter)
{
case EXCEPTION_EXECUTE_HANDLER + 1:
case EXCEPTION_CONTINUE_SEARCH + 1:
case EXCEPTION_CONTINUE_EXECUTION + 1:
case _SEH_EXECUTE_HANDLER + 1:
case _SEH_CONTINUE_SEARCH + 1:
case _SEH_CONTINUE_EXECUTION + 1:
{
ret = (int)((UINT_PTR)frame->SPF_Handlers->SH_Filter) - 1;
break;
@ -98,13 +99,13 @@ int __cdecl _SEHFrameHandler
}
}
/* EXCEPTION_CONTINUE_EXECUTION */
/* _SEH_CONTINUE_EXECUTION */
if(ret < 0)
return ExceptionContinueExecution;
/* EXCEPTION_EXECUTE_HANDLER */
/* _SEH_EXECUTE_HANDLER */
else if(ret > 0)
_SEHCallHandler(frame);
/* EXCEPTION_CONTINUE_SEARCH */
/* _SEH_CONTINUE_SEARCH */
else
/* fall through */;
}

View file

@ -1,4 +1,4 @@
# $Id: helper.mk,v 1.68 2004/06/18 22:33:06 hyperion Exp $
# $Id: helper.mk,v 1.69 2004/06/21 20:55:16 hyperion Exp $
#
# Helper makefile for ReactOS modules
# Variables this makefile accepts:
@ -583,8 +583,8 @@ endif
ifeq ($(MK_MODE),kernel)
MK_DEFBASE := 0x10000
MK_LIBS := $(addprefix $(DDK_PATH_LIB)/, $(TARGET_DDKLIBS) $(MK_DDKLIBS))
MK_CFLAGS += -D_SEH_NO_NATIVE_NLG -D_SEH_NO_SYSTEM_HEADERS
MK_CPPFLAGS += -D_SEH_NO_NATIVE_NLG -D_SEH_NO_SYSTEM_HEADERS
MK_CFLAGS += -D_SEH_NO_NATIVE_NLG
MK_CPPFLAGS += -D_SEH_NO_NATIVE_NLG
endif