source: trunk/src/kernel32/oslibdos.h@ 3602

Last change on this file since 3602 was 3593, checked in by sandervl, 25 years ago

some bugfixes + GetVolumeInformation rewrite

File size: 6.4 KB
Line 
1/* $Id: oslibdos.h,v 1.15 2000-05-23 18:45:13 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
16DWORD OSLibDosAliasMem(LPVOID pb, ULONG cb, LPVOID *ppbAlias, ULONG fl);
17DWORD OSLibDosAllocMem(LPVOID *lplpMemAddr, DWORD size, DWORD flags);
18DWORD OSLibDosFreeMem(LPVOID lpMemAddr);
19DWORD OSLibDosQueryMem(LPVOID lpMemAddr, DWORD *lpRangeSize, DWORD *lpAttr);
20DWORD OSLibDosSetMem(LPVOID lpMemAddr, DWORD size, DWORD flags);
21DWORD OSLibDosAllocSharedMem(LPVOID *lplpMemAddr, DWORD size, DWORD flags, LPSTR name);
22DWORD OSLibDosGetNamedSharedMem(LPVOID *lplpMemAddr, LPSTR name);
23DWORD OSLibDosChangeMaxFileHandles();
24
25#define ODIN_INCREMENT_MAX_FILEHANDLES 64
26#define ODIN_DEFAULT_MAX_FILEHANDLES 256
27DWORD OSLibDosSetInitialMaxFileHandles(DWORD maxhandles);
28
29BOOL OSLibDosGetFileAttributesEx(LPSTR pszName, ULONG ulDummy, PVOID pBuffer);
30
31#define OSLIB_NOERROR 0
32#define OSLIB_ERROR_INVALID_ADDRESS 1
33#define OSLIB_ERROR_ACCESS_DENIED 2
34#define OSLIB_ERROR_INVALID_PARAMETER 3
35
36#ifndef __OS2_H__
37
38/* Access protection */
39#define PAG_READ 0x00000001U /* read access */
40#define PAG_WRITE 0x00000002U /* write access */
41#define PAG_EXECUTE 0x00000004U /* execute access */
42#define PAG_GUARD 0x00000008U /* guard protection */
43#define PAG_DEFAULT 0x00000400U /* default (initial) access */
44
45/* Commit */
46#define PAG_COMMIT 0x00000010U /* commit storage */
47#define PAG_DECOMMIT 0x00000020U /* decommit storage */
48
49/* Allocation attributes */
50#define OBJ_TILE 0x00000040U /* tile object */
51#define OBJ_PROTECTED 0x00000080U /* protect object */
52#define OBJ_GETTABLE 0x00000100U /* gettable by other processes */
53#define OBJ_GIVEABLE 0x00000200U /* giveable to other processes */
54
55/* Allocation type (returned from DosQueryMem) */
56#define PAG_SHARED 0x00002000U /* shared object */
57#define PAG_FREE 0x00004000U /* pages are free */
58#define PAG_BASE 0x00010000U /* first page in object */
59
60#endif
61
62#define OSLIB_ACCESS_READONLY 1
63#define OSLIB_ACCESS_READWRITE 2
64#define OSLIB_ACCESS_SHAREDENYNONE 4
65#define OSLIB_ACCESS_SHAREDENYREAD 8
66#define OSLIB_ACCESS_SHAREDENYWRITE 16
67
68DWORD OSLibDosOpen(char *lpszFileName, DWORD flags);
69DWORD OSLibDosClose(DWORD hFile);
70DWORD OSLibDosGetFileSize(DWORD hFile);
71DWORD OSLibDosRead(DWORD hFile, LPVOID lpBuffer, DWORD size, DWORD *nrBytesRead);
72DWORD OSLibDosWrite(DWORD hFile, LPVOID lpBuffer, DWORD size, DWORD *nrBytesWritten);
73DWORD OSLibDosDelete(char *lpszFileName);
74
75#define OSLIB_SETPTR_FILE_CURRENT 1
76#define OSLIB_SETPTR_FILE_BEGIN 2
77#define OSLIB_SETPTR_FILE_END 3
78
79DWORD OSLibDosSetFilePtr(DWORD hFile, DWORD offset, DWORD method);
80
81#define OSLIB_SEARCHDIR 1
82#define OSLIB_SEARCHCURDIR 2
83#define OSLIB_SEARCHFILE 3
84#define OSLIB_SEARCHENV 4
85
86DWORD OSLibDosSearchPath(DWORD cmd, char *path, char *name, char *full_name, DWORD length_fullname);
87
88
89DWORD OSLibDosCreate(CHAR *lpFileName,
90 DWORD dwAccess,
91 DWORD dwShare,
92 LPSECURITY_ATTRIBUTES lpSecurityAttributes,
93 DWORD dwCreation,
94 DWORD dwFlags,
95 HANDLE hTemplate,
96 DWORD *dwFile);
97
98DWORD OSLibDosResetBuffer(DWORD hFile);
99DWORD OSLibDosDupHandle(DWORD hFile, DWORD *hNew);
100DWORD OSLibDosSetFilePtr2(DWORD hFile, DWORD offset, DWORD method);
101
102#ifndef PAGE_SIZE
103#define PAGE_SIZE 4096
104#endif
105
106void OSLibDosDisableHardError(BOOL fTurnOff);
107BOOL OSLibDosQueryProcTimes(DWORD procid, ULONG *kerneltime, ULONG *usertime);
108
109BOOL OSLibDosTransactNamedPipe( DWORD hNamedPipe,
110 LPVOID lpInBuffer,
111 DWORD nInBufferSize,
112 LPVOID lpOutBuffer,
113 DWORD nOutBufferSize,
114 LPDWORD lpBytesRead,
115 LPOVERLAPPED lpOverlapped);
116
117BOOL OSLibDosCallNamedPipe( LPCTSTR lpNamedPipeName,
118 LPVOID lpInBuffer,
119 DWORD nInBufferSize,
120 LPVOID lpOutBuffer,
121 DWORD nOutBufferSize,
122 LPDWORD lpBytesRead,
123 DWORD nTimeOut );
124
125BOOL OSLibDosPeekNamedPipe(DWORD hPipe,
126 LPVOID lpvBuffer,
127 DWORD cbBuffer,
128 LPDWORD lpcbRead,
129 LPDWORD lpcbAvail,
130 LPDWORD lpcbMessage);
131
132BOOL OSLibDosConnectNamedPipe(DWORD hNamedPipe, LPOVERLAPPED lpOverlapped);
133
134DWORD OSLibDosCreateNamedPipe(LPCTSTR lpName,
135 DWORD dwOpenMode,
136 DWORD dwPipeMode,
137 DWORD nMaxInstances,
138 DWORD nOutBufferSize,
139 DWORD nInBufferSize,
140 DWORD nDefaultTimeOut,
141 void* lpSecurityAttributes);
142
143BOOL OSLibDosWaitNamedPipe(LPCSTR lpszNamedPipeName,
144 DWORD dwTimeout);
145
146BOOL OSLibDosDisconnectNamedPipe(DWORD hPipe);
147
148DWORD OSLibDosFindFirst(LPCSTR lpFileName,WIN32_FIND_DATAA* lpFindFileData);
149DWORD OSLibDosFindFirstMulti(LPCSTR lpFileName,WIN32_FIND_DATAA *lpFindFileData,DWORD *count);
150BOOL OSLibDosFindNext(DWORD hFindFile,WIN32_FIND_DATAA* lpFindFileData);
151BOOL OSLibDosFindNextMulti(DWORD hFindFile,WIN32_FIND_DATAA *lpFindFileData,DWORD *count);
152BOOL OSLibDosFindClose(DWORD hFindFile);
153
154DWORD OSLibDosQueryVolumeFS(int drive, LPSTR lpFileSystemNameBuffer, DWORD nFileSystemNameSize);
155DWORD OSLibDosQueryVolumeSerialAndName(int drive, LPDWORD lpVolumeSerialNumber, LPSTR lpVolumeNameBuffer, DWORD nVolumeNameSize);
156
157
158#endif
Note: See TracBrowser for help on using the repository browser.