[9617] | 1 | /* $Id: oslibmem.h,v 1.3 2003-01-05 12:31:24 sandervl Exp $ */
|
---|
[8877] | 2 | /*
|
---|
| 3 | * OS/2 Memory management procedures
|
---|
| 4 | *
|
---|
| 5 | * Copyright 2002 Sander van Leeuwen (sandervl@xs4all.nl)
|
---|
| 6 | *
|
---|
| 7 | */
|
---|
| 8 | #ifndef __OSLIBMEM_H__
|
---|
| 9 | #define __OSLIBMISC_H__
|
---|
| 10 |
|
---|
[9617] | 11 | #ifdef __cplusplus
|
---|
| 12 | extern "C" {
|
---|
| 13 | #endif
|
---|
| 14 |
|
---|
[8877] | 15 | #ifndef __OS2_H__
|
---|
| 16 |
|
---|
| 17 | /* Access protection */
|
---|
| 18 | #define PAG_READ 0x00000001U /* read access */
|
---|
| 19 | #define PAG_WRITE 0x00000002U /* write access */
|
---|
| 20 | #define PAG_EXECUTE 0x00000004U /* execute access */
|
---|
| 21 | #define PAG_GUARD 0x00000008U /* guard protection */
|
---|
| 22 | #define PAG_DEFAULT 0x00000400U /* default (initial) access */
|
---|
| 23 |
|
---|
| 24 | /* Commit */
|
---|
| 25 | #define PAG_COMMIT 0x00000010U /* commit storage */
|
---|
| 26 | #define PAG_DECOMMIT 0x00000020U /* decommit storage */
|
---|
| 27 |
|
---|
| 28 | /* Allocation attributes */
|
---|
| 29 | #define OBJ_TILE 0x00000040U /* tile object */
|
---|
| 30 | #define OBJ_PROTECTED 0x00000080U /* protect object */
|
---|
| 31 | #define OBJ_GETTABLE 0x00000100U /* gettable by other processes */
|
---|
| 32 | #define OBJ_GIVEABLE 0x00000200U /* giveable to other processes */
|
---|
| 33 |
|
---|
| 34 | /* Allocation type (returned from DosQueryMem) */
|
---|
| 35 | #define PAG_SHARED 0x00002000U /* shared object */
|
---|
| 36 | #define PAG_FREE 0x00004000U /* pages are free */
|
---|
| 37 | #define PAG_BASE 0x00010000U /* first page in object */
|
---|
| 38 |
|
---|
| 39 | #endif
|
---|
| 40 |
|
---|
| 41 | #ifndef PAGE_SIZE
|
---|
| 42 | #define PAGE_SIZE 4096
|
---|
| 43 | #endif
|
---|
| 44 |
|
---|
| 45 | #define MEM_TILED_CEILING 0x1fffffff
|
---|
| 46 |
|
---|
| 47 | DWORD OSLibDosAliasMem(LPVOID pb, ULONG cb, LPVOID *ppbAlias, ULONG fl);
|
---|
[8882] | 48 | DWORD OSLibDosAllocMem(LPVOID *lplpMemAddr, DWORD size, DWORD flags, BOOL fLowMemory = FALSE);
|
---|
[8877] | 49 | DWORD OSLibDosFreeMem(LPVOID lpMemAddr);
|
---|
| 50 | DWORD OSLibDosQueryMem(LPVOID lpMemAddr, DWORD *lpRangeSize, DWORD *lpAttr);
|
---|
| 51 | DWORD OSLibDosSetMem(LPVOID lpMemAddr, DWORD size, DWORD flags);
|
---|
| 52 | DWORD OSLibDosAllocSharedMem(LPVOID *lplpMemAddr, DWORD size, DWORD flags, LPSTR name);
|
---|
| 53 | DWORD OSLibDosGetNamedSharedMem(LPVOID *lplpMemAddr, LPSTR name);
|
---|
[21302] | 54 | PVOID OSLibDosFindMemBase(LPVOID lpMemAddr, DWORD *lpAttr);
|
---|
[8877] | 55 |
|
---|
[9617] | 56 | #ifdef __cplusplus
|
---|
| 57 | }
|
---|
| 58 | #endif
|
---|
[8877] | 59 |
|
---|
| 60 | #endif
|
---|