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
efffa663
Commit
efffa663
authored
Dec 17, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Don't use a real guard page at the bottom of the stack.
A no-access page is enough, we can't properly raise an overflow exception anyway.
parent
f0c55e7d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
9 deletions
+4
-9
process.c
dlls/kernel/process.c
+1
-1
thread.c
dlls/ntdll/thread.c
+1
-2
virtual.c
dlls/ntdll/virtual.c
+2
-6
No files found.
dlls/kernel/process.c
View file @
efffa663
...
...
@@ -994,7 +994,7 @@ static void *init_stack(void)
NtCurrentTeb
()
->
Tib
.
StackLimit
=
(
char
*
)
base
+
page_size
;
/* setup guard page */
VirtualProtect
(
base
,
1
,
PAGE_READWRITE
|
PAGE_GUARD
,
NULL
);
VirtualProtect
(
base
,
page_size
,
PAGE_NOACCESS
,
NULL
);
return
NtCurrentTeb
()
->
Tib
.
StackBase
;
}
...
...
dlls/ntdll/thread.c
View file @
efffa663
...
...
@@ -223,8 +223,7 @@ static void start_thread( struct wine_pthread_thread_info *info )
/* setup the guard page */
size
=
page_size
;
NtProtectVirtualMemory
(
NtCurrentProcess
(),
&
teb
->
DeallocationStack
,
&
size
,
PAGE_READWRITE
|
PAGE_GUARD
,
NULL
);
NtProtectVirtualMemory
(
NtCurrentProcess
(),
&
teb
->
DeallocationStack
,
&
size
,
PAGE_NOACCESS
,
NULL
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
info
);
RtlAcquirePebLock
();
...
...
dlls/ntdll/virtual.c
View file @
efffa663
...
...
@@ -1178,17 +1178,13 @@ NTSTATUS VIRTUAL_HandleFault( LPCVOID addr )
RtlEnterCriticalSection
(
&
csVirtual
);
if
((
view
=
VIRTUAL_FindView
(
addr
)))
{
BYTE
vprot
=
view
->
prot
[((
const
char
*
)
addr
-
(
const
char
*
)
view
->
base
)
>>
page_shift
];
void
*
page
=
(
void
*
)((
UINT_PTR
)
addr
&
~
page_mask
);
char
*
stack
=
NtCurrentTeb
()
->
Tib
.
StackLimit
;
void
*
page
=
ROUND_ADDR
(
addr
,
page_mask
);
BYTE
vprot
=
view
->
prot
[((
const
char
*
)
page
-
(
const
char
*
)
view
->
base
)
>>
page_shift
];
if
(
vprot
&
VPROT_GUARD
)
{
VIRTUAL_SetProt
(
view
,
page
,
page_mask
+
1
,
vprot
&
~
VPROT_GUARD
);
ret
=
STATUS_GUARD_PAGE_VIOLATION
;
}
/* is it inside the stack guard page? */
if
(((
const
char
*
)
addr
>=
stack
-
(
page_mask
+
1
))
&&
((
const
char
*
)
addr
<
stack
))
ret
=
STATUS_STACK_OVERFLOW
;
}
RtlLeaveCriticalSection
(
&
csVirtual
);
return
ret
;
...
...
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