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
b6928d3a
Commit
b6928d3a
authored
Apr 09, 2024
by
Paul Gofman
Committed by
Alexandre Julliard
Apr 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Store exception reporting flags on suspend.
parent
04a2917f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
13 deletions
+30
-13
exception.c
dlls/ntdll/tests/exception.c
+5
-5
signal_arm.c
dlls/ntdll/unix/signal_arm.c
+7
-2
signal_arm64.c
dlls/ntdll/unix/signal_arm64.c
+7
-2
signal_i386.c
dlls/ntdll/unix/signal_i386.c
+7
-2
signal_x86_64.c
dlls/ntdll/unix/signal_x86_64.c
+4
-2
No files found.
dlls/ntdll/tests/exception.c
View file @
b6928d3a
...
@@ -4444,7 +4444,7 @@ static void test_wow64_context(void)
...
@@ -4444,7 +4444,7 @@ static void test_wow64_context(void)
{
{
trace
(
"in 64-bit mode %04x
\n
"
,
context
.
SegCs
);
trace
(
"in 64-bit mode %04x
\n
"
,
context
.
SegCs
);
if
(
ctx
.
ContextFlags
&
CONTEXT_EXCEPTION_REPORTING
)
if
(
ctx
.
ContextFlags
&
CONTEXT_EXCEPTION_REPORTING
)
todo_wine
ok
(
ctx
.
ContextFlags
==
(
WOW64_CONTEXT_ALL
|
CONTEXT_EXCEPTION_REQUEST
ok
(
ctx
.
ContextFlags
==
(
WOW64_CONTEXT_ALL
|
CONTEXT_EXCEPTION_REQUEST
|
CONTEXT_EXCEPTION_REPORTING
|
CONTEXT_SERVICE_ACTIVE
)
|
CONTEXT_EXCEPTION_REPORTING
|
CONTEXT_SERVICE_ACTIVE
)
||
ctx
.
ContextFlags
==
(
WOW64_CONTEXT_ALL
|
CONTEXT_EXCEPTION_REQUEST
||
ctx
.
ContextFlags
==
(
WOW64_CONTEXT_ALL
|
CONTEXT_EXCEPTION_REQUEST
|
CONTEXT_EXCEPTION_REPORTING
|
CONTEXT_EXCEPTION_ACTIVE
),
|
CONTEXT_EXCEPTION_REPORTING
|
CONTEXT_EXCEPTION_ACTIVE
),
...
@@ -11179,8 +11179,8 @@ static void test_context_exception_request(void)
...
@@ -11179,8 +11179,8 @@ static void test_context_exception_request(void)
c
.
ContextFlags
=
CONTEXT_CONTROL
|
CONTEXT_EXCEPTION_REQUEST
;
c
.
ContextFlags
=
CONTEXT_CONTROL
|
CONTEXT_EXCEPTION_REQUEST
;
ret
=
GetThreadContext
(
thread
,
&
c
);
ret
=
GetThreadContext
(
thread
,
&
c
);
ok
(
ret
,
"got error %lu.
\n
"
,
GetLastError
()
);
ok
(
ret
,
"got error %lu.
\n
"
,
GetLastError
()
);
todo_wine
ok
(
c
.
ContextFlags
==
expected_flags
||
broken
(
c
.
ContextFlags
==
(
CONTEXT_CONTROL
ok
(
c
.
ContextFlags
==
expected_flags
||
broken
(
c
.
ContextFlags
==
(
CONTEXT_CONTROL
|
CONTEXT_EXCEPTION_REQUEST
|
CONTEXT_EXCEPTION_REPORTING
))
/* Win7 64 */
,
"got %#lx.
\n
"
,
c
.
ContextFlags
);
|
CONTEXT_EXCEPTION_REQUEST
|
CONTEXT_EXCEPTION_REPORTING
))
/* Win7 64 */
,
"got %#lx.
\n
"
,
c
.
ContextFlags
);
p
.
sync
=
0
;
p
.
sync
=
0
;
ResumeThread
(
thread
);
ResumeThread
(
thread
);
...
@@ -11222,7 +11222,7 @@ static void test_context_exception_request(void)
...
@@ -11222,7 +11222,7 @@ static void test_context_exception_request(void)
c
.
ContextFlags
=
CONTEXT_CONTROL
|
CONTEXT_EXCEPTION_REQUEST
;
c
.
ContextFlags
=
CONTEXT_CONTROL
|
CONTEXT_EXCEPTION_REQUEST
;
ret
=
GetThreadContext
(
thread
,
&
c
);
ret
=
GetThreadContext
(
thread
,
&
c
);
ok
(
ret
,
"got error %lu.
\n
"
,
GetLastError
()
);
ok
(
ret
,
"got error %lu.
\n
"
,
GetLastError
()
);
todo_wine
ok
(
c
.
ContextFlags
==
expected_flags
,
"got %#lx.
\n
"
,
c
.
ContextFlags
);
ok
(
c
.
ContextFlags
==
expected_flags
,
"got %#lx.
\n
"
,
c
.
ContextFlags
);
c
.
ContextFlags
=
CONTEXT_CONTROL
;
c
.
ContextFlags
=
CONTEXT_CONTROL
;
ret
=
SetThreadContext
(
thread
,
&
c
);
ret
=
SetThreadContext
(
thread
,
&
c
);
...
@@ -11232,7 +11232,7 @@ static void test_context_exception_request(void)
...
@@ -11232,7 +11232,7 @@ static void test_context_exception_request(void)
|
CONTEXT_EXCEPTION_ACTIVE
;
|
CONTEXT_EXCEPTION_ACTIVE
;
ret
=
GetThreadContext
(
thread
,
&
c
);
ret
=
GetThreadContext
(
thread
,
&
c
);
ok
(
ret
,
"got error %lu.
\n
"
,
GetLastError
()
);
ok
(
ret
,
"got error %lu.
\n
"
,
GetLastError
()
);
todo_wine
ok
(
c
.
ContextFlags
==
expected_flags
,
"got %#lx.
\n
"
,
c
.
ContextFlags
);
ok
(
c
.
ContextFlags
==
expected_flags
,
"got %#lx.
\n
"
,
c
.
ContextFlags
);
SetEvent
(
p
.
event
);
SetEvent
(
p
.
event
);
...
...
dlls/ntdll/unix/signal_arm.c
View file @
b6928d3a
...
@@ -1021,7 +1021,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
...
@@ -1021,7 +1021,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
if
(
is_inside_syscall
(
sigcontext
))
if
(
is_inside_syscall
(
sigcontext
))
{
{
context
.
ContextFlags
=
CONTEXT_FULL
;
context
.
ContextFlags
=
CONTEXT_FULL
|
CONTEXT_EXCEPTION_REQUEST
;
NtGetContextThread
(
GetCurrentThread
(),
&
context
);
NtGetContextThread
(
GetCurrentThread
(),
&
context
);
wait_suspend
(
&
context
);
wait_suspend
(
&
context
);
NtSetContextThread
(
GetCurrentThread
(),
&
context
);
NtSetContextThread
(
GetCurrentThread
(),
&
context
);
...
@@ -1029,6 +1029,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
...
@@ -1029,6 +1029,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
else
else
{
{
save_context
(
&
context
,
sigcontext
);
save_context
(
&
context
,
sigcontext
);
context
.
ContextFlags
|=
CONTEXT_EXCEPTION_REPORTING
;
wait_suspend
(
&
context
);
wait_suspend
(
&
context
);
restore_context
(
&
context
,
sigcontext
);
restore_context
(
&
context
,
sigcontext
);
}
}
...
@@ -1135,7 +1136,11 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB
...
@@ -1135,7 +1136,11 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB
if
(
context
.
Pc
&
1
)
context
.
Cpsr
|=
0x20
;
/* thumb mode */
if
(
context
.
Pc
&
1
)
context
.
Cpsr
|=
0x20
;
/* thumb mode */
if
((
ctx
=
get_cpu_area
(
IMAGE_FILE_MACHINE_ARMNT
)))
*
ctx
=
context
;
if
((
ctx
=
get_cpu_area
(
IMAGE_FILE_MACHINE_ARMNT
)))
*
ctx
=
context
;
if
(
suspend
)
wait_suspend
(
&
context
);
if
(
suspend
)
{
context
.
ContextFlags
|=
CONTEXT_EXCEPTION_REPORTING
|
CONTEXT_EXCEPTION_ACTIVE
;
wait_suspend
(
&
context
);
}
ctx
=
(
CONTEXT
*
)((
ULONG_PTR
)
context
.
Sp
&
~
15
)
-
1
;
ctx
=
(
CONTEXT
*
)((
ULONG_PTR
)
context
.
Sp
&
~
15
)
-
1
;
*
ctx
=
context
;
*
ctx
=
context
;
...
...
dlls/ntdll/unix/signal_arm64.c
View file @
b6928d3a
...
@@ -1225,7 +1225,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
...
@@ -1225,7 +1225,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
if
(
is_inside_syscall
(
sigcontext
))
if
(
is_inside_syscall
(
sigcontext
))
{
{
context
.
ContextFlags
=
CONTEXT_FULL
;
context
.
ContextFlags
=
CONTEXT_FULL
|
CONTEXT_EXCEPTION_REQUEST
;
NtGetContextThread
(
GetCurrentThread
(),
&
context
);
NtGetContextThread
(
GetCurrentThread
(),
&
context
);
wait_suspend
(
&
context
);
wait_suspend
(
&
context
);
NtSetContextThread
(
GetCurrentThread
(),
&
context
);
NtSetContextThread
(
GetCurrentThread
(),
&
context
);
...
@@ -1233,6 +1233,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
...
@@ -1233,6 +1233,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
else
else
{
{
save_context
(
&
context
,
sigcontext
);
save_context
(
&
context
,
sigcontext
);
context
.
ContextFlags
|=
CONTEXT_EXCEPTION_REPORTING
;
wait_suspend
(
&
context
);
wait_suspend
(
&
context
);
restore_context
(
&
context
,
sigcontext
);
restore_context
(
&
context
,
sigcontext
);
}
}
...
@@ -1418,7 +1419,11 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB
...
@@ -1418,7 +1419,11 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB
if
(
arm_context
->
Pc
&
1
)
arm_context
->
Cpsr
|=
0x20
;
/* thumb mode */
if
(
arm_context
->
Pc
&
1
)
arm_context
->
Cpsr
|=
0x20
;
/* thumb mode */
}
}
if
(
suspend
)
wait_suspend
(
&
context
);
if
(
suspend
)
{
context
.
ContextFlags
|=
CONTEXT_EXCEPTION_REPORTING
|
CONTEXT_EXCEPTION_ACTIVE
;
wait_suspend
(
&
context
);
}
ctx
=
(
CONTEXT
*
)((
ULONG_PTR
)
context
.
Sp
&
~
15
)
-
1
;
ctx
=
(
CONTEXT
*
)((
ULONG_PTR
)
context
.
Sp
&
~
15
)
-
1
;
*
ctx
=
context
;
*
ctx
=
context
;
...
...
dlls/ntdll/unix/signal_i386.c
View file @
b6928d3a
...
@@ -2130,7 +2130,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
...
@@ -2130,7 +2130,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
ERR_
(
seh
)(
"kernel stack overflow.
\n
"
);
ERR_
(
seh
)(
"kernel stack overflow.
\n
"
);
return
;
return
;
}
}
context
->
c
.
ContextFlags
=
CONTEXT_FULL
;
context
->
c
.
ContextFlags
=
CONTEXT_FULL
|
CONTEXT_EXCEPTION_REQUEST
;
NtGetContextThread
(
GetCurrentThread
(),
&
context
->
c
);
NtGetContextThread
(
GetCurrentThread
(),
&
context
->
c
);
if
(
xstate_extended_features
())
if
(
xstate_extended_features
())
{
{
...
@@ -2153,6 +2153,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
...
@@ -2153,6 +2153,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
struct
xcontext
context
;
struct
xcontext
context
;
save_context
(
&
context
,
ucontext
);
save_context
(
&
context
,
ucontext
);
context
.
c
.
ContextFlags
|=
CONTEXT_EXCEPTION_REPORTING
;
wait_suspend
(
&
context
.
c
);
wait_suspend
(
&
context
.
c
);
restore_context
(
&
context
,
ucontext
);
restore_context
(
&
context
,
ucontext
);
}
}
...
@@ -2514,7 +2515,11 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB
...
@@ -2514,7 +2515,11 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB
((
XSAVE_FORMAT
*
)
context
.
ExtendedRegisters
)
->
MxCsr
=
0x1f80
;
((
XSAVE_FORMAT
*
)
context
.
ExtendedRegisters
)
->
MxCsr
=
0x1f80
;
if
((
ctx
=
get_cpu_area
(
IMAGE_FILE_MACHINE_I386
)))
*
ctx
=
context
;
if
((
ctx
=
get_cpu_area
(
IMAGE_FILE_MACHINE_I386
)))
*
ctx
=
context
;
if
(
suspend
)
wait_suspend
(
&
context
);
if
(
suspend
)
{
context
.
ContextFlags
|=
CONTEXT_EXCEPTION_REPORTING
|
CONTEXT_EXCEPTION_ACTIVE
;
wait_suspend
(
&
context
);
}
ctx
=
(
CONTEXT
*
)((
ULONG_PTR
)
context
.
Esp
&
~
3
)
-
1
;
ctx
=
(
CONTEXT
*
)((
ULONG_PTR
)
context
.
Esp
&
~
3
)
-
1
;
*
ctx
=
context
;
*
ctx
=
context
;
...
...
dlls/ntdll/unix/signal_x86_64.c
View file @
b6928d3a
...
@@ -2172,7 +2172,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
...
@@ -2172,7 +2172,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
ERR_
(
seh
)(
"kernel stack overflow.
\n
"
);
ERR_
(
seh
)(
"kernel stack overflow.
\n
"
);
return
;
return
;
}
}
context
->
c
.
ContextFlags
=
CONTEXT_FULL
|
CONTEXT_SEGMENTS
;
context
->
c
.
ContextFlags
=
CONTEXT_FULL
|
CONTEXT_SEGMENTS
|
CONTEXT_EXCEPTION_REQUEST
;
NtGetContextThread
(
GetCurrentThread
(),
&
context
->
c
);
NtGetContextThread
(
GetCurrentThread
(),
&
context
->
c
);
if
(
xstate_extended_features
())
if
(
xstate_extended_features
())
{
{
...
@@ -2195,6 +2195,8 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
...
@@ -2195,6 +2195,8 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
struct
xcontext
context
;
struct
xcontext
context
;
save_context
(
&
context
,
ucontext
);
save_context
(
&
context
,
ucontext
);
context
.
c
.
ContextFlags
|=
CONTEXT_EXCEPTION_REPORTING
;
if
(
is_wow64
()
&&
context
.
c
.
SegCs
==
cs64_sel
)
context
.
c
.
ContextFlags
|=
CONTEXT_EXCEPTION_ACTIVE
;
wait_suspend
(
&
context
.
c
);
wait_suspend
(
&
context
.
c
);
restore_context
(
&
context
,
ucontext
);
restore_context
(
&
context
,
ucontext
);
}
}
...
@@ -2536,7 +2538,7 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB
...
@@ -2536,7 +2538,7 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB
# error Please define setting %gs for your architecture
# error Please define setting %gs for your architecture
#endif
#endif
context
.
ContextFlags
=
CONTEXT_ALL
;
context
.
ContextFlags
=
CONTEXT_ALL
|
CONTEXT_EXCEPTION_REPORTING
|
CONTEXT_EXCEPTION_ACTIVE
;
context
.
Rcx
=
(
ULONG_PTR
)
entry
;
context
.
Rcx
=
(
ULONG_PTR
)
entry
;
context
.
Rdx
=
(
ULONG_PTR
)
arg
;
context
.
Rdx
=
(
ULONG_PTR
)
arg
;
context
.
Rsp
=
(
ULONG_PTR
)
teb
->
Tib
.
StackBase
-
0x28
;
context
.
Rsp
=
(
ULONG_PTR
)
teb
->
Tib
.
StackBase
-
0x28
;
...
...
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