| 1 | /* $Id: oslibdos.h,v 1.1 1999-09-15 23:32:59 sandervl Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /*
|
|---|
| 4 | * Wrappers for OS/2 Dos* API
|
|---|
| 5 | *
|
|---|
| 6 | * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
|
|---|
| 7 | *
|
|---|
| 8 | *
|
|---|
| 9 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 10 | *
|
|---|
| 11 | */
|
|---|
| 12 | #ifndef __OSLIBDOS_H__
|
|---|
| 13 | #define __OSLIBDOS_H__
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 | DWORD OSLibDosAliasMem(LPVOID pb, ULONG cb, LPVOID *ppbAlias, ULONG fl);
|
|---|
| 17 | DWORD OSLibDosAllocMem(LPVOID *lplpMemAddr, DWORD size, DWORD flags);
|
|---|
| 18 | DWORD OSLibDosFreeMem(LPVOID lpMemAddr);
|
|---|
| 19 | DWORD OSLibDosQueryMem(LPVOID lpMemAddr, DWORD *lpRangeSize, DWORD *lpAttr);
|
|---|
| 20 | DWORD OSLibDosSetMem(LPVOID lpMemAddr, DWORD size, DWORD flags);
|
|---|
| 21 |
|
|---|
| 22 | #define OSLIB_NOERROR 0
|
|---|
| 23 | #define OSLIB_ERROR_INVALID_ADDRESS 1
|
|---|
| 24 | #define OSLIB_ERROR_ACCESS_DENIED 2
|
|---|
| 25 | #define OSLIB_ERROR_INVALID_PARAMETER 3
|
|---|
| 26 |
|
|---|
| 27 | #ifndef __OS2_H__
|
|---|
| 28 |
|
|---|
| 29 | /* Access protection */
|
|---|
| 30 | #define PAG_READ 0x00000001U /* read access */
|
|---|
| 31 | #define PAG_WRITE 0x00000002U /* write access */
|
|---|
| 32 | #define PAG_EXECUTE 0x00000004U /* execute access */
|
|---|
| 33 | #define PAG_GUARD 0x00000008U /* guard protection */
|
|---|
| 34 | #define PAG_DEFAULT 0x00000400U /* default (initial) access */
|
|---|
| 35 |
|
|---|
| 36 | /* Commit */
|
|---|
| 37 | #define PAG_COMMIT 0x00000010U /* commit storage */
|
|---|
| 38 | #define PAG_DECOMMIT 0x00000020U /* decommit storage */
|
|---|
| 39 |
|
|---|
| 40 | /* Allocation attributes */
|
|---|
| 41 | #define OBJ_TILE 0x00000040U /* tile object */
|
|---|
| 42 | #define OBJ_PROTECTED 0x00000080U /* protect object */
|
|---|
| 43 | #define OBJ_GETTABLE 0x00000100U /* gettable by other processes */
|
|---|
| 44 | #define OBJ_GIVEABLE 0x00000200U /* giveable to other processes */
|
|---|
| 45 |
|
|---|
| 46 | /* Allocation type (returned from DosQueryMem) */
|
|---|
| 47 | #define PAG_SHARED 0x00002000U /* shared object */
|
|---|
| 48 | #define PAG_FREE 0x00004000U /* pages are free */
|
|---|
| 49 | #define PAG_BASE 0x00010000U /* first page in object */
|
|---|
| 50 |
|
|---|
| 51 | #endif
|
|---|
| 52 |
|
|---|
| 53 | #define OSLIB_ACCESS_READONLY 1
|
|---|
| 54 | #define OSLIB_ACCESS_READWRITE 2
|
|---|
| 55 | #define OSLIB_ACCESS_SHAREDENYNONE 4
|
|---|
| 56 | #define OSLIB_ACCESS_SHAREDENYREAD 8
|
|---|
| 57 | #define OSLIB_ACCESS_SHAREDENYWRITE 16
|
|---|
| 58 |
|
|---|
| 59 | DWORD OSLibDosOpen(char *lpszFileName, DWORD flags);
|
|---|
| 60 | DWORD OSLibDosClose(DWORD hFile);
|
|---|
| 61 | DWORD OSLibDosGetFileSize(DWORD hFile);
|
|---|
| 62 | DWORD OSLibDosRead(DWORD hFile, LPVOID lpBuffer, DWORD size, DWORD *nrBytesRead);
|
|---|
| 63 | DWORD OSLibDosWrite(DWORD hFile, LPVOID lpBuffer, DWORD size, DWORD *nrBytesWritten);
|
|---|
| 64 |
|
|---|
| 65 | #define OSLIB_SETPTR_FILE_CURRENT 1
|
|---|
| 66 | #define OSLIB_SETPTR_FILE_BEGIN 2
|
|---|
| 67 | #define OSLIB_SETPTR_FILE_END 3
|
|---|
| 68 |
|
|---|
| 69 | DWORD OSLibDosSetFilePtr(DWORD hFile, DWORD offset, DWORD method);
|
|---|
| 70 |
|
|---|
| 71 | #endif
|
|---|