Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f626349c
Commit
f626349c
authored
Jun 23, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Use separate handles for thread and context in get_thread_context.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2ff7a767
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
12 deletions
+17
-12
thread.c
dlls/ntdll/unix/thread.c
+4
-3
server_protocol.h
include/wine/server_protocol.h
+1
-1
protocol.def
server/protocol.def
+2
-1
request.h
server/request.h
+2
-1
thread.c
server/thread.c
+7
-6
trace.c
server/trace.c
+1
-0
No files found.
dlls/ntdll/unix/thread.c
View file @
f626349c
...
...
@@ -1316,6 +1316,7 @@ NTSTATUS set_thread_context( HANDLE handle, const void *context, BOOL *self, USH
NTSTATUS
get_thread_context
(
HANDLE
handle
,
void
*
context
,
BOOL
*
self
,
USHORT
machine
)
{
NTSTATUS
ret
;
HANDLE
context_handle
;
context_t
server_context
;
unsigned
int
flags
=
get_server_context_flags
(
context
,
machine
);
...
...
@@ -1326,17 +1327,17 @@ NTSTATUS get_thread_context( HANDLE handle, void *context, BOOL *self, USHORT ma
wine_server_set_reply
(
req
,
&
server_context
,
sizeof
(
server_context
)
);
ret
=
wine_server_call
(
req
);
*
self
=
reply
->
self
;
handle
=
wine_server_ptr_handle
(
reply
->
handle
);
context_
handle
=
wine_server_ptr_handle
(
reply
->
handle
);
}
SERVER_END_REQ
;
if
(
ret
==
STATUS_PENDING
)
{
NtWaitForSingleObject
(
handle
,
FALSE
,
NULL
);
NtWaitForSingleObject
(
context_
handle
,
FALSE
,
NULL
);
SERVER_START_REQ
(
get_thread_context
)
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
req
->
context
=
wine_server_obj_handle
(
context_
handle
);
req
->
flags
=
flags
;
wine_server_set_reply
(
req
,
&
server_context
,
sizeof
(
server_context
)
);
ret
=
wine_server_call
(
req
);
...
...
include/wine/server_protocol.h
View file @
f626349c
...
...
@@ -2460,8 +2460,8 @@ struct get_thread_context_request
{
struct
request_header
__header
;
obj_handle_t
handle
;
obj_handle_t
context
;
unsigned
int
flags
;
char
__pad_20
[
4
];
};
struct
get_thread_context_reply
{
...
...
server/protocol.def
View file @
f626349c
...
...
@@ -1882,7 +1882,8 @@ struct process_info
/* Retrieve the current context of a thread */
@REQ(get_thread_context)
obj_handle_t handle; /* thread or context handle */
obj_handle_t handle; /* thread handle */
obj_handle_t context; /* context handle */
unsigned int flags; /* context flags */
@REPLY
int self; /* was it a handle to the current thread? */
...
...
server/request.h
View file @
f626349c
...
...
@@ -1253,7 +1253,8 @@ C_ASSERT( FIELD_OFFSET(struct get_timer_info_reply, when) == 8 );
C_ASSERT
(
FIELD_OFFSET
(
struct
get_timer_info_reply
,
signaled
)
==
16
);
C_ASSERT
(
sizeof
(
struct
get_timer_info_reply
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_thread_context_request
,
handle
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_thread_context_request
,
flags
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_thread_context_request
,
context
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_thread_context_request
,
flags
)
==
20
);
C_ASSERT
(
sizeof
(
struct
get_thread_context_request
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_thread_context_reply
,
self
)
==
8
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_thread_context_reply
,
handle
)
==
12
);
...
...
server/thread.c
View file @
f626349c
...
...
@@ -1797,14 +1797,15 @@ DECL_HANDLER(get_thread_context)
return
;
}
if
(
(
thread_context
=
(
struct
context
*
)
get_handle_obj
(
current
->
process
,
req
->
handle
,
0
,
&
context_ops
))
)
if
(
req
->
context
)
{
close_handle
(
current
->
process
,
req
->
handle
);
/* avoid extra server call */
system_flags
=
get_context_system_regs
(
thread_context
->
regs
.
machine
);
if
(
!
(
thread_context
=
(
struct
context
*
)
get_handle_obj
(
current
->
process
,
req
->
context
,
0
,
&
context_ops
)))
return
;
close_handle
(
current
->
process
,
req
->
context
);
/* avoid extra server call */
}
else
if
((
thread
=
get_thread_from_handle
(
req
->
handle
,
THREAD_GET_CONTEXT
)))
else
{
clear_error
()
;
if
(
!
(
thread
=
get_thread_from_handle
(
req
->
handle
,
THREAD_GET_CONTEXT
)))
return
;
system_flags
=
get_context_system_regs
(
thread
->
process
->
machine
);
if
(
thread
->
state
==
RUNNING
)
{
...
...
@@ -1831,8 +1832,8 @@ DECL_HANDLER(get_thread_context)
}
else
set_error
(
STATUS_UNSUCCESSFUL
);
release_object
(
thread
);
if
(
!
thread_context
)
return
;
}
if
(
get_error
()
||
!
thread_context
)
return
;
set_error
(
thread_context
->
status
);
if
(
!
thread_context
->
status
&&
(
context
=
set_reply_data_size
(
sizeof
(
context_t
)
)))
...
...
server/trace.c
View file @
f626349c
...
...
@@ -2534,6 +2534,7 @@ static void dump_get_timer_info_reply( const struct get_timer_info_reply *req )
static
void
dump_get_thread_context_request
(
const
struct
get_thread_context_request
*
req
)
{
fprintf
(
stderr
,
" handle=%04x"
,
req
->
handle
);
fprintf
(
stderr
,
", context=%04x"
,
req
->
context
);
fprintf
(
stderr
,
", flags=%08x"
,
req
->
flags
);
}
...
...
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