2004-06-02 19:22:06 +00:00
|
|
|
/*
|
2007-02-26 15:32:19 +00:00
|
|
|
Copyright (c) 2004/2005 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.
|
2004-06-02 19:22:06 +00:00
|
|
|
*/
|
|
|
|
|
2007-08-07 20:11:21 +00:00
|
|
|
#define _NTSYSTEM_
|
2004-06-02 18:36:55 +00:00
|
|
|
#define STRICT
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
|
|
#include <windows.h>
|
|
|
|
|
2005-06-30 22:40:36 +00:00
|
|
|
#include <pseh/pseh.h>
|
2004-06-02 18:36:55 +00:00
|
|
|
#include <pseh/framebased/internal.h>
|
2004-06-21 20:55:16 +00:00
|
|
|
#include <pseh/excpt.h>
|
2004-12-05 06:05:52 +00:00
|
|
|
#include <pseh/framebased.h>
|
2004-06-02 18:36:55 +00:00
|
|
|
|
2005-05-06 22:25:30 +00:00
|
|
|
#include <excpt.h>
|
|
|
|
|
2007-02-28 00:04:36 +00:00
|
|
|
/* Tracing */
|
2007-02-28 00:22:08 +00:00
|
|
|
#ifdef _SEH_ENABLE_TRACE
|
2007-02-28 00:04:36 +00:00
|
|
|
extern unsigned long __cdecl DbgPrint(const char * format, ...);
|
|
|
|
|
|
|
|
#define _SEH_TRACE_HEADER_(FRAME_) \
|
|
|
|
DbgPrint("[PSEH:%p]%s:%d:", FRAME_, __FILE__, __LINE__);
|
|
|
|
|
|
|
|
#define _SEH_TRACE_TRAILER_ \
|
|
|
|
DbgPrint("\n");
|
|
|
|
|
|
|
|
#define _SEH_FILTER_RET_STRING_(RET_) \
|
|
|
|
(((int)(RET_) < 0) ? "_SEH_CONTINUE_EXECUTION" : (((int)(RET_) > 0) ? "_SEH_EXECUTE_HANDLER" : "_SEH_CONTINUE_SEARCH"))
|
|
|
|
|
|
|
|
#define _SEH_TRACE_LINE_(FRAME_, ARGS_) \
|
|
|
|
{ \
|
|
|
|
_SEH_TRACE_HEADER_(FRAME_); \
|
|
|
|
DbgPrint ARGS_; \
|
|
|
|
_SEH_TRACE_TRAILER_; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define _SEH_TRACE_ENTER(FRAME_, FUNCNAME_, ARGS_) \
|
|
|
|
{ \
|
|
|
|
if((FRAME_)->SPF_Tracing & _SEH_DO_TRACE_ENTER_LEAVE) \
|
|
|
|
{ \
|
|
|
|
_SEH_TRACE_HEADER_(FRAME_); \
|
|
|
|
DbgPrint(">>> %s(", (FUNCNAME_)); \
|
|
|
|
DbgPrint ARGS_; \
|
|
|
|
DbgPrint(")"); \
|
|
|
|
_SEH_TRACE_TRAILER_; \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define _SEH_TRACE_LEAVE(FRAME_, FUNCNAME_, ARGS_) \
|
|
|
|
{ \
|
|
|
|
if((FRAME_)->SPF_Tracing & _SEH_DO_TRACE_ENTER_LEAVE) \
|
|
|
|
{ \
|
|
|
|
_SEH_TRACE_HEADER_(FRAME_); \
|
|
|
|
DbgPrint("<<< %s => ", (FUNCNAME_)); \
|
|
|
|
DbgPrint ARGS_; \
|
|
|
|
_SEH_TRACE_TRAILER_; \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define _SEH_TRACE_EXCEPTION_RECORD(FRAME_, ER_) \
|
|
|
|
{ \
|
|
|
|
if((FRAME_)->SPF_Tracing & _SEH_DO_TRACE_EXCEPTION_RECORD) \
|
|
|
|
{ \
|
|
|
|
_SEH_TRACE_LINE_ \
|
|
|
|
( \
|
|
|
|
(FRAME_), \
|
|
|
|
( \
|
|
|
|
"ExceptionRecord %p = { ExceptionCode : %08X, ExceptionFlags : %08X, ExceptionRecord : %p, ExceptionAddress : %p }", \
|
|
|
|
(ER_), \
|
|
|
|
(ER_)->ExceptionCode, \
|
|
|
|
(ER_)->ExceptionFlags, \
|
|
|
|
(ER_)->ExceptionRecord, \
|
|
|
|
(ER_)->ExceptionAddress \
|
|
|
|
) \
|
|
|
|
); \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef _X86_
|
|
|
|
#define _SEH_TRACE_CONTEXT(FRAME_, CONTEXT_) \
|
|
|
|
{ \
|
|
|
|
if((FRAME_)->SPF_Tracing & _SEH_DO_TRACE_CONTEXT) \
|
|
|
|
{ \
|
|
|
|
if(((CONTEXT_)->ContextFlags & CONTEXT_INTEGER) == CONTEXT_INTEGER) \
|
|
|
|
{ \
|
|
|
|
_SEH_TRACE_LINE_ \
|
|
|
|
( \
|
|
|
|
(FRAME_), \
|
|
|
|
( \
|
|
|
|
"eax=%08X ebx=%08X ecx=%08X edx=%08X esi=%08X edi=%08X", \
|
|
|
|
(CONTEXT_)->Eax, \
|
|
|
|
(CONTEXT_)->Ebx, \
|
|
|
|
(CONTEXT_)->Ecx, \
|
|
|
|
(CONTEXT_)->Edx, \
|
|
|
|
(CONTEXT_)->Esi, \
|
|
|
|
(CONTEXT_)->Edi \
|
|
|
|
) \
|
|
|
|
); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
if(((CONTEXT_)->ContextFlags & CONTEXT_CONTROL) == CONTEXT_CONTROL) \
|
|
|
|
{ \
|
|
|
|
_SEH_TRACE_LINE_ \
|
|
|
|
( \
|
|
|
|
(FRAME_), \
|
|
|
|
( \
|
|
|
|
"eip=%08X esp=%08X ebp=%08X efl=%08X cs=%08X ss=%08X", \
|
|
|
|
(CONTEXT_)->Eip, \
|
|
|
|
(CONTEXT_)->Esp, \
|
|
|
|
(CONTEXT_)->Ebp, \
|
|
|
|
(CONTEXT_)->EFlags, \
|
|
|
|
(CONTEXT_)->SegCs, \
|
|
|
|
(CONTEXT_)->SegSs \
|
|
|
|
) \
|
|
|
|
); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
if(((CONTEXT_)->ContextFlags & CONTEXT_SEGMENTS) == CONTEXT_SEGMENTS) \
|
|
|
|
{ \
|
|
|
|
_SEH_TRACE_LINE_ \
|
|
|
|
( \
|
|
|
|
(FRAME_), \
|
|
|
|
( \
|
|
|
|
"ds=%08X es=%08X fs=%08X gs=%08X", \
|
|
|
|
(CONTEXT_)->SegDs, \
|
|
|
|
(CONTEXT_)->SegEs, \
|
|
|
|
(CONTEXT_)->SegFs, \
|
|
|
|
(CONTEXT_)->SegGs \
|
|
|
|
) \
|
|
|
|
); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
#else
|
2007-09-02 18:05:16 +00:00
|
|
|
#define _SEH_TRACE_CONTEXT(FRAME_, CONTEXT_)
|
2007-02-28 00:04:36 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define _SEH_TRACE_UNWIND(FRAME_, ARGS_) \
|
|
|
|
{ \
|
|
|
|
if((FRAME_)->SPF_Tracing & _SEH_DO_TRACE_UNWIND) \
|
|
|
|
{ \
|
|
|
|
_SEH_TRACE_LINE_((FRAME_), ARGS_); \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define _SEH_TRACE_TRYLEVEL(FRAME_, TRYLEVEL_) \
|
|
|
|
{ \
|
|
|
|
if((FRAME_)->SPF_Tracing & _SEH_DO_TRACE_TRYLEVEL) \
|
|
|
|
{ \
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
_SEH_TRACE_LINE_((FRAME_), ("trylevel %p, filter %p", (TRYLEVEL_), (TRYLEVEL_)->SPT_Handlers.SH_Filter)); \
|
2007-02-28 00:04:36 +00:00
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define _SEH_TRACE_ENTER_CALL_FILTER(FRAME_, TRYLEVEL_, ER_) \
|
|
|
|
{ \
|
|
|
|
if((FRAME_)->SPF_Tracing & _SEH_DO_TRACE_CALL_FILTER) \
|
|
|
|
{ \
|
|
|
|
_SEH_TRACE_LINE_ \
|
|
|
|
( \
|
|
|
|
(FRAME_), \
|
|
|
|
( \
|
|
|
|
"trylevel %p, calling filter %p, ExceptionCode %08X", \
|
|
|
|
(TRYLEVEL_), \
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
(TRYLEVEL_)->SPT_Handlers.SH_Filter, \
|
2007-02-28 00:04:36 +00:00
|
|
|
(ER_)->ExceptionCode \
|
|
|
|
) \
|
|
|
|
); \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define _SEH_TRACE_LEAVE_CALL_FILTER(FRAME_, TRYLEVEL_, RET_) \
|
|
|
|
{ \
|
|
|
|
if((FRAME_)->SPF_Tracing & _SEH_DO_TRACE_CALL_FILTER) \
|
|
|
|
{ \
|
|
|
|
_SEH_TRACE_LINE_ \
|
|
|
|
( \
|
|
|
|
(FRAME_), \
|
|
|
|
( \
|
|
|
|
"trylevel %p, filter %p => %s", \
|
|
|
|
(TRYLEVEL_), \
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
(TRYLEVEL_)->SPT_Handlers.SH_Filter, \
|
2007-02-28 00:04:36 +00:00
|
|
|
_SEH_FILTER_RET_STRING_(RET_) \
|
|
|
|
) \
|
|
|
|
); \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define _SEH_TRACE_FILTER(FRAME_, TRYLEVEL_, RET_) \
|
|
|
|
{ \
|
|
|
|
if((FRAME_)->SPF_Tracing & _SEH_DO_TRACE_FILTER) \
|
|
|
|
{ \
|
|
|
|
_SEH_TRACE_LINE_ \
|
|
|
|
( \
|
|
|
|
(FRAME_), \
|
|
|
|
( \
|
|
|
|
"trylevel %p => %s", \
|
|
|
|
(TRYLEVEL_), \
|
|
|
|
_SEH_FILTER_RET_STRING_(RET_) \
|
|
|
|
) \
|
|
|
|
); \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define _SEH_TRACE_ENTER_CALL_HANDLER(FRAME_, TRYLEVEL_) \
|
|
|
|
{ \
|
|
|
|
if((FRAME_)->SPF_Tracing & _SEH_DO_TRACE_CALL_HANDLER) \
|
|
|
|
{ \
|
|
|
|
_SEH_TRACE_LINE_((FRAME_), ("trylevel %p, handling", (TRYLEVEL_))); \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define _SEH_TRACE_ENTER_CALL_FINALLY(FRAME_, TRYLEVEL_) \
|
|
|
|
{ \
|
|
|
|
if((FRAME_)->SPF_Tracing & _SEH_DO_TRACE_CALL_FINALLY) \
|
|
|
|
{ \
|
|
|
|
_SEH_TRACE_LINE_ \
|
|
|
|
( \
|
|
|
|
(FRAME_), \
|
|
|
|
( \
|
|
|
|
"trylevel %p, calling exit routine %p", \
|
|
|
|
(TRYLEVEL_), \
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
(TRYLEVEL_)->SPT_Handlers.SH_Finally \
|
2007-02-28 00:04:36 +00:00
|
|
|
) \
|
|
|
|
); \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define _SEH_TRACE_LEAVE_CALL_FINALLY(FRAME_, TRYLEVEL_) \
|
|
|
|
{ \
|
|
|
|
if((FRAME_)->SPF_Tracing & _SEH_DO_TRACE_CALL_FINALLY) \
|
|
|
|
{ \
|
|
|
|
_SEH_TRACE_LINE_ \
|
|
|
|
( \
|
|
|
|
(FRAME_), \
|
|
|
|
( \
|
|
|
|
"trylevel %p, exit routine %p returned", \
|
|
|
|
(TRYLEVEL_), \
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
(TRYLEVEL_)->SPT_Handlers.SH_Finally \
|
2007-02-28 00:04:36 +00:00
|
|
|
) \
|
|
|
|
); \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
#define _SEH_TRACE_ENTER(FRAME_, FUNCNAME_, ARGS_)
|
|
|
|
#define _SEH_TRACE_LEAVE(FRAME_, FUNCNAME_, ARGS_)
|
|
|
|
#define _SEH_TRACE_EXCEPTION_RECORD(FRAME_, ER_)
|
|
|
|
#define _SEH_TRACE_CONTEXT(FRAME_, CONTEXT_)
|
|
|
|
#define _SEH_TRACE_UNWIND(FRAME_, ARGS_)
|
|
|
|
#define _SEH_TRACE_TRYLEVEL(FRAME_, TRYLEVEL_)
|
|
|
|
#define _SEH_TRACE_ENTER_CALL_FILTER(FRAME_, TRYLEVEL_, ER_)
|
|
|
|
#define _SEH_TRACE_LEAVE_CALL_FILTER(FRAME_, TRYLEVEL_, RET_)
|
|
|
|
#define _SEH_TRACE_FILTER(FRAME_, TRYLEVEL_, RET_)
|
|
|
|
#define _SEH_TRACE_ENTER_CALL_HANDLER(FRAME_, TRYLEVEL_)
|
|
|
|
#define _SEH_TRACE_ENTER_CALL_FINALLY(FRAME_, TRYLEVEL_)
|
|
|
|
#define _SEH_TRACE_LEAVE_CALL_FINALLY(FRAME_, TRYLEVEL_)
|
|
|
|
#endif
|
|
|
|
|
2004-06-02 18:36:55 +00:00
|
|
|
/* Assembly helpers, see i386/framebased.asm */
|
|
|
|
extern void __cdecl _SEHCleanHandlerEnvironment(void);
|
2005-05-06 22:25:30 +00:00
|
|
|
extern struct __SEHRegistration * __cdecl _SEHRegisterFrame(_SEHRegistration_t *);
|
|
|
|
extern void __cdecl _SEHUnregisterFrame(void);
|
|
|
|
extern void __cdecl _SEHGlobalUnwind(_SEHPortableFrame_t *);
|
|
|
|
extern _SEHRegistration_t * __cdecl _SEHCurrentRegistration(void);
|
2004-06-02 18:36:55 +00:00
|
|
|
|
2004-06-03 22:19:10 +00:00
|
|
|
/* Borland C++ uses a different decoration (i.e. none) for stdcall functions */
|
2007-08-07 20:11:21 +00:00
|
|
|
extern void __stdcall RtlUnwind(void *, void *, PEXCEPTION_RECORD, void *);
|
2004-06-03 22:19:10 +00:00
|
|
|
void const * _SEHRtlUnwind = RtlUnwind;
|
|
|
|
|
2005-10-06 21:39:18 +00:00
|
|
|
static void __stdcall _SEHLocalUnwind
|
2005-05-06 22:25:30 +00:00
|
|
|
(
|
2007-02-26 15:55:43 +00:00
|
|
|
_SEHPortableFrame_t * frame,
|
|
|
|
_SEHPortableTryLevel_t * dsttrylevel
|
2005-05-06 22:25:30 +00:00
|
|
|
)
|
|
|
|
{
|
2007-02-26 15:55:43 +00:00
|
|
|
_SEHPortableTryLevel_t * trylevel;
|
2005-05-06 22:25:30 +00:00
|
|
|
|
2007-02-28 00:04:36 +00:00
|
|
|
_SEH_TRACE_UNWIND(frame, ("enter local unwind from %p to %p", frame->SPF_TopTryLevel, dsttrylevel));
|
|
|
|
|
2007-02-26 15:55:43 +00:00
|
|
|
for
|
|
|
|
(
|
|
|
|
trylevel = frame->SPF_TopTryLevel;
|
|
|
|
trylevel != dsttrylevel;
|
|
|
|
trylevel = trylevel->SPT_Next
|
|
|
|
)
|
|
|
|
{
|
|
|
|
_SEHFinally_t pfnFinally;
|
2005-05-06 22:25:30 +00:00
|
|
|
|
2007-02-26 15:55:43 +00:00
|
|
|
/* ASSERT(trylevel); */
|
2005-05-06 22:25:30 +00:00
|
|
|
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
pfnFinally = trylevel->SPT_Handlers.SH_Finally;
|
2005-05-06 22:25:30 +00:00
|
|
|
|
2007-02-26 15:55:43 +00:00
|
|
|
if(pfnFinally)
|
2007-02-28 00:04:36 +00:00
|
|
|
{
|
|
|
|
_SEH_TRACE_ENTER_CALL_FINALLY(frame, trylevel);
|
2007-02-26 15:55:43 +00:00
|
|
|
pfnFinally(frame);
|
2007-02-28 00:04:36 +00:00
|
|
|
_SEH_TRACE_LEAVE_CALL_FINALLY(frame, trylevel);
|
|
|
|
}
|
2007-02-26 15:55:43 +00:00
|
|
|
}
|
2007-02-28 00:04:36 +00:00
|
|
|
|
|
|
|
_SEH_TRACE_UNWIND(frame, ("leave local unwind from %p to %p", frame->SPF_TopTryLevel, dsttrylevel));
|
2005-05-06 22:25:30 +00:00
|
|
|
}
|
|
|
|
|
2005-10-06 21:39:18 +00:00
|
|
|
static void __cdecl _SEHCallHandler
|
2005-05-06 22:25:30 +00:00
|
|
|
(
|
2007-02-26 15:55:43 +00:00
|
|
|
_SEHPortableFrame_t * frame,
|
|
|
|
_SEHPortableTryLevel_t * trylevel
|
2005-05-06 22:25:30 +00:00
|
|
|
)
|
2004-06-02 18:36:55 +00:00
|
|
|
{
|
2007-02-26 15:55:43 +00:00
|
|
|
_SEHGlobalUnwind(frame);
|
|
|
|
_SEHLocalUnwind(frame, trylevel);
|
2007-02-28 00:04:36 +00:00
|
|
|
_SEH_TRACE_ENTER_CALL_HANDLER(frame, trylevel);
|
2007-02-26 15:55:43 +00:00
|
|
|
frame->SPF_Handler(trylevel);
|
2007-02-28 00:04:36 +00:00
|
|
|
/* ASSERT(0); */
|
2004-06-02 18:36:55 +00:00
|
|
|
}
|
|
|
|
|
2005-10-06 21:39:18 +00:00
|
|
|
static int __cdecl _SEHFrameHandler
|
2004-06-02 18:36:55 +00:00
|
|
|
(
|
2007-02-26 15:55:43 +00:00
|
|
|
struct _EXCEPTION_RECORD * ExceptionRecord,
|
|
|
|
void * EstablisherFrame,
|
|
|
|
struct _CONTEXT * ContextRecord,
|
|
|
|
void * DispatcherContext
|
2004-06-02 18:36:55 +00:00
|
|
|
)
|
|
|
|
{
|
2007-02-26 15:55:43 +00:00
|
|
|
_SEHPortableFrame_t * frame;
|
|
|
|
|
|
|
|
_SEHCleanHandlerEnvironment();
|
|
|
|
|
|
|
|
frame = EstablisherFrame;
|
|
|
|
|
2007-02-28 00:04:36 +00:00
|
|
|
_SEH_TRACE_ENTER
|
|
|
|
(
|
|
|
|
frame,
|
|
|
|
"_SEHFrameHandler",
|
|
|
|
(
|
|
|
|
"%p, %p, %p, %p",
|
|
|
|
ExceptionRecord,
|
|
|
|
EstablisherFrame,
|
|
|
|
ContextRecord,
|
|
|
|
DispatcherContext
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
_SEH_TRACE_EXCEPTION_RECORD(frame, ExceptionRecord);
|
|
|
|
_SEH_TRACE_CONTEXT(frame, ContextRecord);
|
|
|
|
|
2007-02-26 15:55:43 +00:00
|
|
|
/* Unwinding */
|
|
|
|
if(ExceptionRecord->ExceptionFlags & (4 | 2))
|
2007-02-28 00:04:36 +00:00
|
|
|
{
|
|
|
|
_SEH_TRACE_UNWIND(frame, ("enter forced unwind"));
|
2007-02-26 15:55:43 +00:00
|
|
|
_SEHLocalUnwind(frame, NULL);
|
2007-02-28 00:04:36 +00:00
|
|
|
_SEH_TRACE_UNWIND(frame, ("leave forced unwind"));
|
|
|
|
}
|
2007-02-26 15:55:43 +00:00
|
|
|
/* Handling */
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
_SEHPortableTryLevel_t * trylevel;
|
|
|
|
|
|
|
|
if(ExceptionRecord->ExceptionCode)
|
|
|
|
frame->SPF_Code = ExceptionRecord->ExceptionCode;
|
|
|
|
else
|
|
|
|
frame->SPF_Code = 0xC0000001;
|
|
|
|
|
|
|
|
for
|
|
|
|
(
|
|
|
|
trylevel = frame->SPF_TopTryLevel;
|
|
|
|
trylevel != NULL;
|
|
|
|
trylevel = trylevel->SPT_Next
|
|
|
|
)
|
|
|
|
{
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
_SEHFilter_t pfnFilter = trylevel->SPT_Handlers.SH_Filter;
|
2007-02-26 15:55:43 +00:00
|
|
|
|
2007-02-28 00:04:36 +00:00
|
|
|
_SEH_TRACE_TRYLEVEL(frame, trylevel);
|
|
|
|
|
2007-02-26 15:55:43 +00:00
|
|
|
switch((UINT_PTR)pfnFilter)
|
|
|
|
{
|
|
|
|
case (UINT_PTR)_SEH_STATIC_FILTER(_SEH_EXECUTE_HANDLER):
|
|
|
|
case (UINT_PTR)_SEH_STATIC_FILTER(_SEH_CONTINUE_SEARCH):
|
|
|
|
case (UINT_PTR)_SEH_STATIC_FILTER(_SEH_CONTINUE_EXECUTION):
|
|
|
|
{
|
|
|
|
ret = (int)((UINT_PTR)pfnFilter) - 2;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
{
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
if(trylevel->SPT_Handlers.SH_Filter)
|
2007-02-26 15:55:43 +00:00
|
|
|
{
|
|
|
|
EXCEPTION_POINTERS ep;
|
|
|
|
|
|
|
|
ep.ExceptionRecord = ExceptionRecord;
|
|
|
|
ep.ContextRecord = ContextRecord;
|
|
|
|
|
2007-02-28 00:04:36 +00:00
|
|
|
_SEH_TRACE_ENTER_CALL_FILTER(frame, trylevel, ExceptionRecord);
|
2007-02-26 15:55:43 +00:00
|
|
|
ret = pfnFilter(&ep, frame);
|
2007-02-28 00:04:36 +00:00
|
|
|
_SEH_TRACE_LEAVE_CALL_FILTER(frame, trylevel, ret);
|
2007-02-26 15:55:43 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
ret = _SEH_CONTINUE_SEARCH;
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-02-28 00:04:36 +00:00
|
|
|
_SEH_TRACE_FILTER(frame, trylevel, ret);
|
|
|
|
|
2007-02-26 15:55:43 +00:00
|
|
|
/* _SEH_CONTINUE_EXECUTION */
|
|
|
|
if(ret < 0)
|
2007-02-28 00:04:36 +00:00
|
|
|
{
|
|
|
|
_SEH_TRACE_LEAVE(frame, "_SEHFrameHandler", ("ExceptionContinueExecution"));
|
2007-02-26 15:55:43 +00:00
|
|
|
return ExceptionContinueExecution;
|
2007-02-28 00:04:36 +00:00
|
|
|
}
|
2007-02-26 15:55:43 +00:00
|
|
|
/* _SEH_EXECUTE_HANDLER */
|
|
|
|
else if(ret > 0)
|
|
|
|
_SEHCallHandler(frame, trylevel);
|
|
|
|
/* _SEH_CONTINUE_SEARCH */
|
|
|
|
else
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
}
|
|
|
|
|
2007-02-28 00:04:36 +00:00
|
|
|
_SEH_TRACE_LEAVE(frame, "_SEHFrameHandler", ("ExceptionContinueSearch"));
|
2007-02-26 15:55:43 +00:00
|
|
|
return ExceptionContinueSearch;
|
2004-06-02 18:36:55 +00:00
|
|
|
}
|
|
|
|
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
void __stdcall _SEHEnterFrame_s(_SEHPortableFrame_t * frame)
|
2005-05-06 22:25:30 +00:00
|
|
|
{
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
_SEHEnterFrame_f(frame);
|
2005-05-06 22:25:30 +00:00
|
|
|
}
|
|
|
|
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
void __stdcall _SEHLeaveFrame_s(void)
|
2005-05-06 22:25:30 +00:00
|
|
|
{
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
_SEHLeaveFrame_f();
|
2005-05-06 22:25:30 +00:00
|
|
|
}
|
|
|
|
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
void __stdcall _SEHReturn_s(void)
|
2005-05-06 22:25:30 +00:00
|
|
|
{
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
_SEHReturn_f();
|
2005-05-06 22:25:30 +00:00
|
|
|
}
|
|
|
|
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
void _SEH_FASTCALL _SEHEnterFrame_f(_SEHPortableFrame_t * frame)
|
2004-06-02 18:36:55 +00:00
|
|
|
{
|
2007-02-26 15:55:43 +00:00
|
|
|
/* ASSERT(frame); */
|
|
|
|
/* ASSERT(trylevel); */
|
|
|
|
frame->SPF_Registration.SER_Handler = _SEHFrameHandler;
|
|
|
|
frame->SPF_Code = 0;
|
|
|
|
_SEHRegisterFrame(&frame->SPF_Registration);
|
2004-06-02 18:36:55 +00:00
|
|
|
}
|
|
|
|
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
void _SEH_FASTCALL _SEHLeaveFrame_f(void)
|
2004-06-02 18:36:55 +00:00
|
|
|
{
|
2007-02-26 15:55:43 +00:00
|
|
|
_SEHPortableFrame_t * frame;
|
2005-05-06 22:25:30 +00:00
|
|
|
|
2007-02-26 15:55:43 +00:00
|
|
|
frame = _SEH_CONTAINING_RECORD
|
|
|
|
(
|
|
|
|
_SEHCurrentRegistration(),
|
|
|
|
_SEHPortableFrame_t,
|
|
|
|
SPF_Registration
|
|
|
|
);
|
2005-05-06 22:25:30 +00:00
|
|
|
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
/* ASSERT(frame); */
|
|
|
|
/* ASSERT(frame->SPF_TopTryLevel == NULL) */
|
|
|
|
|
|
|
|
_SEHUnregisterFrame();
|
2005-05-06 22:25:30 +00:00
|
|
|
}
|
|
|
|
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
void _SEH_FASTCALL _SEHReturn_f(void)
|
2005-05-06 22:25:30 +00:00
|
|
|
{
|
2007-02-26 15:55:43 +00:00
|
|
|
_SEHPortableFrame_t * frame;
|
2005-05-06 22:25:30 +00:00
|
|
|
|
2007-02-26 15:55:43 +00:00
|
|
|
frame = _SEH_CONTAINING_RECORD
|
|
|
|
(
|
|
|
|
_SEHCurrentRegistration(),
|
|
|
|
_SEHPortableFrame_t,
|
|
|
|
SPF_Registration
|
|
|
|
);
|
2005-05-06 22:25:30 +00:00
|
|
|
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
_SEHLocalUnwind(frame, NULL);
|
|
|
|
_SEHUnregisterFrame();
|
2004-06-02 18:36:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* EOF */
|