msvcrt: Use the official definitions for exception flags.

This commit is contained in:
Alexandre Julliard 2024-02-28 16:24:17 +01:00
parent 35ef1be8ef
commit 8739aef4ff
5 changed files with 17 additions and 17 deletions

View file

@ -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

View file

@ -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 );

View file

@ -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

View file

@ -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;

View file

@ -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);