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
943e16de
Commit
943e16de
authored
Oct 16, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move RtlUserThreadStart implementation to the CPU backends.
parent
bf2b38a8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
121 additions
and
90 deletions
+121
-90
exception.c
dlls/ntdll/exception.c
+21
-0
signal_arm.c
dlls/ntdll/signal_arm.c
+16
-0
signal_arm64.c
dlls/ntdll/signal_arm64.c
+16
-0
signal_i386.c
dlls/ntdll/signal_i386.c
+37
-0
signal_x86_64.c
dlls/ntdll/signal_x86_64.c
+31
-0
thread.c
dlls/ntdll/thread.c
+0
-90
No files found.
dlls/ntdll/exception.c
View file @
943e16de
...
@@ -279,6 +279,27 @@ LONG WINAPI call_unhandled_exception_filter( PEXCEPTION_POINTERS eptr )
...
@@ -279,6 +279,27 @@ LONG WINAPI call_unhandled_exception_filter( PEXCEPTION_POINTERS eptr )
return
unhandled_exception_filter
(
eptr
);
return
unhandled_exception_filter
(
eptr
);
}
}
/*******************************************************************
* call_unhandled_exception_handler
*/
EXCEPTION_DISPOSITION
WINAPI
call_unhandled_exception_handler
(
EXCEPTION_RECORD
*
rec
,
void
*
frame
,
CONTEXT
*
context
,
void
*
dispatch
)
{
EXCEPTION_POINTERS
ep
=
{
rec
,
context
};
switch
(
call_unhandled_exception_filter
(
&
ep
))
{
case
EXCEPTION_CONTINUE_SEARCH
:
return
ExceptionContinueSearch
;
case
EXCEPTION_CONTINUE_EXECUTION
:
return
ExceptionContinueExecution
;
case
EXCEPTION_EXECUTE_HANDLER
:
break
;
}
NtTerminateProcess
(
GetCurrentProcess
(),
rec
->
ExceptionCode
);
return
ExceptionContinueExecution
;
}
#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
...
...
dlls/ntdll/signal_arm.c
View file @
943e16de
...
@@ -1488,6 +1488,22 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
...
@@ -1488,6 +1488,22 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
return
0
;
return
0
;
}
}
/***********************************************************************
* RtlUserThreadStart (NTDLL.@)
*/
void
WINAPI
RtlUserThreadStart
(
PRTL_THREAD_START_ROUTINE
entry
,
void
*
arg
)
{
__TRY
{
pBaseThreadInitThunk
(
0
,
(
LPTHREAD_START_ROUTINE
)
entry
,
arg
);
}
__EXCEPT
(
call_unhandled_exception_filter
)
{
NtTerminateProcess
(
GetCurrentProcess
(),
GetExceptionCode
()
);
}
__ENDTRY
}
/******************************************************************
/******************************************************************
* LdrInitializeThunk (NTDLL.@)
* LdrInitializeThunk (NTDLL.@)
*/
*/
...
...
dlls/ntdll/signal_arm64.c
View file @
943e16de
...
@@ -1525,6 +1525,22 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
...
@@ -1525,6 +1525,22 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
return
0
;
return
0
;
}
}
/***********************************************************************
* RtlUserThreadStart (NTDLL.@)
*/
void
WINAPI
RtlUserThreadStart
(
PRTL_THREAD_START_ROUTINE
entry
,
void
*
arg
)
{
__TRY
{
pBaseThreadInitThunk
(
0
,
(
LPTHREAD_START_ROUTINE
)
entry
,
arg
);
}
__EXCEPT
(
call_unhandled_exception_filter
)
{
NtTerminateProcess
(
GetCurrentProcess
(),
GetExceptionCode
()
);
}
__ENDTRY
}
/******************************************************************
/******************************************************************
* LdrInitializeThunk (NTDLL.@)
* LdrInitializeThunk (NTDLL.@)
*/
*/
...
...
dlls/ntdll/signal_i386.c
View file @
943e16de
...
@@ -536,6 +536,43 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
...
@@ -536,6 +536,43 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
/***********************************************************************
/***********************************************************************
* RtlUserThreadStart (NTDLL.@)
*/
__ASM_STDCALL_FUNC
(
RtlUserThreadStart
,
8
,
"movl %ebx,8(%esp)
\n\t
"
/* arg */
"movl %eax,4(%esp)
\n\t
"
/* entry */
"jmp "
__ASM_NAME
(
"call_thread_func"
)
)
/* wrapper to call BaseThreadInitThunk */
extern
void
DECLSPEC_NORETURN
call_thread_func_wrapper
(
void
*
thunk
,
PRTL_THREAD_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
"
)
"movl %esp,%ebp
\n\t
"
__ASM_CFI
(
".cfi_def_cfa_register %ebp
\n\t
"
)
"subl $4,%esp
\n\t
"
"andl $~0xf,%esp
\n\t
"
"xorl %ecx,%ecx
\n\t
"
"movl 12(%ebp),%edx
\n\t
"
"movl 16(%ebp),%eax
\n\t
"
"movl %eax,(%esp)
\n\t
"
"call *8(%ebp)"
)
void
DECLSPEC_HIDDEN
call_thread_func
(
PRTL_THREAD_START_ROUTINE
entry
,
void
*
arg
)
{
__TRY
{
call_thread_func_wrapper
(
pBaseThreadInitThunk
,
entry
,
arg
);
}
__EXCEPT
(
call_unhandled_exception_filter
)
{
NtTerminateProcess
(
GetCurrentProcess
(),
GetExceptionCode
()
);
}
__ENDTRY
}
/***********************************************************************
* signal_start_thread
* signal_start_thread
*/
*/
extern
void
CDECL
DECLSPEC_NORETURN
signal_start_thread
(
CONTEXT
*
ctx
)
DECLSPEC_HIDDEN
;
extern
void
CDECL
DECLSPEC_NORETURN
signal_start_thread
(
CONTEXT
*
ctx
)
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/signal_x86_64.c
View file @
943e16de
...
@@ -1589,6 +1589,37 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
...
@@ -1589,6 +1589,37 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
/***********************************************************************
/***********************************************************************
* RtlUserThreadStart (NTDLL.@)
*/
#ifdef __ASM_SEH_SUPPORTED
__ASM_GLOBAL_FUNC
(
RtlUserThreadStart
,
"subq $0x28,%rsp
\n\t
"
".seh_stackalloc 0x28
\n\t
"
".seh_endprologue
\n\t
"
"movq %rdx,%r8
\n\t
"
"movq %rcx,%rdx
\n\t
"
"xorq %rcx,%rcx
\n\t
"
"movq "
__ASM_NAME
(
"pBaseThreadInitThunk"
)
"(%rip),%r9
\n\t
"
"call *%r9
\n\t
"
"int3
\n\t
"
".seh_handler "
__ASM_NAME
(
"call_unhandled_exception_handler"
)
", @except"
)
#else
void
WINAPI
RtlUserThreadStart
(
PRTL_THREAD_START_ROUTINE
entry
,
void
*
arg
)
{
__TRY
{
pBaseThreadInitThunk
(
0
,
(
LPTHREAD_START_ROUTINE
)
entry
,
arg
);
}
__EXCEPT
(
call_unhandled_exception_filter
)
{
NtTerminateProcess
(
GetCurrentProcess
(),
GetExceptionCode
()
);
}
__ENDTRY
}
#endif
/***********************************************************************
* signal_start_thread
* signal_start_thread
*/
*/
extern
void
CDECL
DECLSPEC_NORETURN
signal_start_thread
(
CONTEXT
*
ctx
)
DECLSPEC_HIDDEN
;
extern
void
CDECL
DECLSPEC_NORETURN
signal_start_thread
(
CONTEXT
*
ctx
)
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/thread.c
View file @
943e16de
...
@@ -247,96 +247,6 @@ void WINAPI RtlExitUserThread( ULONG status )
...
@@ -247,96 +247,6 @@ void WINAPI RtlExitUserThread( ULONG status )
/***********************************************************************
/***********************************************************************
* RtlUserThreadStart (NTDLL.@)
*/
#ifdef __i386__
__ASM_STDCALL_FUNC
(
RtlUserThreadStart
,
8
,
"movl %ebx,8(%esp)
\n\t
"
/* arg */
"movl %eax,4(%esp)
\n\t
"
/* entry */
"jmp "
__ASM_NAME
(
"call_thread_func"
)
)
/* wrapper to call BaseThreadInitThunk */
extern
void
DECLSPEC_NORETURN
call_thread_func_wrapper
(
void
*
thunk
,
PRTL_THREAD_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
"
)
"movl %esp,%ebp
\n\t
"
__ASM_CFI
(
".cfi_def_cfa_register %ebp
\n\t
"
)
"subl $4,%esp
\n\t
"
"andl $~0xf,%esp
\n\t
"
"xorl %ecx,%ecx
\n\t
"
"movl 12(%ebp),%edx
\n\t
"
"movl 16(%ebp),%eax
\n\t
"
"movl %eax,(%esp)
\n\t
"
"call *8(%ebp)"
)
void
DECLSPEC_HIDDEN
call_thread_func
(
PRTL_THREAD_START_ROUTINE
entry
,
void
*
arg
)
{
__TRY
{
call_thread_func_wrapper
(
pBaseThreadInitThunk
,
entry
,
arg
);
}
__EXCEPT
(
call_unhandled_exception_filter
)
{
NtTerminateProcess
(
GetCurrentProcess
(),
GetExceptionCode
()
);
}
__ENDTRY
}
#elif
/* __i386__ */
defined(__x86_64__) && defined(__ASM_SEH_SUPPORTED)
EXCEPTION_DISPOSITION
WINAPI
call_thread_func_handler
(
EXCEPTION_RECORD
*
rec
,
ULONG64
frame
,
CONTEXT
*
context
,
DISPATCHER_CONTEXT
*
dispatch
)
{
EXCEPTION_POINTERS
ep
=
{
rec
,
context
};
WARN
(
"Unhandled exception, calling filter.
\n
"
);
switch
(
call_unhandled_exception_filter
(
&
ep
))
{
case
EXCEPTION_CONTINUE_SEARCH
:
return
ExceptionContinueSearch
;
case
EXCEPTION_CONTINUE_EXECUTION
:
return
ExceptionContinueExecution
;
case
EXCEPTION_EXECUTE_HANDLER
:
break
;
}
NtTerminateProcess
(
GetCurrentProcess
(),
rec
->
ExceptionCode
);
return
ExceptionContinueExecution
;
}
extern
void
WINAPI
RtlUserThreadStart
(
PRTL_THREAD_START_ROUTINE
entry
,
void
*
arg
);
__ASM_GLOBAL_FUNC
(
RtlUserThreadStart
,
"subq $0x28,%rsp
\n\t
"
".seh_stackalloc 0x28
\n\t
"
".seh_endprologue
\n\t
"
"movq %rdx,%r8
\n\t
"
"movq %rcx,%rdx
\n\t
"
"xorq %rcx,%rcx
\n\t
"
"movq "
__ASM_NAME
(
"pBaseThreadInitThunk"
)
"(%rip),%r9
\n\t
"
"call *%r9
\n\t
"
"int3
\n\t
"
".seh_handler call_thread_func_handler, @except
\n\t
"
)
#else
/* defined(__x86_64__) && defined(__ASM_SEH_SUPPORTED) */
void
WINAPI
RtlUserThreadStart
(
PRTL_THREAD_START_ROUTINE
entry
,
void
*
arg
)
{
__TRY
{
pBaseThreadInitThunk
(
0
,
(
LPTHREAD_START_ROUTINE
)
entry
,
arg
);
}
__EXCEPT
(
call_unhandled_exception_filter
)
{
NtTerminateProcess
(
GetCurrentProcess
(),
GetExceptionCode
()
);
}
__ENDTRY
}
#endif
/* __i386__ */
/***********************************************************************
* RtlCreateUserThread (NTDLL.@)
* RtlCreateUserThread (NTDLL.@)
*/
*/
NTSTATUS
WINAPI
RtlCreateUserThread
(
HANDLE
process
,
SECURITY_DESCRIPTOR
*
descr
,
NTSTATUS
WINAPI
RtlCreateUserThread
(
HANDLE
process
,
SECURITY_DESCRIPTOR
*
descr
,
...
...
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