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
d41b1c28
Commit
d41b1c28
authored
Jul 22, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Avoid private Unix functions in RtlExitUserThread().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a511c093
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
28 deletions
+14
-28
thread.c
dlls/ntdll/thread.c
+2
-17
loader.c
dlls/ntdll/unix/loader.c
+0
-2
process.c
dlls/ntdll/unix/process.c
+7
-1
thread.c
dlls/ntdll/unix/thread.c
+3
-3
unix_private.h
dlls/ntdll/unix/unix_private.h
+1
-2
unixlib.h
dlls/ntdll/unixlib.h
+1
-3
No files found.
dlls/ntdll/thread.c
View file @
d41b1c28
...
...
@@ -81,26 +81,11 @@ void WINAPI RtlExitUserThread( ULONG status )
{
ULONG
last
;
if
(
status
)
/* send the exit code to the server (0 is already the default) */
{
SERVER_START_REQ
(
terminate_thread
)
{
req
->
handle
=
wine_server_obj_handle
(
GetCurrentThread
()
);
req
->
exit_code
=
status
;
wine_server_call
(
req
);
}
SERVER_END_REQ
;
}
NtQueryInformationThread
(
GetCurrentThread
(),
ThreadAmILastThread
,
&
last
,
sizeof
(
last
),
NULL
);
if
(
last
)
{
LdrShutdownProcess
();
unix_funcs
->
exit_process
(
status
);
}
if
(
last
)
RtlExitUserProcess
(
status
);
LdrShutdownThread
();
RtlFreeThreadActivationContextStack
();
for
(;;)
unix_funcs
->
exit_thread
(
status
);
for
(;;)
NtTerminateThread
(
GetCurrentThread
(),
status
);
}
...
...
dlls/ntdll/unix/loader.c
View file @
d41b1c28
...
...
@@ -1404,8 +1404,6 @@ static struct unix_funcs unix_funcs =
virtual_locked_recvmsg
,
virtual_release_address_space
,
virtual_set_large_address_space
,
exit_thread
,
exit_process
,
exec_process
,
wine_server_call
,
server_send_fd
,
...
...
dlls/ntdll/unix/process.c
View file @
d41b1c28
...
...
@@ -1002,6 +1002,7 @@ done:
*/
NTSTATUS
WINAPI
NtTerminateProcess
(
HANDLE
handle
,
LONG
exit_code
)
{
static
BOOL
clean_exit
;
NTSTATUS
ret
;
BOOL
self
;
...
...
@@ -1013,7 +1014,12 @@ NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code )
self
=
reply
->
self
;
}
SERVER_END_REQ
;
if
(
self
&&
handle
)
abort_process
(
exit_code
);
if
(
self
)
{
if
(
!
handle
)
clean_exit
=
TRUE
;
else
if
(
clean_exit
)
exit_process
(
exit_code
);
else
abort_process
(
exit_code
);
}
return
ret
;
}
...
...
dlls/ntdll/unix/thread.c
View file @
d41b1c28
...
...
@@ -298,7 +298,7 @@ void abort_process( int status )
/***********************************************************************
* exit_thread
*/
void
CDECL
exit_thread
(
int
status
)
static
void
exit_thread
(
int
status
)
{
static
void
*
prev_teb
;
TEB
*
teb
;
...
...
@@ -322,7 +322,7 @@ void CDECL exit_thread( int status )
/***********************************************************************
* exit_process
*/
void
CDECL
exit_process
(
int
status
)
void
exit_process
(
int
status
)
{
pthread_sigmask
(
SIG_BLOCK
,
&
server_block_set
,
NULL
);
signal_exit_thread
(
get_unix_exit_code
(
status
),
exit
);
...
...
@@ -525,7 +525,7 @@ NTSTATUS WINAPI NtTerminateThread( HANDLE handle, LONG exit_code )
}
SERVER_END_REQ
;
}
if
(
self
)
abor
t_thread
(
exit_code
);
if
(
self
)
exi
t_thread
(
exit_code
);
return
ret
;
}
...
...
dlls/ntdll/unix/unix_private.h
View file @
d41b1c28
...
...
@@ -120,8 +120,6 @@ extern NTSTATUS CDECL server_handle_to_fd( HANDLE handle, unsigned int access, i
unsigned
int
*
options
)
DECLSPEC_HIDDEN
;
extern
void
CDECL
server_release_fd
(
HANDLE
handle
,
int
unix_fd
)
DECLSPEC_HIDDEN
;
extern
void
CDECL
server_init_process_done
(
void
*
relay
)
DECLSPEC_HIDDEN
;
extern
void
CDECL
DECLSPEC_NORETURN
exit_thread
(
int
status
)
DECLSPEC_HIDDEN
;
extern
void
CDECL
DECLSPEC_NORETURN
exit_process
(
int
status
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
CDECL
exec_process
(
UNICODE_STRING
*
path
,
UNICODE_STRING
*
cmdline
,
NTSTATUS
status
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
CDECL
unwind_builtin_dll
(
ULONG
type
,
struct
_DISPATCHER_CONTEXT
*
dispatch
,
CONTEXT
*
context
)
DECLSPEC_HIDDEN
;
...
...
@@ -181,6 +179,7 @@ extern NTSTATUS context_to_server( context_t *to, const CONTEXT *from ) DECLSPEC
extern
NTSTATUS
context_from_server
(
CONTEXT
*
to
,
const
context_t
*
from
)
DECLSPEC_HIDDEN
;
extern
void
DECLSPEC_NORETURN
abort_thread
(
int
status
)
DECLSPEC_HIDDEN
;
extern
void
DECLSPEC_NORETURN
abort_process
(
int
status
)
DECLSPEC_HIDDEN
;
extern
void
DECLSPEC_NORETURN
exit_process
(
int
status
)
DECLSPEC_HIDDEN
;
extern
void
wait_suspend
(
CONTEXT
*
context
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
send_debug_event
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
,
BOOL
first_chance
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
set_thread_context
(
HANDLE
handle
,
const
context_t
*
context
,
BOOL
*
self
)
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/unixlib.h
View file @
d41b1c28
...
...
@@ -28,7 +28,7 @@ struct msghdr;
struct
_DISPATCHER_CONTEXT
;
/* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 9
0
#define NTDLL_UNIXLIB_VERSION 9
1
struct
unix_funcs
{
...
...
@@ -97,8 +97,6 @@ struct unix_funcs
void
(
CDECL
*
virtual_set_large_address_space
)(
void
);
/* thread/process functions */
void
(
CDECL
*
exit_thread
)(
int
status
);
void
(
CDECL
*
exit_process
)(
int
status
);
NTSTATUS
(
CDECL
*
exec_process
)(
UNICODE_STRING
*
path
,
UNICODE_STRING
*
cmdline
,
NTSTATUS
status
);
/* server functions */
...
...
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