source: trunk/src/kernel32/oslibmem.h@ 9023

Last change on this file since 9023 was 8882, checked in by sandervl, 23 years ago

Fix for loading PE images in low memory (introduced yesterday)

File size: 2.3 KB
Line 
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
43DWORD OSLibDosAliasMem(LPVOID pb, ULONG cb, LPVOID *ppbAlias, ULONG fl);
44DWORD OSLibDosAllocMem(LPVOID *lplpMemAddr, DWORD size, DWORD flags, BOOL fLowMemory = FALSE);
45DWORD OSLibDosFreeMem(LPVOID lpMemAddr);
46DWORD OSLibDosQueryMem(LPVOID lpMemAddr, DWORD *lpRangeSize, DWORD *lpAttr);
47DWORD OSLibDosSetMem(LPVOID lpMemAddr, DWORD size, DWORD flags);
48DWORD OSLibDosAllocSharedMem(LPVOID *lplpMemAddr, DWORD size, DWORD flags, LPSTR name);
49DWORD OSLibDosGetNamedSharedMem(LPVOID *lplpMemAddr, LPSTR name);
50PVOID OSLibDosFindMemBase(LPVOID lpMemAddr);
51
52
53#endif
Note: See TracBrowser for help on using the repository browser.