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
6de7fa1b
Commit
6de7fa1b
authored
May 07, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Take the zero_bits parameter into account in NtCreateThreadEx().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6a296592
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
7 deletions
+11
-7
loader.c
dlls/ntdll/unix/loader.c
+1
-1
thread.c
dlls/ntdll/unix/thread.c
+4
-1
unix_private.h
dlls/ntdll/unix/unix_private.h
+2
-2
virtual.c
dlls/ntdll/unix/virtual.c
+4
-3
No files found.
dlls/ntdll/unix/loader.c
View file @
6de7fa1b
...
...
@@ -1871,7 +1871,7 @@ static void start_main_thread(void)
if
(
p___wine_main_argv
)
*
p___wine_main_argv
=
main_argv
;
if
(
p___wine_main_wargv
)
*
p___wine_main_wargv
=
main_wargv
;
set_load_order_app_name
(
main_wargv
[
0
]
);
virtual_alloc_thread_stack
(
&
stack
,
0
,
0
,
NULL
);
virtual_alloc_thread_stack
(
&
stack
,
is_win64
?
0x7fffffff
:
0
,
0
,
0
,
NULL
);
teb
->
Tib
.
StackBase
=
stack
.
StackBase
;
teb
->
Tib
.
StackLimit
=
stack
.
StackLimit
;
teb
->
DeallocationStack
=
stack
.
DeallocationStack
;
...
...
dlls/ntdll/unix/thread.c
View file @
6de7fa1b
...
...
@@ -178,6 +178,9 @@ NTSTATUS WINAPI NtCreateThreadEx( HANDLE *handle, ACCESS_MASK access, OBJECT_ATT
INITIAL_TEB
stack
;
NTSTATUS
status
;
if
(
zero_bits
>
21
&&
zero_bits
<
32
)
return
STATUS_INVALID_PARAMETER_3
;
if
(
!
is_win64
&&
!
is_wow64
&&
zero_bits
>=
32
)
return
STATUS_INVALID_PARAMETER_3
;
if
(
process
!=
NtCurrentProcess
())
{
apc_call_t
call
;
...
...
@@ -244,7 +247,7 @@ NTSTATUS WINAPI NtCreateThreadEx( HANDLE *handle, ACCESS_MASK access, OBJECT_ATT
if
((
status
=
virtual_alloc_teb
(
&
teb
)))
goto
done
;
if
((
status
=
virtual_alloc_thread_stack
(
&
stack
,
stack_reserve
,
stack_commit
,
&
extra_stack
)))
if
((
status
=
virtual_alloc_thread_stack
(
&
stack
,
zero_bits
,
stack_reserve
,
stack_commit
,
&
extra_stack
)))
{
virtual_free_teb
(
teb
);
goto
done
;
...
...
dlls/ntdll/unix/unix_private.h
View file @
6de7fa1b
...
...
@@ -197,8 +197,8 @@ extern TEB *virtual_alloc_first_teb(void) DECLSPEC_HIDDEN;
extern
NTSTATUS
virtual_alloc_teb
(
TEB
**
ret_teb
)
DECLSPEC_HIDDEN
;
extern
void
virtual_free_teb
(
TEB
*
teb
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_clear_tls_index
(
ULONG
index
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_alloc_thread_stack
(
INITIAL_TEB
*
stack
,
SIZE_T
reserve_size
,
SIZE_T
commit
_size
,
SIZE_T
*
pthread_size
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_alloc_thread_stack
(
INITIAL_TEB
*
stack
,
ULONG_PTR
zero_bits
,
SIZE_T
reserve
_size
,
SIZE_T
commit_size
,
SIZE_T
*
pthread_size
)
DECLSPEC_HIDDEN
;
extern
void
virtual_map_user_shared_data
(
void
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_handle_fault
(
void
*
addr
,
DWORD
err
,
void
*
stack
)
DECLSPEC_HIDDEN
;
extern
unsigned
int
virtual_locked_server_call
(
void
*
req_ptr
)
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/unix/virtual.c
View file @
6de7fa1b
...
...
@@ -3044,9 +3044,10 @@ NTSTATUS virtual_clear_tls_index( ULONG index )
/***********************************************************************
* virtual_alloc_thread_stack
*/
NTSTATUS
virtual_alloc_thread_stack
(
INITIAL_TEB
*
stack
,
SIZE_T
reserve_size
,
SIZE_T
commit
_size
,
SIZE_T
*
pthread_size
)
NTSTATUS
virtual_alloc_thread_stack
(
INITIAL_TEB
*
stack
,
ULONG_PTR
zero_bits
,
SIZE_T
reserve
_size
,
SIZE_T
commit_size
,
SIZE_T
*
pthread_size
)
{
unsigned
short
zero_bits_64
=
zero_bits_win_to_64
(
zero_bits
);
struct
file_view
*
view
;
NTSTATUS
status
;
sigset_t
sigset
;
...
...
@@ -3063,7 +3064,7 @@ NTSTATUS virtual_alloc_thread_stack( INITIAL_TEB *stack, SIZE_T reserve_size, SI
server_enter_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
if
((
status
=
map_view
(
&
view
,
NULL
,
size
+
extra_size
,
FALSE
,
VPROT_READ
|
VPROT_WRITE
|
VPROT_COMMITTED
,
33
))
!=
STATUS_SUCCESS
)
VPROT_READ
|
VPROT_WRITE
|
VPROT_COMMITTED
,
zero_bits_64
))
!=
STATUS_SUCCESS
)
goto
done
;
#ifdef VALGRIND_STACK_REGISTER
...
...
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