Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
014f020e
Commit
014f020e
authored
Jan 25, 2024
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Share the nested exception handler across platforms.
parent
6ba584d1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
38 deletions
+24
-38
exception.c
dlls/ntdll/exception.c
+11
-0
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+2
-0
signal_arm.c
dlls/ntdll/signal_arm.c
+5
-14
signal_arm64.c
dlls/ntdll/signal_arm64.c
+5
-14
signal_x86_64.c
dlls/ntdll/signal_x86_64.c
+1
-10
No files found.
dlls/ntdll/exception.c
View file @
014f020e
...
...
@@ -231,6 +231,17 @@ NTSTATUS WINAPI dispatch_user_callback( void *args, ULONG len, ULONG id )
#endif
/*******************************************************************
* nested_exception_handler
*/
EXCEPTION_DISPOSITION
WINAPI
nested_exception_handler
(
EXCEPTION_RECORD
*
rec
,
void
*
frame
,
CONTEXT
*
context
,
void
*
dispatch
)
{
if
(
rec
->
ExceptionFlags
&
(
EH_UNWINDING
|
EH_EXIT_UNWIND
))
return
ExceptionContinueSearch
;
return
ExceptionNestedException
;
}
/*******************************************************************
* raise_status
*
* Implementation of RtlRaiseStatus with a specific exception record.
...
...
dlls/ntdll/ntdll_misc.h
View file @
014f020e
...
...
@@ -52,6 +52,8 @@ extern LONG call_vectored_handlers( EXCEPTION_RECORD *rec, CONTEXT *context );
extern
NTSTATUS
WINAPI
dispatch_user_callback
(
void
*
args
,
ULONG
len
,
ULONG
id
);
extern
EXCEPTION_DISPOSITION
WINAPI
user_callback_handler
(
EXCEPTION_RECORD
*
record
,
void
*
frame
,
CONTEXT
*
context
,
void
*
dispatch
);
extern
EXCEPTION_DISPOSITION
WINAPI
nested_exception_handler
(
EXCEPTION_RECORD
*
rec
,
void
*
frame
,
CONTEXT
*
context
,
void
*
dispatch
);
extern
void
DECLSPEC_NORETURN
raise_status
(
NTSTATUS
status
,
EXCEPTION_RECORD
*
rec
);
extern
LONG
WINAPI
call_unhandled_exception_filter
(
PEXCEPTION_POINTERS
eptr
);
extern
void
WINAPI
process_breakpoint
(
void
);
...
...
dlls/ntdll/signal_arm.c
View file @
014f020e
...
...
@@ -304,28 +304,17 @@ static DWORD call_teb_unwind_handler( EXCEPTION_RECORD *rec, DISPATCHER_CONTEXT
}
static
DWORD
__cdecl
nested_exception_handler
(
EXCEPTION_RECORD
*
rec
,
EXCEPTION_REGISTRATION_RECORD
*
frame
,
CONTEXT
*
context
,
EXCEPTION_REGISTRATION_RECORD
**
dispatcher
)
{
if
(
!
(
rec
->
ExceptionFlags
&
(
EH_UNWINDING
|
EH_EXIT_UNWIND
)))
rec
->
ExceptionFlags
|=
EH_NESTED_CALL
;
return
ExceptionContinueSearch
;
}
/**********************************************************************
* call_handler
*
* Call a single exception handler.
* FIXME: Handle nested exceptions.
*/
static
DWORD
call_handler
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
,
DISPATCHER_CONTEXT
*
dispatch
)
{
EXCEPTION_REGISTRATION_RECORD
frame
;
DWORD
res
;
frame
.
Handler
=
nested_exception_handler
;
frame
.
Handler
=
(
PEXCEPTION_HANDLER
)
nested_exception_handler
;
__wine_push_frame
(
&
frame
);
TRACE
(
"calling handler %p (rec=%p, frame=0x%lx context=%p, dispatch=%p)
\n
"
,
...
...
@@ -404,7 +393,8 @@ static NTSTATUS call_function_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_con
case
ExceptionContinueSearch
:
break
;
case
ExceptionNestedException
:
FIXME
(
"nested exception
\n
"
);
rec
->
ExceptionFlags
|=
EH_NESTED_CALL
;
TRACE_
(
seh
)(
"nested exception
\n
"
);
break
;
case
ExceptionCollidedUnwind
:
{
ULONG_PTR
frame
;
...
...
@@ -434,7 +424,8 @@ static NTSTATUS call_function_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_con
case
ExceptionContinueSearch
:
break
;
case
ExceptionNestedException
:
FIXME
(
"nested exception
\n
"
);
rec
->
ExceptionFlags
|=
EH_NESTED_CALL
;
TRACE_
(
seh
)(
"nested exception
\n
"
);
break
;
case
ExceptionCollidedUnwind
:
{
ULONG_PTR
frame
;
...
...
dlls/ntdll/signal_arm64.c
View file @
014f020e
...
...
@@ -335,28 +335,17 @@ static DWORD call_teb_unwind_handler( EXCEPTION_RECORD *rec, DISPATCHER_CONTEXT
}
static
DWORD
__cdecl
nested_exception_handler
(
EXCEPTION_RECORD
*
rec
,
EXCEPTION_REGISTRATION_RECORD
*
frame
,
CONTEXT
*
context
,
EXCEPTION_REGISTRATION_RECORD
**
dispatcher
)
{
if
(
!
(
rec
->
ExceptionFlags
&
(
EH_UNWINDING
|
EH_EXIT_UNWIND
)))
rec
->
ExceptionFlags
|=
EH_NESTED_CALL
;
return
ExceptionContinueSearch
;
}
/**********************************************************************
* call_handler
*
* Call a single exception handler.
* FIXME: Handle nested exceptions.
*/
static
DWORD
call_handler
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
,
DISPATCHER_CONTEXT
*
dispatch
)
{
EXCEPTION_REGISTRATION_RECORD
frame
;
DWORD
res
;
frame
.
Handler
=
nested_exception_handler
;
frame
.
Handler
=
(
PEXCEPTION_HANDLER
)
nested_exception_handler
;
__wine_push_frame
(
&
frame
);
TRACE
(
"calling handler %p (rec=%p, frame=%I64x context=%p, dispatch=%p)
\n
"
,
...
...
@@ -435,7 +424,8 @@ static NTSTATUS call_function_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_con
case
ExceptionContinueSearch
:
break
;
case
ExceptionNestedException
:
FIXME
(
"nested exception
\n
"
);
rec
->
ExceptionFlags
|=
EH_NESTED_CALL
;
TRACE_
(
seh
)(
"nested exception
\n
"
);
break
;
case
ExceptionCollidedUnwind
:
{
ULONG64
frame
;
...
...
@@ -465,7 +455,8 @@ static NTSTATUS call_function_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_con
case
ExceptionContinueSearch
:
break
;
case
ExceptionNestedException
:
FIXME
(
"nested exception
\n
"
);
rec
->
ExceptionFlags
|=
EH_NESTED_CALL
;
TRACE_
(
seh
)(
"nested exception
\n
"
);
break
;
case
ExceptionCollidedUnwind
:
{
ULONG64
frame
;
...
...
dlls/ntdll/signal_x86_64.c
View file @
014f020e
...
...
@@ -357,15 +357,6 @@ __ASM_GLOBAL_FUNC( RtlCaptureContext,
"fxsave 0x100(%rcx)
\n\t
"
/* context->FltSave */
"ret"
);
DWORD
__cdecl
nested_exception_handler
(
EXCEPTION_RECORD
*
rec
,
EXCEPTION_REGISTRATION_RECORD
*
frame
,
CONTEXT
*
context
,
EXCEPTION_REGISTRATION_RECORD
**
dispatcher
)
{
if
(
!
(
rec
->
ExceptionFlags
&
(
EH_UNWINDING
|
EH_EXIT_UNWIND
)))
return
ExceptionNestedException
;
return
ExceptionContinueSearch
;
}
/***********************************************************************
* exception_handler_call_wrapper
*/
...
...
@@ -391,7 +382,7 @@ static DWORD exception_handler_call_wrapper( EXCEPTION_RECORD *rec, void *frame,
EXCEPTION_REGISTRATION_RECORD
wrapper_frame
;
DWORD
res
;
wrapper_frame
.
Handler
=
nested_exception_handler
;
wrapper_frame
.
Handler
=
(
PEXCEPTION_HANDLER
)
nested_exception_handler
;
__wine_push_frame
(
&
wrapper_frame
);
res
=
dispatch
->
LanguageHandler
(
rec
,
(
void
*
)
dispatch
->
EstablisherFrame
,
context
,
dispatch
);
__wine_pop_frame
(
&
wrapper_frame
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment