mirror of
https://github.com/reactos/reactos.git
synced 2024-09-28 13:34:53 +00:00
[NTOS:MM] Handle unimplemeted case for MiCheckForUserStackOverflow
This commit is contained in:
parent
cdf47d5254
commit
8a0495063b
|
@ -81,8 +81,29 @@ MiCheckForUserStackOverflow(IN PVOID Address,
|
||||||
/* Do we have at least one page between here and the end of the stack? */
|
/* Do we have at least one page between here and the end of the stack? */
|
||||||
if (((ULONG_PTR)NextStackAddress - PAGE_SIZE) <= (ULONG_PTR)DeallocationStack)
|
if (((ULONG_PTR)NextStackAddress - PAGE_SIZE) <= (ULONG_PTR)DeallocationStack)
|
||||||
{
|
{
|
||||||
/* We don't -- Windows would try to make this guard page valid now */
|
/* We don't -- Trying to make this guard page valid now */
|
||||||
DPRINT1("Close to our death...\n");
|
DPRINT1("Close to our death...\n");
|
||||||
|
|
||||||
|
/* Calculate the next memory address */
|
||||||
|
NextStackAddress = (PVOID)((ULONG_PTR)PAGE_ALIGN(DeallocationStack) + GuranteedSize);
|
||||||
|
|
||||||
|
/* Allocate the memory */
|
||||||
|
Status = ZwAllocateVirtualMemory(NtCurrentProcess(),
|
||||||
|
&NextStackAddress,
|
||||||
|
0,
|
||||||
|
&GuranteedSize,
|
||||||
|
MEM_COMMIT,
|
||||||
|
PAGE_READWRITE);
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
/* Success! */
|
||||||
|
Teb->NtTib.StackLimit = NextStackAddress;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DPRINT1("Failed to allocate memory\n");
|
||||||
|
}
|
||||||
|
|
||||||
return STATUS_STACK_OVERFLOW;
|
return STATUS_STACK_OVERFLOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue