Jump to content

DosR2StackRealloc

From EDM2
Revision as of 03:36, 29 August 2016 by Martini (talk | contribs) (Created page with "image:legacy.png This function has been eliminated since OS/2 2.0 [https://books.google.com.ec/books?id=u7WbsmbttwYC&pg=PT372&lpg=PT372&dq#v=onepage&q&f=false] ==Descript...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function has been eliminated since OS/2 2.0 [1]

Description

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.

Example Code

C Binding

#define INCL_DOSDEVICES

USHORT  rc = DosR2StackRealloc(NewSize);

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

USHORT           rc;            /* return code */

MASM Binding

EXTRN  DosR2StackRealloc:FAR
INCL_DOSDEVICES     EQU 1

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

Returns WORD

Related Functions