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
7404ef3e
Commit
7404ef3e
authored
Jun 29, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Don't rely on get_thread_context() updating the context flags.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
19f19d0e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
28 deletions
+10
-28
signal_arm.c
dlls/ntdll/unix/signal_arm.c
+2
-6
signal_arm64.c
dlls/ntdll/unix/signal_arm64.c
+2
-6
signal_i386.c
dlls/ntdll/unix/signal_i386.c
+1
-2
signal_x86_64.c
dlls/ntdll/unix/signal_x86_64.c
+5
-14
No files found.
dlls/ntdll/unix/signal_arm.c
View file @
7404ef3e
...
...
@@ -405,19 +405,16 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
*/
NTSTATUS
WINAPI
NtGetContextThread
(
HANDLE
handle
,
CONTEXT
*
context
)
{
NTSTATUS
ret
;
struct
syscall_frame
*
frame
=
arm_thread_data
()
->
syscall_frame
;
DWORD
needed_flags
=
context
->
ContextFlags
&
~
CONTEXT_ARM
;
BOOL
self
=
(
handle
==
GetCurrentThread
());
if
(
!
self
)
{
if
((
ret
=
get_thread_context
(
handle
,
&
context
,
&
self
,
IMAGE_FILE_MACHINE_ARMNT
)))
return
ret
;
needed_flags
&=
~
context
->
ContextFlags
;
NTSTATUS
ret
=
get_thread_context
(
handle
,
&
context
,
&
self
,
IMAGE_FILE_MACHINE_ARMNT
)
;
if
(
ret
||
!
self
)
return
ret
;
}
if
(
self
)
{
if
(
needed_flags
&
CONTEXT_INTEGER
)
{
context
->
R0
=
frame
->
r0
;
...
...
@@ -449,7 +446,6 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
memcpy
(
context
->
u
.
D
,
frame
->
d
,
sizeof
(
frame
->
d
)
);
context
->
ContextFlags
|=
CONTEXT_FLOATING_POINT
;
}
}
return
STATUS_SUCCESS
;
}
...
...
dlls/ntdll/unix/signal_arm64.c
View file @
7404ef3e
...
...
@@ -493,19 +493,16 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
*/
NTSTATUS
WINAPI
NtGetContextThread
(
HANDLE
handle
,
CONTEXT
*
context
)
{
NTSTATUS
ret
;
struct
syscall_frame
*
frame
=
arm64_thread_data
()
->
syscall_frame
;
DWORD
needed_flags
=
context
->
ContextFlags
&
~
CONTEXT_ARM64
;
BOOL
self
=
(
handle
==
GetCurrentThread
());
if
(
!
self
)
{
if
((
ret
=
get_thread_context
(
handle
,
context
,
&
self
,
IMAGE_FILE_MACHINE_ARM64
)))
return
ret
;
needed_flags
&=
~
context
->
ContextFlags
;
NTSTATUS
ret
=
get_thread_context
(
handle
,
context
,
&
self
,
IMAGE_FILE_MACHINE_ARM64
)
;
if
(
ret
||
!
self
)
return
ret
;
}
if
(
self
)
{
if
(
needed_flags
&
CONTEXT_INTEGER
)
{
memcpy
(
context
->
u
.
X
,
frame
->
x
,
sizeof
(
context
->
u
.
X
[
0
])
*
29
);
...
...
@@ -528,7 +525,6 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
context
->
ContextFlags
|=
CONTEXT_FLOATING_POINT
;
}
if
(
needed_flags
&
CONTEXT_DEBUG_REGISTERS
)
FIXME
(
"debug registers not supported
\n
"
);
}
return
STATUS_SUCCESS
;
}
...
...
dlls/ntdll/unix/signal_i386.c
View file @
7404ef3e
...
...
@@ -1024,7 +1024,6 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
if
(
!
self
)
{
if
((
ret
=
get_thread_context
(
handle
,
context
,
&
self
,
IMAGE_FILE_MACHINE_I386
)))
return
ret
;
needed_flags
&=
~
context
->
ContextFlags
;
}
if
(
self
)
...
...
@@ -1129,7 +1128,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
}
}
/* update the cached version of the debug registers */
if
(
context
->
ContextFlags
&
(
CONTEXT_DEBUG_REGISTERS
&
~
CONTEXT_i386
)
)
if
(
needed_flags
&
CONTEXT_DEBUG_REGISTERS
)
{
x86_thread_data
()
->
dr0
=
context
->
Dr0
;
x86_thread_data
()
->
dr1
=
context
->
Dr1
;
...
...
dlls/ntdll/unix/signal_x86_64.c
View file @
7404ef3e
...
...
@@ -1725,26 +1725,19 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
*/
NTSTATUS
WINAPI
NtGetContextThread
(
HANDLE
handle
,
CONTEXT
*
context
)
{
NTSTATUS
ret
;
DWORD
needed_flags
;
struct
syscall_frame
*
frame
=
amd64_thread_data
()
->
syscall_frame
;
DWORD
needed_flags
=
context
->
ContextFlags
&
~
CONTEXT_AMD64
;
BOOL
self
=
(
handle
==
GetCurrentThread
());
if
(
!
context
)
return
STATUS_INVALID_PARAMETER
;
needed_flags
=
context
->
ContextFlags
&
~
CONTEXT_AMD64
;
/* debug registers require a server call */
if
(
context
->
ContextFlags
&
(
CONTEXT_DEBUG_REGISTERS
&
~
CONTEXT_AMD64
)
)
self
=
FALSE
;
if
(
needed_flags
&
CONTEXT_DEBUG_REGISTERS
)
self
=
FALSE
;
if
(
!
self
)
{
if
((
ret
=
get_thread_context
(
handle
,
context
,
&
self
,
IMAGE_FILE_MACHINE_AMD64
)))
return
ret
;
needed_flags
&=
~
context
->
ContextFlags
;
NTSTATUS
ret
=
get_thread_context
(
handle
,
context
,
&
self
,
IMAGE_FILE_MACHINE_AMD64
)
;
if
(
ret
||
!
self
)
return
ret
;
}
if
(
self
)
{
if
(
needed_flags
&
CONTEXT_INTEGER
)
{
context
->
Rax
=
frame
->
rax
;
...
...
@@ -1837,7 +1830,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
}
}
/* update the cached version of the debug registers */
if
(
context
->
ContextFlags
&
(
CONTEXT_DEBUG_REGISTERS
&
~
CONTEXT_AMD64
)
)
if
(
needed_flags
&
CONTEXT_DEBUG_REGISTERS
)
{
amd64_thread_data
()
->
dr0
=
context
->
Dr0
;
amd64_thread_data
()
->
dr1
=
context
->
Dr1
;
...
...
@@ -1846,8 +1839,6 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
amd64_thread_data
()
->
dr6
=
context
->
Dr6
;
amd64_thread_data
()
->
dr7
=
context
->
Dr7
;
}
}
return
STATUS_SUCCESS
;
}
...
...
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