Don't use GetExceptionCode and GetExceptionInformation in exception filter functions.

Robert Shearman rob at codeweavers.com
Thu Feb 14 08:40:51 CST 2008


When using native compiler exceptions, it isn't valid to use 
GetExceptionCode and GetExceptionInformation anywhere other than in the 
filter or handler blocks since it would be very hard for the compiler to 
work out where to retrieve the exception information from on the stack.

Therefore, introduce two new functions, WineFilterGetExceptionCode and 
WineFilterGetExceptionInformation for this purpose and rename the __eptr 
parameter of the filter function so GetExceptionCode and 
GetExceptionInformation can't be used here.

Also give the same treatment to the AbnormalTermination finally helper, 
although it isn't actually used anywhere at the moment.

Move WINE_EXCEPTION_FILTER and WINE_FINALLY_FUNC outside of the !defined 
USE_COMPILER_EXCEPTIONS block since they are used by general Wine code.
---
  dlls/kernel32/console.c  |    2 +-
  dlls/rpcrt4/cstub.c      |    2 +-
  dlls/rpcrt4/rpc_server.c |    2 +-
  dlls/winedos/dosvm.c     |    4 ++--
  dlls/winedos/int31.c     |    4 ++--
  include/wine/exception.h |   10 +++++++---
  programs/explorer/hal.c  |    2 +-
  programs/winedbg/dbg.y   |    4 ++--
  8 files changed, 17 insertions(+), 13 deletions(-)

Alternatively, we could get rid of the WINE_EXCEPTION_FILTER and 
WINE_FINALLY_FUNC functions and make users of __EXCEPT and __FINALLY 
declare the functions themselves and access the exception data directly 
without use of macros.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 357d63cbfe8494e994f5f332fc716892cf05567f.diff
Type: text/x-patch
Size: 5350 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20080214/2a2b5195/attachment.bin 


More information about the wine-patches mailing list