OS/2 Memory Manager API Differences
The following describes the implementation differences between the OS2Linux
library and the real OS/2 memory manager APIs.
These APIs are included in your application by including the following
definition in your application source file.
#define INCL_DOSMEMMGR
DosAllocMem
APIRET APIENTRY DosAllocMem(PPVOID ppb, ULONG cb, ULONG flag);
- The argument flag is ignored.
- The system memory page size might not be 4096 bytes.
- The memory returned is allocated using the malloc function.
DosFreeMem
APIRET APIENTRY DosFreeMem(PVOID pb);
- The specified memory is freed using the free function.
DosSetMem
APIRET APIENTRY DosSetMem(PVOID pb, ULONG cb, ULONG flag);
- This function is not supported and always returns ERROR_ACCESS_DENIED.
DosGiveSharedMem
APIRET APIENTRY DosGiveSharedMem(PVOID pb, PID pid, ULONG flag);
- This function is not supported and always returns ERROR_ACCESS_DENIED.
DosGetSharedMem
APIRET APIENTRY DosGetSharedMem(PVOID pb, ULONG flag);
- This function is not supported and always returns ERROR_ACCESS_DENIED.
DosGetNamedSharedMem
APIRET APIENTRY DosGetNamedSharedMem(PPVOID ppb, PSZ pszName, ULONG flag);
- If the argument flag PAG_WRITE bit is not set then the memory will
be read only, otherwise the memory will be set to read/write.
- All other bits in the argument flag are ignored.
- The argument pszName must be non-NULL.
- The system memory page size might not be 4096 bytes.
- The memory returned is allocated using the shmget and shmat
functions.
DosAllocSharedMem
APIRET APIENTRY DosAllocSharedMem(PPVOID ppb, PSZ pszName, ULONG cb,
ULONG flag);
- If the argument flag PAG_WRITE bit is not set then the memory will
be read only, otherwise the memory will be set to read/write.
- All other bits in the argument flag are ignored.
- The argument pszName must be non-NULL.
- The system memory page size might not be 4096 bytes.
- The memory returned is allocated using the shmget and shmat
functions.
DosQueryMem
APIRET APIENTRY DosQueryMem(PVOID pb, PULONG pcb, PULONG pFlag);
- This function is not supported and always returns ERROR_ACCESS_DENIED.
DosSubAllocMem
APIRET APIENTRY DosSubAllocMem(PVOID pbBase, PPVOID ppb, ULONG cb);
- This function is not supported and always returns ERROR_ACCESS_DENIED.
DosSubFreeMem
APIRET APIENTRY DosSubFreeMem(PVOID pbBase, PVOID pb, ULONG cb);
- This function is not supported and always returns ERROR_ACCESS_DENIED.
DosSubSetMem
APIRET APIENTRY DosSubSetMem(PVOID pbBase, ULONG flag, ULONG cb);
- This function is not supported and always returns ERROR_ACCESS_DENIED.
DosSubUnsetMem
APIRET APIENTRY DosSubUnsetMem(PVOID pbBase);
- This function is not supported and always returns ERROR_ACCESS_DENIED.