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
58d076b4
Commit
58d076b4
authored
Jun 26, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Force execute permission again on the stack after clearing it.
parent
6e9a6577
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
5 deletions
+17
-5
loader.c
dlls/ntdll/loader.c
+1
-5
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+1
-0
virtual.c
dlls/ntdll/virtual.c
+15
-0
No files found.
dlls/ntdll/loader.c
View file @
58d076b4
...
...
@@ -2423,11 +2423,7 @@ void WINAPI LdrInitializeThunk( ULONG unknown1, ULONG unknown2, ULONG unknown3,
status
=
wine_call_on_stack
(
attach_process_dlls
,
wm
,
NtCurrentTeb
()
->
Tib
.
StackBase
);
if
(
status
!=
STATUS_SUCCESS
)
goto
error
;
/* clear the stack contents before calling the main entry point, some broken apps need that */
wine_anon_mmap
(
NtCurrentTeb
()
->
Tib
.
StackLimit
,
(
char
*
)
NtCurrentTeb
()
->
Tib
.
StackBase
-
(
char
*
)
NtCurrentTeb
()
->
Tib
.
StackLimit
,
PROT_READ
|
PROT_WRITE
,
MAP_FIXED
);
virtual_clear_thread_stack
();
if
(
nt
->
FileHeader
.
Characteristics
&
IMAGE_FILE_LARGE_ADDRESS_AWARE
)
VIRTUAL_UseLargeAddressSpace
();
return
;
...
...
dlls/ntdll/ntdll_misc.h
View file @
58d076b4
...
...
@@ -134,6 +134,7 @@ extern unsigned int DIR_get_drives_info( struct drive_info info[MAX_DOS_DRIVES]
/* virtual memory */
extern
NTSTATUS
virtual_alloc_thread_stack
(
void
*
base
,
SIZE_T
stack_size
);
extern
void
virtual_clear_thread_stack
(
void
);
extern
BOOL
virtual_handle_stack_fault
(
void
*
addr
);
extern
NTSTATUS
VIRTUAL_HandleFault
(
LPCVOID
addr
);
extern
void
VIRTUAL_SetForceExec
(
BOOL
enable
);
...
...
dlls/ntdll/virtual.c
View file @
58d076b4
...
...
@@ -1243,6 +1243,21 @@ done:
/***********************************************************************
* virtual_clear_thread_stack
*
* Clear the stack contents before calling the main entry point, some broken apps need that.
*/
void
virtual_clear_thread_stack
(
void
)
{
void
*
stack
=
NtCurrentTeb
()
->
Tib
.
StackLimit
;
size_t
size
=
(
char
*
)
NtCurrentTeb
()
->
Tib
.
StackBase
-
(
char
*
)
NtCurrentTeb
()
->
Tib
.
StackLimit
;
wine_anon_mmap
(
stack
,
size
,
PROT_READ
|
PROT_WRITE
,
MAP_FIXED
);
if
(
force_exec_prot
)
mprotect
(
stack
,
size
,
PROT_READ
|
PROT_WRITE
|
PROT_EXEC
);
}
/***********************************************************************
* VIRTUAL_HandleFault
*/
NTSTATUS
VIRTUAL_HandleFault
(
LPCVOID
addr
)
...
...
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