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
62b7069f
Commit
62b7069f
authored
Oct 19, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Unwind the stack before calling exit/abort_thread on i386 the same way we do on x86_64.
parent
241ccd9a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
7 deletions
+46
-7
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+4
-0
signal_i386.c
dlls/ntdll/signal_i386.c
+42
-7
No files found.
dlls/ntdll/ntdll_misc.h
View file @
62b7069f
...
...
@@ -224,6 +224,10 @@ struct ntdll_thread_data
int
wait_fd
[
2
];
/* 1ec/300 fd for sleeping server requests */
BOOL
wow64_redir
;
/* 1f4/308 Wow64 filesystem redirection flag */
pthread_t
pthread_id
;
/* 1f8/310 pthread thread id */
#ifdef __i386__
WINE_VM86_TEB_INFO
vm86
;
/* 1fc vm86 private data */
void
*
exit_frame
;
/* 204 exit frame pointer */
#endif
};
static
inline
struct
ntdll_thread_data
*
ntdll_get_thread_data
(
void
)
...
...
dlls/ntdll/signal_i386.c
View file @
62b7069f
...
...
@@ -2473,9 +2473,41 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
}
extern
void
DECLSPEC_NORETURN
call_thread_entry_point
(
LPTHREAD_START_ROUTINE
entry
,
void
*
arg
);
__ASM_GLOBAL_FUNC
(
call_thread_entry_point
,
"pushl %ebp
\n\t
"
__ASM_CFI
(
".cfi_adjust_cfa_offset 4
\n\t
"
)
__ASM_CFI
(
".cfi_rel_offset %ebp,0
\n\t
"
)
"movl %esp,%ebp
\n\t
"
__ASM_CFI
(
".cfi_def_cfa_register %ebp
\n\t
"
)
"pushl %ebx
\n\t
"
__ASM_CFI
(
".cfi_rel_offset %ebx,-4
\n\t
"
)
"pushl %esi
\n\t
"
__ASM_CFI
(
".cfi_rel_offset %esi,-8
\n\t
"
)
"pushl %edi
\n\t
"
__ASM_CFI
(
".cfi_rel_offset %edi,-12
\n\t
"
)
"pushl %ebp
\n\t
"
"pushl 12(%ebp)
\n\t
"
"pushl 8(%ebp)
\n\t
"
"call "
__ASM_NAME
(
"call_thread_func"
)
);
extern
void
DECLSPEC_NORETURN
call_thread_exit_func
(
int
status
,
void
(
*
func
)(
int
),
void
*
frame
);
__ASM_GLOBAL_FUNC
(
call_thread_exit_func
,
"movl 4(%esp),%eax
\n\t
"
"movl 8(%esp),%ecx
\n\t
"
"movl 12(%esp),%ebp
\n\t
"
__ASM_CFI
(
".cfi_def_cfa %ebp,4
\n\t
"
)
__ASM_CFI
(
".cfi_rel_offset %ebp,0
\n\t
"
)
__ASM_CFI
(
".cfi_rel_offset %ebx,-4
\n\t
"
)
__ASM_CFI
(
".cfi_rel_offset %esi,-8
\n\t
"
)
__ASM_CFI
(
".cfi_rel_offset %edi,-12
\n\t
"
)
"leal -20(%ebp),%esp
\n\t
"
"pushl %eax
\n\t
"
"call *%ecx"
);
/* wrapper for apps that don't declare the thread function correctly */
extern
void
DECLSPEC_NORETURN
call_thread_func
(
LPTHREAD_START_ROUTINE
entry
,
void
*
arg
);
__ASM_GLOBAL_FUNC
(
call_thread_func
,
extern
void
DECLSPEC_NORETURN
call_thread_func
_wrapper
(
LPTHREAD_START_ROUTINE
entry
,
void
*
arg
);
__ASM_GLOBAL_FUNC
(
call_thread_func
_wrapper
,
"pushl %ebp
\n\t
"
__ASM_CFI
(
".cfi_adjust_cfa_offset 4
\n\t
"
)
__ASM_CFI
(
".cfi_rel_offset %ebp,0
\n\t
"
)
...
...
@@ -2490,13 +2522,14 @@ __ASM_GLOBAL_FUNC(call_thread_func,
"int $3"
)
/***********************************************************************
* call_thread_
entry_point
* call_thread_
func
*/
void
call_thread_
entry_point
(
LPTHREAD_START_ROUTINE
entry
,
void
*
arg
)
void
call_thread_
func
(
LPTHREAD_START_ROUTINE
entry
,
void
*
arg
,
void
*
frame
)
{
ntdll_get_thread_data
()
->
exit_frame
=
frame
;
__TRY
{
call_thread_func
(
entry
,
arg
);
call_thread_func
_wrapper
(
entry
,
arg
);
}
__EXCEPT
(
unhandled_exception_filter
)
{
...
...
@@ -2511,7 +2544,8 @@ void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
*/
void
WINAPI
RtlExitUserThread
(
ULONG
status
)
{
exit_thread
(
status
);
if
(
!
ntdll_get_thread_data
()
->
exit_frame
)
exit_thread
(
status
);
call_thread_exit_func
(
status
,
exit_thread
,
ntdll_get_thread_data
()
->
exit_frame
);
}
/***********************************************************************
...
...
@@ -2519,7 +2553,8 @@ void WINAPI RtlExitUserThread( ULONG status )
*/
void
abort_thread
(
int
status
)
{
terminate_thread
(
status
);
if
(
!
ntdll_get_thread_data
()
->
exit_frame
)
terminate_thread
(
status
);
call_thread_exit_func
(
status
,
terminate_thread
,
ntdll_get_thread_data
()
->
exit_frame
);
}
/**********************************************************************
...
...
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