Module: wine Branch: master Commit: 8739aef4ff31c6cf4e8a625cf430e3d0ac6334d5 URL: https://gitlab.winehq.org/wine/wine/-/commit/8739aef4ff31c6cf4e8a625cf430e3d...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Feb 28 16:24:17 2024 +0100
msvcrt: Use the official definitions for exception flags.
---
dlls/msvcrt/cpp.c | 4 ++-- dlls/msvcrt/except_i386.c | 14 +++++++------- dlls/msvcrt/except_x86_64.c | 4 ++-- dlls/msvcrt/exception_ptr.c | 6 +++--- dlls/msvcrt/handler4.c | 6 +++--- 5 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/dlls/msvcrt/cpp.c b/dlls/msvcrt/cpp.c index ce89f5fb0b4..7e59aaf78c6 100644 --- a/dlls/msvcrt/cpp.c +++ b/dlls/msvcrt/cpp.c @@ -1024,7 +1024,7 @@ void WINAPI _CxxThrowException( void *object, const cxx_exception_type *type ) args[0] = CXX_FRAME_MAGIC_VC6; args[1] = (ULONG_PTR)object; args[2] = (ULONG_PTR)type; - RaiseException( CXX_EXCEPTION, EH_NONCONTINUABLE, 3, args ); + RaiseException( CXX_EXCEPTION, EXCEPTION_NONCONTINUABLE, 3, args ); } #else void WINAPI _CxxThrowException( void *object, const cxx_exception_type *type ) @@ -1035,7 +1035,7 @@ void WINAPI _CxxThrowException( void *object, const cxx_exception_type *type ) args[1] = (ULONG_PTR)object; args[2] = (ULONG_PTR)type; RtlPcToFileHeader( (void*)type, (void**)&args[3]); - RaiseException( CXX_EXCEPTION, EH_NONCONTINUABLE, 4, args ); + RaiseException( CXX_EXCEPTION, EXCEPTION_NONCONTINUABLE, 4, args ); } #endif
diff --git a/dlls/msvcrt/except_i386.c b/dlls/msvcrt/except_i386.c index a870b26edaa..45e6558fcf1 100644 --- a/dlls/msvcrt/except_i386.c +++ b/dlls/msvcrt/except_i386.c @@ -332,7 +332,7 @@ static DWORD catch_function_nested_handler( EXCEPTION_RECORD *rec, EXCEPTION_REG { catch_func_nested_frame *nested_frame = (catch_func_nested_frame *)frame;
- if (rec->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND)) + if (rec->ExceptionFlags & (EXCEPTION_UNWINDING | EXCEPTION_EXIT_UNWIND)) { __CxxUnregisterExceptionObject(&nested_frame->frame_info, FALSE); return ExceptionContinueSearch; @@ -351,7 +351,7 @@ static DWORD catch_function_nested_handler( EXCEPTION_RECORD *rec, EXCEPTION_REG { /* exception was rethrown */ *rec = *prev_rec; - rec->ExceptionFlags &= ~EH_UNWINDING; + rec->ExceptionFlags &= ~EXCEPTION_UNWINDING; if(TRACE_ON(seh)) { TRACE("detect rethrow: exception code: %lx\n", rec->ExceptionCode); if(rec->ExceptionCode == CXX_EXCEPTION) @@ -569,7 +569,7 @@ DWORD CDECL cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* frame (rec->ExceptionCode != CXX_EXCEPTION)) return ExceptionContinueSearch; /* handle only c++ exceptions */
- if (rec->ExceptionFlags & (EH_UNWINDING|EH_EXIT_UNWIND)) + if (rec->ExceptionFlags & (EXCEPTION_UNWINDING|EXCEPTION_EXIT_UNWIND)) { if (descr->unwind_count && !nested_frame) cxx_local_unwind( frame, descr, -1 ); return ExceptionContinueSearch; @@ -584,7 +584,7 @@ DWORD CDECL cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* frame rec->ExceptionInformation[1] == 0 && rec->ExceptionInformation[2] == 0) { *rec = *msvcrt_get_thread_data()->exc_record; - rec->ExceptionFlags &= ~EH_UNWINDING; + rec->ExceptionFlags &= ~EXCEPTION_UNWINDING; if(TRACE_ON(seh)) { TRACE("detect rethrow: exception code: %lx\n", rec->ExceptionCode); if(rec->ExceptionCode == CXX_EXCEPTION) @@ -759,7 +759,7 @@ static DWORD MSVCRT_nested_handler(PEXCEPTION_RECORD rec, PCONTEXT context, EXCEPTION_REGISTRATION_RECORD** dispatch) { - if (!(rec->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND))) + if (!(rec->ExceptionFlags & (EXCEPTION_UNWINDING | EXCEPTION_EXIT_UNWIND))) return ExceptionContinueSearch; *dispatch = frame; return ExceptionCollidedUnwind; @@ -874,7 +874,7 @@ int CDECL _except_handler3(PEXCEPTION_RECORD rec,
__asm__ __volatile__ ("cld");
- if (rec->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND)) + if (rec->ExceptionFlags & (EXCEPTION_UNWINDING | EXCEPTION_EXIT_UNWIND)) { /* Unwinding the current frame */ msvcrt_local_unwind2(frame, TRYLEVEL_END, &frame->_ebp); @@ -945,7 +945,7 @@ int CDECL _except_handler4_common( ULONG *cookie, void (*check_cookie)(void),
/* FIXME: no cookie validation yet */
- if (rec->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND)) + if (rec->ExceptionFlags & (EXCEPTION_UNWINDING | EXCEPTION_EXIT_UNWIND)) { /* Unwinding the current frame */ msvcrt_local_unwind4( cookie, frame, -2, &frame->_ebp ); diff --git a/dlls/msvcrt/except_x86_64.c b/dlls/msvcrt/except_x86_64.c index 9b8db6d0d67..8b37e13cb77 100644 --- a/dlls/msvcrt/except_x86_64.c +++ b/dlls/msvcrt/except_x86_64.c @@ -564,9 +564,9 @@ static DWORD cxx_frame_handler(EXCEPTION_RECORD *rec, ULONG64 frame, } }
- if (rec->ExceptionFlags & (EH_UNWINDING|EH_EXIT_UNWIND)) + if (rec->ExceptionFlags & (EXCEPTION_UNWINDING|EXCEPTION_EXIT_UNWIND)) { - if (rec->ExceptionFlags & EH_TARGET_UNWIND) + if (rec->ExceptionFlags & EXCEPTION_TARGET_UNWIND) cxx_local_unwind(orig_frame, dispatch, descr, cxx_is_consolidate(rec) ? rec->ExceptionInformation[3] : trylevel); else diff --git a/dlls/msvcrt/exception_ptr.c b/dlls/msvcrt/exception_ptr.c index bd341ac49a1..34c2bcdc4ea 100644 --- a/dlls/msvcrt/exception_ptr.c +++ b/dlls/msvcrt/exception_ptr.c @@ -169,7 +169,7 @@ void __cdecl __ExceptionPtrRethrow(const exception_ptr *ep) return; }
- RaiseException(ep->rec->ExceptionCode, ep->rec->ExceptionFlags & (~EH_UNWINDING), + RaiseException(ep->rec->ExceptionCode, ep->rec->ExceptionFlags & ~EXCEPTION_UNWINDING, ep->rec->NumberParameters, ep->rec->ExceptionInformation); }
@@ -306,7 +306,7 @@ void __cdecl __ExceptionPtrCopyException(exception_ptr *ep,
memset(ep->rec, 0, sizeof(EXCEPTION_RECORD)); ep->rec->ExceptionCode = CXX_EXCEPTION; - ep->rec->ExceptionFlags = EH_NONCONTINUABLE; + ep->rec->ExceptionFlags = EXCEPTION_NONCONTINUABLE; ep->rec->NumberParameters = 3; ep->rec->ExceptionInformation[0] = CXX_FRAME_MAGIC_VC6; ep->rec->ExceptionInformation[2] = (ULONG_PTR)type; @@ -344,7 +344,7 @@ void __cdecl __ExceptionPtrCopyException(exception_ptr *ep,
memset(ep->rec, 0, sizeof(EXCEPTION_RECORD)); ep->rec->ExceptionCode = CXX_EXCEPTION; - ep->rec->ExceptionFlags = EH_NONCONTINUABLE; + ep->rec->ExceptionFlags = EXCEPTION_NONCONTINUABLE; ep->rec->NumberParameters = 4; ep->rec->ExceptionInformation[0] = CXX_FRAME_MAGIC_VC6; ep->rec->ExceptionInformation[2] = (ULONG_PTR)type; diff --git a/dlls/msvcrt/handler4.c b/dlls/msvcrt/handler4.c index 40cb1a7c3b8..2e225b21458 100644 --- a/dlls/msvcrt/handler4.c +++ b/dlls/msvcrt/handler4.c @@ -736,12 +736,12 @@ static DWORD cxx_frame_handler4(EXCEPTION_RECORD *rec, ULONG64 frame, TRACE("setting orig_frame to %Ix\n", orig_frame); }
- if (rec->ExceptionFlags & (EH_UNWINDING|EH_EXIT_UNWIND)) + if (rec->ExceptionFlags & (EXCEPTION_UNWINDING|EXCEPTION_EXIT_UNWIND)) { int last_level = -1; - if ((rec->ExceptionFlags & EH_TARGET_UNWIND) && cxx_is_consolidate(rec)) + if ((rec->ExceptionFlags & EXCEPTION_TARGET_UNWIND) && cxx_is_consolidate(rec)) last_level = rec->ExceptionInformation[3]; - else if ((rec->ExceptionFlags & EH_TARGET_UNWIND) && rec->ExceptionCode == STATUS_LONGJUMP) + else if ((rec->ExceptionFlags & EXCEPTION_TARGET_UNWIND) && rec->ExceptionCode == STATUS_LONGJUMP) last_level = ip_to_state4(rva_to_ptr(descr->ip_map, dispatch->ImageBase), descr->ip_count, dispatch, dispatch->TargetIp);