Jump to content

SSAllocMem

From EDM2
Revision as of 23:48, 12 December 2019 by Martini (talk | contribs) (Created page with "SSAllocMem allocates a shared memory object that is managed by the selector server component of the graphics engine. == Syntax == SSAllocMem(pBaseAddress, ObjectSize, Flag...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

SSAllocMem allocates a shared memory object that is managed by the selector server component of the graphics engine.

Syntax

SSAllocMem(pBaseAddress, ObjectSize, Flags);

Parameters

pBaseAddress (PVOID) - input
Pointer to a variable, which will receive the base address of the allocated memory.
ObjectSize (ULONG) - input
Value that specifies the size in bytes of the shared memory to allocate. The size is rounded up to the next page boundary.
Flags (ULONG) - input
Reserved.
Reserved. Must be 0.

Returns

rc (ULONG) - returns
Return codes.
SSAllocMem returns a ULONG value:
NO_ERROR
ERROR_INVALID_PARAMETER
ERROR_NOT_ENOUGH_MEMORY.
Note
:Other return codes listed under DosAllocSharedMem might also apply.

Sample

#include <os2.h>

PVOID    pBaseAddress;
ULONG    ObjectSize;
ULONG    Flags;         /*  Reserved. */
ULONG    rc;            /*  Return codes. */

rc = SSAllocMem(pBaseAddress, ObjectSize,
       Flags);

Remarks

Presentation drivers should use SSAllocMem to allocate memory for objects, such as bit maps and regions, to ensure that the returned memory object is a global memory object for which the system can set a new owner, or which can be marked as having no owner.

In some presentation devices, the handling routine for FillLogicalDeviceBlock (OS2_PM_DRV_ENABLE, sub-function 2) allocates global heap space for use by the device contexts. The memory for this heap space is obtained by calling the SSAllocMem function.