mirror of
https://github.com/reactos/reactos.git
synced 2025-06-26 20:09:44 +00:00
[KERNEL32] Add an (incomplete) pre-implementation for SetThreadStackGuarantee(). (#803)
This should remove some of the "SetThreadStackGuarantee(): stub" messages in some simple cases.
This commit is contained in:
parent
30b800f8b5
commit
0e3a043526
1 changed files with 33 additions and 6 deletions
|
@ -5,7 +5,6 @@
|
||||||
* PURPOSE: Thread functions
|
* PURPOSE: Thread functions
|
||||||
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
|
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
|
||||||
* Ariadne (ariadne@xs4all.nl)
|
* Ariadne (ariadne@xs4all.nl)
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* INCLUDES *******************************************************************/
|
/* INCLUDES *******************************************************************/
|
||||||
|
@ -950,16 +949,44 @@ QueueUserAPC(IN PAPCFUNC pfnAPC,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
BOOL
|
BOOL
|
||||||
WINAPI
|
WINAPI
|
||||||
SetThreadStackGuarantee(IN OUT PULONG StackSizeInBytes)
|
SetThreadStackGuarantee(IN OUT PULONG StackSizeInBytes)
|
||||||
{
|
{
|
||||||
static int once;
|
PTEB Teb = NtCurrentTeb();
|
||||||
if (once++ == 0)
|
ULONG GuaranteedStackBytes;
|
||||||
DPRINT1("SetThreadStackGuarantee(%p): stub\n", StackSizeInBytes);
|
ULONG AllocationSize;
|
||||||
|
|
||||||
|
if (!StackSizeInBytes)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
AllocationSize = *StackSizeInBytes;
|
||||||
|
|
||||||
|
/* Retrieve the current stack size */
|
||||||
|
GuaranteedStackBytes = Teb->GuaranteedStackBytes;
|
||||||
|
|
||||||
|
/* Return the size of the previous stack */
|
||||||
|
*StackSizeInBytes = GuaranteedStackBytes;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the new stack size is either zero or is less than the current size,
|
||||||
|
* the previous stack size is returned and we return success.
|
||||||
|
*/
|
||||||
|
if ((AllocationSize == 0) || (AllocationSize < GuaranteedStackBytes))
|
||||||
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// FIXME: Unimplemented!
|
||||||
|
UNIMPLEMENTED_ONCE;
|
||||||
|
|
||||||
|
// return TRUE;
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue