ESMAllocWindow

Allocates a logical region of memory.

Library:LibC
Classification:NetWare OS
Service:NetWare Platform

Syntax

  #include <esm.h> 
   
  int ESMAllocWindow (
     size_t   size,
     void   **logicalAddress,
     void    *callerID);
  

Parameters

size

(IN) Specifies, in bytes, the size of the logical buffer. The size is rounded up to the next multiple of 4 MB (4194304).

logicalAddress

(OUT) Points to where the logical address value is returned.

callerID

(IN) Not currently used. Pass 0.

Return Values

If successful, returns 0. Otherwise, returns a nonzero error code.

Decimal

Name

Description

1

ERR_ESM_AVAL

The server has no registered memory above 4 GB.

2

ERR_SIZE_ZERO

The size requested is zero.

3

ERR_TABLE_FULL

There is insufficient memory to expand the allocated memory table.

11

ERR_LOGICAL_SPACE

The size of logical space or window that was requested is not available.

For other possible values, see Section 30.3, Return Values for ESM Functions.

Remarks

Extended server memory is handled in 4 MB blocks for efficiency. After allocating a window, memory that is allocated with ESMAlloc can be mapped to gain access to the memory through the window.

All windows must be freed using ESMFreeWindow before unloading your NLM to avoid the loss of memory.

See Also