| 1 | /* $Id: oslibdos.h,v 1.9 1999-12-01 18:40:48 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 | DWORD OSLibDosAllocSharedMem(LPVOID *lplpMemAddr, DWORD size, DWORD flags, LPSTR name);
|
|---|
| 22 | DWORD OSLibDosGetNamedSharedMem(LPVOID *lplpMemAddr, LPSTR name);
|
|---|
| 23 |
|
|---|
| 24 | BOOL OSLibDosGetFileAttributesEx(LPSTR pszName, ULONG ulDummy, PVOID pBuffer);
|
|---|
| 25 |
|
|---|
| 26 | #define OSLIB_NOERROR 0
|
|---|
| 27 | #define OSLIB_ERROR_INVALID_ADDRESS 1
|
|---|
| 28 | #define OSLIB_ERROR_ACCESS_DENIED 2
|
|---|
| 29 | #define OSLIB_ERROR_INVALID_PARAMETER 3
|
|---|
| 30 |
|
|---|
| 31 | #ifndef __OS2_H__
|
|---|
| 32 |
|
|---|
| 33 | /* Access protection */
|
|---|
| 34 | #define PAG_READ 0x00000001U /* read access */
|
|---|
| 35 | #define PAG_WRITE 0x00000002U /* write access */
|
|---|
| 36 | #define PAG_EXECUTE 0x00000004U /* execute access */
|
|---|
| 37 | #define PAG_GUARD 0x00000008U /* guard protection */
|
|---|
| 38 | #define PAG_DEFAULT 0x00000400U /* default (initial) access */
|
|---|
| 39 |
|
|---|
| 40 | /* Commit */
|
|---|
| 41 | #define PAG_COMMIT 0x00000010U /* commit storage */
|
|---|
| 42 | #define PAG_DECOMMIT 0x00000020U /* decommit storage */
|
|---|
| 43 |
|
|---|
| 44 | /* Allocation attributes */
|
|---|
| 45 | #define OBJ_TILE 0x00000040U /* tile object */
|
|---|
| 46 | #define OBJ_PROTECTED 0x00000080U /* protect object */
|
|---|
| 47 | #define OBJ_GETTABLE 0x00000100U /* gettable by other processes */
|
|---|
| 48 | #define OBJ_GIVEABLE 0x00000200U /* giveable to other processes */
|
|---|
| 49 |
|
|---|
| 50 | /* Allocation type (returned from DosQueryMem) */
|
|---|
| 51 | #define PAG_SHARED 0x00002000U /* shared object */
|
|---|
| 52 | #define PAG_FREE 0x00004000U /* pages are free */
|
|---|
| 53 | #define PAG_BASE 0x00010000U /* first page in object */
|
|---|
| 54 |
|
|---|
| 55 | #endif
|
|---|
| 56 |
|
|---|
| 57 | #define OSLIB_ACCESS_READONLY 1
|
|---|
| 58 | #define OSLIB_ACCESS_READWRITE 2
|
|---|
| 59 | #define OSLIB_ACCESS_SHAREDENYNONE 4
|
|---|
| 60 | #define OSLIB_ACCESS_SHAREDENYREAD 8
|
|---|
| 61 | #define OSLIB_ACCESS_SHAREDENYWRITE 16
|
|---|
| 62 |
|
|---|
| 63 | DWORD OSLibDosOpen(char *lpszFileName, DWORD flags);
|
|---|
| 64 | DWORD OSLibDosClose(DWORD hFile);
|
|---|
| 65 | DWORD OSLibDosGetFileSize(DWORD hFile);
|
|---|
| 66 | DWORD OSLibDosRead(DWORD hFile, LPVOID lpBuffer, DWORD size, DWORD *nrBytesRead);
|
|---|
| 67 | DWORD OSLibDosWrite(DWORD hFile, LPVOID lpBuffer, DWORD size, DWORD *nrBytesWritten);
|
|---|
| 68 |
|
|---|
| 69 | #define OSLIB_SETPTR_FILE_CURRENT 1
|
|---|
| 70 | #define OSLIB_SETPTR_FILE_BEGIN 2
|
|---|
| 71 | #define OSLIB_SETPTR_FILE_END 3
|
|---|
| 72 |
|
|---|
| 73 | DWORD OSLibDosSetFilePtr(DWORD hFile, DWORD offset, DWORD method);
|
|---|
| 74 |
|
|---|
| 75 | #define OSLIB_SEARCHDIR 1
|
|---|
| 76 | #define OSLIB_SEARCHCURDIR 2
|
|---|
| 77 | #define OSLIB_SEARCHFILE 3
|
|---|
| 78 | #define OSLIB_SEARCHENV 4
|
|---|
| 79 |
|
|---|
| 80 | DWORD OSLibDosSearchPath(DWORD cmd, char *path, char *name, char *full_name, DWORD length_fullname);
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 | DWORD OSLibDosCreate(CHAR *lpFileName,
|
|---|
| 84 | DWORD dwAccess,
|
|---|
| 85 | DWORD dwShare,
|
|---|
| 86 | LPSECURITY_ATTRIBUTES lpSecurityAttributes,
|
|---|
| 87 | DWORD dwCreation,
|
|---|
| 88 | DWORD dwFlags,
|
|---|
| 89 | HANDLE hTemplate,
|
|---|
| 90 | DWORD *dwFile);
|
|---|
| 91 |
|
|---|
| 92 | DWORD OSLibDosResetBuffer(DWORD hFile);
|
|---|
| 93 | DWORD OSLibDosDupHandle(DWORD hFile, DWORD *hNew);
|
|---|
| 94 | DWORD OSLibDosSetFilePtr2(DWORD hFile, DWORD offset, DWORD method);
|
|---|
| 95 |
|
|---|
| 96 | #ifndef PAGE_SIZE
|
|---|
| 97 | #define PAGE_SIZE 4096
|
|---|
| 98 | #endif
|
|---|
| 99 |
|
|---|
| 100 | void OSLibDosDisableHardError(BOOL fTurnOff);
|
|---|
| 101 | BOOL OSLibDosQueryProcTimes(DWORD procid, ULONG *kerneltime, ULONG *usertime);
|
|---|
| 102 |
|
|---|
| 103 | #endif
|
|---|