Moves more stuff from windows.h.
[wine/multimedia.git] / include / winbase.h
blob8668da9a0a5699778989c179076699c061ab5e63
1 #ifndef __WINE_WINBASE_H
2 #define __WINE_WINBASE_H
4 #include "wintypes.h"
6 #pragma pack(1)
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
13 #define WAIT_FAILED 0xffffffff
14 #define WAIT_OBJECT_0 0
15 #define WAIT_ABANDONED STATUS_ABANDONED_WAIT_0
16 #define WAIT_ABANDONED_0 STATUS_ABANDONED_WAIT_0
17 #define WAIT_IO_COMPLETION STATUS_USER_APC
18 #define WAIT_TIMEOUT STATUS_TIMEOUT
20 #define PAGE_NOACCESS 0x01
21 #define PAGE_READONLY 0x02
22 #define PAGE_READWRITE 0x04
23 #define PAGE_WRITECOPY 0x08
24 #define PAGE_EXECUTE 0x10
25 #define PAGE_EXECUTE_READ 0x20
26 #define PAGE_EXECUTE_READWRITE 0x40
27 #define PAGE_EXECUTE_WRITECOPY 0x80
28 #define PAGE_GUARD 0x100
29 #define PAGE_NOCACHE 0x200
31 #define MEM_COMMIT 0x00001000
32 #define MEM_RESERVE 0x00002000
33 #define MEM_DECOMMIT 0x00004000
34 #define MEM_RELEASE 0x00008000
35 #define MEM_FREE 0x00010000
36 #define MEM_PRIVATE 0x00020000
37 #define MEM_MAPPED 0x00040000
38 #define MEM_TOP_DOWN 0x00100000
40 #define SEC_FILE 0x00800000
41 #define SEC_IMAGE 0x01000000
42 #define SEC_RESERVE 0x04000000
43 #define SEC_COMMIT 0x08000000
44 #define SEC_NOCACHE 0x10000000
46 #define FILE_BEGIN 0
47 #define FILE_CURRENT 1
48 #define FILE_END 2
50 #define FILE_CASE_SENSITIVE_SEARCH 0x00000001
51 #define FILE_CASE_PRESERVED_NAMES 0x00000002
52 #define FILE_UNICODE_ON_DISK 0x00000004
53 #define FILE_PERSISTENT_ACLS 0x00000008
55 #define FILE_MAP_COPY 0x00000001
56 #define FILE_MAP_WRITE 0x00000002
57 #define FILE_MAP_READ 0x00000004
58 #define FILE_MAP_ALL_ACCESS 0x000f001f
60 #define MOVEFILE_REPLACE_EXISTING 0x00000001
61 #define MOVEFILE_COPY_ALLOWED 0x00000002
62 #define MOVEFILE_DELAY_UNTIL_REBOOT 0x00000004
64 #define FS_CASE_SENSITIVE FILE_CASE_SENSITIVE_SEARCH
65 #define FS_CASE_IS_PRESERVED FILE_CASE_PRESERVED_NAMES
66 #define FS_UNICODE_STORED_ON_DISK FILE_UNICODE_ON_DISK
69 #define STATUS_SUCCESS 0x00000000
70 #define STATUS_WAIT_0 0x00000000
71 #define STATUS_ABANDONED_WAIT_0 0x00000080
72 #define STATUS_USER_APC 0x000000C0
73 #define STATUS_TIMEOUT 0x00000102
74 #define STATUS_PENDING 0x00000103
75 #define STATUS_GUARD_PAGE_VIOLATION 0x80000001
76 #define STATUS_DATATYPE_MISALIGNMENT 0x80000002
77 #define STATUS_BREAKPOINT 0x80000003
78 #define STATUS_SINGLE_STEP 0x80000004
79 #define STATUS_BUFFER_OVERFLOW 0x80000005
80 #define STATUS_ACCESS_VIOLATION 0xC0000005
81 #define STATUS_IN_PAGE_ERROR 0xC0000006
82 #define STATUS_INVALID_PARAMETER 0xC000000D
83 #define STATUS_NO_MEMORY 0xC0000017
84 #define STATUS_ILLEGAL_INSTRUCTION 0xC000001D
85 #define STATUS_BUFFER_TOO_SMALL 0xC0000023
86 #define STATUS_NONCONTINUABLE_EXCEPTION 0xC0000025
87 #define STATUS_INVALID_DISPOSITION 0xC0000026
88 #define STATUS_UNKNOWN_REVISION 0xC0000058
89 #define STATUS_INVALID_SECURITY_DESCR 0xC0000079
90 #define STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008C
91 #define STATUS_FLOAT_DENORMAL_OPERAND 0xC000008D
92 #define STATUS_FLOAT_DIVIDE_BY_ZERO 0xC000008E
93 #define STATUS_FLOAT_INEXACT_RESULT 0xC000008F
94 #define STATUS_FLOAT_INVALID_OPERATION 0xC0000090
95 #define STATUS_FLOAT_OVERFLOW 0xC0000091
96 #define STATUS_FLOAT_STACK_CHECK 0xC0000092
97 #define STATUS_FLOAT_UNDERFLOW 0xC0000093
98 #define STATUS_INTEGER_DIVIDE_BY_ZERO 0xC0000094
99 #define STATUS_INTEGER_OVERFLOW 0xC0000095
100 #define STATUS_PRIVILEGED_INSTRUCTION 0xC0000096
101 #define STATUS_INVALID_PARAMETER_2 0xC00000F0
102 #define STATUS_STACK_OVERFLOW 0xC00000FD
103 #define STATUS_CONTROL_C_EXIT 0xC000013A
105 #define DUPLICATE_CLOSE_SOURCE 0x00000001
106 #define DUPLICATE_SAME_ACCESS 0x00000002
108 #define HANDLE_FLAG_INHERIT 0x00000001
109 #define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x00000002
111 #define THREAD_PRIORITY_LOWEST THREAD_BASE_PRIORITY_MIN
112 #define THREAD_PRIORITY_BELOW_NORMAL (THREAD_PRIORITY_LOWEST+1)
113 #define THREAD_PRIORITY_NORMAL 0
114 #define THREAD_PRIORITY_HIGHEST THREAD_BASE_PRIORITY_MAX
115 #define THREAD_PRIORITY_ABOVE_NORMAL (THREAD_PRIORITY_HIGHEST-1)
116 #define THREAD_PRIORITY_ERROR_RETURN (0x7fffffff)
117 #define THREAD_PRIORITY_TIME_CRITICAL THREAD_BASE_PRIORITY_LOWRT
118 #define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE
120 typedef struct
122 int type;
123 } wine_exception;
125 typedef struct
127 int pad[39];
128 int edi;
129 int esi;
130 int ebx;
131 int edx;
132 int ecx;
133 int eax;
135 int ebp;
136 int eip;
137 int cs;
138 int eflags;
139 int esp;
140 int ss;
141 } exception_info;
143 /* Could this type be considered opaque? */
144 typedef struct {
145 LPVOID DebugInfo;
146 LONG LockCount;
147 LONG RecursionCount;
148 HANDLE32 OwningThread;
149 HANDLE32 LockSemaphore;
150 DWORD Reserved;
151 }CRITICAL_SECTION;
153 typedef struct {
154 DWORD dwOSVersionInfoSize;
155 DWORD dwMajorVersion;
156 DWORD dwMinorVersion;
157 DWORD dwBuildNumber;
158 DWORD dwPlatformId;
159 CHAR szCSDVersion[128];
160 } OSVERSIONINFO16;
162 typedef struct {
163 DWORD dwOSVersionInfoSize;
164 DWORD dwMajorVersion;
165 DWORD dwMinorVersion;
166 DWORD dwBuildNumber;
167 DWORD dwPlatformId;
168 CHAR szCSDVersion[128];
169 } OSVERSIONINFO32A;
171 typedef struct {
172 DWORD dwOSVersionInfoSize;
173 DWORD dwMajorVersion;
174 DWORD dwMinorVersion;
175 DWORD dwBuildNumber;
176 DWORD dwPlatformId;
177 WCHAR szCSDVersion[128];
178 } OSVERSIONINFO32W;
180 DECL_WINELIB_TYPE_AW(OSVERSIONINFO)
182 #define VER_PLATFORM_WIN32s 0
183 #define VER_PLATFORM_WIN32_WINDOWS 1
184 #define VER_PLATFORM_WIN32_NT 2
186 typedef struct tagCOMSTAT
188 BYTE status;
189 UINT16 cbInQue WINE_PACKED;
190 UINT16 cbOutQue WINE_PACKED;
191 } COMSTAT,*LPCOMSTAT;
193 typedef struct tagDCB16
195 BYTE Id;
196 UINT16 BaudRate WINE_PACKED;
197 BYTE ByteSize;
198 BYTE Parity;
199 BYTE StopBits;
200 UINT16 RlsTimeout;
201 UINT16 CtsTimeout;
202 UINT16 DsrTimeout;
204 UINT16 fBinary :1;
205 UINT16 fRtsDisable :1;
206 UINT16 fParity :1;
207 UINT16 fOutxCtsFlow :1;
208 UINT16 fOutxDsrFlow :1;
209 UINT16 fDummy :2;
210 UINT16 fDtrDisable :1;
212 UINT16 fOutX :1;
213 UINT16 fInX :1;
214 UINT16 fPeChar :1;
215 UINT16 fNull :1;
216 UINT16 fChEvt :1;
217 UINT16 fDtrflow :1;
218 UINT16 fRtsflow :1;
219 UINT16 fDummy2 :1;
221 CHAR XonChar;
222 CHAR XoffChar;
223 UINT16 XonLim;
224 UINT16 XoffLim;
225 CHAR PeChar;
226 CHAR EofChar;
227 CHAR EvtChar;
228 UINT16 TxDelay WINE_PACKED;
229 } DCB16, *LPDCB16;
231 typedef struct tagDCB32
233 DWORD DCBlength;
234 DWORD BaudRate;
235 DWORD fBinary :1;
236 DWORD fParity :1;
237 DWORD fOutxCtsFlow :1;
238 DWORD fOutxDsrFlow :1;
239 DWORD fDtrControl :2;
240 DWORD fDsrSensitivity :1;
241 DWORD fTXContinueOnXoff :1;
242 DWORD fOutX :1;
243 DWORD fInX :1;
244 DWORD fErrorChar :1;
245 DWORD fNull :1;
246 DWORD fRtsControl :2;
247 DWORD fAbortOnError :1;
248 DWORD fDummy2 :17;
249 WORD wReserved;
250 WORD XonLim;
251 WORD XoffLim;
252 BYTE ByteSize;
253 BYTE Parity;
254 BYTE StopBits;
255 char XonChar;
256 char XoffChar;
257 char ErrorChar;
258 char EofChar;
259 char EvtChar;
260 } DCB32, *LPDCB32;
262 DECL_WINELIB_TYPE(DCB)
263 DECL_WINELIB_TYPE(LPDCB)
266 typedef struct tagCOMMTIMEOUTS {
267 DWORD ReadIntervalTimeout;
268 DWORD ReadTotalTimeoutMultiplier;
269 DWORD ReadTotalTimeoutConstant;
270 DWORD WriteTotalTimeoutMultiplier;
271 DWORD WriteTotalTimeoutConstant;
272 } COMMTIMEOUTS,*LPCOMMTIMEOUTS;
274 #pragma pack(4)
276 BOOL32 WINAPI ClearCommError(INT32,LPDWORD,LPCOMSTAT);
277 BOOL32 WINAPI BuildCommDCB32A(LPCSTR,LPDCB32);
278 BOOL32 WINAPI BuildCommDCB32W(LPCWSTR,LPDCB32);
279 #define BuildCommDCB WINELIB_NAME_AW(BuildCommDCB)
280 BOOL32 WINAPI BuildCommDCBAndTimeouts32A(LPCSTR,LPDCB32,LPCOMMTIMEOUTS);
281 BOOL32 WINAPI BuildCommDCBAndTimeouts32W(LPCWSTR,LPDCB32,LPCOMMTIMEOUTS);
282 #define BuildCommDCBAndTimeouts WINELIB_NAME_AW(BuildCommDCBAndTimeouts)
283 BOOL32 WINAPI GetCommTimeouts(INT32,LPCOMMTIMEOUTS);
284 BOOL32 WINAPI SetCommTimeouts(INT32,LPCOMMTIMEOUTS);
285 BOOL32 WINAPI GetCommState32(INT32,LPDCB32);
286 #define GetCommState WINELIB_NAME(GetCommState)
287 BOOL32 WINAPI SetCommState32(INT32,LPDCB32);
288 #define SetCommState WINELIB_NAME(SetCommState)
289 BOOL32 WINAPI TransmitCommChar32(INT32,CHAR);
290 #define TransmitCommChar WINELIB_NAME(TransmitCommChar)
293 /*DWORD WINAPI GetVersion( void );*/
294 BOOL16 WINAPI GetVersionEx16(OSVERSIONINFO16*);
295 BOOL32 WINAPI GetVersionEx32A(OSVERSIONINFO32A*);
296 BOOL32 WINAPI GetVersionEx32W(OSVERSIONINFO32W*);
297 #define GetVersionEx WINELIB_NAME_AW(GetVersionEx)
299 /*int WinMain(HINSTANCE, HINSTANCE prev, char *cmd, int show);*/
301 void WINAPI DeleteCriticalSection(CRITICAL_SECTION *lpCrit);
302 void WINAPI EnterCriticalSection(CRITICAL_SECTION *lpCrit);
303 void WINAPI InitializeCriticalSection(CRITICAL_SECTION *lpCrit);
304 void WINAPI LeaveCriticalSection(CRITICAL_SECTION *lpCrit);
305 HANDLE32 WINAPI OpenProcess(DWORD access, BOOL32 inherit, DWORD id);
306 BOOL32 WINAPI GetProcessWorkingSetSize(HANDLE32,LPDWORD,LPDWORD);
307 BOOL32 WINAPI SetProcessWorkingSetSize(HANDLE32,DWORD,DWORD);
308 void WINAPI RaiseException(DWORD,DWORD,DWORD,const LPDWORD);
309 BOOL32 WINAPI TerminateProcess(HANDLE32,DWORD);
310 BOOL32 WINAPI TerminateThread(HANDLE32,DWORD);
313 /* GetBinaryType return values.
316 #define SCS_32BIT_BINARY 0
317 #define SCS_DOS_BINARY 1
318 #define SCS_WOW_BINARY 2
319 #define SCS_PIF_BINARY 3
320 #define SCS_POSIX_BINARY 4
321 #define SCS_OS216_BINARY 5
323 BOOL32 WINAPI GetBinaryType32A( LPCSTR lpApplicationName, LPDWORD lpBinaryType );
324 BOOL32 WINAPI GetBinaryType32W( LPCWSTR lpApplicationName, LPDWORD lpBinaryType );
325 #define GetBinaryType WINELIB_NAME_AW(GetBinaryType)
329 #ifdef __cplusplus
331 #endif
333 #endif /* __WINE_WINBASE_H */