| 1 | /* $Id: oslibmem.h,v 1.2 2002-07-16 08:16:48 sandervl Exp $ */ | 
|---|
| 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 |  | 
|---|
| 11 | #ifndef __OS2_H__ | 
|---|
| 12 |  | 
|---|
| 13 | /* Access protection                                                          */ | 
|---|
| 14 | #define PAG_READ          0x00000001U      /* read access                      */ | 
|---|
| 15 | #define PAG_WRITE         0x00000002U      /* write access                     */ | 
|---|
| 16 | #define PAG_EXECUTE       0x00000004U      /* execute access                   */ | 
|---|
| 17 | #define PAG_GUARD         0x00000008U      /* guard protection                 */ | 
|---|
| 18 | #define PAG_DEFAULT       0x00000400U      /* default (initial) access         */ | 
|---|
| 19 |  | 
|---|
| 20 | /* Commit                                                                     */ | 
|---|
| 21 | #define PAG_COMMIT        0x00000010U      /* commit storage                   */ | 
|---|
| 22 | #define PAG_DECOMMIT      0x00000020U      /* decommit storage                 */ | 
|---|
| 23 |  | 
|---|
| 24 | /* Allocation attributes                                                      */ | 
|---|
| 25 | #define OBJ_TILE          0x00000040U      /* tile object                      */ | 
|---|
| 26 | #define OBJ_PROTECTED     0x00000080U      /* protect object */ | 
|---|
| 27 | #define OBJ_GETTABLE      0x00000100U      /* gettable by other processes      */ | 
|---|
| 28 | #define OBJ_GIVEABLE      0x00000200U      /* giveable to other processes      */ | 
|---|
| 29 |  | 
|---|
| 30 | /* Allocation type (returned from DosQueryMem)                                */ | 
|---|
| 31 | #define PAG_SHARED        0x00002000U     /* shared object                    */ | 
|---|
| 32 | #define PAG_FREE          0x00004000U     /* pages are free                   */ | 
|---|
| 33 | #define PAG_BASE          0x00010000U     /* first page in object             */ | 
|---|
| 34 |  | 
|---|
| 35 | #endif | 
|---|
| 36 |  | 
|---|
| 37 | #ifndef PAGE_SIZE | 
|---|
| 38 | #define PAGE_SIZE           4096 | 
|---|
| 39 | #endif | 
|---|
| 40 |  | 
|---|
| 41 | #define MEM_TILED_CEILING   0x1fffffff | 
|---|
| 42 |  | 
|---|
| 43 | DWORD OSLibDosAliasMem(LPVOID pb, ULONG cb, LPVOID *ppbAlias, ULONG fl); | 
|---|
| 44 | DWORD OSLibDosAllocMem(LPVOID *lplpMemAddr, DWORD size, DWORD flags, BOOL fLowMemory = FALSE); | 
|---|
| 45 | DWORD OSLibDosFreeMem(LPVOID lpMemAddr); | 
|---|
| 46 | DWORD OSLibDosQueryMem(LPVOID lpMemAddr, DWORD *lpRangeSize, DWORD *lpAttr); | 
|---|
| 47 | DWORD OSLibDosSetMem(LPVOID lpMemAddr, DWORD size, DWORD flags); | 
|---|
| 48 | DWORD OSLibDosAllocSharedMem(LPVOID *lplpMemAddr, DWORD size, DWORD flags, LPSTR name); | 
|---|
| 49 | DWORD OSLibDosGetNamedSharedMem(LPVOID *lplpMemAddr, LPSTR name); | 
|---|
| 50 | PVOID OSLibDosFindMemBase(LPVOID lpMemAddr); | 
|---|
| 51 |  | 
|---|
| 52 |  | 
|---|
| 53 | #endif | 
|---|