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
5adfec28
Commit
5adfec28
authored
Feb 18, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Determine the Unix tid for the server directly in ntdll.
parent
f365ef46
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
7 deletions
+37
-7
Makefile.in
dlls/ntdll/Makefile.in
+1
-1
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+1
-1
server.c
dlls/ntdll/server.c
+33
-3
thread.c
dlls/ntdll/thread.c
+2
-2
No files found.
dlls/ntdll/Makefile.in
View file @
5adfec28
...
@@ -5,7 +5,7 @@ SRCDIR = @srcdir@
...
@@ -5,7 +5,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
ntdll.dll
MODULE
=
ntdll.dll
IMPORTLIB
=
ntdll
IMPORTLIB
=
ntdll
EXTRALIBS
=
@IOKITLIB@
EXTRALIBS
=
@IOKITLIB@
@LIBPTHREAD@
EXTRADLLFLAGS
=
-Wl
,--image-base,0x7bc00000
EXTRADLLFLAGS
=
-Wl
,--image-base,0x7bc00000
C_SRCS
=
\
C_SRCS
=
\
...
...
dlls/ntdll/ntdll_misc.h
View file @
5adfec28
...
@@ -67,7 +67,7 @@ extern void virtual_init_threading(void);
...
@@ -67,7 +67,7 @@ extern void virtual_init_threading(void);
extern
timeout_t
server_start_time
;
extern
timeout_t
server_start_time
;
extern
void
server_init_process
(
void
);
extern
void
server_init_process
(
void
);
extern
NTSTATUS
server_init_process_done
(
void
);
extern
NTSTATUS
server_init_process_done
(
void
);
extern
size_t
server_init_thread
(
int
unix_pid
,
int
unix_tid
,
void
*
entry_point
);
extern
size_t
server_init_thread
(
void
*
entry_point
);
extern
void
DECLSPEC_NORETURN
server_protocol_error
(
const
char
*
err
,
...
);
extern
void
DECLSPEC_NORETURN
server_protocol_error
(
const
char
*
err
,
...
);
extern
void
DECLSPEC_NORETURN
server_protocol_perror
(
const
char
*
err
);
extern
void
DECLSPEC_NORETURN
server_protocol_perror
(
const
char
*
err
);
extern
void
DECLSPEC_NORETURN
server_exit_thread
(
int
status
);
extern
void
DECLSPEC_NORETURN
server_exit_thread
(
int
status
);
...
...
dlls/ntdll/server.c
View file @
5adfec28
...
@@ -51,6 +51,10 @@
...
@@ -51,6 +51,10 @@
#ifdef HAVE_SYS_UIO_H
#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
#include <sys/uio.h>
#endif
#endif
#ifdef HAVE_SYS_THR_H
#include <sys/ucontext.h>
#include <sys/thr.h>
#endif
#ifdef HAVE_UNISTD_H
#ifdef HAVE_UNISTD_H
# include <unistd.h>
# include <unistd.h>
#endif
#endif
...
@@ -927,6 +931,32 @@ static void send_server_task_port(void)
...
@@ -927,6 +931,32 @@ static void send_server_task_port(void)
}
}
#endif
/* __APPLE__ */
#endif
/* __APPLE__ */
/***********************************************************************
* get_unix_tid
*
* Retrieve the Unix tid to use on the server side for the current thread.
*/
static
int
get_unix_tid
(
void
)
{
int
ret
=
-
1
;
#if defined(linux) && defined(__i386__)
__asm__
(
"int $0x80"
:
"=a"
(
ret
)
:
"0"
(
224
)
/* SYS_gettid */
);
#elif defined(linux) && defined(__x86_64__)
__asm__
(
"syscall"
:
"=a"
(
ret
)
:
"0"
(
186
)
/* SYS_gettid */
);
#elif defined(__sun)
ret
=
pthread_self
();
#elif defined(__APPLE__)
ret
=
mach_thread_self
();
#elif defined(__FreeBSD__)
long
lwpid
;
thr_self
(
&
lwpid
);
ret
=
lwpid
;
#endif
return
ret
;
}
/***********************************************************************
/***********************************************************************
* server_init_process
* server_init_process
*
*
...
@@ -1012,7 +1042,7 @@ NTSTATUS server_init_process_done(void)
...
@@ -1012,7 +1042,7 @@ NTSTATUS server_init_process_done(void)
*
*
* Send an init thread request. Return 0 if OK.
* Send an init thread request. Return 0 if OK.
*/
*/
size_t
server_init_thread
(
int
unix_pid
,
int
unix_tid
,
void
*
entry_point
)
size_t
server_init_thread
(
void
*
entry_point
)
{
{
int
ret
;
int
ret
;
int
reply_pipe
[
2
];
int
reply_pipe
[
2
];
...
@@ -1046,8 +1076,8 @@ size_t server_init_thread( int unix_pid, int unix_tid, void *entry_point )
...
@@ -1046,8 +1076,8 @@ size_t server_init_thread( int unix_pid, int unix_tid, void *entry_point )
SERVER_START_REQ
(
init_thread
)
SERVER_START_REQ
(
init_thread
)
{
{
req
->
unix_pid
=
unix_pid
;
req
->
unix_pid
=
getpid
()
;
req
->
unix_tid
=
unix_tid
;
req
->
unix_tid
=
get_unix_tid
()
;
req
->
teb
=
wine_server_client_ptr
(
NtCurrentTeb
()
);
req
->
teb
=
wine_server_client_ptr
(
NtCurrentTeb
()
);
req
->
peb
=
wine_server_client_ptr
(
NtCurrentTeb
()
->
Peb
);
req
->
peb
=
wine_server_client_ptr
(
NtCurrentTeb
()
->
Peb
);
req
->
entry
=
wine_server_client_ptr
(
entry_point
);
req
->
entry
=
wine_server_client_ptr
(
entry_point
);
...
...
dlls/ntdll/thread.c
View file @
5adfec28
...
@@ -306,7 +306,7 @@ HANDLE thread_init(void)
...
@@ -306,7 +306,7 @@ HANDLE thread_init(void)
/* setup the server connection */
/* setup the server connection */
server_init_process
();
server_init_process
();
info_size
=
server_init_thread
(
thread_info
.
pid
,
thread_info
.
tid
,
NULL
);
info_size
=
server_init_thread
(
NULL
);
/* create the process heap */
/* create the process heap */
if
(
!
(
peb
->
ProcessHeap
=
RtlCreateHeap
(
HEAP_GROWABLE
,
NULL
,
0
,
0
,
NULL
,
NULL
)))
if
(
!
(
peb
->
ProcessHeap
=
RtlCreateHeap
(
HEAP_GROWABLE
,
NULL
,
0
,
0
,
NULL
,
NULL
)))
...
@@ -426,7 +426,7 @@ static void start_thread( struct wine_pthread_thread_info *info )
...
@@ -426,7 +426,7 @@ static void start_thread( struct wine_pthread_thread_info *info )
pthread_functions
.
init_current_teb
(
info
);
pthread_functions
.
init_current_teb
(
info
);
signal_init_thread
();
signal_init_thread
();
server_init_thread
(
info
->
pid
,
info
->
tid
,
func
);
server_init_thread
(
func
);
pthread_functions
.
init_thread
(
info
);
pthread_functions
.
init_thread
(
info
);
virtual_alloc_thread_stack
(
info
->
stack_base
,
info
->
stack_size
);
virtual_alloc_thread_stack
(
info
->
stack_base
,
info
->
stack_size
);
pthread_functions
.
sigprocmask
(
SIG_UNBLOCK
,
&
server_block_set
,
NULL
);
pthread_functions
.
sigprocmask
(
SIG_UNBLOCK
,
&
server_block_set
,
NULL
);
...
...
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