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
2a893f42
Commit
2a893f42
authored
Oct 16, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Oct 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use .seh handler in call_handler() on x64.
parent
9f4c0c4d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
7 deletions
+35
-7
signal_x86_64.c
dlls/ntdll/signal_x86_64.c
+35
-7
No files found.
dlls/ntdll/signal_x86_64.c
View file @
2a893f42
...
...
@@ -347,7 +347,7 @@ __ASM_GLOBAL_FUNC( RtlCaptureContext,
"fxsave 0x100(%rcx)
\n\t
"
/* context->FltSave */
"ret"
);
static
DWORD
__cdecl
nested_exception_handler
(
EXCEPTION_RECORD
*
rec
,
EXCEPTION_REGISTRATION_RECORD
*
frame
,
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
)))
...
...
@@ -356,6 +356,39 @@ static DWORD __cdecl nested_exception_handler( EXCEPTION_RECORD *rec, EXCEPTION_
return
ExceptionContinueSearch
;
}
/***********************************************************************
* exception_handler_call_wrapper
*/
#ifdef __ASM_SEH_SUPPORTED
DWORD
WINAPI
exception_handler_call_wrapper
(
EXCEPTION_RECORD
*
rec
,
void
*
frame
,
CONTEXT
*
context
,
DISPATCHER_CONTEXT
*
dispatch
);
C_ASSERT
(
offsetof
(
DISPATCHER_CONTEXT
,
LanguageHandler
)
==
0x30
);
__ASM_GLOBAL_FUNC
(
exception_handler_call_wrapper
,
".seh_endprologue
\n\t
"
"subq $0x28, %rsp
\n\t
"
".seh_stackalloc 0x28
\n\t
"
"callq *0x30(%r9)
\n\t
"
/* dispatch->LanguageHandler */
"nop
\n\t
"
/* avoid epilogue so handler is called */
"addq $0x28, %rsp
\n\t
"
"ret
\n\t
"
".seh_handler "
__ASM_NAME
(
"nested_exception_handler"
)
", @except
\n\t
"
)
#else
static
DWORD
exception_handler_call_wrapper
(
EXCEPTION_RECORD
*
rec
,
void
*
frame
,
CONTEXT
*
context
,
DISPATCHER_CONTEXT
*
dispatch
)
{
EXCEPTION_REGISTRATION_RECORD
wrapper_frame
;
DWORD
res
;
wrapper_frame
.
Handler
=
nested_exception_handler
;
__wine_push_frame
(
&
wrapper_frame
);
res
=
dispatch
->
LanguageHandler
(
rec
,
(
void
*
)
dispatch
->
EstablisherFrame
,
context
,
dispatch
);
__wine_pop_frame
(
&
wrapper_frame
);
return
res
;
}
#endif
/**********************************************************************
* call_handler
*
...
...
@@ -363,19 +396,14 @@ static DWORD __cdecl nested_exception_handler( EXCEPTION_RECORD *rec, EXCEPTION_
*/
static
DWORD
call_handler
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
,
DISPATCHER_CONTEXT
*
dispatch
)
{
EXCEPTION_REGISTRATION_RECORD
frame
;
DWORD
res
;
frame
.
Handler
=
nested_exception_handler
;
__wine_push_frame
(
&
frame
);
TRACE_
(
seh
)(
"calling handler %p (rec=%p, frame=%p context=%p, dispatch=%p)
\n
"
,
dispatch
->
LanguageHandler
,
rec
,
(
void
*
)
dispatch
->
EstablisherFrame
,
dispatch
->
ContextRecord
,
dispatch
);
res
=
dispatch
->
LanguageHandl
er
(
rec
,
(
void
*
)
dispatch
->
EstablisherFrame
,
context
,
dispatch
);
res
=
exception_handler_call_wrapp
er
(
rec
,
(
void
*
)
dispatch
->
EstablisherFrame
,
context
,
dispatch
);
TRACE_
(
seh
)(
"handler at %p returned %lu
\n
"
,
dispatch
->
LanguageHandler
,
res
);
rec
->
ExceptionFlags
&=
EH_NONCONTINUABLE
;
__wine_pop_frame
(
&
frame
);
return
res
;
}
...
...
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