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
d8c39b3d
Commit
d8c39b3d
authored
Jun 01, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Don't pass arguments on the stack for user callbacks on i386.
parent
50ac2555
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
17 deletions
+16
-17
signal_i386.c
dlls/ntdll/unix/signal_i386.c
+16
-17
No files found.
dlls/ntdll/unix/signal_i386.c
View file @
d8c39b3d
...
...
@@ -1574,8 +1574,8 @@ NTSTATUS call_user_exception_dispatcher( EXCEPTION_RECORD *rec, CONTEXT *context
/***********************************************************************
* call_user_mode_callback
*/
extern
NTSTATUS
CDECL
call_user_mode_callback
(
void
*
func
,
void
*
stack
,
void
**
ret_ptr
,
ULONG
*
ret_len
,
TEB
*
teb
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
call_user_mode_callback
(
ULONG
id
,
void
*
args
,
ULONG
len
,
void
**
ret_ptr
,
ULONG
*
ret_len
,
void
*
func
,
TEB
*
teb
)
DECLSPEC_HIDDEN
;
__ASM_GLOBAL_FUNC
(
call_user_mode_callback
,
"pushl %ebp
\n\t
"
__ASM_CFI
(
".cfi_adjust_cfa_offset 4
\n\t
"
)
...
...
@@ -1588,7 +1588,7 @@ __ASM_GLOBAL_FUNC( call_user_mode_callback,
__ASM_CFI
(
".cfi_rel_offset %esi,-8
\n\t
"
)
"pushl %edi
\n\t
"
__ASM_CFI
(
".cfi_rel_offset %edi,-12
\n\t
"
)
"movl 0x
18
(%ebp),%edx
\n\t
"
/* teb */
"movl 0x
20
(%ebp),%edx
\n\t
"
/* teb */
"pushl 0(%edx)
\n\t
"
/* teb->Tib.ExceptionList */
"subl $0x384,%esp
\n\t
"
/* sizeof(struct syscall_frame) + ebp */
"andl $~63,%esp
\n\t
"
...
...
@@ -1600,8 +1600,13 @@ __ASM_GLOBAL_FUNC( call_user_mode_callback,
"movl %eax,0x38(%esp)
\n\t
"
"movl %ecx,0x3c(%esp)
\n\t
"
/* frame->prev_frame */
"movl %esp,0x1f8(%edx)
\n\t
"
/* x86_thread_data()->syscall_frame */
"movl 8(%ebp),%ecx
\n\t
"
/* func */
"movl 12(%ebp),%esp
\n\t
"
/* stack */
"movl 0x1c(%ebp),%ecx
\n\t
"
/* func */
"movl 0x0c(%ebp),%edx
\n\t
"
/* args */
"leal -4(%edx),%esp
\n\t
"
"pushl 0x10(%ebp)
\n\t
"
/* len */
"pushl %edx
\n\t
"
/* args */
"pushl 0x08(%ebp)
\n\t
"
/* id */
"pushl $0
\n\t
"
"xorl %ebp,%ebp
\n\t
"
"jmpl *%ecx"
)
...
...
@@ -1609,8 +1614,8 @@ __ASM_GLOBAL_FUNC( call_user_mode_callback,
/***********************************************************************
* user_mode_callback_return
*/
extern
void
CDECL
DECLSPEC_NORETURN
user_mode_callback_return
(
void
*
ret_ptr
,
ULONG
ret_len
,
NTSTATUS
status
,
TEB
*
teb
)
DECLSPEC_HIDDEN
;
extern
void
DECLSPEC_NORETURN
user_mode_callback_return
(
void
*
ret_ptr
,
ULONG
ret_len
,
NTSTATUS
status
,
TEB
*
teb
)
DECLSPEC_HIDDEN
;
__ASM_GLOBAL_FUNC
(
user_mode_callback_return
,
"movl 16(%esp),%edx
\n
"
/* teb */
"movl 0x1f8(%edx),%eax
\n\t
"
/* x86_thread_data()->syscall_frame */
...
...
@@ -1627,9 +1632,9 @@ __ASM_GLOBAL_FUNC( user_mode_callback_return,
"movl 8(%esp),%edi
\n\t
"
/* ret_len */
"movl 12(%esp),%eax
\n\t
"
/* status */
"leal -16(%ebp),%esp
\n\t
"
"movl 0x1
0
(%ebp),%ecx
\n\t
"
/* ret_ptr */
"movl 0x1
4
(%ebp),%ecx
\n\t
"
/* ret_ptr */
"movl %esi,(%ecx)
\n\t
"
"movl 0x1
4
(%ebp),%ecx
\n\t
"
/* ret_len */
"movl 0x1
8
(%ebp),%ecx
\n\t
"
/* ret_len */
"movl %edi,(%ecx)
\n\t
"
"popl 0(%edx)
\n\t
"
/* teb->Tib.ExceptionList */
"popl %edi
\n\t
"
...
...
@@ -1651,19 +1656,13 @@ NTSTATUS WINAPI KeUserModeCallback( ULONG id, const void *args, ULONG len, void
{
struct
syscall_frame
*
frame
=
x86_thread_data
()
->
syscall_frame
;
void
*
args_data
=
(
void
*
)((
frame
->
esp
-
len
)
&
~
15
);
ULONG_PTR
*
stack
=
args_data
;
if
((
char
*
)
ntdll_get_thread_data
()
->
kernel_stack
+
min_kernel_stack
>
(
char
*
)
&
frame
)
return
STATUS_STACK_OVERFLOW
;
memcpy
(
args_data
,
args
,
len
);
*
(
--
stack
)
=
0
;
*
(
--
stack
)
=
len
;
*
(
--
stack
)
=
(
ULONG_PTR
)
args_data
;
*
(
--
stack
)
=
id
;
*
(
--
stack
)
=
0xdeadbabe
;
return
call_user_mode_callback
(
pKiUserCallbackDispatcher
,
stack
,
ret_ptr
,
ret_len
,
NtCurrentTeb
()
);
return
call_user_mode_callback
(
id
,
args_data
,
len
,
ret_ptr
,
ret_len
,
pKiUserCallbackDispatcher
,
NtCurrentTeb
()
);
}
...
...
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