Jump to content

DosR2StackRealloc: Difference between revisions

From EDM2
Ak120 (talk | contribs)
Ak120 (talk | contribs)
mNo edit summary
 
Line 11: Line 11:
* 0  NO_ERROR
* 0  NO_ERROR
* 8  ERROR_NOT_ENOUGH_MEMORY
* 8  ERROR_NOT_ENOUGH_MEMORY
* 196 ERROR_DYNLINK_FROM_INVALID_RING
*196 ERROR_DYNLINK_FROM_INVALID_RING
* 197 ERROR_IOPL_NOT_ENABLED
*197 ERROR_IOPL_NOT_ENABLED
* 207 ERROR_RING2_STACK_IN_USE
*207 ERROR_RING2_STACK_IN_USE
* 216 ERROR_CANNOT_SHRINK
*216 ERROR_CANNOT_SHRINK


==Remarks==
==Remarks==
Line 43: Line 43:
</code>
</code>


[[Category:Dos]]
[[Category:Dos16]]

Latest revision as of 06:28, 26 January 2020

This call changes the size of a thread's privilege level 2 stack.

Syntax

DosR2StackRealloc (NewSize)

Parameters

NewSize (USHORT) - input
New size, in bytes, for the privilege level 2 stack. The stack is reallocated as required and the TSS SP pointer is adjusted accordingly. The new stack size can not be less than the current stack size.

Return Code

rc (USHORT) - return
Return code descriptions are:
  • 0 NO_ERROR
  • 8 ERROR_NOT_ENOUGH_MEMORY
  • 196 ERROR_DYNLINK_FROM_INVALID_RING
  • 197 ERROR_IOPL_NOT_ENABLED
  • 207 ERROR_RING2_STACK_IN_USE
  • 216 ERROR_CANNOT_SHRINK

Remarks

This call is provided to allow the privilege level 2 stack to be resized and to have the TSS adjusted to reflect the new size. The size can not be less than the current size.

This call can not be made from privilege level 2.

Bindings

C

#define INCL_DOSDEVICES

USHORT  rc = DosR2StackRealloc(NewSize);

USHORT  NewSize;  /* The new size in bytes for the stack */
USHORT  rc;       /* return code */

MASM

EXTRN  DosR2StackRealloc:FAR
INCL_DOSDEVICES     EQU 1

PUSH   WORD    NewSize    ;The new size in bytes for the stack
CALL   DosR2StackRealloc

Returns WORD