Alexandre Julliard | 329f068 | 1996-04-14 13:21:20 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Win32 definitions for Windows NT |
| 3 | * |
| 4 | * Copyright 1996 Alexandre Julliard |
| 5 | */ |
| 6 | |
| 7 | #ifndef __WINE_WINNT_H |
| 8 | #define __WINE_WINNT_H |
| 9 | |
Jeremy White | ccc0a80 | 2000-08-02 01:00:02 +0000 | [diff] [blame] | 10 | #include "basetsd.h" |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 11 | |
Francois Gouget | b42ed54 | 2000-04-24 18:02:02 +0000 | [diff] [blame] | 12 | #ifndef RC_INVOKED |
Francois Gouget | 7a38452 | 2000-11-08 05:03:15 +0000 | [diff] [blame] | 13 | #include <ctype.h> |
François Gouget | 5051020 | 2000-12-19 04:50:49 +0000 | [diff] [blame] | 14 | #include <stddef.h> |
Francois Gouget | 7a2da17 | 2001-04-10 23:23:31 +0000 | [diff] [blame] | 15 | #include <string.h> |
Francois Gouget | b42ed54 | 2000-04-24 18:02:02 +0000 | [diff] [blame] | 16 | #endif |
| 17 | |
François Gouget | 7d64676 | 2000-12-15 21:31:03 +0000 | [diff] [blame] | 18 | |
| 19 | /* On Windows winnt.h depends on a few windef.h types and macros and thus |
| 20 | * is not self-contained. Furthermore windef.h includes winnt.h so that it |
| 21 | * would be pointless to try to use winnt.h directly. |
| 22 | * But for Wine and Winelib I decided to make winnt.h self-contained by |
| 23 | * moving these definitions to winnt.h. It makes no difference to Winelib |
| 24 | * programs since they are not using winnt.h directly anyway, and it allows |
| 25 | * us to use winnt.h and get a minimal set of definitions. |
| 26 | */ |
| 27 | |
| 28 | /**** Some Wine specific definitions *****/ |
| 29 | |
Ulrich Weigand | 15f9680 | 2001-01-11 00:54:21 +0000 | [diff] [blame] | 30 | /* Architecture dependent settings. */ |
| 31 | /* These are hardcoded to avoid dependencies on config.h in Winelib apps. */ |
| 32 | #if defined(__i386__) |
| 33 | # undef WORDS_BIGENDIAN |
| 34 | # undef BITFIELDS_BIGENDIAN |
| 35 | # define ALLOW_UNALIGNED_ACCESS |
| 36 | #elif defined(__sparc__) |
| 37 | # define WORDS_BIGENDIAN |
| 38 | # define BITFIELDS_BIGENDIAN |
| 39 | # undef ALLOW_UNALIGNED_ACCESS |
Josh DuBois | 4b1eb51 | 2001-02-13 01:50:38 +0000 | [diff] [blame] | 40 | #elif defined(__PPC__) |
| 41 | # define WORDS_BIGENDIAN |
| 42 | # define BITFIELDS_BIGENDIAN |
| 43 | # undef ALLOW_UNALIGNED_ACCESS |
Ulrich Weigand | 15f9680 | 2001-01-11 00:54:21 +0000 | [diff] [blame] | 44 | #elif !defined(RC_INVOKED) |
| 45 | # error Unknown CPU architecture! |
| 46 | #endif |
| 47 | |
| 48 | |
François Gouget | 7d64676 | 2000-12-15 21:31:03 +0000 | [diff] [blame] | 49 | /* Calling conventions definitions */ |
| 50 | |
| 51 | #ifdef __i386__ |
| 52 | # ifndef _X86_ |
| 53 | # define _X86_ |
| 54 | # endif |
| 55 | # if defined(__GNUC__) && ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7))) |
| 56 | # define __stdcall __attribute__((__stdcall__)) |
| 57 | # define __cdecl __attribute__((__cdecl__)) |
| 58 | # else |
| 59 | # error You need gcc >= 2.7 to build Wine on a 386 |
| 60 | # endif /* __GNUC__ */ |
| 61 | #else /* __i386__ */ |
| 62 | # define __stdcall |
| 63 | # define __cdecl |
| 64 | #endif /* __i386__ */ |
| 65 | |
| 66 | #ifndef __WINE__ |
| 67 | #define pascal __stdcall |
| 68 | #define _pascal __stdcall |
| 69 | #define _stdcall __stdcall |
| 70 | #define _fastcall __stdcall |
| 71 | #define __fastcall __stdcall |
| 72 | #define __export __stdcall |
| 73 | #define cdecl __cdecl |
| 74 | #define _cdecl __cdecl |
| 75 | |
| 76 | #define near |
| 77 | #define far |
| 78 | #define _near |
| 79 | #define _far |
| 80 | #define NEAR |
| 81 | #define FAR |
| 82 | |
| 83 | #ifndef _declspec |
| 84 | #define _declspec(x) |
| 85 | #endif |
| 86 | #ifndef __declspec |
| 87 | #define __declspec(x) |
| 88 | #endif |
| 89 | #endif /* __WINE__ */ |
| 90 | |
| 91 | #define CALLBACK __stdcall |
| 92 | #define WINAPI __stdcall |
| 93 | #define APIPRIVATE __stdcall |
| 94 | #define PASCAL __stdcall |
| 95 | #define CDECL __cdecl |
| 96 | #define _CDECL __cdecl |
| 97 | #define WINAPIV __cdecl |
| 98 | #define APIENTRY WINAPI |
| 99 | #define CONST const |
| 100 | |
| 101 | /* Macro for structure packing and more. */ |
| 102 | |
| 103 | #ifdef __GNUC__ |
| 104 | #define WINE_PACKED __attribute__((packed)) |
| 105 | #define WINE_UNUSED __attribute__((unused)) |
| 106 | #define WINE_NORETURN __attribute__((noreturn)) |
| 107 | #else |
| 108 | #define WINE_PACKED /* nothing */ |
| 109 | #define WINE_UNUSED /* nothing */ |
| 110 | #define WINE_NORETURN /* nothing */ |
| 111 | #endif |
| 112 | |
| 113 | /* Anonymous union/struct handling */ |
| 114 | |
| 115 | #ifdef __WINE__ |
| 116 | # define NONAMELESSSTRUCT |
| 117 | # define NONAMELESSUNION |
| 118 | #else |
| 119 | /* Anonymous struct support starts with gcc/g++ 2.96 */ |
| 120 | # if !defined(NONAMELESSSTRUCT) && defined(__GNUC__) && ((__GNUC__ < 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ < 96))) |
| 121 | # define NONAMELESSSTRUCT |
| 122 | # endif |
| 123 | /* Anonymous unions support starts with gcc 2.96/g++ 2.95 */ |
| 124 | # if !defined(NONAMELESSUNION) && defined(__GNUC__) && ((__GNUC__ < 2) || ((__GNUC__ == 2) && ((__GNUC_MINOR__ < 95) || ((__GNUC_MINOR__ == 95) && !defined(__cplusplus))))) |
| 125 | # define NONAMELESSUNION |
| 126 | # endif |
| 127 | #endif |
| 128 | |
| 129 | #ifndef NONAMELESSSTRUCT |
| 130 | #define DUMMYSTRUCTNAME |
| 131 | #define DUMMYSTRUCTNAME1 |
| 132 | #define DUMMYSTRUCTNAME2 |
| 133 | #define DUMMYSTRUCTNAME3 |
| 134 | #define DUMMYSTRUCTNAME4 |
| 135 | #define DUMMYSTRUCTNAME5 |
| 136 | #else /* !defined(NONAMELESSSTRUCT) */ |
| 137 | #define DUMMYSTRUCTNAME s |
| 138 | #define DUMMYSTRUCTNAME1 s1 |
| 139 | #define DUMMYSTRUCTNAME2 s2 |
| 140 | #define DUMMYSTRUCTNAME3 s3 |
| 141 | #define DUMMYSTRUCTNAME4 s4 |
| 142 | #define DUMMYSTRUCTNAME5 s5 |
| 143 | #endif /* !defined(NONAMELESSSTRUCT) */ |
| 144 | |
| 145 | #ifndef NONAMELESSUNION |
| 146 | #define DUMMYUNIONNAME |
| 147 | #define DUMMYUNIONNAME1 |
| 148 | #define DUMMYUNIONNAME2 |
| 149 | #define DUMMYUNIONNAME3 |
| 150 | #define DUMMYUNIONNAME4 |
| 151 | #define DUMMYUNIONNAME5 |
| 152 | #define DUMMYUNIONNAME6 |
| 153 | #define DUMMYUNIONNAME7 |
| 154 | #define DUMMYUNIONNAME8 |
| 155 | #else /* !defined(NONAMELESSUNION) */ |
| 156 | #define DUMMYUNIONNAME u |
| 157 | #define DUMMYUNIONNAME1 u1 |
| 158 | #define DUMMYUNIONNAME2 u2 |
| 159 | #define DUMMYUNIONNAME3 u3 |
| 160 | #define DUMMYUNIONNAME4 u4 |
| 161 | #define DUMMYUNIONNAME5 u5 |
| 162 | #define DUMMYUNIONNAME6 u6 |
| 163 | #define DUMMYUNIONNAME7 u7 |
| 164 | #define DUMMYUNIONNAME8 u8 |
| 165 | #endif /* !defined(NONAMELESSUNION) */ |
| 166 | |
| 167 | |
| 168 | /**** Parts of windef.h that are needed here *****/ |
| 169 | |
| 170 | /* Misc. constants. */ |
| 171 | |
| 172 | #undef NULL |
| 173 | #ifdef __cplusplus |
| 174 | #define NULL 0 |
| 175 | #else |
| 176 | #define NULL ((void*)0) |
| 177 | #endif |
| 178 | |
| 179 | #ifdef FALSE |
| 180 | #undef FALSE |
| 181 | #endif |
| 182 | #define FALSE 0 |
| 183 | |
| 184 | #ifdef TRUE |
| 185 | #undef TRUE |
| 186 | #endif |
| 187 | #define TRUE 1 |
| 188 | |
| 189 | #ifndef IN |
| 190 | #define IN |
| 191 | #endif |
| 192 | |
| 193 | #ifndef OUT |
| 194 | #define OUT |
| 195 | #endif |
| 196 | |
| 197 | #ifndef OPTIONAL |
| 198 | #define OPTIONAL |
| 199 | #endif |
| 200 | |
| 201 | /* Standard data types */ |
| 202 | typedef const void *PCVOID, *LPCVOID; |
| 203 | typedef int BOOL, *PBOOL, *LPBOOL; |
| 204 | typedef unsigned char BYTE, *PBYTE, *LPBYTE; |
| 205 | typedef unsigned char UCHAR, *PUCHAR; |
| 206 | typedef unsigned short USHORT, *PUSHORT, *LPUSHORT; |
| 207 | typedef unsigned short WORD, *PWORD, *LPWORD; |
| 208 | typedef int INT, *PINT, *LPINT; |
| 209 | typedef unsigned int UINT, *PUINT, *LPUINT; |
| 210 | typedef unsigned long DWORD, *PDWORD, *LPDWORD; |
| 211 | typedef unsigned long ULONG, *PULONG, *LPULONG; |
| 212 | typedef float FLOAT, *PFLOAT, *LPFLOAT; |
| 213 | typedef double DOUBLE, *PDOUBLE, *LPDOUBLE; |
| 214 | typedef double DATE; |
| 215 | |
| 216 | |
| 217 | /**** winnt.h proper *****/ |
| 218 | |
François Gouget | 42b3ee7 | 2000-12-19 02:09:52 +0000 | [diff] [blame] | 219 | /* Microsoft's macros for declaring functions */ |
| 220 | |
| 221 | #ifdef __cplusplus |
| 222 | # define EXTERN_C extern "C" |
| 223 | #else |
| 224 | # define EXTERN_C extern |
| 225 | #endif |
| 226 | |
| 227 | #ifndef __WINE__ |
| 228 | #define STDMETHODCALLTYPE __stdcall |
| 229 | #define STDMETHODVCALLTYPE __cdecl |
| 230 | #define STDAPICALLTYPE __stdcall |
| 231 | #define STDAPIVCALLTYPE __cdecl |
| 232 | |
| 233 | #define STDAPI EXTERN_C HRESULT STDAPICALLTYPE |
| 234 | #define STDAPI_(type) EXTERN_C type STDAPICALLTYPE |
| 235 | #define STDMETHODIMP HRESULT STDMETHODCALLTYPE |
| 236 | #define STDMETHODIMP_(type) type STDMETHODCALLTYPE |
| 237 | #define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE |
| 238 | #define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE |
| 239 | #define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE |
| 240 | #define STDMETHODIMPV_(type) type STDMETHODVCALLTYPE |
| 241 | #endif |
| 242 | |
François Gouget | 7d64676 | 2000-12-15 21:31:03 +0000 | [diff] [blame] | 243 | /* Define the basic types */ |
| 244 | #ifndef VOID |
| 245 | #define VOID void |
| 246 | #endif |
| 247 | typedef VOID *PVOID, *LPVOID; |
| 248 | typedef BYTE BOOLEAN, *PBOOLEAN; |
| 249 | typedef char CHAR, *PCHAR; |
François Gouget | 7d64676 | 2000-12-15 21:31:03 +0000 | [diff] [blame] | 250 | typedef short SHORT, *PSHORT; |
| 251 | typedef long LONG, *PLONG, *LPLONG; |
| 252 | |
François Gouget | 5051020 | 2000-12-19 04:50:49 +0000 | [diff] [blame] | 253 | /* Some systems might have wchar_t, but we really need 16 bit characters */ |
Francois Gouget | 7a2da17 | 2001-04-10 23:23:31 +0000 | [diff] [blame] | 254 | #ifndef WINE_WCHAR_DEFINED |
François Gouget | 5051020 | 2000-12-19 04:50:49 +0000 | [diff] [blame] | 255 | #ifdef WINE_UNICODE_NATIVE |
| 256 | typedef wchar_t WCHAR, *PWCHAR; |
| 257 | #else |
| 258 | typedef unsigned short WCHAR, *PWCHAR; |
| 259 | #endif |
Francois Gouget | 7a2da17 | 2001-04-10 23:23:31 +0000 | [diff] [blame] | 260 | #define WINE_WCHAR_DEFINED |
| 261 | #endif |
François Gouget | 5051020 | 2000-12-19 04:50:49 +0000 | [diff] [blame] | 262 | |
François Gouget | 7d64676 | 2000-12-15 21:31:03 +0000 | [diff] [blame] | 263 | /* 'Extended/Wide' numerical types */ |
| 264 | #ifndef _ULONGLONG_ |
| 265 | #define _ULONGLONG_ |
| 266 | typedef __int64 LONGLONG, *PLONGLONG; |
| 267 | typedef __uint64 ULONGLONG, *PULONGLONG; |
| 268 | #endif |
| 269 | |
| 270 | #ifndef _DWORDLONG_ |
| 271 | #define _DWORDLONG_ |
| 272 | typedef ULONGLONG DWORDLONG, *PDWORDLONG; |
| 273 | #endif |
| 274 | |
| 275 | /* ANSI string types */ |
| 276 | typedef CHAR *PCH, *LPCH; |
| 277 | typedef const CHAR *PCCH, *LPCCH; |
| 278 | typedef CHAR *PSTR, *LPSTR; |
| 279 | typedef const CHAR *PCSTR, *LPCSTR; |
| 280 | |
| 281 | /* Unicode string types */ |
| 282 | typedef WCHAR *PWCH, *LPWCH; |
| 283 | typedef const WCHAR *PCWCH, *LPCWCH; |
| 284 | typedef WCHAR *PWSTR, *LPWSTR; |
| 285 | typedef const WCHAR *PCWSTR, *LPCWSTR; |
| 286 | |
| 287 | /* Neutral character and string types */ |
François Gouget | 5051020 | 2000-12-19 04:50:49 +0000 | [diff] [blame] | 288 | /* These are only defined for Winelib, i.e. _not_ defined for |
François Gouget | 7d64676 | 2000-12-15 21:31:03 +0000 | [diff] [blame] | 289 | * the emulator. The reason is they depend on the UNICODE |
| 290 | * macro which only exists in the user's code. |
| 291 | */ |
| 292 | #ifndef __WINE__ |
François Gouget | 5051020 | 2000-12-19 04:50:49 +0000 | [diff] [blame] | 293 | # ifdef WINE_UNICODE_REWRITE |
François Gouget | 880cd39 | 2001-02-28 05:18:54 +0000 | [diff] [blame] | 294 | |
| 295 | /* Use this if your compiler does not provide a 16bit wchar_t type. |
| 296 | * Note that you will need to specify -fwritable-strings or an option |
| 297 | * to this effect. |
| 298 | * In C++ both WINE_UNICODE_TEXT('c') and WINE_UNICODE_TEXT("str") are |
| 299 | * supported, but only the string form can be supported in C. |
| 300 | */ |
François Gouget | 5051020 | 2000-12-19 04:50:49 +0000 | [diff] [blame] | 301 | EXTERN_C unsigned short* wine_rewrite_s4tos2(const wchar_t* str4); |
| 302 | # ifdef __cplusplus |
| 303 | inline WCHAR* wine_unicode_text(const wchar_t* str4) |
| 304 | { |
| 305 | return (WCHAR*)wine_rewrite_s4tos2(str4); |
| 306 | } |
| 307 | inline WCHAR wine_unicode_text(wchar_t chr4) |
| 308 | { |
| 309 | return (WCHAR)chr4; |
| 310 | } |
| 311 | # define WINE_UNICODE_TEXT(x) wine_unicode_text(L##x) |
| 312 | # else /* __cplusplus */ |
François Gouget | 880cd39 | 2001-02-28 05:18:54 +0000 | [diff] [blame] | 313 | # define WINE_UNICODE_TEXT(x) ((WCHAR*)wine_rewrite_s4tos2(L##x)) |
François Gouget | 5051020 | 2000-12-19 04:50:49 +0000 | [diff] [blame] | 314 | # endif /* __cplusplus */ |
François Gouget | 880cd39 | 2001-02-28 05:18:54 +0000 | [diff] [blame] | 315 | |
François Gouget | 5051020 | 2000-12-19 04:50:49 +0000 | [diff] [blame] | 316 | # else /* WINE_UNICODE_REWRITE */ |
François Gouget | 880cd39 | 2001-02-28 05:18:54 +0000 | [diff] [blame] | 317 | |
| 318 | /* Define WINE_UNICODE_NATIVE if: |
| 319 | * - your compiler provides a 16bit wchar_t type, e.g. gcc >= 2.96 with |
| 320 | * -fshort-wchar option |
| 321 | * - or if you decide to use the native 32bit Unix wchar_t type. Be aware |
| 322 | * though that the Wine APIs only support 16bit WCHAR characters for |
| 323 | * binary compatibility reasons. |
| 324 | * - or define nothing at all if you don't use Unicode, and blissfully |
| 325 | * ignore the issue :-) |
| 326 | */ |
François Gouget | 5051020 | 2000-12-19 04:50:49 +0000 | [diff] [blame] | 327 | # define WINE_UNICODE_TEXT(string) L##string |
François Gouget | 880cd39 | 2001-02-28 05:18:54 +0000 | [diff] [blame] | 328 | |
François Gouget | 5051020 | 2000-12-19 04:50:49 +0000 | [diff] [blame] | 329 | # endif /* WINE_UNICODE_REWRITE */ |
| 330 | |
François Gouget | 7d64676 | 2000-12-15 21:31:03 +0000 | [diff] [blame] | 331 | # ifdef UNICODE |
| 332 | typedef WCHAR TCHAR, *PTCHAR; |
| 333 | typedef LPWSTR PTSTR, LPTSTR; |
| 334 | typedef LPCWSTR PCTSTR, LPCTSTR; |
François Gouget | 5051020 | 2000-12-19 04:50:49 +0000 | [diff] [blame] | 335 | # define __TEXT(string) WINE_UNICODE_TEXT(string) |
François Gouget | 7d64676 | 2000-12-15 21:31:03 +0000 | [diff] [blame] | 336 | # else /* UNICODE */ |
| 337 | typedef CHAR TCHAR, *PTCHAR; |
| 338 | typedef LPSTR PTSTR, LPTSTR; |
| 339 | typedef LPCSTR PCTSTR, LPCTSTR; |
| 340 | # define __TEXT(string) string |
| 341 | # endif /* UNICODE */ |
François Gouget | 5051020 | 2000-12-19 04:50:49 +0000 | [diff] [blame] | 342 | # define TEXT(quote) __TEXT(quote) |
François Gouget | 7d64676 | 2000-12-15 21:31:03 +0000 | [diff] [blame] | 343 | #endif /* __WINE__ */ |
François Gouget | 7d64676 | 2000-12-15 21:31:03 +0000 | [diff] [blame] | 344 | |
| 345 | /* Misc common WIN32 types */ |
| 346 | typedef LONG HRESULT; |
| 347 | typedef DWORD LCID, *PLCID; |
| 348 | typedef WORD LANGID; |
James Juran | 7313b78 | 2001-03-13 23:33:26 +0000 | [diff] [blame] | 349 | typedef DWORD EXECUTION_STATE; |
François Gouget | 7d64676 | 2000-12-15 21:31:03 +0000 | [diff] [blame] | 350 | |
| 351 | /* Handle type */ |
| 352 | |
| 353 | /* FIXME: Wine does not compile with strict on, therefore strict |
| 354 | * handles are presently only usable on machines where sizeof(UINT) == |
| 355 | * sizeof(void*). HANDLEs are supposed to be void* but a large amount |
| 356 | * of WINE code operates on HANDLES as if they are UINTs. So to WINE |
| 357 | * they exist as UINTs but to the Winelib user who turns on strict, |
| 358 | * they exist as void*. If there is a size difference between UINT and |
François Gouget | 4543703 | 2000-12-26 00:07:25 +0000 | [diff] [blame] | 359 | * void* then things get ugly. |
| 360 | * |
| 361 | * Here is the plan to convert Wine to STRICT: |
| 362 | * |
| 363 | * Types will be converted one at a time by volunteers who will compile |
| 364 | * Wine with STRICT turned on. Handles that have not been converted yet |
| 365 | * will be declared with DECLARE_OLD_HANDLE. Converted handles are |
| 366 | * declared with DECLARE_HANDLE. |
| 367 | * See the bug report 90 for more details: |
| 368 | * http://wine.codeweavers.com/bugzilla/show_bug.cgi?id=90 |
| 369 | */ |
| 370 | /* |
| 371 | * when compiling Wine we always treat HANDLE as an UINT. Then when |
| 372 | * we're ready we'll remove the '!defined(__WINE__)' (the equivalent |
| 373 | * of converting it from DECLARE_OLD_HANDLE to DECLARE_HANDLE). |
| 374 | */ |
| 375 | #if defined(STRICT) && !defined(__WINE__) |
François Gouget | 7d64676 | 2000-12-15 21:31:03 +0000 | [diff] [blame] | 376 | typedef VOID* HANDLE; |
François Gouget | 4543703 | 2000-12-26 00:07:25 +0000 | [diff] [blame] | 377 | #define DECLARE_OLD_HANDLE(a) \ |
| 378 | typedef struct a##__ { int unused; } *a; \ |
| 379 | typedef a *P##a, *LP##a |
| 380 | |
François Gouget | 7d64676 | 2000-12-15 21:31:03 +0000 | [diff] [blame] | 381 | #else |
| 382 | typedef UINT HANDLE; |
François Gouget | 4543703 | 2000-12-26 00:07:25 +0000 | [diff] [blame] | 383 | #define DECLARE_OLD_HANDLE(a) \ |
| 384 | typedef HANDLE a; \ |
| 385 | typedef a *P##a, *LP##a |
François Gouget | 7d64676 | 2000-12-15 21:31:03 +0000 | [diff] [blame] | 386 | #endif |
François Gouget | 4543703 | 2000-12-26 00:07:25 +0000 | [diff] [blame] | 387 | typedef HANDLE *PHANDLE, *LPHANDLE; |
François Gouget | 7d64676 | 2000-12-15 21:31:03 +0000 | [diff] [blame] | 388 | |
| 389 | #ifdef STRICT |
| 390 | #define DECLARE_HANDLE(a) \ |
François Gouget | 4543703 | 2000-12-26 00:07:25 +0000 | [diff] [blame] | 391 | typedef struct a##__ { int unused; } *a; \ |
| 392 | typedef a *P##a, *LP##a |
François Gouget | 7d64676 | 2000-12-15 21:31:03 +0000 | [diff] [blame] | 393 | #else /*STRICT*/ |
| 394 | #define DECLARE_HANDLE(a) \ |
François Gouget | 4543703 | 2000-12-26 00:07:25 +0000 | [diff] [blame] | 395 | typedef HANDLE a; \ |
| 396 | typedef a *P##a, *LP##a |
François Gouget | 7d64676 | 2000-12-15 21:31:03 +0000 | [diff] [blame] | 397 | #endif /*STRICT*/ |
| 398 | |
| 399 | |
Patrik Stridvall | c7a8dde | 1999-04-25 12:36:53 +0000 | [diff] [blame] | 400 | #include "pshpack1.h" |
Patrik Stridvall | 56d52aa | 1998-11-14 18:24:37 +0000 | [diff] [blame] | 401 | /* Defines */ |
| 402 | |
Michael Veksler | 17822f4 | 1999-02-09 15:46:25 +0000 | [diff] [blame] | 403 | /* Argument 1 passed to the DllEntryProc. */ |
| 404 | #define DLL_PROCESS_DETACH 0 /* detach process (unload library) */ |
| 405 | #define DLL_PROCESS_ATTACH 1 /* attach process (load library) */ |
| 406 | #define DLL_THREAD_ATTACH 2 /* attach new thread */ |
| 407 | #define DLL_THREAD_DETACH 3 /* detach thread */ |
| 408 | |
| 409 | |
| 410 | /* u.x.wProcessorArchitecture (NT) */ |
Marcus Meissner | 4a0af42 | 1999-07-31 19:22:25 +0000 | [diff] [blame] | 411 | #define PROCESSOR_ARCHITECTURE_INTEL 0 |
| 412 | #define PROCESSOR_ARCHITECTURE_MIPS 1 |
| 413 | #define PROCESSOR_ARCHITECTURE_ALPHA 2 |
| 414 | #define PROCESSOR_ARCHITECTURE_PPC 3 |
| 415 | #define PROCESSOR_ARCHITECTURE_SHX 4 |
| 416 | #define PROCESSOR_ARCHITECTURE_ARM 5 |
| 417 | #define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF |
Michael Veksler | 17822f4 | 1999-02-09 15:46:25 +0000 | [diff] [blame] | 418 | |
| 419 | /* dwProcessorType */ |
Marcus Meissner | 4a0af42 | 1999-07-31 19:22:25 +0000 | [diff] [blame] | 420 | #define PROCESSOR_INTEL_386 386 |
| 421 | #define PROCESSOR_INTEL_486 486 |
| 422 | #define PROCESSOR_INTEL_PENTIUM 586 |
| 423 | #define PROCESSOR_INTEL_860 860 |
| 424 | #define PROCESSOR_MIPS_R2000 2000 |
| 425 | #define PROCESSOR_MIPS_R3000 3000 |
| 426 | #define PROCESSOR_MIPS_R4000 4000 |
| 427 | #define PROCESSOR_ALPHA_21064 21064 |
| 428 | #define PROCESSOR_PPC_601 601 |
| 429 | #define PROCESSOR_PPC_603 603 |
| 430 | #define PROCESSOR_PPC_604 604 |
| 431 | #define PROCESSOR_PPC_620 620 |
| 432 | #define PROCESSOR_HITACHI_SH3 10003 |
| 433 | #define PROCESSOR_HITACHI_SH3E 10004 |
| 434 | #define PROCESSOR_HITACHI_SH4 10005 |
| 435 | #define PROCESSOR_MOTOROLA_821 821 |
| 436 | #define PROCESSOR_SHx_SH3 103 |
| 437 | #define PROCESSOR_SHx_SH4 104 |
| 438 | #define PROCESSOR_STRONGARM 2577 |
| 439 | #define PROCESSOR_ARM720 1824 /* 0x720 */ |
| 440 | #define PROCESSOR_ARM820 2080 /* 0x820 */ |
| 441 | #define PROCESSOR_ARM920 2336 /* 0x920 */ |
| 442 | #define PROCESSOR_ARM_7TDMI 70001 |
Michael Veksler | 17822f4 | 1999-02-09 15:46:25 +0000 | [diff] [blame] | 443 | |
Francois Gouget | 5353224 | 2000-05-24 21:03:48 +0000 | [diff] [blame] | 444 | typedef struct _MEMORY_BASIC_INFORMATION |
| 445 | { |
| 446 | LPVOID BaseAddress; |
| 447 | LPVOID AllocationBase; |
| 448 | DWORD AllocationProtect; |
| 449 | DWORD RegionSize; |
| 450 | DWORD State; |
| 451 | DWORD Protect; |
| 452 | DWORD Type; |
| 453 | } MEMORY_BASIC_INFORMATION,*LPMEMORY_BASIC_INFORMATION,*PMEMORY_BASIC_INFORMATION; |
| 454 | |
| 455 | #define PAGE_NOACCESS 0x01 |
| 456 | #define PAGE_READONLY 0x02 |
| 457 | #define PAGE_READWRITE 0x04 |
| 458 | #define PAGE_WRITECOPY 0x08 |
| 459 | #define PAGE_EXECUTE 0x10 |
| 460 | #define PAGE_EXECUTE_READ 0x20 |
| 461 | #define PAGE_EXECUTE_READWRITE 0x40 |
| 462 | #define PAGE_EXECUTE_WRITECOPY 0x80 |
| 463 | #define PAGE_GUARD 0x100 |
| 464 | #define PAGE_NOCACHE 0x200 |
| 465 | |
| 466 | #define MEM_COMMIT 0x00001000 |
| 467 | #define MEM_RESERVE 0x00002000 |
| 468 | #define MEM_DECOMMIT 0x00004000 |
| 469 | #define MEM_RELEASE 0x00008000 |
| 470 | #define MEM_FREE 0x00010000 |
| 471 | #define MEM_PRIVATE 0x00020000 |
| 472 | #define MEM_MAPPED 0x00040000 |
| 473 | #define MEM_RESET 0x00080000 |
| 474 | #define MEM_TOP_DOWN 0x00100000 |
| 475 | #ifdef __WINE__ |
| 476 | #define MEM_SYSTEM 0x80000000 |
| 477 | #endif |
| 478 | |
| 479 | #define SEC_FILE 0x00800000 |
| 480 | #define SEC_IMAGE 0x01000000 |
| 481 | #define SEC_RESERVE 0x04000000 |
| 482 | #define SEC_COMMIT 0x08000000 |
| 483 | #define SEC_NOCACHE 0x10000000 |
| 484 | #define MEM_IMAGE SEC_IMAGE |
| 485 | |
| 486 | |
Paul Quinn | ea1640f | 1999-03-10 18:03:53 +0000 | [diff] [blame] | 487 | #define MINCHAR 0x80 |
| 488 | #define MAXCHAR 0x7f |
| 489 | #define MINSHORT 0x8000 |
| 490 | #define MAXSHORT 0x7fff |
| 491 | #define MINLONG 0x80000000 |
| 492 | #define MAXLONG 0x7fffffff |
| 493 | #define MAXBYTE 0xff |
| 494 | #define MAXWORD 0xffff |
| 495 | #define MAXDWORD 0xffffffff |
| 496 | |
Patrik Stridvall | 56d52aa | 1998-11-14 18:24:37 +0000 | [diff] [blame] | 497 | #define FIELD_OFFSET(type, field) \ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 498 | ((LONG)(INT)&(((type *)0)->field)) |
Patrik Stridvall | 56d52aa | 1998-11-14 18:24:37 +0000 | [diff] [blame] | 499 | |
| 500 | #define CONTAINING_RECORD(address, type, field) \ |
| 501 | ((type *)((PCHAR)(address) - (PCHAR)(&((type *)0)->field))) |
| 502 | |
| 503 | /* Types */ |
| 504 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 505 | typedef struct _LIST_ENTRY { |
| 506 | struct _LIST_ENTRY *Flink; |
| 507 | struct _LIST_ENTRY *Blink; |
| 508 | } LIST_ENTRY, *PLIST_ENTRY; |
Patrik Stridvall | 56d52aa | 1998-11-14 18:24:37 +0000 | [diff] [blame] | 509 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 510 | typedef struct _SINGLE_LIST_ENTRY { |
| 511 | struct _SINGLE_LIST_ENTRY *Next; |
| 512 | } SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY; |
Patrik Stridvall | 56d52aa | 1998-11-14 18:24:37 +0000 | [diff] [blame] | 513 | |
Alexandre Julliard | 329f068 | 1996-04-14 13:21:20 +0000 | [diff] [blame] | 514 | /* Heap flags */ |
Alexandre Julliard | c6c0944 | 1997-01-12 18:32:19 +0000 | [diff] [blame] | 515 | |
Alexandre Julliard | 329f068 | 1996-04-14 13:21:20 +0000 | [diff] [blame] | 516 | #define HEAP_NO_SERIALIZE 0x00000001 |
| 517 | #define HEAP_GROWABLE 0x00000002 |
| 518 | #define HEAP_GENERATE_EXCEPTIONS 0x00000004 |
| 519 | #define HEAP_ZERO_MEMORY 0x00000008 |
| 520 | #define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010 |
| 521 | #define HEAP_TAIL_CHECKING_ENABLED 0x00000020 |
| 522 | #define HEAP_FREE_CHECKING_ENABLED 0x00000040 |
| 523 | #define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080 |
| 524 | #define HEAP_CREATE_ALIGN_16 0x00010000 |
| 525 | #define HEAP_CREATE_ENABLE_TRACING 0x00020000 |
Peter Ganten | 9f7907e | 2000-08-01 23:38:02 +0000 | [diff] [blame] | 526 | |
| 527 | /* This flag allows it to create heaps shared by all processes under win95, |
| 528 | FIXME: correct name */ |
| 529 | #define HEAP_SHARED 0x04000000 |
| 530 | |
| 531 | #define HEAP_WINE_SEGPTR 0x10000000 /* Not a Win32 flag */ |
| 532 | #define HEAP_WINE_CODESEG 0x20000000 /* Not a Win32 flag */ |
| 533 | #define HEAP_WINE_CODE16SEG 0x40000000 /* Not a Win32 flag */ |
Alexandre Julliard | 329f068 | 1996-04-14 13:21:20 +0000 | [diff] [blame] | 534 | |
Alexandre Julliard | 44ed71f | 1997-12-21 19:17:50 +0000 | [diff] [blame] | 535 | /* Processor feature flags. */ |
Alexandre Julliard | 60ce85c | 1998-02-01 18:33:27 +0000 | [diff] [blame] | 536 | #define PF_FLOATING_POINT_PRECISION_ERRATA 0 |
| 537 | #define PF_FLOATING_POINT_EMULATED 1 |
| 538 | #define PF_COMPARE_EXCHANGE_DOUBLE 2 |
| 539 | #define PF_MMX_INSTRUCTIONS_AVAILABLE 3 |
| 540 | #define PF_PPC_MOVEMEM_64BIT_OK 4 |
| 541 | #define PF_ALPHA_BYTE_INSTRUCTIONS 5 |
James Abbatiello | 4570478 | 2001-02-13 20:20:27 +0000 | [diff] [blame] | 542 | #define PF_XMMI_INSTRUCTIONS_AVAILABLE 6 |
| 543 | #define PF_AMD3D_INSTRUCTIONS_AVAILABLE 7 |
| 544 | #define PF_RDTSC_INSTRUCTION_AVAILABLE 8 |
Alexandre Julliard | 60ce85c | 1998-02-01 18:33:27 +0000 | [diff] [blame] | 545 | |
Alexandre Julliard | 44ed71f | 1997-12-21 19:17:50 +0000 | [diff] [blame] | 546 | |
Marcus Meissner | f6eb06b | 2001-05-18 20:58:43 +0000 | [diff] [blame^] | 547 | /* Execution state flags */ |
| 548 | #define ES_SYSTEM_REQUIRED 0x00000001 |
| 549 | #define ES_DISPLAY_REQUIRED 0x00000002 |
| 550 | #define ES_USER_PRESENT 0x00000004 |
| 551 | #define ES_CONTINUOUS 0x80000000 |
| 552 | |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 553 | /* The Win32 register context */ |
| 554 | |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame] | 555 | /* CONTEXT is the CPU-dependent context; it should be used */ |
| 556 | /* wherever a platform-specific context is needed (e.g. exception */ |
| 557 | /* handling, Win32 register functions). */ |
| 558 | |
| 559 | /* CONTEXT86 is the i386-specific context; it should be used */ |
| 560 | /* wherever only a 386 context makes sense (e.g. DOS interrupts, */ |
| 561 | /* Win16 register functions), so that this code can be compiled */ |
| 562 | /* on all platforms. */ |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 563 | |
| 564 | #define SIZE_OF_80387_REGISTERS 80 |
| 565 | |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame] | 566 | typedef struct _FLOATING_SAVE_AREA |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 567 | { |
| 568 | DWORD ControlWord; |
| 569 | DWORD StatusWord; |
| 570 | DWORD TagWord; |
| 571 | DWORD ErrorOffset; |
| 572 | DWORD ErrorSelector; |
| 573 | DWORD DataOffset; |
| 574 | DWORD DataSelector; |
| 575 | BYTE RegisterArea[SIZE_OF_80387_REGISTERS]; |
| 576 | DWORD Cr0NpxState; |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame] | 577 | } FLOATING_SAVE_AREA, *PFLOATING_SAVE_AREA; |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 578 | |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame] | 579 | typedef struct _CONTEXT86 |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 580 | { |
| 581 | DWORD ContextFlags; |
| 582 | |
| 583 | /* These are selected by CONTEXT_DEBUG_REGISTERS */ |
| 584 | DWORD Dr0; |
| 585 | DWORD Dr1; |
| 586 | DWORD Dr2; |
| 587 | DWORD Dr3; |
| 588 | DWORD Dr6; |
| 589 | DWORD Dr7; |
| 590 | |
| 591 | /* These are selected by CONTEXT_FLOATING_POINT */ |
| 592 | FLOATING_SAVE_AREA FloatSave; |
| 593 | |
| 594 | /* These are selected by CONTEXT_SEGMENTS */ |
| 595 | DWORD SegGs; |
| 596 | DWORD SegFs; |
| 597 | DWORD SegEs; |
| 598 | DWORD SegDs; |
| 599 | |
| 600 | /* These are selected by CONTEXT_INTEGER */ |
| 601 | DWORD Edi; |
| 602 | DWORD Esi; |
| 603 | DWORD Ebx; |
| 604 | DWORD Edx; |
| 605 | DWORD Ecx; |
| 606 | DWORD Eax; |
| 607 | |
| 608 | /* These are selected by CONTEXT_CONTROL */ |
| 609 | DWORD Ebp; |
| 610 | DWORD Eip; |
| 611 | DWORD SegCs; |
| 612 | DWORD EFlags; |
| 613 | DWORD Esp; |
| 614 | DWORD SegSs; |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame] | 615 | } CONTEXT86; |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 616 | |
Ulrich Weigand | 0fa6dad | 1999-07-15 14:32:20 +0000 | [diff] [blame] | 617 | #define CONTEXT_X86 0x00010000 |
| 618 | #define CONTEXT_i386 CONTEXT_X86 |
| 619 | #define CONTEXT_i486 CONTEXT_X86 |
| 620 | |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame] | 621 | #define CONTEXT86_CONTROL (CONTEXT_i386 | 0x0001) /* SS:SP, CS:IP, FLAGS, BP */ |
| 622 | #define CONTEXT86_INTEGER (CONTEXT_i386 | 0x0002) /* AX, BX, CX, DX, SI, DI */ |
| 623 | #define CONTEXT86_SEGMENTS (CONTEXT_i386 | 0x0004) /* DS, ES, FS, GS */ |
| 624 | #define CONTEXT86_FLOATING_POINT (CONTEXT_i386 | 0x0008L) /* 387 state */ |
| 625 | #define CONTEXT86_DEBUG_REGISTERS (CONTEXT_i386 | 0x0010L) /* DB 0-3,6,7 */ |
Ulrich Weigand | 0fa6dad | 1999-07-15 14:32:20 +0000 | [diff] [blame] | 626 | #define CONTEXT86_FULL (CONTEXT86_CONTROL | CONTEXT86_INTEGER | CONTEXT86_SEGMENTS) |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame] | 627 | |
| 628 | /* i386 context definitions */ |
| 629 | #ifdef __i386__ |
| 630 | |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame] | 631 | #define CONTEXT_CONTROL CONTEXT86_CONTROL |
| 632 | #define CONTEXT_INTEGER CONTEXT86_INTEGER |
| 633 | #define CONTEXT_SEGMENTS CONTEXT86_SEGMENTS |
| 634 | #define CONTEXT_FLOATING_POINT CONTEXT86_FLOATING_POINT |
| 635 | #define CONTEXT_DEBUG_REGISTERS CONTEXT86_DEBUG_REGISTERS |
| 636 | #define CONTEXT_FULL CONTEXT86_FULL |
| 637 | |
| 638 | typedef CONTEXT86 CONTEXT; |
| 639 | |
| 640 | #endif /* __i386__ */ |
| 641 | |
Marcus Meissner | 4a0af42 | 1999-07-31 19:22:25 +0000 | [diff] [blame] | 642 | /* Alpha context definitions */ |
| 643 | #ifdef _ALPHA_ |
| 644 | |
| 645 | #define CONTEXT_ALPHA 0x00020000 |
| 646 | |
| 647 | #define CONTEXT_CONTROL (CONTEXT_ALPHA | 0x00000001L) |
| 648 | #define CONTEXT_FLOATING_POINT (CONTEXT_ALPHA | 0x00000002L) |
| 649 | #define CONTEXT_INTEGER (CONTEXT_ALPHA | 0x00000004L) |
| 650 | #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER) |
| 651 | |
| 652 | typedef struct _CONTEXT |
| 653 | { |
| 654 | /* selected by CONTEXT_FLOATING_POINT */ |
| 655 | ULONGLONG FltF0; |
| 656 | ULONGLONG FltF1; |
| 657 | ULONGLONG FltF2; |
| 658 | ULONGLONG FltF3; |
| 659 | ULONGLONG FltF4; |
| 660 | ULONGLONG FltF5; |
| 661 | ULONGLONG FltF6; |
| 662 | ULONGLONG FltF7; |
| 663 | ULONGLONG FltF8; |
| 664 | ULONGLONG FltF9; |
| 665 | ULONGLONG FltF10; |
| 666 | ULONGLONG FltF11; |
| 667 | ULONGLONG FltF12; |
| 668 | ULONGLONG FltF13; |
| 669 | ULONGLONG FltF14; |
| 670 | ULONGLONG FltF15; |
| 671 | ULONGLONG FltF16; |
| 672 | ULONGLONG FltF17; |
| 673 | ULONGLONG FltF18; |
| 674 | ULONGLONG FltF19; |
| 675 | ULONGLONG FltF20; |
| 676 | ULONGLONG FltF21; |
| 677 | ULONGLONG FltF22; |
| 678 | ULONGLONG FltF23; |
| 679 | ULONGLONG FltF24; |
| 680 | ULONGLONG FltF25; |
| 681 | ULONGLONG FltF26; |
| 682 | ULONGLONG FltF27; |
| 683 | ULONGLONG FltF28; |
| 684 | ULONGLONG FltF29; |
| 685 | ULONGLONG FltF30; |
| 686 | ULONGLONG FltF31; |
| 687 | |
| 688 | /* selected by CONTEXT_INTEGER */ |
| 689 | ULONGLONG IntV0; |
| 690 | ULONGLONG IntT0; |
| 691 | ULONGLONG IntT1; |
| 692 | ULONGLONG IntT2; |
| 693 | ULONGLONG IntT3; |
| 694 | ULONGLONG IntT4; |
| 695 | ULONGLONG IntT5; |
| 696 | ULONGLONG IntT6; |
| 697 | ULONGLONG IntT7; |
| 698 | ULONGLONG IntS0; |
| 699 | ULONGLONG IntS1; |
| 700 | ULONGLONG IntS2; |
| 701 | ULONGLONG IntS3; |
| 702 | ULONGLONG IntS4; |
| 703 | ULONGLONG IntS5; |
| 704 | ULONGLONG IntFp; |
| 705 | ULONGLONG IntA0; |
| 706 | ULONGLONG IntA1; |
| 707 | ULONGLONG IntA2; |
| 708 | ULONGLONG IntA3; |
| 709 | ULONGLONG IntA4; |
| 710 | ULONGLONG IntA5; |
| 711 | ULONGLONG IntT8; |
| 712 | ULONGLONG IntT9; |
| 713 | ULONGLONG IntT10; |
| 714 | ULONGLONG IntT11; |
| 715 | ULONGLONG IntRa; |
| 716 | ULONGLONG IntT12; |
| 717 | ULONGLONG IntAt; |
| 718 | ULONGLONG IntGp; |
| 719 | ULONGLONG IntSp; |
| 720 | ULONGLONG IntZero; |
| 721 | |
| 722 | /* selected by CONTEXT_FLOATING_POINT */ |
| 723 | ULONGLONG Fpcr; |
| 724 | ULONGLONG SoftFpcr; |
| 725 | |
| 726 | /* selected by CONTEXT_CONTROL */ |
| 727 | ULONGLONG Fir; |
| 728 | DWORD Psr; |
| 729 | DWORD ContextFlags; |
| 730 | DWORD Fill[4]; |
| 731 | } CONTEXT; |
| 732 | |
| 733 | #define _QUAD_PSR_OFFSET HighSoftFpcr |
| 734 | #define _QUAD_FLAGS_OFFSET HighFir |
| 735 | |
| 736 | #endif /* _ALPHA_ */ |
| 737 | |
| 738 | /* Mips context definitions */ |
| 739 | #ifdef _MIPS_ |
| 740 | |
| 741 | #define CONTEXT_R4000 0x00010000 |
| 742 | |
| 743 | #define CONTEXT_CONTROL (CONTEXT_R4000 | 0x00000001) |
| 744 | #define CONTEXT_FLOATING_POINT (CONTEXT_R4000 | 0x00000002) |
| 745 | #define CONTEXT_INTEGER (CONTEXT_R4000 | 0x00000004) |
| 746 | |
| 747 | #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER) |
| 748 | |
| 749 | typedef struct _CONTEXT |
| 750 | { |
| 751 | DWORD Argument[4]; |
| 752 | /* These are selected by CONTEXT_FLOATING_POINT */ |
| 753 | DWORD FltF0; |
| 754 | DWORD FltF1; |
| 755 | DWORD FltF2; |
| 756 | DWORD FltF3; |
| 757 | DWORD FltF4; |
| 758 | DWORD FltF5; |
| 759 | DWORD FltF6; |
| 760 | DWORD FltF7; |
| 761 | DWORD FltF8; |
| 762 | DWORD FltF9; |
| 763 | DWORD FltF10; |
| 764 | DWORD FltF11; |
| 765 | DWORD FltF12; |
| 766 | DWORD FltF13; |
| 767 | DWORD FltF14; |
| 768 | DWORD FltF15; |
| 769 | DWORD FltF16; |
| 770 | DWORD FltF17; |
| 771 | DWORD FltF18; |
| 772 | DWORD FltF19; |
| 773 | DWORD FltF20; |
| 774 | DWORD FltF21; |
| 775 | DWORD FltF22; |
| 776 | DWORD FltF23; |
| 777 | DWORD FltF24; |
| 778 | DWORD FltF25; |
| 779 | DWORD FltF26; |
| 780 | DWORD FltF27; |
| 781 | DWORD FltF28; |
| 782 | DWORD FltF29; |
| 783 | DWORD FltF30; |
| 784 | DWORD FltF31; |
| 785 | |
| 786 | /* These are selected by CONTEXT_INTEGER */ |
| 787 | DWORD IntZero; |
| 788 | DWORD IntAt; |
| 789 | DWORD IntV0; |
| 790 | DWORD IntV1; |
| 791 | DWORD IntA0; |
| 792 | DWORD IntA1; |
| 793 | DWORD IntA2; |
| 794 | DWORD IntA3; |
| 795 | DWORD IntT0; |
| 796 | DWORD IntT1; |
| 797 | DWORD IntT2; |
| 798 | DWORD IntT3; |
| 799 | DWORD IntT4; |
| 800 | DWORD IntT5; |
| 801 | DWORD IntT6; |
| 802 | DWORD IntT7; |
| 803 | DWORD IntS0; |
| 804 | DWORD IntS1; |
| 805 | DWORD IntS2; |
| 806 | DWORD IntS3; |
| 807 | DWORD IntS4; |
| 808 | DWORD IntS5; |
| 809 | DWORD IntS6; |
| 810 | DWORD IntS7; |
| 811 | DWORD IntT8; |
| 812 | DWORD IntT9; |
| 813 | DWORD IntK0; |
| 814 | DWORD IntK1; |
| 815 | DWORD IntGp; |
| 816 | DWORD IntSp; |
| 817 | DWORD IntS8; |
| 818 | DWORD IntRa; |
| 819 | DWORD IntLo; |
| 820 | DWORD IntHi; |
| 821 | |
| 822 | /* These are selected by CONTEXT_FLOATING_POINT */ |
| 823 | DWORD Fsr; |
| 824 | |
| 825 | /* These are selected by CONTEXT_CONTROL */ |
| 826 | DWORD Fir; |
| 827 | DWORD Psr; |
| 828 | |
| 829 | DWORD ContextFlags; |
| 830 | DWORD Fill[2]; |
| 831 | } CONTEXT; |
| 832 | |
| 833 | #endif /* _MIPS_ */ |
| 834 | |
| 835 | /* PowerPC context definitions */ |
Alexandre Julliard | 016e059 | 1999-08-21 14:44:18 +0000 | [diff] [blame] | 836 | #ifdef __PPC__ |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame] | 837 | |
| 838 | #define CONTEXT_CONTROL 0x0001 |
| 839 | #define CONTEXT_FLOATING_POINT 0x0002 |
| 840 | #define CONTEXT_INTEGER 0x0004 |
| 841 | #define CONTEXT_DEBUG_REGISTERS 0x0008 |
| 842 | #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER) |
| 843 | |
| 844 | typedef struct |
| 845 | { |
| 846 | /* These are selected by CONTEXT_FLOATING_POINT */ |
| 847 | double Fpr0; |
| 848 | double Fpr1; |
| 849 | double Fpr2; |
| 850 | double Fpr3; |
| 851 | double Fpr4; |
| 852 | double Fpr5; |
| 853 | double Fpr6; |
| 854 | double Fpr7; |
| 855 | double Fpr8; |
| 856 | double Fpr9; |
| 857 | double Fpr10; |
| 858 | double Fpr11; |
| 859 | double Fpr12; |
| 860 | double Fpr13; |
| 861 | double Fpr14; |
| 862 | double Fpr15; |
| 863 | double Fpr16; |
| 864 | double Fpr17; |
| 865 | double Fpr18; |
| 866 | double Fpr19; |
| 867 | double Fpr20; |
| 868 | double Fpr21; |
| 869 | double Fpr22; |
| 870 | double Fpr23; |
| 871 | double Fpr24; |
| 872 | double Fpr25; |
| 873 | double Fpr26; |
| 874 | double Fpr27; |
| 875 | double Fpr28; |
| 876 | double Fpr29; |
| 877 | double Fpr30; |
| 878 | double Fpr31; |
| 879 | double Fpscr; |
| 880 | |
| 881 | /* These are selected by CONTEXT_INTEGER */ |
| 882 | DWORD Gpr0; |
| 883 | DWORD Gpr1; |
| 884 | DWORD Gpr2; |
| 885 | DWORD Gpr3; |
| 886 | DWORD Gpr4; |
| 887 | DWORD Gpr5; |
| 888 | DWORD Gpr6; |
| 889 | DWORD Gpr7; |
| 890 | DWORD Gpr8; |
| 891 | DWORD Gpr9; |
| 892 | DWORD Gpr10; |
| 893 | DWORD Gpr11; |
| 894 | DWORD Gpr12; |
| 895 | DWORD Gpr13; |
| 896 | DWORD Gpr14; |
| 897 | DWORD Gpr15; |
| 898 | DWORD Gpr16; |
| 899 | DWORD Gpr17; |
| 900 | DWORD Gpr18; |
| 901 | DWORD Gpr19; |
| 902 | DWORD Gpr20; |
| 903 | DWORD Gpr21; |
| 904 | DWORD Gpr22; |
| 905 | DWORD Gpr23; |
| 906 | DWORD Gpr24; |
| 907 | DWORD Gpr25; |
| 908 | DWORD Gpr26; |
| 909 | DWORD Gpr27; |
| 910 | DWORD Gpr28; |
| 911 | DWORD Gpr29; |
| 912 | DWORD Gpr30; |
| 913 | DWORD Gpr31; |
| 914 | |
| 915 | DWORD Cr; |
| 916 | DWORD Xer; |
| 917 | |
| 918 | /* These are selected by CONTEXT_CONTROL */ |
| 919 | DWORD Msr; |
| 920 | DWORD Iar; |
| 921 | DWORD Lr; |
| 922 | DWORD Ctr; |
| 923 | |
| 924 | DWORD ContextFlags; |
| 925 | DWORD Fill[3]; |
| 926 | |
| 927 | /* These are selected by CONTEXT_DEBUG_REGISTERS */ |
| 928 | DWORD Dr0; |
| 929 | DWORD Dr1; |
| 930 | DWORD Dr2; |
| 931 | DWORD Dr3; |
| 932 | DWORD Dr4; |
| 933 | DWORD Dr5; |
| 934 | DWORD Dr6; |
| 935 | DWORD Dr7; |
| 936 | } CONTEXT; |
| 937 | |
Marcus Meissner | 4a0af42 | 1999-07-31 19:22:25 +0000 | [diff] [blame] | 938 | typedef struct _STACK_FRAME_HEADER |
| 939 | { |
| 940 | DWORD BackChain; |
| 941 | DWORD GlueSaved1; |
| 942 | DWORD GlueSaved2; |
| 943 | DWORD Reserved1; |
| 944 | DWORD Spare1; |
| 945 | DWORD Spare2; |
| 946 | |
| 947 | DWORD Parameter0; |
| 948 | DWORD Parameter1; |
| 949 | DWORD Parameter2; |
| 950 | DWORD Parameter3; |
| 951 | DWORD Parameter4; |
| 952 | DWORD Parameter5; |
| 953 | DWORD Parameter6; |
| 954 | DWORD Parameter7; |
| 955 | } STACK_FRAME_HEADER,*PSTACK_FRAME_HEADER; |
| 956 | |
Alexandre Julliard | 016e059 | 1999-08-21 14:44:18 +0000 | [diff] [blame] | 957 | #endif /* __PPC__ */ |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame] | 958 | |
Ulrich Weigand | 248c75e | 1999-11-10 20:18:53 +0000 | [diff] [blame] | 959 | #ifdef __sparc__ |
| 960 | |
| 961 | /* |
| 962 | * FIXME: |
| 963 | * |
| 964 | * There is no official CONTEXT structure defined for the SPARC |
| 965 | * architecture, so I just made one up. |
| 966 | * |
| 967 | * This structure is valid only for 32-bit SPARC architectures, |
| 968 | * not for 64-bit SPARC. |
| 969 | * |
| 970 | * Note that this structure contains only the 'top-level' registers; |
| 971 | * the rest of the register window chain is not visible. |
| 972 | * |
| 973 | * The layout follows the Solaris 'prgregset_t' structure. |
| 974 | * |
| 975 | */ |
| 976 | |
| 977 | #define CONTEXT_SPARC 0x10000000 |
| 978 | |
| 979 | #define CONTEXT_CONTROL (CONTEXT_SPARC | 0x00000001) |
| 980 | #define CONTEXT_FLOATING_POINT (CONTEXT_SPARC | 0x00000002) |
| 981 | #define CONTEXT_INTEGER (CONTEXT_SPARC | 0x00000004) |
| 982 | |
| 983 | #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER) |
| 984 | |
| 985 | typedef struct _CONTEXT |
| 986 | { |
Ulrich Weigand | 9b233bd | 1999-11-13 23:51:13 +0000 | [diff] [blame] | 987 | DWORD ContextFlags; |
| 988 | |
Ulrich Weigand | 248c75e | 1999-11-10 20:18:53 +0000 | [diff] [blame] | 989 | /* These are selected by CONTEXT_INTEGER */ |
| 990 | DWORD g0; |
| 991 | DWORD g1; |
| 992 | DWORD g2; |
| 993 | DWORD g3; |
| 994 | DWORD g4; |
| 995 | DWORD g5; |
| 996 | DWORD g6; |
| 997 | DWORD g7; |
| 998 | DWORD o0; |
| 999 | DWORD o1; |
| 1000 | DWORD o2; |
| 1001 | DWORD o3; |
| 1002 | DWORD o4; |
| 1003 | DWORD o5; |
| 1004 | DWORD o6; |
| 1005 | DWORD o7; |
| 1006 | DWORD l0; |
| 1007 | DWORD l1; |
| 1008 | DWORD l2; |
| 1009 | DWORD l3; |
| 1010 | DWORD l4; |
| 1011 | DWORD l5; |
| 1012 | DWORD l6; |
| 1013 | DWORD l7; |
| 1014 | DWORD i0; |
| 1015 | DWORD i1; |
| 1016 | DWORD i2; |
| 1017 | DWORD i3; |
| 1018 | DWORD i4; |
| 1019 | DWORD i5; |
| 1020 | DWORD i6; |
| 1021 | DWORD i7; |
| 1022 | |
| 1023 | /* These are selected by CONTEXT_CONTROL */ |
| 1024 | DWORD psr; |
| 1025 | DWORD pc; |
| 1026 | DWORD npc; |
| 1027 | DWORD y; |
| 1028 | DWORD wim; |
| 1029 | DWORD tbr; |
| 1030 | |
| 1031 | /* FIXME: floating point registers missing */ |
| 1032 | |
| 1033 | } CONTEXT; |
| 1034 | |
Andreas Mohr | 32a5b63 | 2000-03-26 14:41:10 +0000 | [diff] [blame] | 1035 | #endif /* __sparc__ */ |
Ulrich Weigand | 248c75e | 1999-11-10 20:18:53 +0000 | [diff] [blame] | 1036 | |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame] | 1037 | #if !defined(CONTEXT_FULL) && !defined(RC_INVOKED) |
| 1038 | #error You need to define a CONTEXT for your CPU |
| 1039 | #endif |
| 1040 | |
| 1041 | typedef CONTEXT *PCONTEXT; |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 1042 | |
| 1043 | #ifdef __WINE__ |
| 1044 | |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame] | 1045 | /* Macros for easier access to i386 context registers */ |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 1046 | |
Alexandre Julliard | d8fab2e | 2000-09-25 23:53:07 +0000 | [diff] [blame] | 1047 | #define AX_reg(context) (*(WORD*)&(context)->Eax) |
| 1048 | #define BX_reg(context) (*(WORD*)&(context)->Ebx) |
| 1049 | #define CX_reg(context) (*(WORD*)&(context)->Ecx) |
| 1050 | #define DX_reg(context) (*(WORD*)&(context)->Edx) |
| 1051 | #define SI_reg(context) (*(WORD*)&(context)->Esi) |
| 1052 | #define DI_reg(context) (*(WORD*)&(context)->Edi) |
| 1053 | #define BP_reg(context) (*(WORD*)&(context)->Ebp) |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 1054 | |
Alexandre Julliard | d8fab2e | 2000-09-25 23:53:07 +0000 | [diff] [blame] | 1055 | #define AL_reg(context) (*(BYTE*)&(context)->Eax) |
| 1056 | #define AH_reg(context) (*((BYTE*)&(context)->Eax + 1)) |
| 1057 | #define BL_reg(context) (*(BYTE*)&(context)->Ebx) |
| 1058 | #define BH_reg(context) (*((BYTE*)&(context)->Ebx + 1)) |
| 1059 | #define CL_reg(context) (*(BYTE*)&(context)->Ecx) |
| 1060 | #define CH_reg(context) (*((BYTE*)&(context)->Ecx + 1)) |
| 1061 | #define DL_reg(context) (*(BYTE*)&(context)->Edx) |
| 1062 | #define DH_reg(context) (*((BYTE*)&(context)->Edx + 1)) |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 1063 | |
Alexandre Julliard | d8fab2e | 2000-09-25 23:53:07 +0000 | [diff] [blame] | 1064 | #define SET_CFLAG(context) ((context)->EFlags |= 0x0001) |
| 1065 | #define RESET_CFLAG(context) ((context)->EFlags &= ~0x0001) |
| 1066 | #define SET_ZFLAG(context) ((context)->EFlags |= 0x0040) |
| 1067 | #define RESET_ZFLAG(context) ((context)->EFlags &= ~0x0040) |
| 1068 | #define ISV86(context) ((context)->EFlags & 0x00020000) |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 1069 | |
Ulrich Weigand | 9b233bd | 1999-11-13 23:51:13 +0000 | [diff] [blame] | 1070 | |
| 1071 | /* Macros to retrieve the current context */ |
| 1072 | |
Alexandre Julliard | 916f975 | 2000-02-26 16:51:13 +0000 | [diff] [blame] | 1073 | #ifdef NEED_UNDERSCORE_PREFIX |
| 1074 | # define __ASM_NAME(name) "_" name |
| 1075 | #else |
| 1076 | # define __ASM_NAME(name) name |
| 1077 | #endif |
| 1078 | |
Dimitrie O. Paun | c77cbbc | 2000-11-27 23:32:55 +0000 | [diff] [blame] | 1079 | #ifdef NEED_TYPE_IN_DEF |
Dimitrie O. Paun | 31b6d09 | 2000-12-01 21:27:43 +0000 | [diff] [blame] | 1080 | # define __ASM_FUNC(name) ".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef" |
Dimitrie O. Paun | c77cbbc | 2000-11-27 23:32:55 +0000 | [diff] [blame] | 1081 | #else |
Dimitrie O. Paun | 31b6d09 | 2000-12-01 21:27:43 +0000 | [diff] [blame] | 1082 | # define __ASM_FUNC(name) ".type " __ASM_NAME(name) ",@function" |
Dimitrie O. Paun | c77cbbc | 2000-11-27 23:32:55 +0000 | [diff] [blame] | 1083 | #endif |
| 1084 | |
Alexandre Julliard | 916f975 | 2000-02-26 16:51:13 +0000 | [diff] [blame] | 1085 | #ifdef __GNUC__ |
| 1086 | # define __ASM_GLOBAL_FUNC(name,code) \ |
| 1087 | __asm__( ".align 4\n\t" \ |
| 1088 | ".globl " __ASM_NAME(#name) "\n\t" \ |
Dimitrie O. Paun | 31b6d09 | 2000-12-01 21:27:43 +0000 | [diff] [blame] | 1089 | __ASM_FUNC(#name) "\n" \ |
Alexandre Julliard | 916f975 | 2000-02-26 16:51:13 +0000 | [diff] [blame] | 1090 | __ASM_NAME(#name) ":\n\t" \ |
| 1091 | code ); |
| 1092 | #else /* __GNUC__ */ |
| 1093 | # define __ASM_GLOBAL_FUNC(name,code) \ |
| 1094 | void __asm_dummy_##name(void) { \ |
| 1095 | asm( ".align 4\n\t" \ |
| 1096 | ".globl " __ASM_NAME(#name) "\n\t" \ |
Dimitrie O. Paun | 31b6d09 | 2000-12-01 21:27:43 +0000 | [diff] [blame] | 1097 | __ASM_FUNC(#name) "\n" \ |
Alexandre Julliard | 916f975 | 2000-02-26 16:51:13 +0000 | [diff] [blame] | 1098 | __ASM_NAME(#name) ":\n\t" \ |
| 1099 | code ); \ |
| 1100 | } |
| 1101 | #endif /* __GNUC__ */ |
| 1102 | |
Ulrich Weigand | 0108d83 | 2000-12-29 05:17:33 +0000 | [diff] [blame] | 1103 | #ifdef __i386__ |
| 1104 | |
Alexandre Julliard | 916f975 | 2000-02-26 16:51:13 +0000 | [diff] [blame] | 1105 | #define _DEFINE_REGS_ENTRYPOINT( name, fn, args ) \ |
| 1106 | __ASM_GLOBAL_FUNC( name, \ |
| 1107 | "call " __ASM_NAME("CALL32_Regs") "\n\t" \ |
| 1108 | ".long " __ASM_NAME(#fn) "\n\t" \ |
| 1109 | ".byte " #args ", " #args ) |
Ulrich Weigand | 9b233bd | 1999-11-13 23:51:13 +0000 | [diff] [blame] | 1110 | #define DEFINE_REGS_ENTRYPOINT_0( name, fn ) \ |
Alexandre Julliard | 246c360 | 2000-05-10 03:48:00 +0000 | [diff] [blame] | 1111 | extern void WINAPI name(void); \ |
Ulrich Weigand | 9b233bd | 1999-11-13 23:51:13 +0000 | [diff] [blame] | 1112 | _DEFINE_REGS_ENTRYPOINT( name, fn, 0 ) |
| 1113 | #define DEFINE_REGS_ENTRYPOINT_1( name, fn, t1 ) \ |
Alexandre Julliard | 246c360 | 2000-05-10 03:48:00 +0000 | [diff] [blame] | 1114 | extern void WINAPI name( t1 a1 ); \ |
Ulrich Weigand | 9b233bd | 1999-11-13 23:51:13 +0000 | [diff] [blame] | 1115 | _DEFINE_REGS_ENTRYPOINT( name, fn, 4 ) |
| 1116 | #define DEFINE_REGS_ENTRYPOINT_2( name, fn, t1, t2 ) \ |
Alexandre Julliard | 246c360 | 2000-05-10 03:48:00 +0000 | [diff] [blame] | 1117 | extern void WINAPI name( t1 a1, t2 a2 ); \ |
Ulrich Weigand | 9b233bd | 1999-11-13 23:51:13 +0000 | [diff] [blame] | 1118 | _DEFINE_REGS_ENTRYPOINT( name, fn, 8 ) |
| 1119 | #define DEFINE_REGS_ENTRYPOINT_3( name, fn, t1, t2, t3 ) \ |
Alexandre Julliard | 246c360 | 2000-05-10 03:48:00 +0000 | [diff] [blame] | 1120 | extern void WINAPI name( t1 a1, t2 a2, t3 a3 ); \ |
Ulrich Weigand | 9b233bd | 1999-11-13 23:51:13 +0000 | [diff] [blame] | 1121 | _DEFINE_REGS_ENTRYPOINT( name, fn, 12 ) |
| 1122 | #define DEFINE_REGS_ENTRYPOINT_4( name, fn, t1, t2, t3, t4 ) \ |
Alexandre Julliard | 246c360 | 2000-05-10 03:48:00 +0000 | [diff] [blame] | 1123 | extern void WINAPI name( t1 a1, t2 a2, t3 a3, t4 a4 ); \ |
Ulrich Weigand | 9b233bd | 1999-11-13 23:51:13 +0000 | [diff] [blame] | 1124 | _DEFINE_REGS_ENTRYPOINT( name, fn, 16 ) |
| 1125 | |
| 1126 | #endif /* __i386__ */ |
| 1127 | |
| 1128 | #ifdef __sparc__ |
| 1129 | /* FIXME: use getcontext() to retrieve full context */ |
| 1130 | #define _GET_CONTEXT \ |
| 1131 | CONTEXT context; \ |
| 1132 | do { memset(&context, 0, sizeof(CONTEXT)); \ |
| 1133 | context.ContextFlags = CONTEXT_CONTROL; \ |
| 1134 | context.pc = (DWORD)__builtin_return_address(0); \ |
| 1135 | } while (0) |
| 1136 | |
| 1137 | #define DEFINE_REGS_ENTRYPOINT_0( name, fn ) \ |
| 1138 | void WINAPI name ( void ) \ |
| 1139 | { _GET_CONTEXT; fn( &context ); } |
| 1140 | #define DEFINE_REGS_ENTRYPOINT_1( name, fn, t1 ) \ |
| 1141 | void WINAPI name ( t1 a1 ) \ |
| 1142 | { _GET_CONTEXT; fn( a1, &context ); } |
| 1143 | #define DEFINE_REGS_ENTRYPOINT_2( name, fn, t1, t2 ) \ |
| 1144 | void WINAPI name ( t1 a1, t2 a2 ) \ |
| 1145 | { _GET_CONTEXT; fn( a1, a2, &context ); } |
| 1146 | #define DEFINE_REGS_ENTRYPOINT_3( name, fn, t1, t2, t3 ) \ |
| 1147 | void WINAPI name ( t1 a1, t2 a2, t3 a3 ) \ |
| 1148 | { _GET_CONTEXT; fn( a1, a2, a3, &context ); } |
| 1149 | #define DEFINE_REGS_ENTRYPOINT_4( name, fn, t1, t2, t3, t4 ) \ |
| 1150 | void WINAPI name ( t1 a1, t2 a2, t3 a3, t4 a4 ) \ |
| 1151 | { _GET_CONTEXT; fn( a1, a2, a3, a4, &context ); } |
| 1152 | |
| 1153 | #endif /* __sparc__ */ |
| 1154 | |
Josh DuBois | 4b1eb51 | 2001-02-13 01:50:38 +0000 | [diff] [blame] | 1155 | #ifdef __PPC__ |
| 1156 | |
| 1157 | /* FIXME: use getcontext() to retrieve full context */ |
| 1158 | #define _GET_CONTEXT \ |
| 1159 | CONTEXT context; \ |
| 1160 | do { memset(&context, 0, sizeof(CONTEXT)); \ |
| 1161 | context.ContextFlags = CONTEXT_CONTROL; \ |
| 1162 | } while (0) |
| 1163 | |
| 1164 | #define DEFINE_REGS_ENTRYPOINT_0( name, fn ) \ |
| 1165 | void WINAPI name ( void ) \ |
| 1166 | { _GET_CONTEXT; fn( &context ); } |
| 1167 | #define DEFINE_REGS_ENTRYPOINT_1( name, fn, t1 ) \ |
| 1168 | void WINAPI name ( t1 a1 ) \ |
| 1169 | { _GET_CONTEXT; fn( a1, &context ); } |
| 1170 | #define DEFINE_REGS_ENTRYPOINT_2( name, fn, t1, t2 ) \ |
| 1171 | void WINAPI name ( t1 a1, t2 a2 ) \ |
| 1172 | { _GET_CONTEXT; fn( a1, a2, &context ); } |
| 1173 | #define DEFINE_REGS_ENTRYPOINT_3( name, fn, t1, t2, t3 ) \ |
| 1174 | void WINAPI name ( t1 a1, t2 a2, t3 a3 ) \ |
| 1175 | { _GET_CONTEXT; fn( a1, a2, a3, &context ); } |
| 1176 | #define DEFINE_REGS_ENTRYPOINT_4( name, fn, t1, t2, t3, t4 ) \ |
| 1177 | void WINAPI name ( t1 a1, t2 a2, t3 a3, t4 a4 ) \ |
| 1178 | { _GET_CONTEXT; fn( a1, a2, a3, a4, &context ); } |
| 1179 | |
| 1180 | #endif /* __PPC__ */ |
| 1181 | |
| 1182 | |
Ulrich Weigand | 9b233bd | 1999-11-13 23:51:13 +0000 | [diff] [blame] | 1183 | #ifndef DEFINE_REGS_ENTRYPOINT_0 |
| 1184 | #error You need to define DEFINE_REGS_ENTRYPOINT macros for your CPU |
| 1185 | #endif |
| 1186 | |
Alexandre Julliard | 1ca9be8 | 2000-05-01 20:25:13 +0000 | [diff] [blame] | 1187 | /* Constructor functions */ |
| 1188 | |
| 1189 | #ifdef __GNUC__ |
| 1190 | # define DECL_GLOBAL_CONSTRUCTOR(func) \ |
| 1191 | static void func(void) __attribute__((constructor)); \ |
| 1192 | static void func(void) |
| 1193 | #else /* __GNUC__ */ |
| 1194 | # ifdef __i386__ |
| 1195 | # define DECL_GLOBAL_CONSTRUCTOR(func) \ |
| 1196 | static void __dummy_init_##func(void) { \ |
| 1197 | asm(".section .init,\"ax\"\n\t" \ |
| 1198 | "call " #func "\n\t" \ |
| 1199 | ".previous"); } \ |
| 1200 | static void func(void) |
| 1201 | # else /* __i386__ */ |
| 1202 | # error You must define the DECL_GLOBAL_CONSTRUCTOR macro for your platform |
| 1203 | # endif |
| 1204 | #endif /* __GNUC__ */ |
| 1205 | |
Alexandre Julliard | 982a223 | 2000-12-13 20:20:09 +0000 | [diff] [blame] | 1206 | /* Segment register access */ |
| 1207 | |
| 1208 | #ifdef __i386__ |
| 1209 | # ifdef __GNUC__ |
| 1210 | # define __DEFINE_GET_SEG(seg) \ |
| 1211 | extern inline unsigned short __get_##seg(void) \ |
| 1212 | { unsigned short res; __asm__("movw %%" #seg ",%w0" : "=r"(res)); return res; } |
| 1213 | # define __DEFINE_SET_SEG(seg) \ |
| 1214 | extern inline void __set_##seg(int val) { __asm__("movw %w0,%%" #seg : : "r" (val)); } |
| 1215 | # else /* __GNUC__ */ |
| 1216 | # define __DEFINE_GET_SEG(seg) extern unsigned short __get_##seg(void); |
| 1217 | # define __DEFINE_SET_SEG(seg) extern void __set_##seg(unsigned int); |
| 1218 | # endif /* __GNUC__ */ |
| 1219 | #else /* __i386__ */ |
| 1220 | # define __DEFINE_GET_SEG(seg) inline static unsigned short __get_##seg(void) { return 0; } |
| 1221 | # define __DEFINE_SET_SEG(seg) /* nothing */ |
| 1222 | #endif /* __i386__ */ |
| 1223 | |
| 1224 | __DEFINE_GET_SEG(cs) |
| 1225 | __DEFINE_GET_SEG(ds) |
| 1226 | __DEFINE_GET_SEG(es) |
| 1227 | __DEFINE_GET_SEG(fs) |
| 1228 | __DEFINE_GET_SEG(gs) |
| 1229 | __DEFINE_GET_SEG(ss) |
| 1230 | __DEFINE_SET_SEG(fs) |
| 1231 | __DEFINE_SET_SEG(gs) |
| 1232 | #undef __DEFINE_GET_SEG |
| 1233 | #undef __DEFINE_SET_SEG |
| 1234 | |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 1235 | #endif /* __WINE__ */ |
| 1236 | |
Francois Gouget | 48fc4aa | 2000-10-12 23:20:29 +0000 | [diff] [blame] | 1237 | |
| 1238 | |
| 1239 | /* |
| 1240 | * Language IDs |
| 1241 | */ |
| 1242 | |
| 1243 | #define MAKELCID(l, s) (MAKELONG(l, s)) |
| 1244 | |
| 1245 | #define MAKELANGID(p, s) ((((WORD)(s))<<10) | (WORD)(p)) |
| 1246 | #define PRIMARYLANGID(l) ((WORD)(l) & 0x3ff) |
| 1247 | #define SUBLANGID(l) ((WORD)(l) >> 10) |
| 1248 | |
| 1249 | #define LANGIDFROMLCID(lcid) ((WORD)(lcid)) |
| 1250 | #define SORTIDFROMLCID(lcid) ((WORD)((((DWORD)(lcid)) >> 16) & 0x0f)) |
| 1251 | |
| 1252 | #define LANG_SYSTEM_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT)) |
| 1253 | #define LANG_USER_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)) |
| 1254 | #define LOCALE_SYSTEM_DEFAULT (MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT)) |
| 1255 | #define LOCALE_USER_DEFAULT (MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT)) |
| 1256 | #define LOCALE_NEUTRAL (MAKELCID(MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL),SORT_DEFAULT)) |
| 1257 | |
| 1258 | /* FIXME: are the symbolic names correct for LIDs: 0x17, 0x20, 0x28, |
| 1259 | * 0x2a, 0x2b, 0x2c, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, |
| 1260 | * 0x37, 0x39, 0x3a, 0x3b, 0x3c, 0x3e, 0x3f, 0x41, 0x43, 0x44, |
| 1261 | * 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, |
| 1262 | * 0x4f, 0x57 |
| 1263 | */ |
| 1264 | #define LANG_NEUTRAL 0x00 |
| 1265 | #define LANG_AFRIKAANS 0x36 |
| 1266 | #define LANG_ALBANIAN 0x1c |
| 1267 | #define LANG_ARABIC 0x01 |
| 1268 | #define LANG_ARMENIAN 0x2b |
| 1269 | #define LANG_ASSAMESE 0x4d |
| 1270 | #define LANG_AZERI 0x2c |
| 1271 | #define LANG_BASQUE 0x2d |
| 1272 | #define LANG_BENGALI 0x45 |
| 1273 | #define LANG_BULGARIAN 0x02 |
| 1274 | #define LANG_BYELORUSSIAN 0x23 |
| 1275 | #define LANG_CATALAN 0x03 |
| 1276 | #define LANG_CHINESE 0x04 |
| 1277 | #define LANG_SERBO_CROATIAN 0x1a |
| 1278 | #define LANG_CROATIAN LANG_SERBO_CROATIAN |
| 1279 | #define LANG_SERBIAN LANG_SERBO_CROATIAN |
| 1280 | #define LANG_CZECH 0x05 |
| 1281 | #define LANG_DANISH 0x06 |
| 1282 | #define LANG_DUTCH 0x13 |
| 1283 | #define LANG_ENGLISH 0x09 |
| 1284 | #define LANG_ESTONIAN 0x25 |
| 1285 | #define LANG_FAEROESE 0x38 |
| 1286 | #define LANG_FARSI 0x29 |
| 1287 | #define LANG_FINNISH 0x0b |
| 1288 | #define LANG_FRENCH 0x0c |
| 1289 | #define LANG_GAELIC 0x3c |
| 1290 | #define LANG_GEORGIAN 0x37 |
| 1291 | #define LANG_GERMAN 0x07 |
| 1292 | #define LANG_GREEK 0x08 |
| 1293 | #define LANG_GUJARATI 0x47 |
| 1294 | #define LANG_HEBREW 0x0D |
| 1295 | #define LANG_HINDI 0x39 |
| 1296 | #define LANG_HUNGARIAN 0x0e |
| 1297 | #define LANG_ICELANDIC 0x0f |
| 1298 | #define LANG_INDONESIAN 0x21 |
| 1299 | #define LANG_ITALIAN 0x10 |
| 1300 | #define LANG_JAPANESE 0x11 |
| 1301 | #define LANG_KANNADA 0x4b |
| 1302 | #define LANG_KAZAKH 0x3f |
| 1303 | #define LANG_KONKANI 0x57 |
| 1304 | #define LANG_KOREAN 0x12 |
| 1305 | #define LANG_LATVIAN 0x26 |
| 1306 | #define LANG_LITHUANIAN 0x27 |
| 1307 | #define LANG_MACEDONIAN 0x2f |
| 1308 | #define LANG_MALAY 0x3e |
| 1309 | #define LANG_MALAYALAM 0x4c |
| 1310 | #define LANG_MALTESE 0x3a |
| 1311 | #define LANG_MAORI 0x28 |
| 1312 | #define LANG_MARATHI 0x4e |
| 1313 | #define LANG_NORWEGIAN 0x14 |
| 1314 | #define LANG_ORIYA 0x48 |
| 1315 | #define LANG_POLISH 0x15 |
| 1316 | #define LANG_PORTUGUESE 0x16 |
| 1317 | #define LANG_PUNJABI 0x46 |
| 1318 | #define LANG_RHAETO_ROMANCE 0x17 |
| 1319 | #define LANG_ROMANIAN 0x18 |
| 1320 | #define LANG_RUSSIAN 0x19 |
| 1321 | #define LANG_SAAMI 0x3b |
| 1322 | #define LANG_SANSKRIT 0x4f |
| 1323 | #define LANG_SLOVAK 0x1b |
| 1324 | #define LANG_SLOVENIAN 0x24 |
| 1325 | #define LANG_SORBIAN 0x2e |
| 1326 | #define LANG_SPANISH 0x0a |
| 1327 | #define LANG_SUTU 0x30 |
| 1328 | #define LANG_SWAHILI 0x41 |
| 1329 | #define LANG_SWEDISH 0x1d |
| 1330 | #define LANG_TAMIL 0x49 |
| 1331 | #define LANG_TATAR 0x44 |
| 1332 | #define LANG_TELUGU 0x4a |
| 1333 | #define LANG_THAI 0x1e |
| 1334 | #define LANG_TSONGA 0x31 |
| 1335 | #define LANG_TSWANA 0x32 |
| 1336 | #define LANG_TURKISH 0x1f |
| 1337 | #define LANG_UKRAINIAN 0x22 |
| 1338 | #define LANG_URDU 0x20 |
| 1339 | #define LANG_UZBEK 0x43 |
| 1340 | #define LANG_VENDA 0x33 |
| 1341 | #define LANG_VIETNAMESE 0x2a |
| 1342 | #define LANG_XHOSA 0x34 |
| 1343 | #define LANG_ZULU 0x35 |
| 1344 | /* non standard; keep the number high enough (but < 0xff) */ |
| 1345 | #define LANG_ESPERANTO 0x8f |
| 1346 | #define LANG_WALON 0x90 |
| 1347 | #define LANG_CORNISH 0x91 |
| 1348 | #define LANG_WELSH 0x92 |
| 1349 | #define LANG_BRETON 0x93 |
| 1350 | |
| 1351 | /* Sublanguage definitions */ |
| 1352 | #define SUBLANG_NEUTRAL 0x00 /* language neutral */ |
| 1353 | #define SUBLANG_DEFAULT 0x01 /* user default */ |
| 1354 | #define SUBLANG_SYS_DEFAULT 0x02 /* system default */ |
| 1355 | |
| 1356 | #define SUBLANG_ARABIC 0x01 |
| 1357 | #define SUBLANG_ARABIC_SAUDI_ARABIA 0x01 |
| 1358 | #define SUBLANG_ARABIC_IRAQ 0x02 |
| 1359 | #define SUBLANG_ARABIC_EGYPT 0x03 |
| 1360 | #define SUBLANG_ARABIC_LIBYA 0x04 |
| 1361 | #define SUBLANG_ARABIC_ALGERIA 0x05 |
| 1362 | #define SUBLANG_ARABIC_MOROCCO 0x06 |
| 1363 | #define SUBLANG_ARABIC_TUNISIA 0x07 |
| 1364 | #define SUBLANG_ARABIC_OMAN 0x08 |
| 1365 | #define SUBLANG_ARABIC_YEMEN 0x09 |
| 1366 | #define SUBLANG_ARABIC_SYRIA 0x0a |
| 1367 | #define SUBLANG_ARABIC_JORDAN 0x0b |
| 1368 | #define SUBLANG_ARABIC_LEBANON 0x0c |
| 1369 | #define SUBLANG_ARABIC_KUWAIT 0x0d |
| 1370 | #define SUBLANG_ARABIC_UAE 0x0e |
| 1371 | #define SUBLANG_ARABIC_BAHRAIN 0x0f |
| 1372 | #define SUBLANG_ARABIC_QATAR 0x10 |
| 1373 | #define SUBLANG_CHINESE_TRADITIONAL 0x01 |
| 1374 | #define SUBLANG_CHINESE_SIMPLIFIED 0x02 |
| 1375 | #define SUBLANG_CHINESE_HONGKONG 0x03 |
| 1376 | #define SUBLANG_CHINESE_SINGAPORE 0x04 |
| 1377 | #define SUBLANG_CHINESE_MACAU 0x05 |
| 1378 | #define SUBLANG_DUTCH 0x01 |
| 1379 | #define SUBLANG_DUTCH_BELGIAN 0x02 |
| 1380 | #define SUBLANG_DUTCH_SURINAM 0x03 |
| 1381 | #define SUBLANG_ENGLISH_US 0x01 |
| 1382 | #define SUBLANG_ENGLISH_UK 0x02 |
| 1383 | #define SUBLANG_ENGLISH_AUS 0x03 |
| 1384 | #define SUBLANG_ENGLISH_CAN 0x04 |
| 1385 | #define SUBLANG_ENGLISH_NZ 0x05 |
| 1386 | #define SUBLANG_ENGLISH_EIRE 0x06 |
| 1387 | #define SUBLANG_ENGLISH_SAFRICA 0x07 |
| 1388 | #define SUBLANG_ENGLISH_JAMAICA 0x08 |
| 1389 | #define SUBLANG_ENGLISH_CARRIBEAN 0x09 |
| 1390 | #define SUBLANG_ENGLISH_BELIZE 0x0a |
| 1391 | #define SUBLANG_ENGLISH_TRINIDAD 0x0b |
| 1392 | #define SUBLANG_ENGLISH_ZIMBABWE 0x0c |
| 1393 | #define SUBLANG_ENGLISH_PHILIPPINES 0x0d |
| 1394 | #define SUBLANG_FRENCH 0x01 |
| 1395 | #define SUBLANG_FRENCH_BELGIAN 0x02 |
| 1396 | #define SUBLANG_FRENCH_CANADIAN 0x03 |
| 1397 | #define SUBLANG_FRENCH_SWISS 0x04 |
| 1398 | #define SUBLANG_FRENCH_LUXEMBOURG 0x05 |
| 1399 | #define SUBLANG_FRENCH_MONACO 0x06 |
| 1400 | #define SUBLANG_GERMAN 0x01 |
| 1401 | #define SUBLANG_GERMAN_SWISS 0x02 |
| 1402 | #define SUBLANG_GERMAN_AUSTRIAN 0x03 |
| 1403 | #define SUBLANG_GERMAN_LUXEMBOURG 0x04 |
| 1404 | #define SUBLANG_GERMAN_LIECHTENSTEIN 0x05 |
| 1405 | #define SUBLANG_ITALIAN 0x01 |
| 1406 | #define SUBLANG_ITALIAN_SWISS 0x02 |
| 1407 | #define SUBLANG_KOREAN 0x01 |
| 1408 | #define SUBLANG_KOREAN_JOHAB 0x02 |
| 1409 | #define SUBLANG_NORWEGIAN_BOKMAL 0x01 |
| 1410 | #define SUBLANG_NORWEGIAN_NYNORSK 0x02 |
| 1411 | #define SUBLANG_PORTUGUESE 0x02 |
| 1412 | #define SUBLANG_PORTUGUESE_BRAZILIAN 0x01 |
| 1413 | #define SUBLANG_SPANISH 0x01 |
| 1414 | #define SUBLANG_SPANISH_MEXICAN 0x02 |
| 1415 | #define SUBLANG_SPANISH_MODERN 0x03 |
| 1416 | #define SUBLANG_SPANISH_GUATEMALA 0x04 |
| 1417 | #define SUBLANG_SPANISH_COSTARICA 0x05 |
| 1418 | #define SUBLANG_SPANISH_PANAMA 0x06 |
| 1419 | #define SUBLANG_SPANISH_DOMINICAN 0x07 |
| 1420 | #define SUBLANG_SPANISH_VENEZUELA 0x08 |
| 1421 | #define SUBLANG_SPANISH_COLOMBIA 0x09 |
| 1422 | #define SUBLANG_SPANISH_PERU 0x0a |
| 1423 | #define SUBLANG_SPANISH_ARGENTINA 0x0b |
| 1424 | #define SUBLANG_SPANISH_ECUADOR 0x0c |
| 1425 | #define SUBLANG_SPANISH_CHILE 0x0d |
| 1426 | #define SUBLANG_SPANISH_URUGUAY 0x0e |
| 1427 | #define SUBLANG_SPANISH_PARAGUAY 0x0f |
| 1428 | #define SUBLANG_SPANISH_BOLIVIA 0x10 |
| 1429 | #define SUBLANG_SPANISH_EL_SALVADOR 0x11 |
| 1430 | #define SUBLANG_SPANISH_HONDURAS 0x12 |
| 1431 | #define SUBLANG_SPANISH_NICARAGUA 0x13 |
| 1432 | #define SUBLANG_SPANISH_PUERTO_RICO 0x14 |
| 1433 | /* FIXME: I don't know the symbolic names for those */ |
| 1434 | #define SUBLANG_ROMANIAN 0x01 |
| 1435 | #define SUBLANG_ROMANIAN_MOLDAVIA 0x02 |
| 1436 | #define SUBLANG_RUSSIAN 0x01 |
| 1437 | #define SUBLANG_RUSSIAN_MOLDAVIA 0x02 |
| 1438 | #define SUBLANG_CROATIAN 0x01 |
| 1439 | #define SUBLANG_SERBIAN 0x02 |
| 1440 | #define SUBLANG_SERBIAN_LATIN 0x03 |
| 1441 | #define SUBLANG_SWEDISH 0x01 |
| 1442 | #define SUBLANG_SWEDISH_FINLAND 0x02 |
| 1443 | #define SUBLANG_LITHUANIAN 0x01 |
| 1444 | #define SUBLANG_LITHUANIAN_CLASSIC 0x02 |
| 1445 | #define SUBLANG_AZERI 0x01 |
| 1446 | #define SUBLANG_AZERI_CYRILLIC 0x02 |
| 1447 | #define SUBLANG_GAELIC 0x01 |
| 1448 | #define SUBLANG_GAELIC_SCOTTISH 0x02 |
| 1449 | #define SUBLANG_GAELIC_MANX 0x03 |
| 1450 | #define SUBLANG_MALAY 0x01 |
| 1451 | #define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02 |
| 1452 | #define SUBLANG_UZBEK 0x01 |
| 1453 | #define SUBLANG_UZBEK_CYRILLIC 0x02 |
| 1454 | #define SUBLANG_URDU_PAKISTAN 0x01 |
| 1455 | |
| 1456 | |
| 1457 | |
| 1458 | /* |
| 1459 | * Sort definitions |
| 1460 | */ |
| 1461 | |
| 1462 | #define SORT_DEFAULT 0x0 |
| 1463 | #define SORT_JAPANESE_XJIS 0x0 |
| 1464 | #define SORT_JAPANESE_UNICODE 0x1 |
| 1465 | #define SORT_CHINESE_BIG5 0x0 |
| 1466 | #define SORT_CHINESE_UNICODE 0x1 |
| 1467 | #define SORT_KOREAN_KSC 0x0 |
| 1468 | #define SORT_KOREAN_UNICODE 0x1 |
| 1469 | |
| 1470 | |
| 1471 | |
| 1472 | /* |
| 1473 | * Definitions for IsTextUnicode() |
| 1474 | */ |
| 1475 | |
| 1476 | #define IS_TEXT_UNICODE_ASCII16 0x0001 |
| 1477 | #define IS_TEXT_UNICODE_STATISTICS 0x0002 |
| 1478 | #define IS_TEXT_UNICODE_CONTROLS 0x0004 |
| 1479 | #define IS_TEXT_UNICODE_SIGNATURE 0x0008 |
| 1480 | #define IS_TEXT_UNICODE_UNICODE_MASK 0x000F |
| 1481 | #define IS_TEXT_UNICODE_REVERSE_ASCII16 0x0010 |
| 1482 | #define IS_TEXT_UNICODE_REVERSE_STATISTICS 0x0020 |
| 1483 | #define IS_TEXT_UNICODE_REVERSE_CONTROLS 0x0040 |
| 1484 | #define IS_TEXT_UNICODE_REVERSE_SIGNATURE 0x0080 |
| 1485 | #define IS_TEXT_UNICODE_REVERSE_MASK 0x00F0 |
| 1486 | #define IS_TEXT_UNICODE_ILLEGAL_CHARS 0x0100 |
| 1487 | #define IS_TEXT_UNICODE_ODD_LENGTH 0x0200 |
| 1488 | #define IS_TEXT_UNICODE_DBCS_LEADBYTE 0x0400 |
| 1489 | #define IS_TEXT_UNICODE_NOT_UNICODE_MASK 0x0F00 |
| 1490 | #define IS_TEXT_UNICODE_NULL_BYTES 0x1000 |
| 1491 | #define IS_TEXT_UNICODE_NOT_ASCII_MASK 0xF000 |
| 1492 | |
| 1493 | |
| 1494 | |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 1495 | /* |
| 1496 | * Exception codes |
| 1497 | */ |
Alexandre Julliard | c18740d | 2000-01-24 05:54:11 +0000 | [diff] [blame] | 1498 | |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 1499 | #define STATUS_SUCCESS 0x00000000 |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 1500 | #define STATUS_WAIT_0 0x00000000 |
| 1501 | #define STATUS_ABANDONED_WAIT_0 0x00000080 |
| 1502 | #define STATUS_USER_APC 0x000000C0 |
| 1503 | #define STATUS_TIMEOUT 0x00000102 |
| 1504 | #define STATUS_PENDING 0x00000103 |
Juergen Schmied | bc3c4d4 | 2000-01-12 04:59:42 +0000 | [diff] [blame] | 1505 | |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 1506 | #define STATUS_GUARD_PAGE_VIOLATION 0x80000001 |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 1507 | #define STATUS_DATATYPE_MISALIGNMENT 0x80000002 |
| 1508 | #define STATUS_BREAKPOINT 0x80000003 |
| 1509 | #define STATUS_SINGLE_STEP 0x80000004 |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 1510 | #define STATUS_BUFFER_OVERFLOW 0x80000005 |
Juergen Schmied | bc3c4d4 | 2000-01-12 04:59:42 +0000 | [diff] [blame] | 1511 | #define STATUS_NO_MORE_FILES 0x80000006 |
| 1512 | #define STATUS_WAKE_SYSTEM_DEBUGGER 0x80000007 |
| 1513 | |
| 1514 | #define STATUS_HANDLES_CLOSED 0x8000000A |
| 1515 | #define STATUS_NO_INHERITANCE 0x8000000B |
| 1516 | #define STATUS_GUID_SUBSTITUTION_MADE 0x8000000C |
| 1517 | #define STATUS_PARTIAL_COPY 0x8000000D |
| 1518 | #define STATUS_DEVICE_PAPER_EMPTY 0x8000000E |
| 1519 | #define STATUS_DEVICE_POWERED_OFF 0x8000000F |
| 1520 | #define STATUS_DEVICE_OFF_LINE 0x80000010 |
| 1521 | #define STATUS_DEVICE_BUSY 0x80000011 |
| 1522 | #define STATUS_NO_MORE_EAS 0x80000012 |
| 1523 | #define STATUS_INVALID_EA_NAME 0x80000013 |
| 1524 | #define STATUS_EA_LIST_INCONSISTENT 0x80000014 |
| 1525 | #define STATUS_INVALID_EA_FLAG 0x80000015 |
| 1526 | #define STATUS_VERIFY_REQUIRED 0x80000016 |
| 1527 | #define STATUS_EXTRANEOUS_INFORMATION 0x80000017 |
| 1528 | #define STATUS_RXACT_COMMIT_NECESSARY 0x80000018 |
| 1529 | #define STATUS_NO_MORE_ENTRIES 0x8000001A |
| 1530 | #define STATUS_FILEMARK_DETECTED 0x8000001B |
| 1531 | #define STATUS_MEDIA_CHANGED 0x8000001C |
| 1532 | #define STATUS_BUS_RESET 0x8000001D |
| 1533 | #define STATUS_END_OF_MEDIA 0x8000001E |
| 1534 | #define STATUS_BEGINNING_OF_MEDIA 0x8000001F |
| 1535 | #define STATUS_MEDIA_CHECK 0x80000020 |
| 1536 | #define STATUS_SETMARK_DETECTED 0x80000021 |
| 1537 | #define STATUS_NO_DATA_DETECTED 0x80000022 |
| 1538 | #define STATUS_REDIRECTOR_HAS_OPEN_HANDLES 0x80000023 |
| 1539 | #define STATUS_SERVER_HAS_OPEN_HANDLES 0x80000024 |
| 1540 | #define STATUS_ALREADY_DISCONNECTED 0x80000025 |
| 1541 | #define STATUS_LONGJUMP 0x80000026 |
| 1542 | |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 1543 | #define STATUS_UNSUCCESSFUL 0xC0000001 |
Juergen Schmied | bc3c4d4 | 2000-01-12 04:59:42 +0000 | [diff] [blame] | 1544 | #define STATUS_NOT_IMPLEMENTED 0xC0000002 |
| 1545 | #define STATUS_INVALID_INFO_CLASS 0xC0000003 |
| 1546 | #define STATUS_INFO_LENGTH_MISMATCH 0xC0000004 |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 1547 | #define STATUS_ACCESS_VIOLATION 0xC0000005 |
| 1548 | #define STATUS_IN_PAGE_ERROR 0xC0000006 |
Juergen Schmied | bc3c4d4 | 2000-01-12 04:59:42 +0000 | [diff] [blame] | 1549 | #define STATUS_PAGEFILE_QUOTA 0xC0000007 |
| 1550 | #define STATUS_INVALID_HANDLE 0xC0000008 |
| 1551 | #define STATUS_BAD_INITIAL_STACK 0xC0000009 |
| 1552 | #define STATUS_BAD_INITIAL_PC 0xC000000A |
| 1553 | #define STATUS_INVALID_CID 0xC000000B |
| 1554 | #define STATUS_TIMER_NOT_CANCELED 0xC000000C |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 1555 | #define STATUS_INVALID_PARAMETER 0xC000000D |
Juergen Schmied | bc3c4d4 | 2000-01-12 04:59:42 +0000 | [diff] [blame] | 1556 | #define STATUS_NO_SUCH_DEVICE 0xC000000E |
| 1557 | #define STATUS_NO_SUCH_FILE 0xC000000F |
| 1558 | #define STATUS_INVALID_DEVICE_REQUEST 0xC0000010 |
| 1559 | #define STATUS_END_OF_FILE 0xC0000011 |
| 1560 | #define STATUS_WRONG_VOLUME 0xC0000012 |
| 1561 | #define STATUS_NO_MEDIA_IN_DEVICE 0xC0000013 |
| 1562 | #define STATUS_UNRECOGNIZED_MEDIA 0xC0000014 |
| 1563 | #define STATUS_NONEXISTENT_SECTOR 0xC0000015 |
| 1564 | #define STATUS_MORE_PROCESSING_REQUIRED 0xC0000016 |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 1565 | #define STATUS_NO_MEMORY 0xC0000017 |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 1566 | #define STATUS_CONFLICTING_ADDRESSES 0xC0000018 |
Juergen Schmied | bc3c4d4 | 2000-01-12 04:59:42 +0000 | [diff] [blame] | 1567 | #define STATUS_NOT_MAPPED_VIEW 0xC0000019 |
| 1568 | #define STATUS_UNABLE_TO_FREE_VM 0xC000001A |
| 1569 | #define STATUS_UNABLE_TO_DELETE_SECTION 0xC000001B |
| 1570 | #define STATUS_INVALID_SYSTEM_SERVICE 0xC000001C |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 1571 | #define STATUS_ILLEGAL_INSTRUCTION 0xC000001D |
Juergen Schmied | bc3c4d4 | 2000-01-12 04:59:42 +0000 | [diff] [blame] | 1572 | #define STATUS_INVALID_LOCK_SEQUENCE 0xC000001E |
| 1573 | #define STATUS_INVALID_VIEW_SIZE 0xC000001F |
| 1574 | #define STATUS_INVALID_FILE_FOR_SECTION 0xC0000020 |
| 1575 | #define STATUS_ALREADY_COMMITTED 0xC0000021 |
| 1576 | #define STATUS_ACCESS_DENIED 0xC0000022 |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 1577 | #define STATUS_BUFFER_TOO_SMALL 0xC0000023 |
Juergen Schmied | bc3c4d4 | 2000-01-12 04:59:42 +0000 | [diff] [blame] | 1578 | #define STATUS_OBJECT_TYPE_MISMATCH 0xC0000024 |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 1579 | #define STATUS_NONCONTINUABLE_EXCEPTION 0xC0000025 |
| 1580 | #define STATUS_INVALID_DISPOSITION 0xC0000026 |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 1581 | #define STATUS_UNWIND 0xC0000027 |
| 1582 | #define STATUS_BAD_STACK 0xC0000028 |
| 1583 | #define STATUS_INVALID_UNWIND_TARGET 0xC0000029 |
Juergen Schmied | bc3c4d4 | 2000-01-12 04:59:42 +0000 | [diff] [blame] | 1584 | #define STATUS_NOT_LOCKED 0xC000002A |
| 1585 | #define STATUS_PARITY_ERROR 0xC000002B |
| 1586 | #define STATUS_UNABLE_TO_DECOMMIT_VM 0xC000002C |
| 1587 | #define STATUS_NOT_COMMITTED 0xC000002D |
| 1588 | #define STATUS_INVALID_PORT_ATTRIBUTES 0xC000002E |
| 1589 | #define STATUS_PORT_MESSAGE_TOO_LONG 0xC000002F |
| 1590 | #define STATUS_INVALID_PARAMETER_MIX 0xC0000030 |
| 1591 | #define STATUS_INVALID_QUOTA_LOWER 0xC0000031 |
| 1592 | #define STATUS_DISK_CORRUPT_ERROR 0xC0000032 |
| 1593 | #define STATUS_OBJECT_NAME_INVALID 0xC0000033 |
| 1594 | #define STATUS_OBJECT_NAME_NOT_FOUND 0xC0000034 |
| 1595 | #define STATUS_OBJECT_NAME_COLLISION 0xC0000035 |
| 1596 | #define STATUS_PORT_DISCONNECTED 0xC0000037 |
| 1597 | #define STATUS_DEVICE_ALREADY_ATTACHED 0xC0000038 |
| 1598 | #define STATUS_OBJECT_PATH_INVALID 0xC0000039 |
| 1599 | #define STATUS_OBJECT_PATH_NOT_FOUND 0xC000003A |
| 1600 | #define STATUS_PATH_SYNTAX_BAD 0xC000003B |
| 1601 | #define STATUS_DATA_OVERRUN 0xC000003C |
| 1602 | #define STATUS_DATA_LATE_ERROR 0xC000003D |
| 1603 | #define STATUS_DATA_ERROR 0xC000003E |
| 1604 | #define STATUS_CRC_ERROR 0xC000003F |
| 1605 | #define STATUS_SECTION_TOO_BIG 0xC0000040 |
| 1606 | #define STATUS_PORT_CONNECTION_REFUSED 0xC0000041 |
| 1607 | #define STATUS_INVALID_PORT_HANDLE 0xC0000042 |
| 1608 | #define STATUS_SHARING_VIOLATION 0xC0000043 |
| 1609 | #define STATUS_QUOTA_EXCEEDED 0xC0000044 |
| 1610 | #define STATUS_INVALID_PAGE_PROTECTION 0xC0000045 |
| 1611 | #define STATUS_MUTANT_NOT_OWNED 0xC0000046 |
| 1612 | #define STATUS_SEMAPHORE_LIMIT_EXCEEDED 0xC0000047 |
| 1613 | #define STATUS_PORT_ALREADY_SET 0xC0000048 |
Alexandre Julliard | c18740d | 2000-01-24 05:54:11 +0000 | [diff] [blame] | 1614 | #define STATUS_SUSPEND_COUNT_EXCEEDED 0xC000004A |
| 1615 | #define STATUS_LOCK_NOT_GRANTED 0xC0000054 /* FIXME: not sure */ |
| 1616 | #define STATUS_FILE_LOCK_CONFLICT 0xC0000055 /* FIXME: not sure */ |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 1617 | #define STATUS_UNKNOWN_REVISION 0xC0000058 |
| 1618 | #define STATUS_INVALID_SECURITY_DESCR 0xC0000079 |
Alexandre Julliard | c18740d | 2000-01-24 05:54:11 +0000 | [diff] [blame] | 1619 | #define STATUS_DISK_FULL 0xC000007F |
Juergen Schmied | bc3c4d4 | 2000-01-12 04:59:42 +0000 | [diff] [blame] | 1620 | #define STATUS_SECTION_NOT_EXTENDED 0xC0000087 |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 1621 | #define STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008C |
| 1622 | #define STATUS_FLOAT_DENORMAL_OPERAND 0xC000008D |
| 1623 | #define STATUS_FLOAT_DIVIDE_BY_ZERO 0xC000008E |
| 1624 | #define STATUS_FLOAT_INEXACT_RESULT 0xC000008F |
| 1625 | #define STATUS_FLOAT_INVALID_OPERATION 0xC0000090 |
| 1626 | #define STATUS_FLOAT_OVERFLOW 0xC0000091 |
| 1627 | #define STATUS_FLOAT_STACK_CHECK 0xC0000092 |
| 1628 | #define STATUS_FLOAT_UNDERFLOW 0xC0000093 |
| 1629 | #define STATUS_INTEGER_DIVIDE_BY_ZERO 0xC0000094 |
| 1630 | #define STATUS_INTEGER_OVERFLOW 0xC0000095 |
| 1631 | #define STATUS_PRIVILEGED_INSTRUCTION 0xC0000096 |
Alexandre Julliard | c18740d | 2000-01-24 05:54:11 +0000 | [diff] [blame] | 1632 | #define STATUS_MEDIA_WRITE_PROTECTED 0XC00000A2 |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 1633 | #define STATUS_INVALID_PARAMETER_2 0xC00000F0 |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 1634 | #define STATUS_STACK_OVERFLOW 0xC00000FD |
Alexandre Julliard | c18740d | 2000-01-24 05:54:11 +0000 | [diff] [blame] | 1635 | #define STATUS_DIRECTORY_NOT_EMPTY 0xC0000101 |
| 1636 | #define STATUS_TOO_MANY_OPENED_FILES 0xC000011F |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 1637 | #define STATUS_CONTROL_C_EXIT 0xC000013A |
Alexandre Julliard | c18740d | 2000-01-24 05:54:11 +0000 | [diff] [blame] | 1638 | #define STATUS_PIPE_BROKEN 0xC000014B |
Juergen Schmied | bc3c4d4 | 2000-01-12 04:59:42 +0000 | [diff] [blame] | 1639 | #define STATUS_NOT_REGISTRY_FILE 0xC000015C |
| 1640 | #define STATUS_PARTITION_FAILURE 0xC0000172 |
| 1641 | #define STATUS_INVALID_BLOCK_LENGTH 0xC0000173 |
| 1642 | #define STATUS_DEVICE_NOT_PARTITIONED 0xC0000174 |
| 1643 | #define STATUS_UNABLE_TO_LOCK_MEDIA 0xC0000175 |
| 1644 | #define STATUS_UNABLE_TO_UNLOAD_MEDIA 0xC0000176 |
| 1645 | #define STATUS_EOM_OVERFLOW 0xC0000177 |
| 1646 | #define STATUS_NO_MEDIA 0xC0000178 |
| 1647 | #define STATUS_NO_SUCH_MEMBER 0xC000017A |
| 1648 | #define STATUS_INVALID_MEMBER 0xC000017B |
| 1649 | #define STATUS_KEY_DELETED 0xC000017C |
| 1650 | #define STATUS_NO_LOG_SPACE 0xC000017D |
| 1651 | #define STATUS_TOO_MANY_SIDS 0xC000017E |
| 1652 | #define STATUS_LM_CROSS_ENCRYPTION_REQUIRED 0xC000017F |
| 1653 | #define STATUS_KEY_HAS_CHILDREN 0xC0000180 |
| 1654 | #define STATUS_CHILD_MUST_BE_VOLATILE 0xC0000181 |
| 1655 | #define STATUS_DEVICE_CONFIGURATION_ERROR0xC0000182 |
| 1656 | #define STATUS_DRIVER_INTERNAL_ERROR 0xC0000183 |
| 1657 | #define STATUS_INVALID_DEVICE_STATE 0xC0000184 |
| 1658 | #define STATUS_IO_DEVICE_ERROR 0xC0000185 |
| 1659 | #define STATUS_DEVICE_PROTOCOL_ERROR 0xC0000186 |
| 1660 | #define STATUS_BACKUP_CONTROLLER 0xC0000187 |
| 1661 | #define STATUS_LOG_FILE_FULL 0xC0000188 |
| 1662 | #define STATUS_TOO_LATE 0xC0000189 |
| 1663 | #define STATUS_NO_TRUST_LSA_SECRET 0xC000018A |
| 1664 | #define STATUS_NO_TRUST_SAM_ACCOUNT 0xC000018B |
| 1665 | #define STATUS_TRUSTED_DOMAIN_FAILURE 0xC000018C |
| 1666 | #define STATUS_TRUSTED_RELATIONSHIP_FAILURE 0xC000018D |
| 1667 | #define STATUS_EVENTLOG_FILE_CORRUPT 0xC000018E |
| 1668 | #define STATUS_EVENTLOG_CANT_START 0xC000018F |
| 1669 | #define STATUS_TRUST_FAILURE 0xC0000190 |
| 1670 | #define STATUS_MUTANT_LIMIT_EXCEEDED 0xC0000191 |
| 1671 | #define STATUS_NETLOGON_NOT_STARTED 0xC0000192 |
| 1672 | #define STATUS_ACCOUNT_EXPIRED 0xC0000193 |
| 1673 | #define STATUS_POSSIBLE_DEADLOCK 0xC0000194 |
| 1674 | #define STATUS_NETWORK_CREDENTIAL_CONFLICT 0xC0000195 |
| 1675 | #define STATUS_REMOTE_SESSION_LIMIT 0xC0000196 |
| 1676 | #define STATUS_EVENTLOG_FILE_CHANGED 0xC0000197 |
| 1677 | #define STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT 0xC0000198 |
| 1678 | #define STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT 0xC0000199 |
| 1679 | #define STATUS_NOLOGON_SERVER_TRUST_ACCOUNT 0xC000019A |
| 1680 | #define STATUS_DOMAIN_TRUST_INCONSISTENT 0xC000019B |
| 1681 | #define STATUS_FS_DRIVER_REQUIRED 0xC000019C |
| 1682 | |
| 1683 | #define STATUS_RESOURCE_LANG_NOT_FOUND 0xC0000204 |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 1684 | |
Alexandre Julliard | 02e9008 | 1998-01-04 17:49:09 +0000 | [diff] [blame] | 1685 | #define MAXIMUM_WAIT_OBJECTS 64 |
| 1686 | #define MAXIMUM_SUSPEND_COUNT 127 |
| 1687 | |
| 1688 | |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 1689 | /* |
| 1690 | * Return values from the actual exception handlers |
| 1691 | */ |
| 1692 | |
| 1693 | #define ExceptionContinueExecution 0 |
| 1694 | #define ExceptionContinueSearch 1 |
| 1695 | #define ExceptionNestedException 2 |
| 1696 | #define ExceptionCollidedUnwind 3 |
| 1697 | |
| 1698 | /* |
| 1699 | * Return values from filters in except() and from UnhandledExceptionFilter |
| 1700 | */ |
| 1701 | |
| 1702 | #define EXCEPTION_EXECUTE_HANDLER 1 |
| 1703 | #define EXCEPTION_CONTINUE_SEARCH 0 |
| 1704 | #define EXCEPTION_CONTINUE_EXECUTION -1 |
| 1705 | |
| 1706 | /* |
| 1707 | * From OS/2 2.0 exception handling |
| 1708 | * Win32 seems to use the same flags as ExceptionFlags in an EXCEPTION_RECORD |
| 1709 | */ |
| 1710 | |
| 1711 | #define EH_NONCONTINUABLE 0x01 |
| 1712 | #define EH_UNWINDING 0x02 |
| 1713 | #define EH_EXIT_UNWIND 0x04 |
| 1714 | #define EH_STACK_INVALID 0x08 |
| 1715 | #define EH_NESTED_CALL 0x10 |
| 1716 | |
| 1717 | #define EXCEPTION_CONTINUABLE 0 |
| 1718 | #define EXCEPTION_NONCONTINUABLE EH_NONCONTINUABLE |
| 1719 | |
| 1720 | /* |
| 1721 | * The exception record used by Win32 to give additional information |
| 1722 | * about exception to exception handlers. |
| 1723 | */ |
| 1724 | |
| 1725 | #define EXCEPTION_MAXIMUM_PARAMETERS 15 |
| 1726 | |
| 1727 | typedef struct __EXCEPTION_RECORD |
| 1728 | { |
| 1729 | DWORD ExceptionCode; |
| 1730 | DWORD ExceptionFlags; |
| 1731 | struct __EXCEPTION_RECORD *ExceptionRecord; |
| 1732 | |
| 1733 | LPVOID ExceptionAddress; |
| 1734 | DWORD NumberParameters; |
| 1735 | DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; |
| 1736 | } EXCEPTION_RECORD, *PEXCEPTION_RECORD; |
| 1737 | |
| 1738 | /* |
| 1739 | * The exception pointers structure passed to exception filters |
| 1740 | * in except() and the UnhandledExceptionFilter(). |
| 1741 | */ |
| 1742 | |
| 1743 | typedef struct _EXCEPTION_POINTERS |
| 1744 | { |
| 1745 | PEXCEPTION_RECORD ExceptionRecord; |
| 1746 | PCONTEXT ContextRecord; |
| 1747 | } EXCEPTION_POINTERS, *PEXCEPTION_POINTERS; |
| 1748 | |
Alexandre Julliard | 89fae7e | 1999-05-12 12:47:01 +0000 | [diff] [blame] | 1749 | |
| 1750 | /* |
| 1751 | * The exception frame, used for registering exception handlers |
| 1752 | * Win32 cares only about this, but compilers generally emit |
| 1753 | * larger exception frames for their own use. |
| 1754 | */ |
| 1755 | |
| 1756 | struct __EXCEPTION_FRAME; |
| 1757 | |
Ulrich Weigand | ae8342d | 1999-11-10 19:42:13 +0000 | [diff] [blame] | 1758 | typedef DWORD (*PEXCEPTION_HANDLER)(PEXCEPTION_RECORD,struct __EXCEPTION_FRAME*, |
| 1759 | PCONTEXT,struct __EXCEPTION_FRAME **); |
Alexandre Julliard | 89fae7e | 1999-05-12 12:47:01 +0000 | [diff] [blame] | 1760 | |
| 1761 | typedef struct __EXCEPTION_FRAME |
| 1762 | { |
| 1763 | struct __EXCEPTION_FRAME *Prev; |
| 1764 | PEXCEPTION_HANDLER Handler; |
| 1765 | } EXCEPTION_FRAME, *PEXCEPTION_FRAME; |
| 1766 | |
Patrik Stridvall | c7a8dde | 1999-04-25 12:36:53 +0000 | [diff] [blame] | 1767 | #include "poppack.h" |
Michael Veksler | 17822f4 | 1999-02-09 15:46:25 +0000 | [diff] [blame] | 1768 | |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 1769 | /* |
| 1770 | * function pointer to a exception filter |
| 1771 | */ |
| 1772 | |
Francois Gouget | ae41e8c | 2000-06-11 20:07:58 +0000 | [diff] [blame] | 1773 | typedef LONG CALLBACK (*PTOP_LEVEL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS ExceptionInfo); |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 1774 | typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER; |
| 1775 | |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1776 | DWORD WINAPI UnhandledExceptionFilter( PEXCEPTION_POINTERS epointers ); |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 1777 | LPTOP_LEVEL_EXCEPTION_FILTER |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1778 | WINAPI SetUnhandledExceptionFilter( LPTOP_LEVEL_EXCEPTION_FILTER filter ); |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 1779 | |
Alexandre Julliard | 1ab8c68 | 1999-05-16 17:11:58 +0000 | [diff] [blame] | 1780 | /* status values for ContinueDebugEvent */ |
| 1781 | #define DBG_CONTINUE 0x00010002 |
| 1782 | #define DBG_TERMINATE_THREAD 0x40010003 |
| 1783 | #define DBG_TERMINATE_PROCESS 0x40010004 |
| 1784 | #define DBG_CONTROL_C 0x40010005 |
| 1785 | #define DBG_CONTROL_BREAK 0x40010008 |
| 1786 | #define DBG_EXCEPTION_NOT_HANDLED 0x80010001 |
| 1787 | |
Juergen Schmied | bc3c4d4 | 2000-01-12 04:59:42 +0000 | [diff] [blame] | 1788 | typedef struct _NT_TIB |
| 1789 | { |
| 1790 | struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList; |
| 1791 | PVOID StackBase; |
| 1792 | PVOID StackLimit; |
| 1793 | PVOID SubSystemTib; |
| 1794 | union { |
| 1795 | PVOID FiberData; |
| 1796 | DWORD Version; |
| 1797 | } DUMMYUNIONNAME; |
| 1798 | PVOID ArbitraryUserPointer; |
| 1799 | struct _NT_TIB *Self; |
| 1800 | } NT_TIB, *PNT_TIB; |
| 1801 | |
Alexandre Julliard | 0a860a0 | 1999-06-22 11:43:42 +0000 | [diff] [blame] | 1802 | struct _TEB; |
Ulrich Weigand | cebd60b | 1999-09-03 16:45:44 +0000 | [diff] [blame] | 1803 | |
Alexandre Julliard | 916f975 | 2000-02-26 16:51:13 +0000 | [diff] [blame] | 1804 | #if defined(__i386__) && defined(__GNUC__) |
Francois Gouget | ae41e8c | 2000-06-11 20:07:58 +0000 | [diff] [blame] | 1805 | extern inline struct _TEB WINAPI *NtCurrentTeb(void); |
| 1806 | extern inline struct _TEB WINAPI *NtCurrentTeb(void) |
Alexandre Julliard | 0a860a0 | 1999-06-22 11:43:42 +0000 | [diff] [blame] | 1807 | { |
| 1808 | struct _TEB *teb; |
| 1809 | __asm__(".byte 0x64\n\tmovl (0x18),%0" : "=r" (teb)); |
| 1810 | return teb; |
| 1811 | } |
Alexandre Julliard | 0a860a0 | 1999-06-22 11:43:42 +0000 | [diff] [blame] | 1812 | #else |
Francois Gouget | ae41e8c | 2000-06-11 20:07:58 +0000 | [diff] [blame] | 1813 | extern struct _TEB WINAPI *NtCurrentTeb(void); |
Alexandre Julliard | 0a860a0 | 1999-06-22 11:43:42 +0000 | [diff] [blame] | 1814 | #endif |
| 1815 | |
Alexandre Julliard | 180a088 | 2000-04-18 11:58:24 +0000 | [diff] [blame] | 1816 | |
| 1817 | /* |
| 1818 | * File formats definitions |
| 1819 | */ |
| 1820 | |
| 1821 | typedef struct _IMAGE_DOS_HEADER { |
| 1822 | WORD e_magic; /* 00: MZ Header signature */ |
| 1823 | WORD e_cblp; /* 02: Bytes on last page of file */ |
| 1824 | WORD e_cp; /* 04: Pages in file */ |
| 1825 | WORD e_crlc; /* 06: Relocations */ |
| 1826 | WORD e_cparhdr; /* 08: Size of header in paragraphs */ |
| 1827 | WORD e_minalloc; /* 0a: Minimum extra paragraphs needed */ |
| 1828 | WORD e_maxalloc; /* 0c: Maximum extra paragraphs needed */ |
| 1829 | WORD e_ss; /* 0e: Initial (relative) SS value */ |
| 1830 | WORD e_sp; /* 10: Initial SP value */ |
| 1831 | WORD e_csum; /* 12: Checksum */ |
| 1832 | WORD e_ip; /* 14: Initial IP value */ |
| 1833 | WORD e_cs; /* 16: Initial (relative) CS value */ |
| 1834 | WORD e_lfarlc; /* 18: File address of relocation table */ |
| 1835 | WORD e_ovno; /* 1a: Overlay number */ |
| 1836 | WORD e_res[4]; /* 1c: Reserved words */ |
| 1837 | WORD e_oemid; /* 24: OEM identifier (for e_oeminfo) */ |
| 1838 | WORD e_oeminfo; /* 26: OEM information; e_oemid specific */ |
| 1839 | WORD e_res2[10]; /* 28: Reserved words */ |
| 1840 | DWORD e_lfanew; /* 3c: Offset to extended header */ |
| 1841 | } IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER; |
| 1842 | |
| 1843 | #define IMAGE_DOS_SIGNATURE 0x5A4D /* MZ */ |
| 1844 | #define IMAGE_OS2_SIGNATURE 0x454E /* NE */ |
| 1845 | #define IMAGE_OS2_SIGNATURE_LE 0x454C /* LE */ |
| 1846 | #define IMAGE_OS2_SIGNATURE_LX 0x584C /* LX */ |
| 1847 | #define IMAGE_VXD_SIGNATURE 0x454C /* LE */ |
| 1848 | #define IMAGE_NT_SIGNATURE 0x00004550 /* PE00 */ |
| 1849 | |
| 1850 | /* |
| 1851 | * This is the Windows executable (NE) header. |
| 1852 | * the name IMAGE_OS2_HEADER is misleading, but in the SDK this way. |
| 1853 | */ |
| 1854 | typedef struct |
| 1855 | { |
| 1856 | WORD ne_magic; /* 00 NE signature 'NE' */ |
| 1857 | BYTE ne_ver; /* 02 Linker version number */ |
| 1858 | BYTE ne_rev; /* 03 Linker revision number */ |
| 1859 | WORD ne_enttab; /* 04 Offset to entry table relative to NE */ |
| 1860 | WORD ne_cbenttab; /* 06 Length of entry table in bytes */ |
| 1861 | LONG ne_crc; /* 08 Checksum */ |
| 1862 | WORD ne_flags; /* 0c Flags about segments in this file */ |
| 1863 | WORD ne_autodata; /* 0e Automatic data segment number */ |
| 1864 | WORD ne_heap; /* 10 Initial size of local heap */ |
| 1865 | WORD ne_stack; /* 12 Initial size of stack */ |
| 1866 | DWORD ne_csip; /* 14 Initial CS:IP */ |
| 1867 | DWORD ne_sssp; /* 18 Initial SS:SP */ |
| 1868 | WORD ne_cseg; /* 1c # of entries in segment table */ |
| 1869 | WORD ne_cmod; /* 1e # of entries in module reference tab. */ |
| 1870 | WORD ne_cbnrestab; /* 20 Length of nonresident-name table */ |
| 1871 | WORD ne_segtab; /* 22 Offset to segment table */ |
| 1872 | WORD ne_rsrctab; /* 24 Offset to resource table */ |
| 1873 | WORD ne_restab; /* 26 Offset to resident-name table */ |
| 1874 | WORD ne_modtab; /* 28 Offset to module reference table */ |
| 1875 | WORD ne_imptab; /* 2a Offset to imported name table */ |
| 1876 | DWORD ne_nrestab; /* 2c Offset to nonresident-name table */ |
| 1877 | WORD ne_cmovent; /* 30 # of movable entry points */ |
| 1878 | WORD ne_align; /* 32 Logical sector alignment shift count */ |
| 1879 | WORD ne_cres; /* 34 # of resource segments */ |
| 1880 | BYTE ne_exetyp; /* 36 Flags indicating target OS */ |
| 1881 | BYTE ne_flagsothers; /* 37 Additional information flags */ |
| 1882 | WORD fastload_offset; /* 38 Offset to fast load area (should be ne_pretthunks)*/ |
| 1883 | WORD fastload_length; /* 3a Length of fast load area (should be ne_psegrefbytes) */ |
| 1884 | WORD ne_swaparea; /* 3c Reserved by Microsoft */ |
| 1885 | WORD ne_expver; /* 3e Expected Windows version number */ |
| 1886 | } IMAGE_OS2_HEADER,*PIMAGE_OS2_HEADER; |
| 1887 | |
| 1888 | typedef struct _IMAGE_VXD_HEADER { |
| 1889 | WORD e32_magic; |
| 1890 | BYTE e32_border; |
| 1891 | BYTE e32_worder; |
| 1892 | DWORD e32_level; |
| 1893 | WORD e32_cpu; |
| 1894 | WORD e32_os; |
| 1895 | DWORD e32_ver; |
| 1896 | DWORD e32_mflags; |
| 1897 | DWORD e32_mpages; |
| 1898 | DWORD e32_startobj; |
| 1899 | DWORD e32_eip; |
| 1900 | DWORD e32_stackobj; |
| 1901 | DWORD e32_esp; |
| 1902 | DWORD e32_pagesize; |
| 1903 | DWORD e32_lastpagesize; |
| 1904 | DWORD e32_fixupsize; |
| 1905 | DWORD e32_fixupsum; |
| 1906 | DWORD e32_ldrsize; |
| 1907 | DWORD e32_ldrsum; |
| 1908 | DWORD e32_objtab; |
| 1909 | DWORD e32_objcnt; |
| 1910 | DWORD e32_objmap; |
| 1911 | DWORD e32_itermap; |
| 1912 | DWORD e32_rsrctab; |
| 1913 | DWORD e32_rsrccnt; |
| 1914 | DWORD e32_restab; |
| 1915 | DWORD e32_enttab; |
| 1916 | DWORD e32_dirtab; |
| 1917 | DWORD e32_dircnt; |
| 1918 | DWORD e32_fpagetab; |
| 1919 | DWORD e32_frectab; |
| 1920 | DWORD e32_impmod; |
| 1921 | DWORD e32_impmodcnt; |
| 1922 | DWORD e32_impproc; |
| 1923 | DWORD e32_pagesum; |
| 1924 | DWORD e32_datapage; |
| 1925 | DWORD e32_preload; |
| 1926 | DWORD e32_nrestab; |
| 1927 | DWORD e32_cbnrestab; |
| 1928 | DWORD e32_nressum; |
| 1929 | DWORD e32_autodata; |
| 1930 | DWORD e32_debuginfo; |
| 1931 | DWORD e32_debuglen; |
| 1932 | DWORD e32_instpreload; |
| 1933 | DWORD e32_instdemand; |
| 1934 | DWORD e32_heapsize; |
| 1935 | BYTE e32_res3[12]; |
| 1936 | DWORD e32_winresoff; |
| 1937 | DWORD e32_winreslen; |
| 1938 | WORD e32_devid; |
| 1939 | WORD e32_ddkver; |
| 1940 | } IMAGE_VXD_HEADER, *PIMAGE_VXD_HEADER; |
| 1941 | |
| 1942 | |
| 1943 | /* These defines describe the meanings of the bits in the Characteristics |
| 1944 | field */ |
| 1945 | |
| 1946 | #define IMAGE_FILE_RELOCS_STRIPPED 0x0001 /* No relocation info */ |
| 1947 | #define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 |
| 1948 | #define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 |
| 1949 | #define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 |
| 1950 | #define IMAGE_FILE_16BIT_MACHINE 0x0040 |
| 1951 | #define IMAGE_FILE_BYTES_REVERSED_LO 0x0080 |
| 1952 | #define IMAGE_FILE_32BIT_MACHINE 0x0100 |
| 1953 | #define IMAGE_FILE_DEBUG_STRIPPED 0x0200 |
| 1954 | #define IMAGE_FILE_SYSTEM 0x1000 |
| 1955 | #define IMAGE_FILE_DLL 0x2000 |
| 1956 | #define IMAGE_FILE_BYTES_REVERSED_HI 0x8000 |
| 1957 | |
| 1958 | /* These are the settings of the Machine field. */ |
| 1959 | #define IMAGE_FILE_MACHINE_UNKNOWN 0 |
| 1960 | #define IMAGE_FILE_MACHINE_I860 0x14d |
| 1961 | #define IMAGE_FILE_MACHINE_I386 0x14c |
| 1962 | #define IMAGE_FILE_MACHINE_R3000 0x162 |
| 1963 | #define IMAGE_FILE_MACHINE_R4000 0x166 |
| 1964 | #define IMAGE_FILE_MACHINE_R10000 0x168 |
| 1965 | #define IMAGE_FILE_MACHINE_ALPHA 0x184 |
| 1966 | #define IMAGE_FILE_MACHINE_POWERPC 0x1F0 |
| 1967 | |
| 1968 | #define IMAGE_SIZEOF_FILE_HEADER 20 |
| 1969 | |
| 1970 | /* Possible Magic values */ |
| 1971 | #define IMAGE_NT_OPTIONAL_HDR_MAGIC 0x10b |
| 1972 | #define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107 |
| 1973 | |
| 1974 | /* These are indexes into the DataDirectory array */ |
| 1975 | #define IMAGE_FILE_EXPORT_DIRECTORY 0 |
| 1976 | #define IMAGE_FILE_IMPORT_DIRECTORY 1 |
| 1977 | #define IMAGE_FILE_RESOURCE_DIRECTORY 2 |
| 1978 | #define IMAGE_FILE_EXCEPTION_DIRECTORY 3 |
| 1979 | #define IMAGE_FILE_SECURITY_DIRECTORY 4 |
| 1980 | #define IMAGE_FILE_BASE_RELOCATION_TABLE 5 |
| 1981 | #define IMAGE_FILE_DEBUG_DIRECTORY 6 |
| 1982 | #define IMAGE_FILE_DESCRIPTION_STRING 7 |
| 1983 | #define IMAGE_FILE_MACHINE_VALUE 8 /* Mips */ |
| 1984 | #define IMAGE_FILE_THREAD_LOCAL_STORAGE 9 |
| 1985 | #define IMAGE_FILE_CALLBACK_DIRECTORY 10 |
| 1986 | |
| 1987 | /* Directory Entries, indices into the DataDirectory array */ |
| 1988 | |
| 1989 | #define IMAGE_DIRECTORY_ENTRY_EXPORT 0 |
| 1990 | #define IMAGE_DIRECTORY_ENTRY_IMPORT 1 |
| 1991 | #define IMAGE_DIRECTORY_ENTRY_RESOURCE 2 |
| 1992 | #define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3 |
| 1993 | #define IMAGE_DIRECTORY_ENTRY_SECURITY 4 |
| 1994 | #define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 |
| 1995 | #define IMAGE_DIRECTORY_ENTRY_DEBUG 6 |
| 1996 | #define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7 |
| 1997 | #define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 /* (MIPS GP) */ |
| 1998 | #define IMAGE_DIRECTORY_ENTRY_TLS 9 |
| 1999 | #define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10 |
| 2000 | #define IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT 11 |
| 2001 | #define IMAGE_DIRECTORY_ENTRY_IAT 12 /* Import Address Table */ |
| 2002 | #define IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT 13 |
| 2003 | #define IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR 14 |
| 2004 | |
| 2005 | /* Subsystem Values */ |
| 2006 | |
| 2007 | #define IMAGE_SUBSYSTEM_UNKNOWN 0 |
| 2008 | #define IMAGE_SUBSYSTEM_NATIVE 1 |
| 2009 | #define IMAGE_SUBSYSTEM_WINDOWS_GUI 2 /* Windows GUI subsystem */ |
| 2010 | #define IMAGE_SUBSYSTEM_WINDOWS_CUI 3 /* Windows character subsystem*/ |
| 2011 | #define IMAGE_SUBSYSTEM_OS2_CUI 5 |
| 2012 | #define IMAGE_SUBSYSTEM_POSIX_CUI 7 |
| 2013 | |
| 2014 | typedef struct _IMAGE_FILE_HEADER { |
| 2015 | WORD Machine; |
| 2016 | WORD NumberOfSections; |
| 2017 | DWORD TimeDateStamp; |
| 2018 | DWORD PointerToSymbolTable; |
| 2019 | DWORD NumberOfSymbols; |
| 2020 | WORD SizeOfOptionalHeader; |
| 2021 | WORD Characteristics; |
| 2022 | } IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER; |
| 2023 | |
| 2024 | typedef struct _IMAGE_DATA_DIRECTORY { |
| 2025 | DWORD VirtualAddress; |
| 2026 | DWORD Size; |
| 2027 | } IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY; |
| 2028 | |
| 2029 | #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 |
| 2030 | |
| 2031 | typedef struct _IMAGE_OPTIONAL_HEADER { |
| 2032 | |
| 2033 | /* Standard fields */ |
| 2034 | |
| 2035 | WORD Magic; |
| 2036 | BYTE MajorLinkerVersion; |
| 2037 | BYTE MinorLinkerVersion; |
| 2038 | DWORD SizeOfCode; |
| 2039 | DWORD SizeOfInitializedData; |
| 2040 | DWORD SizeOfUninitializedData; |
| 2041 | DWORD AddressOfEntryPoint; |
| 2042 | DWORD BaseOfCode; |
| 2043 | DWORD BaseOfData; |
| 2044 | |
| 2045 | /* NT additional fields */ |
| 2046 | |
| 2047 | DWORD ImageBase; |
| 2048 | DWORD SectionAlignment; |
| 2049 | DWORD FileAlignment; |
| 2050 | WORD MajorOperatingSystemVersion; |
| 2051 | WORD MinorOperatingSystemVersion; |
| 2052 | WORD MajorImageVersion; |
| 2053 | WORD MinorImageVersion; |
| 2054 | WORD MajorSubsystemVersion; |
| 2055 | WORD MinorSubsystemVersion; |
| 2056 | DWORD Win32VersionValue; |
| 2057 | DWORD SizeOfImage; |
| 2058 | DWORD SizeOfHeaders; |
| 2059 | DWORD CheckSum; |
| 2060 | WORD Subsystem; |
| 2061 | WORD DllCharacteristics; |
| 2062 | DWORD SizeOfStackReserve; |
| 2063 | DWORD SizeOfStackCommit; |
| 2064 | DWORD SizeOfHeapReserve; |
| 2065 | DWORD SizeOfHeapCommit; |
| 2066 | DWORD LoaderFlags; |
| 2067 | DWORD NumberOfRvaAndSizes; |
| 2068 | IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; |
| 2069 | } IMAGE_OPTIONAL_HEADER, *PIMAGE_OPTIONAL_HEADER; |
| 2070 | |
| 2071 | typedef struct _IMAGE_NT_HEADERS { |
| 2072 | DWORD Signature; |
| 2073 | IMAGE_FILE_HEADER FileHeader; |
| 2074 | IMAGE_OPTIONAL_HEADER OptionalHeader; |
| 2075 | } IMAGE_NT_HEADERS, *PIMAGE_NT_HEADERS; |
| 2076 | |
| 2077 | #define IMAGE_SIZEOF_SHORT_NAME 8 |
| 2078 | |
| 2079 | typedef struct _IMAGE_SECTION_HEADER { |
| 2080 | BYTE Name[IMAGE_SIZEOF_SHORT_NAME]; |
| 2081 | union { |
| 2082 | DWORD PhysicalAddress; |
| 2083 | DWORD VirtualSize; |
| 2084 | } Misc; |
| 2085 | DWORD VirtualAddress; |
| 2086 | DWORD SizeOfRawData; |
| 2087 | DWORD PointerToRawData; |
| 2088 | DWORD PointerToRelocations; |
| 2089 | DWORD PointerToLinenumbers; |
| 2090 | WORD NumberOfRelocations; |
| 2091 | WORD NumberOfLinenumbers; |
| 2092 | DWORD Characteristics; |
| 2093 | } IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER; |
| 2094 | |
| 2095 | #define IMAGE_SIZEOF_SECTION_HEADER 40 |
| 2096 | |
| 2097 | #define IMAGE_FIRST_SECTION(ntheader) \ |
| 2098 | ((PIMAGE_SECTION_HEADER)((LPBYTE)&((PIMAGE_NT_HEADERS)(ntheader))->OptionalHeader + \ |
| 2099 | ((PIMAGE_NT_HEADERS)(ntheader))->FileHeader.SizeOfOptionalHeader)) |
| 2100 | |
| 2101 | /* These defines are for the Characteristics bitfield. */ |
| 2102 | /* #define IMAGE_SCN_TYPE_REG 0x00000000 - Reserved */ |
| 2103 | /* #define IMAGE_SCN_TYPE_DSECT 0x00000001 - Reserved */ |
| 2104 | /* #define IMAGE_SCN_TYPE_NOLOAD 0x00000002 - Reserved */ |
| 2105 | /* #define IMAGE_SCN_TYPE_GROUP 0x00000004 - Reserved */ |
| 2106 | /* #define IMAGE_SCN_TYPE_NO_PAD 0x00000008 - Reserved */ |
| 2107 | /* #define IMAGE_SCN_TYPE_COPY 0x00000010 - Reserved */ |
| 2108 | |
| 2109 | #define IMAGE_SCN_CNT_CODE 0x00000020 |
| 2110 | #define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040 |
| 2111 | #define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080 |
| 2112 | |
| 2113 | #define IMAGE_SCN_LNK_OTHER 0x00000100 |
| 2114 | #define IMAGE_SCN_LNK_INFO 0x00000200 |
| 2115 | /* #define IMAGE_SCN_TYPE_OVER 0x00000400 - Reserved */ |
| 2116 | #define IMAGE_SCN_LNK_REMOVE 0x00000800 |
| 2117 | #define IMAGE_SCN_LNK_COMDAT 0x00001000 |
| 2118 | |
| 2119 | /* 0x00002000 - Reserved */ |
| 2120 | /* #define IMAGE_SCN_MEM_PROTECTED 0x00004000 - Obsolete */ |
| 2121 | #define IMAGE_SCN_MEM_FARDATA 0x00008000 |
| 2122 | |
| 2123 | /* #define IMAGE_SCN_MEM_SYSHEAP 0x00010000 - Obsolete */ |
| 2124 | #define IMAGE_SCN_MEM_PURGEABLE 0x00020000 |
| 2125 | #define IMAGE_SCN_MEM_16BIT 0x00020000 |
| 2126 | #define IMAGE_SCN_MEM_LOCKED 0x00040000 |
| 2127 | #define IMAGE_SCN_MEM_PRELOAD 0x00080000 |
| 2128 | |
| 2129 | #define IMAGE_SCN_ALIGN_1BYTES 0x00100000 |
| 2130 | #define IMAGE_SCN_ALIGN_2BYTES 0x00200000 |
| 2131 | #define IMAGE_SCN_ALIGN_4BYTES 0x00300000 |
| 2132 | #define IMAGE_SCN_ALIGN_8BYTES 0x00400000 |
| 2133 | #define IMAGE_SCN_ALIGN_16BYTES 0x00500000 /* Default */ |
| 2134 | #define IMAGE_SCN_ALIGN_32BYTES 0x00600000 |
| 2135 | #define IMAGE_SCN_ALIGN_64BYTES 0x00700000 |
| 2136 | /* 0x00800000 - Unused */ |
| 2137 | |
| 2138 | #define IMAGE_SCN_LNK_NRELOC_OVFL 0x01000000 |
| 2139 | |
| 2140 | |
| 2141 | #define IMAGE_SCN_MEM_DISCARDABLE 0x02000000 |
| 2142 | #define IMAGE_SCN_MEM_NOT_CACHED 0x04000000 |
| 2143 | #define IMAGE_SCN_MEM_NOT_PAGED 0x08000000 |
| 2144 | #define IMAGE_SCN_MEM_SHARED 0x10000000 |
| 2145 | #define IMAGE_SCN_MEM_EXECUTE 0x20000000 |
| 2146 | #define IMAGE_SCN_MEM_READ 0x40000000 |
| 2147 | #define IMAGE_SCN_MEM_WRITE 0x80000000 |
| 2148 | |
| 2149 | #include "pshpack2.h" |
| 2150 | |
| 2151 | typedef struct _IMAGE_SYMBOL { |
| 2152 | union { |
| 2153 | BYTE ShortName[8]; |
| 2154 | struct { |
| 2155 | DWORD Short; |
| 2156 | DWORD Long; |
| 2157 | } Name; |
| 2158 | DWORD LongName[2]; |
| 2159 | } N; |
| 2160 | DWORD Value; |
| 2161 | SHORT SectionNumber; |
| 2162 | WORD Type; |
| 2163 | BYTE StorageClass; |
| 2164 | BYTE NumberOfAuxSymbols; |
| 2165 | } IMAGE_SYMBOL; |
| 2166 | typedef IMAGE_SYMBOL *PIMAGE_SYMBOL; |
| 2167 | |
| 2168 | #define IMAGE_SIZEOF_SYMBOL 18 |
| 2169 | |
| 2170 | typedef struct _IMAGE_LINENUMBER { |
| 2171 | union { |
| 2172 | DWORD SymbolTableIndex; |
| 2173 | DWORD VirtualAddress; |
| 2174 | } Type; |
| 2175 | WORD Linenumber; |
| 2176 | } IMAGE_LINENUMBER; |
| 2177 | typedef IMAGE_LINENUMBER *PIMAGE_LINENUMBER; |
| 2178 | |
| 2179 | #define IMAGE_SIZEOF_LINENUMBER 6 |
| 2180 | |
| 2181 | typedef union _IMAGE_AUX_SYMBOL { |
| 2182 | struct { |
| 2183 | DWORD TagIndex; |
| 2184 | union { |
| 2185 | struct { |
| 2186 | WORD Linenumber; |
| 2187 | WORD Size; |
| 2188 | } LnSz; |
| 2189 | DWORD TotalSize; |
| 2190 | } Misc; |
| 2191 | union { |
| 2192 | struct { |
| 2193 | DWORD PointerToLinenumber; |
| 2194 | DWORD PointerToNextFunction; |
| 2195 | } Function; |
| 2196 | struct { |
| 2197 | WORD Dimension[4]; |
| 2198 | } Array; |
| 2199 | } FcnAry; |
| 2200 | WORD TvIndex; |
| 2201 | } Sym; |
| 2202 | struct { |
| 2203 | BYTE Name[IMAGE_SIZEOF_SYMBOL]; |
| 2204 | } File; |
| 2205 | struct { |
| 2206 | DWORD Length; |
| 2207 | WORD NumberOfRelocations; |
| 2208 | WORD NumberOfLinenumbers; |
| 2209 | DWORD CheckSum; |
| 2210 | SHORT Number; |
| 2211 | BYTE Selection; |
| 2212 | } Section; |
| 2213 | } IMAGE_AUX_SYMBOL; |
| 2214 | typedef IMAGE_AUX_SYMBOL *PIMAGE_AUX_SYMBOL; |
| 2215 | |
| 2216 | #define IMAGE_SIZEOF_AUX_SYMBOL 18 |
| 2217 | |
| 2218 | #include "poppack.h" |
| 2219 | |
| 2220 | #define IMAGE_SYM_UNDEFINED (SHORT)0 |
| 2221 | #define IMAGE_SYM_ABSOLUTE (SHORT)-1 |
| 2222 | #define IMAGE_SYM_DEBUG (SHORT)-2 |
| 2223 | |
| 2224 | #define IMAGE_SYM_TYPE_NULL 0x0000 |
| 2225 | #define IMAGE_SYM_TYPE_VOID 0x0001 |
| 2226 | #define IMAGE_SYM_TYPE_CHAR 0x0002 |
| 2227 | #define IMAGE_SYM_TYPE_SHORT 0x0003 |
| 2228 | #define IMAGE_SYM_TYPE_INT 0x0004 |
| 2229 | #define IMAGE_SYM_TYPE_LONG 0x0005 |
| 2230 | #define IMAGE_SYM_TYPE_FLOAT 0x0006 |
| 2231 | #define IMAGE_SYM_TYPE_DOUBLE 0x0007 |
| 2232 | #define IMAGE_SYM_TYPE_STRUCT 0x0008 |
| 2233 | #define IMAGE_SYM_TYPE_UNION 0x0009 |
| 2234 | #define IMAGE_SYM_TYPE_ENUM 0x000A |
| 2235 | #define IMAGE_SYM_TYPE_MOE 0x000B |
| 2236 | #define IMAGE_SYM_TYPE_BYTE 0x000C |
| 2237 | #define IMAGE_SYM_TYPE_WORD 0x000D |
| 2238 | #define IMAGE_SYM_TYPE_UINT 0x000E |
| 2239 | #define IMAGE_SYM_TYPE_DWORD 0x000F |
| 2240 | #define IMAGE_SYM_TYPE_PCODE 0x8000 |
| 2241 | |
| 2242 | #define IMAGE_SYM_DTYPE_NULL 0 |
| 2243 | #define IMAGE_SYM_DTYPE_POINTER 1 |
| 2244 | #define IMAGE_SYM_DTYPE_FUNCTION 2 |
| 2245 | #define IMAGE_SYM_DTYPE_ARRAY 3 |
| 2246 | |
| 2247 | #define IMAGE_SYM_CLASS_END_OF_FUNCTION (BYTE )-1 |
| 2248 | #define IMAGE_SYM_CLASS_NULL 0x0000 |
| 2249 | #define IMAGE_SYM_CLASS_AUTOMATIC 0x0001 |
| 2250 | #define IMAGE_SYM_CLASS_EXTERNAL 0x0002 |
| 2251 | #define IMAGE_SYM_CLASS_STATIC 0x0003 |
| 2252 | #define IMAGE_SYM_CLASS_REGISTER 0x0004 |
| 2253 | #define IMAGE_SYM_CLASS_EXTERNAL_DEF 0x0005 |
| 2254 | #define IMAGE_SYM_CLASS_LABEL 0x0006 |
| 2255 | #define IMAGE_SYM_CLASS_UNDEFINED_LABEL 0x0007 |
| 2256 | #define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 0x0008 |
| 2257 | #define IMAGE_SYM_CLASS_ARGUMENT 0x0009 |
| 2258 | #define IMAGE_SYM_CLASS_STRUCT_TAG 0x000A |
| 2259 | #define IMAGE_SYM_CLASS_MEMBER_OF_UNION 0x000B |
| 2260 | #define IMAGE_SYM_CLASS_UNION_TAG 0x000C |
| 2261 | #define IMAGE_SYM_CLASS_TYPE_DEFINITION 0x000D |
| 2262 | #define IMAGE_SYM_CLASS_UNDEFINED_STATIC 0x000E |
| 2263 | #define IMAGE_SYM_CLASS_ENUM_TAG 0x000F |
| 2264 | #define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 0x0010 |
| 2265 | #define IMAGE_SYM_CLASS_REGISTER_PARAM 0x0011 |
| 2266 | #define IMAGE_SYM_CLASS_BIT_FIELD 0x0012 |
| 2267 | |
| 2268 | #define IMAGE_SYM_CLASS_FAR_EXTERNAL 0x0044 |
| 2269 | #define IMAGE_SYM_CLASS_BLOCK 0x0064 |
| 2270 | #define IMAGE_SYM_CLASS_FUNCTION 0x0065 |
| 2271 | #define IMAGE_SYM_CLASS_END_OF_STRUCT 0x0066 |
| 2272 | #define IMAGE_SYM_CLASS_FILE 0x0067 |
| 2273 | #define IMAGE_SYM_CLASS_SECTION 0x0068 |
| 2274 | #define IMAGE_SYM_CLASS_WEAK_EXTERNAL 0x0069 |
| 2275 | |
| 2276 | #define N_BTMASK 0x000F |
| 2277 | #define N_TMASK 0x0030 |
| 2278 | #define N_TMASK1 0x00C0 |
| 2279 | #define N_TMASK2 0x00F0 |
| 2280 | #define N_BTSHFT 4 |
| 2281 | #define N_TSHIFT 2 |
| 2282 | |
| 2283 | #define BTYPE(x) ((x) & N_BTMASK) |
| 2284 | |
| 2285 | #ifndef ISPTR |
| 2286 | #define ISPTR(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT)) |
| 2287 | #endif |
| 2288 | |
| 2289 | #ifndef ISFCN |
| 2290 | #define ISFCN(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_FUNCTION << N_BTSHFT)) |
| 2291 | #endif |
| 2292 | |
| 2293 | #ifndef ISARY |
| 2294 | #define ISARY(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_ARRAY << N_BTSHFT)) |
| 2295 | #endif |
| 2296 | |
| 2297 | #ifndef ISTAG |
| 2298 | #define ISTAG(x) ((x)==IMAGE_SYM_CLASS_STRUCT_TAG || (x)==IMAGE_SYM_CLASS_UNION_TAG || (x)==IMAGE_SYM_CLASS_ENUM_TAG) |
| 2299 | #endif |
| 2300 | |
| 2301 | #ifndef INCREF |
| 2302 | #define INCREF(x) ((((x)&~N_BTMASK)<<N_TSHIFT)|(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT)|((x)&N_BTMASK)) |
| 2303 | #endif |
| 2304 | #ifndef DECREF |
| 2305 | #define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK)) |
| 2306 | #endif |
| 2307 | |
| 2308 | #define IMAGE_COMDAT_SELECT_NODUPLICATES 1 |
| 2309 | #define IMAGE_COMDAT_SELECT_ANY 2 |
| 2310 | #define IMAGE_COMDAT_SELECT_SAME_SIZE 3 |
| 2311 | #define IMAGE_COMDAT_SELECT_EXACT_MATCH 4 |
| 2312 | #define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5 |
| 2313 | #define IMAGE_COMDAT_SELECT_LARGEST 6 |
| 2314 | #define IMAGE_COMDAT_SELECT_NEWEST 7 |
| 2315 | |
| 2316 | #define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1 |
| 2317 | #define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2 |
| 2318 | #define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3 |
| 2319 | |
| 2320 | /* Export module directory */ |
| 2321 | |
| 2322 | typedef struct _IMAGE_EXPORT_DIRECTORY { |
| 2323 | DWORD Characteristics; |
| 2324 | DWORD TimeDateStamp; |
| 2325 | WORD MajorVersion; |
| 2326 | WORD MinorVersion; |
| 2327 | DWORD Name; |
| 2328 | DWORD Base; |
| 2329 | DWORD NumberOfFunctions; |
| 2330 | DWORD NumberOfNames; |
Alexandre Julliard | 246c360 | 2000-05-10 03:48:00 +0000 | [diff] [blame] | 2331 | DWORD AddressOfFunctions; |
| 2332 | DWORD AddressOfNames; |
| 2333 | DWORD AddressOfNameOrdinals; |
Alexandre Julliard | 180a088 | 2000-04-18 11:58:24 +0000 | [diff] [blame] | 2334 | } IMAGE_EXPORT_DIRECTORY,*PIMAGE_EXPORT_DIRECTORY; |
| 2335 | |
| 2336 | /* Import name entry */ |
| 2337 | typedef struct _IMAGE_IMPORT_BY_NAME { |
| 2338 | WORD Hint; |
| 2339 | BYTE Name[1]; |
| 2340 | } IMAGE_IMPORT_BY_NAME,*PIMAGE_IMPORT_BY_NAME; |
| 2341 | |
| 2342 | /* Import thunk */ |
| 2343 | typedef struct _IMAGE_THUNK_DATA { |
| 2344 | union { |
| 2345 | LPBYTE ForwarderString; |
François Gouget | 807b045 | 2000-12-15 20:53:39 +0000 | [diff] [blame] | 2346 | PDWORD Function; |
Alexandre Julliard | 180a088 | 2000-04-18 11:58:24 +0000 | [diff] [blame] | 2347 | DWORD Ordinal; |
| 2348 | PIMAGE_IMPORT_BY_NAME AddressOfData; |
| 2349 | } u1; |
| 2350 | } IMAGE_THUNK_DATA,*PIMAGE_THUNK_DATA; |
| 2351 | |
| 2352 | /* Import module directory */ |
| 2353 | |
| 2354 | typedef struct _IMAGE_IMPORT_DESCRIPTOR { |
| 2355 | union { |
| 2356 | DWORD Characteristics; /* 0 for terminating null import descriptor */ |
| 2357 | PIMAGE_THUNK_DATA OriginalFirstThunk; /* RVA to original unbound IAT */ |
| 2358 | } u; |
| 2359 | DWORD TimeDateStamp; /* 0 if not bound, |
| 2360 | * -1 if bound, and real date\time stamp |
| 2361 | * in IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT |
| 2362 | * (new BIND) |
| 2363 | * otherwise date/time stamp of DLL bound to |
| 2364 | * (Old BIND) |
| 2365 | */ |
| 2366 | DWORD ForwarderChain; /* -1 if no forwarders */ |
| 2367 | DWORD Name; |
| 2368 | /* RVA to IAT (if bound this IAT has actual addresses) */ |
| 2369 | PIMAGE_THUNK_DATA FirstThunk; |
| 2370 | } IMAGE_IMPORT_DESCRIPTOR,*PIMAGE_IMPORT_DESCRIPTOR; |
| 2371 | |
| 2372 | #define IMAGE_ORDINAL_FLAG 0x80000000 |
| 2373 | #define IMAGE_SNAP_BY_ORDINAL(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG) != 0) |
| 2374 | #define IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff) |
| 2375 | |
| 2376 | typedef struct _IMAGE_BOUND_IMPORT_DESCRIPTOR |
| 2377 | { |
| 2378 | DWORD TimeDateStamp; |
| 2379 | WORD OffsetModuleName; |
| 2380 | WORD NumberOfModuleForwarderRefs; |
| 2381 | /* Array of zero or more IMAGE_BOUND_FORWARDER_REF follows */ |
| 2382 | } IMAGE_BOUND_IMPORT_DESCRIPTOR, *PIMAGE_BOUND_IMPORT_DESCRIPTOR; |
| 2383 | |
| 2384 | typedef struct _IMAGE_BOUND_FORWARDER_REF |
| 2385 | { |
| 2386 | DWORD TimeDateStamp; |
| 2387 | WORD OffsetModuleName; |
| 2388 | WORD Reserved; |
| 2389 | } IMAGE_BOUND_FORWARDER_REF, *PIMAGE_BOUND_FORWARDER_REF; |
| 2390 | |
| 2391 | typedef struct _IMAGE_BASE_RELOCATION |
| 2392 | { |
| 2393 | DWORD VirtualAddress; |
| 2394 | DWORD SizeOfBlock; |
| 2395 | WORD TypeOffset[1]; |
| 2396 | } IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION; |
| 2397 | |
| 2398 | typedef struct _IMAGE_RELOCATION |
| 2399 | { |
| 2400 | union { |
| 2401 | DWORD VirtualAddress; |
| 2402 | DWORD RelocCount; |
| 2403 | } u; |
| 2404 | DWORD SymbolTableIndex; |
| 2405 | WORD Type; |
| 2406 | } IMAGE_RELOCATION; |
| 2407 | typedef IMAGE_RELOCATION *PIMAGE_RELOCATION; |
| 2408 | |
| 2409 | #define IMAGE_SIZEOF_RELOCATION 10 |
| 2410 | |
| 2411 | /* generic relocation types */ |
| 2412 | #define IMAGE_REL_BASED_ABSOLUTE 0 |
| 2413 | #define IMAGE_REL_BASED_HIGH 1 |
| 2414 | #define IMAGE_REL_BASED_LOW 2 |
| 2415 | #define IMAGE_REL_BASED_HIGHLOW 3 |
| 2416 | #define IMAGE_REL_BASED_HIGHADJ 4 |
| 2417 | #define IMAGE_REL_BASED_MIPS_JMPADDR 5 |
| 2418 | #define IMAGE_REL_BASED_SECTION 6 |
| 2419 | #define IMAGE_REL_BASED_REL 7 |
| 2420 | #define IMAGE_REL_BASED_MIPS_JMPADDR16 9 |
| 2421 | #define IMAGE_REL_BASED_IA64_IMM64 9 /* yes, 9 too */ |
| 2422 | #define IMAGE_REL_BASED_DIR64 10 |
| 2423 | #define IMAGE_REL_BASED_HIGH3ADJ 11 |
| 2424 | |
| 2425 | /* I386 relocation types */ |
| 2426 | #define IMAGE_REL_I386_ABSOLUTE 0 |
| 2427 | #define IMAGE_REL_I386_DIR16 1 |
| 2428 | #define IMAGE_REL_I386_REL16 2 |
| 2429 | #define IMAGE_REL_I386_DIR32 6 |
| 2430 | #define IMAGE_REL_I386_DIR32NB 7 |
| 2431 | #define IMAGE_REL_I386_SEG12 9 |
| 2432 | #define IMAGE_REL_I386_SECTION 10 |
| 2433 | #define IMAGE_REL_I386_SECREL 11 |
| 2434 | #define IMAGE_REL_I386_REL32 20 |
| 2435 | |
| 2436 | /* MIPS relocation types */ |
| 2437 | #define IMAGE_REL_MIPS_ABSOLUTE 0x0000 |
| 2438 | #define IMAGE_REL_MIPS_REFHALF 0x0001 |
| 2439 | #define IMAGE_REL_MIPS_REFWORD 0x0002 |
| 2440 | #define IMAGE_REL_MIPS_JMPADDR 0x0003 |
| 2441 | #define IMAGE_REL_MIPS_REFHI 0x0004 |
| 2442 | #define IMAGE_REL_MIPS_REFLO 0x0005 |
| 2443 | #define IMAGE_REL_MIPS_GPREL 0x0006 |
| 2444 | #define IMAGE_REL_MIPS_LITERAL 0x0007 |
| 2445 | #define IMAGE_REL_MIPS_SECTION 0x000A |
| 2446 | #define IMAGE_REL_MIPS_SECREL 0x000B |
| 2447 | #define IMAGE_REL_MIPS_SECRELLO 0x000C |
| 2448 | #define IMAGE_REL_MIPS_SECRELHI 0x000D |
| 2449 | #define IMAGE_REL_MIPS_JMPADDR16 0x0010 |
| 2450 | #define IMAGE_REL_MIPS_REFWORDNB 0x0022 |
| 2451 | #define IMAGE_REL_MIPS_PAIR 0x0025 |
| 2452 | |
| 2453 | /* ALPHA relocation types */ |
| 2454 | #define IMAGE_REL_ALPHA_ABSOLUTE 0x0000 |
| 2455 | #define IMAGE_REL_ALPHA_REFLONG 0x0001 |
| 2456 | #define IMAGE_REL_ALPHA_REFQUAD 0x0002 |
| 2457 | #define IMAGE_REL_ALPHA_GPREL 0x0003 |
| 2458 | #define IMAGE_REL_ALPHA_LITERAL 0x0004 |
| 2459 | #define IMAGE_REL_ALPHA_LITUSE 0x0005 |
| 2460 | #define IMAGE_REL_ALPHA_GPDISP 0x0006 |
| 2461 | #define IMAGE_REL_ALPHA_BRADDR 0x0007 |
| 2462 | #define IMAGE_REL_ALPHA_HINT 0x0008 |
| 2463 | #define IMAGE_REL_ALPHA_INLINE_REFLONG 0x0009 |
| 2464 | #define IMAGE_REL_ALPHA_REFHI 0x000A |
| 2465 | #define IMAGE_REL_ALPHA_REFLO 0x000B |
| 2466 | #define IMAGE_REL_ALPHA_PAIR 0x000C |
| 2467 | #define IMAGE_REL_ALPHA_MATCH 0x000D |
| 2468 | #define IMAGE_REL_ALPHA_SECTION 0x000E |
| 2469 | #define IMAGE_REL_ALPHA_SECREL 0x000F |
| 2470 | #define IMAGE_REL_ALPHA_REFLONGNB 0x0010 |
| 2471 | #define IMAGE_REL_ALPHA_SECRELLO 0x0011 |
| 2472 | #define IMAGE_REL_ALPHA_SECRELHI 0x0012 |
| 2473 | #define IMAGE_REL_ALPHA_REFQ3 0x0013 |
| 2474 | #define IMAGE_REL_ALPHA_REFQ2 0x0014 |
| 2475 | #define IMAGE_REL_ALPHA_REFQ1 0x0015 |
| 2476 | #define IMAGE_REL_ALPHA_GPRELLO 0x0016 |
| 2477 | #define IMAGE_REL_ALPHA_GPRELHI 0x0017 |
| 2478 | |
| 2479 | /* PowerPC relocation types */ |
| 2480 | #define IMAGE_REL_PPC_ABSOLUTE 0x0000 |
| 2481 | #define IMAGE_REL_PPC_ADDR64 0x0001 |
| 2482 | #define IMAGE_REL_PPC_ADDR 0x0002 |
| 2483 | #define IMAGE_REL_PPC_ADDR24 0x0003 |
| 2484 | #define IMAGE_REL_PPC_ADDR16 0x0004 |
| 2485 | #define IMAGE_REL_PPC_ADDR14 0x0005 |
| 2486 | #define IMAGE_REL_PPC_REL24 0x0006 |
| 2487 | #define IMAGE_REL_PPC_REL14 0x0007 |
| 2488 | #define IMAGE_REL_PPC_TOCREL16 0x0008 |
| 2489 | #define IMAGE_REL_PPC_TOCREL14 0x0009 |
| 2490 | #define IMAGE_REL_PPC_ADDR32NB 0x000A |
| 2491 | #define IMAGE_REL_PPC_SECREL 0x000B |
| 2492 | #define IMAGE_REL_PPC_SECTION 0x000C |
| 2493 | #define IMAGE_REL_PPC_IFGLUE 0x000D |
| 2494 | #define IMAGE_REL_PPC_IMGLUE 0x000E |
| 2495 | #define IMAGE_REL_PPC_SECREL16 0x000F |
| 2496 | #define IMAGE_REL_PPC_REFHI 0x0010 |
| 2497 | #define IMAGE_REL_PPC_REFLO 0x0011 |
| 2498 | #define IMAGE_REL_PPC_PAIR 0x0012 |
| 2499 | #define IMAGE_REL_PPC_SECRELLO 0x0013 |
| 2500 | #define IMAGE_REL_PPC_SECRELHI 0x0014 |
| 2501 | #define IMAGE_REL_PPC_GPREL 0x0015 |
| 2502 | #define IMAGE_REL_PPC_TYPEMASK 0x00FF |
| 2503 | /* modifier bits */ |
| 2504 | #define IMAGE_REL_PPC_NEG 0x0100 |
| 2505 | #define IMAGE_REL_PPC_BRTAKEN 0x0200 |
| 2506 | #define IMAGE_REL_PPC_BRNTAKEN 0x0400 |
| 2507 | #define IMAGE_REL_PPC_TOCDEFN 0x0800 |
| 2508 | |
| 2509 | /* SH3 ? relocation type */ |
| 2510 | #define IMAGE_REL_SH3_ABSOLUTE 0x0000 |
| 2511 | #define IMAGE_REL_SH3_DIRECT16 0x0001 |
| 2512 | #define IMAGE_REL_SH3_DIRECT 0x0002 |
| 2513 | #define IMAGE_REL_SH3_DIRECT8 0x0003 |
| 2514 | #define IMAGE_REL_SH3_DIRECT8_WORD 0x0004 |
| 2515 | #define IMAGE_REL_SH3_DIRECT8_LONG 0x0005 |
| 2516 | #define IMAGE_REL_SH3_DIRECT4 0x0006 |
| 2517 | #define IMAGE_REL_SH3_DIRECT4_WORD 0x0007 |
| 2518 | #define IMAGE_REL_SH3_DIRECT4_LONG 0x0008 |
| 2519 | #define IMAGE_REL_SH3_PCREL8_WORD 0x0009 |
| 2520 | #define IMAGE_REL_SH3_PCREL8_LONG 0x000A |
| 2521 | #define IMAGE_REL_SH3_PCREL12_WORD 0x000B |
| 2522 | #define IMAGE_REL_SH3_STARTOF_SECTION 0x000C |
| 2523 | #define IMAGE_REL_SH3_SIZEOF_SECTION 0x000D |
| 2524 | #define IMAGE_REL_SH3_SECTION 0x000E |
| 2525 | #define IMAGE_REL_SH3_SECREL 0x000F |
| 2526 | #define IMAGE_REL_SH3_DIRECT32_NB 0x0010 |
| 2527 | |
| 2528 | /* ARM (Archimedes?) relocation types */ |
| 2529 | #define IMAGE_REL_ARM_ABSOLUTE 0x0000 |
| 2530 | #define IMAGE_REL_ARM_ADDR 0x0001 |
| 2531 | #define IMAGE_REL_ARM_ADDR32NB 0x0002 |
| 2532 | #define IMAGE_REL_ARM_BRANCH24 0x0003 |
| 2533 | #define IMAGE_REL_ARM_BRANCH11 0x0004 |
| 2534 | #define IMAGE_REL_ARM_SECTION 0x000E |
| 2535 | #define IMAGE_REL_ARM_SECREL 0x000F |
| 2536 | |
| 2537 | /* IA64 relocation types */ |
| 2538 | #define IMAGE_REL_IA64_ABSOLUTE 0x0000 |
| 2539 | #define IMAGE_REL_IA64_IMM14 0x0001 |
| 2540 | #define IMAGE_REL_IA64_IMM22 0x0002 |
| 2541 | #define IMAGE_REL_IA64_IMM64 0x0003 |
| 2542 | #define IMAGE_REL_IA64_DIR 0x0004 |
| 2543 | #define IMAGE_REL_IA64_DIR64 0x0005 |
| 2544 | #define IMAGE_REL_IA64_PCREL21B 0x0006 |
| 2545 | #define IMAGE_REL_IA64_PCREL21M 0x0007 |
| 2546 | #define IMAGE_REL_IA64_PCREL21F 0x0008 |
| 2547 | #define IMAGE_REL_IA64_GPREL22 0x0009 |
| 2548 | #define IMAGE_REL_IA64_LTOFF22 0x000A |
| 2549 | #define IMAGE_REL_IA64_SECTION 0x000B |
| 2550 | #define IMAGE_REL_IA64_SECREL22 0x000C |
| 2551 | #define IMAGE_REL_IA64_SECREL64I 0x000D |
| 2552 | #define IMAGE_REL_IA64_SECREL 0x000E |
| 2553 | #define IMAGE_REL_IA64_LTOFF64 0x000F |
| 2554 | #define IMAGE_REL_IA64_DIR32NB 0x0010 |
| 2555 | #define IMAGE_REL_IA64_RESERVED_11 0x0011 |
| 2556 | #define IMAGE_REL_IA64_RESERVED_12 0x0012 |
| 2557 | #define IMAGE_REL_IA64_RESERVED_13 0x0013 |
| 2558 | #define IMAGE_REL_IA64_RESERVED_14 0x0014 |
| 2559 | #define IMAGE_REL_IA64_RESERVED_15 0x0015 |
| 2560 | #define IMAGE_REL_IA64_RESERVED_16 0x0016 |
| 2561 | #define IMAGE_REL_IA64_ADDEND 0x001F |
| 2562 | |
| 2563 | /* archive format */ |
| 2564 | |
| 2565 | #define IMAGE_ARCHIVE_START_SIZE 8 |
| 2566 | #define IMAGE_ARCHIVE_START "!<arch>\n" |
| 2567 | #define IMAGE_ARCHIVE_END "`\n" |
| 2568 | #define IMAGE_ARCHIVE_PAD "\n" |
| 2569 | #define IMAGE_ARCHIVE_LINKER_MEMBER "/ " |
| 2570 | #define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// " |
| 2571 | |
| 2572 | typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER |
| 2573 | { |
| 2574 | BYTE Name[16]; |
| 2575 | BYTE Date[12]; |
| 2576 | BYTE UserID[6]; |
| 2577 | BYTE GroupID[6]; |
| 2578 | BYTE Mode[8]; |
| 2579 | BYTE Size[10]; |
| 2580 | BYTE EndHeader[2]; |
| 2581 | } IMAGE_ARCHIVE_MEMBER_HEADER, *PIMAGE_ARCHIVE_MEMBER_HEADER; |
| 2582 | |
| 2583 | #define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60 |
| 2584 | |
| 2585 | /* |
| 2586 | * Resource directory stuff |
| 2587 | */ |
| 2588 | typedef struct _IMAGE_RESOURCE_DIRECTORY { |
| 2589 | DWORD Characteristics; |
| 2590 | DWORD TimeDateStamp; |
| 2591 | WORD MajorVersion; |
| 2592 | WORD MinorVersion; |
| 2593 | WORD NumberOfNamedEntries; |
| 2594 | WORD NumberOfIdEntries; |
| 2595 | /* IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[]; */ |
| 2596 | } IMAGE_RESOURCE_DIRECTORY,*PIMAGE_RESOURCE_DIRECTORY; |
| 2597 | |
| 2598 | #define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000 |
| 2599 | #define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000 |
| 2600 | |
| 2601 | typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY { |
| 2602 | union { |
| 2603 | struct { |
Ulrich Weigand | 9759140 | 2000-12-19 03:38:53 +0000 | [diff] [blame] | 2604 | #ifdef BITFIELDS_BIGENDIAN |
| 2605 | unsigned NameIsString:1; |
| 2606 | unsigned NameOffset:31; |
| 2607 | #else |
Alexandre Julliard | 180a088 | 2000-04-18 11:58:24 +0000 | [diff] [blame] | 2608 | unsigned NameOffset:31; |
| 2609 | unsigned NameIsString:1; |
Ulrich Weigand | 9759140 | 2000-12-19 03:38:53 +0000 | [diff] [blame] | 2610 | #endif |
Francois Gouget | da0acca | 2000-11-10 22:34:39 +0000 | [diff] [blame] | 2611 | } DUMMYSTRUCTNAME1; |
Alexandre Julliard | 180a088 | 2000-04-18 11:58:24 +0000 | [diff] [blame] | 2612 | DWORD Name; |
Ulrich Weigand | 9759140 | 2000-12-19 03:38:53 +0000 | [diff] [blame] | 2613 | struct { |
| 2614 | #ifdef WORDS_BIGENDIAN |
| 2615 | WORD __pad; |
| 2616 | WORD Id; |
| 2617 | #else |
| 2618 | WORD Id; |
| 2619 | WORD __pad; |
| 2620 | #endif |
| 2621 | } DUMMYSTRUCTNAME2; |
Francois Gouget | da0acca | 2000-11-10 22:34:39 +0000 | [diff] [blame] | 2622 | } DUMMYUNIONNAME1; |
Alexandre Julliard | 180a088 | 2000-04-18 11:58:24 +0000 | [diff] [blame] | 2623 | union { |
| 2624 | DWORD OffsetToData; |
| 2625 | struct { |
Ulrich Weigand | 9759140 | 2000-12-19 03:38:53 +0000 | [diff] [blame] | 2626 | #ifdef BITFIELDS_BIGENDIAN |
| 2627 | unsigned DataIsDirectory:1; |
| 2628 | unsigned OffsetToDirectory:31; |
| 2629 | #else |
Alexandre Julliard | 180a088 | 2000-04-18 11:58:24 +0000 | [diff] [blame] | 2630 | unsigned OffsetToDirectory:31; |
| 2631 | unsigned DataIsDirectory:1; |
Ulrich Weigand | 9759140 | 2000-12-19 03:38:53 +0000 | [diff] [blame] | 2632 | #endif |
François Gouget | 5e5c52d | 2000-12-19 23:31:52 +0000 | [diff] [blame] | 2633 | } DUMMYSTRUCTNAME3; |
Francois Gouget | da0acca | 2000-11-10 22:34:39 +0000 | [diff] [blame] | 2634 | } DUMMYUNIONNAME2; |
Alexandre Julliard | 180a088 | 2000-04-18 11:58:24 +0000 | [diff] [blame] | 2635 | } IMAGE_RESOURCE_DIRECTORY_ENTRY,*PIMAGE_RESOURCE_DIRECTORY_ENTRY; |
| 2636 | |
| 2637 | |
| 2638 | typedef struct _IMAGE_RESOURCE_DIRECTORY_STRING { |
| 2639 | WORD Length; |
| 2640 | CHAR NameString[ 1 ]; |
| 2641 | } IMAGE_RESOURCE_DIRECTORY_STRING,*PIMAGE_RESOURCE_DIRECTORY_STRING; |
| 2642 | |
| 2643 | typedef struct _IMAGE_RESOURCE_DIR_STRING_U { |
| 2644 | WORD Length; |
| 2645 | WCHAR NameString[ 1 ]; |
| 2646 | } IMAGE_RESOURCE_DIR_STRING_U,*PIMAGE_RESOURCE_DIR_STRING_U; |
| 2647 | |
| 2648 | typedef struct _IMAGE_RESOURCE_DATA_ENTRY { |
| 2649 | DWORD OffsetToData; |
| 2650 | DWORD Size; |
| 2651 | DWORD CodePage; |
| 2652 | DWORD ResourceHandle; |
| 2653 | } IMAGE_RESOURCE_DATA_ENTRY,*PIMAGE_RESOURCE_DATA_ENTRY; |
| 2654 | |
| 2655 | |
Francois Gouget | ae41e8c | 2000-06-11 20:07:58 +0000 | [diff] [blame] | 2656 | typedef VOID CALLBACK (*PIMAGE_TLS_CALLBACK)( |
Alexandre Julliard | 180a088 | 2000-04-18 11:58:24 +0000 | [diff] [blame] | 2657 | LPVOID DllHandle,DWORD Reason,LPVOID Reserved |
| 2658 | ); |
| 2659 | |
| 2660 | typedef struct _IMAGE_TLS_DIRECTORY { |
| 2661 | DWORD StartAddressOfRawData; |
| 2662 | DWORD EndAddressOfRawData; |
| 2663 | LPDWORD AddressOfIndex; |
| 2664 | PIMAGE_TLS_CALLBACK *AddressOfCallBacks; |
| 2665 | DWORD SizeOfZeroFill; |
| 2666 | DWORD Characteristics; |
| 2667 | } IMAGE_TLS_DIRECTORY,*PIMAGE_TLS_DIRECTORY; |
| 2668 | |
| 2669 | typedef struct _IMAGE_DEBUG_DIRECTORY { |
| 2670 | DWORD Characteristics; |
| 2671 | DWORD TimeDateStamp; |
| 2672 | WORD MajorVersion; |
| 2673 | WORD MinorVersion; |
| 2674 | DWORD Type; |
| 2675 | DWORD SizeOfData; |
| 2676 | DWORD AddressOfRawData; |
| 2677 | DWORD PointerToRawData; |
| 2678 | } IMAGE_DEBUG_DIRECTORY, *PIMAGE_DEBUG_DIRECTORY; |
| 2679 | |
| 2680 | #define IMAGE_DEBUG_TYPE_UNKNOWN 0 |
| 2681 | #define IMAGE_DEBUG_TYPE_COFF 1 |
| 2682 | #define IMAGE_DEBUG_TYPE_CODEVIEW 2 |
| 2683 | #define IMAGE_DEBUG_TYPE_FPO 3 |
| 2684 | #define IMAGE_DEBUG_TYPE_MISC 4 |
| 2685 | #define IMAGE_DEBUG_TYPE_EXCEPTION 5 |
| 2686 | #define IMAGE_DEBUG_TYPE_FIXUP 6 |
| 2687 | #define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7 |
| 2688 | #define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8 |
| 2689 | #define IMAGE_DEBUG_TYPE_BORLAND 9 |
| 2690 | #define IMAGE_DEBUG_TYPE_RESERVED10 10 |
| 2691 | |
| 2692 | typedef struct _IMAGE_COFF_SYMBOLS_HEADER { |
| 2693 | DWORD NumberOfSymbols; |
| 2694 | DWORD LvaToFirstSymbol; |
| 2695 | DWORD NumberOfLinenumbers; |
| 2696 | DWORD LvaToFirstLinenumber; |
| 2697 | DWORD RvaToFirstByteOfCode; |
| 2698 | DWORD RvaToLastByteOfCode; |
| 2699 | DWORD RvaToFirstByteOfData; |
| 2700 | DWORD RvaToLastByteOfData; |
| 2701 | } IMAGE_COFF_SYMBOLS_HEADER, *PIMAGE_COFF_SYMBOLS_HEADER; |
| 2702 | |
| 2703 | #define FRAME_FPO 0 |
| 2704 | #define FRAME_TRAP 1 |
| 2705 | #define FRAME_TSS 2 |
| 2706 | #define FRAME_NONFPO 3 |
| 2707 | |
| 2708 | typedef struct _FPO_DATA { |
| 2709 | DWORD ulOffStart; |
| 2710 | DWORD cbProcSize; |
| 2711 | DWORD cdwLocals; |
| 2712 | WORD cdwParams; |
| 2713 | unsigned cbProlog : 8; |
| 2714 | unsigned cbRegs : 3; |
| 2715 | unsigned fHasSEH : 1; |
| 2716 | unsigned fUseBP : 1; |
| 2717 | unsigned reserved : 1; |
| 2718 | unsigned cbFrame : 2; |
| 2719 | } FPO_DATA, *PFPO_DATA; |
| 2720 | |
| 2721 | typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY { |
| 2722 | DWORD Characteristics; |
| 2723 | DWORD TimeDateStamp; |
| 2724 | WORD MajorVersion; |
| 2725 | WORD MinorVersion; |
| 2726 | DWORD GlobalFlagsClear; |
| 2727 | DWORD GlobalFlagsSet; |
| 2728 | DWORD CriticalSectionDefaultTimeout; |
| 2729 | DWORD DeCommitFreeBlockThreshold; |
| 2730 | DWORD DeCommitTotalFreeThreshold; |
| 2731 | PVOID LockPrefixTable; |
| 2732 | DWORD MaximumAllocationSize; |
| 2733 | DWORD VirtualMemoryThreshold; |
| 2734 | DWORD ProcessHeapFlags; |
| 2735 | DWORD ProcessAffinityMask; |
| 2736 | WORD CSDVersion; |
| 2737 | WORD Reserved1; |
| 2738 | PVOID EditList; |
| 2739 | DWORD Reserved[1]; |
| 2740 | } IMAGE_LOAD_CONFIG_DIRECTORY, *PIMAGE_LOAD_CONFIG_DIRECTORY; |
| 2741 | |
| 2742 | typedef struct _IMAGE_FUNCTION_ENTRY { |
| 2743 | DWORD StartingAddress; |
| 2744 | DWORD EndingAddress; |
| 2745 | DWORD EndOfPrologue; |
| 2746 | } IMAGE_FUNCTION_ENTRY, *PIMAGE_FUNCTION_ENTRY; |
| 2747 | |
Ulrich Weigand | 1b4c779 | 2000-11-07 20:29:00 +0000 | [diff] [blame] | 2748 | #define IMAGE_DEBUG_MISC_EXENAME 1 |
| 2749 | |
| 2750 | typedef struct _IMAGE_DEBUG_MISC { |
| 2751 | DWORD DataType; |
| 2752 | DWORD Length; |
| 2753 | BYTE Unicode; |
| 2754 | BYTE Reserved[ 3 ]; |
| 2755 | BYTE Data[ 1 ]; |
| 2756 | } IMAGE_DEBUG_MISC, *PIMAGE_DEBUG_MISC; |
| 2757 | |
Alexandre Julliard | 180a088 | 2000-04-18 11:58:24 +0000 | [diff] [blame] | 2758 | /* This is the structure that appears at the very start of a .DBG file. */ |
| 2759 | |
| 2760 | typedef struct _IMAGE_SEPARATE_DEBUG_HEADER { |
| 2761 | WORD Signature; |
| 2762 | WORD Flags; |
| 2763 | WORD Machine; |
| 2764 | WORD Characteristics; |
| 2765 | DWORD TimeDateStamp; |
| 2766 | DWORD CheckSum; |
| 2767 | DWORD ImageBase; |
| 2768 | DWORD SizeOfImage; |
| 2769 | DWORD NumberOfSections; |
| 2770 | DWORD ExportedNamesSize; |
| 2771 | DWORD DebugDirectorySize; |
| 2772 | DWORD SectionAlignment; |
| 2773 | DWORD Reserved[ 2 ]; |
| 2774 | } IMAGE_SEPARATE_DEBUG_HEADER,*PIMAGE_SEPARATE_DEBUG_HEADER; |
| 2775 | |
| 2776 | #define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944 |
| 2777 | |
| 2778 | |
| 2779 | typedef struct tagMESSAGE_RESOURCE_ENTRY { |
| 2780 | WORD Length; |
| 2781 | WORD Flags; |
| 2782 | BYTE Text[1]; |
| 2783 | } MESSAGE_RESOURCE_ENTRY,*PMESSAGE_RESOURCE_ENTRY; |
| 2784 | #define MESSAGE_RESOURCE_UNICODE 0x0001 |
| 2785 | |
| 2786 | typedef struct tagMESSAGE_RESOURCE_BLOCK { |
| 2787 | DWORD LowId; |
| 2788 | DWORD HighId; |
| 2789 | DWORD OffsetToEntries; |
| 2790 | } MESSAGE_RESOURCE_BLOCK,*PMESSAGE_RESOURCE_BLOCK; |
| 2791 | |
| 2792 | typedef struct tagMESSAGE_RESOURCE_DATA { |
| 2793 | DWORD NumberOfBlocks; |
| 2794 | MESSAGE_RESOURCE_BLOCK Blocks[ 1 ]; |
| 2795 | } MESSAGE_RESOURCE_DATA,*PMESSAGE_RESOURCE_DATA; |
| 2796 | |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 2797 | /* |
| 2798 | * Here follows typedefs for security and tokens. |
| 2799 | */ |
| 2800 | |
| 2801 | /* |
| 2802 | * First a constant for the following typdefs. |
| 2803 | */ |
| 2804 | |
| 2805 | #define ANYSIZE_ARRAY 1 |
| 2806 | |
Paul Quinn | ea1640f | 1999-03-10 18:03:53 +0000 | [diff] [blame] | 2807 | /* FIXME: Orphan. What does it point to? */ |
| 2808 | typedef PVOID PACCESS_TOKEN; |
| 2809 | |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 2810 | /* |
| 2811 | * TOKEN_INFORMATION_CLASS |
| 2812 | */ |
| 2813 | |
| 2814 | typedef enum _TOKEN_INFORMATION_CLASS { |
| 2815 | TokenUser = 1, |
| 2816 | TokenGroups, |
| 2817 | TokenPrivileges, |
| 2818 | TokenOwner, |
| 2819 | TokenPrimaryGroup, |
| 2820 | TokenDefaultDacl, |
| 2821 | TokenSource, |
| 2822 | TokenType, |
| 2823 | TokenImpersonationLevel, |
| 2824 | TokenStatistics |
| 2825 | } TOKEN_INFORMATION_CLASS; |
| 2826 | |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 2827 | #ifndef _SECURITY_DEFINED |
| 2828 | #define _SECURITY_DEFINED |
| 2829 | |
Patrik Stridvall | c7a8dde | 1999-04-25 12:36:53 +0000 | [diff] [blame] | 2830 | #include "pshpack1.h" |
Juergen Schmied | 3426d85 | 1999-02-19 16:29:05 +0000 | [diff] [blame] | 2831 | |
Patrik Stridvall | 4a73973 | 1999-07-04 11:01:21 +0000 | [diff] [blame] | 2832 | typedef DWORD ACCESS_MASK, *PACCESS_MASK; |
| 2833 | |
| 2834 | typedef struct _GENERIC_MAPPING { |
| 2835 | ACCESS_MASK GenericRead; |
| 2836 | ACCESS_MASK GenericWrite; |
| 2837 | ACCESS_MASK GenericExecute; |
| 2838 | ACCESS_MASK GenericAll; |
| 2839 | } GENERIC_MAPPING, *PGENERIC_MAPPING; |
| 2840 | |
| 2841 | #ifndef SID_IDENTIFIER_AUTHORITY_DEFINED |
| 2842 | #define SID_IDENTIFIER_AUTHORITY_DEFINED |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 2843 | typedef struct { |
| 2844 | BYTE Value[6]; |
Paul Quinn | ea1640f | 1999-03-10 18:03:53 +0000 | [diff] [blame] | 2845 | } SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY; |
Patrik Stridvall | 4a73973 | 1999-07-04 11:01:21 +0000 | [diff] [blame] | 2846 | #endif /* !defined(SID_IDENTIFIER_AUTHORITY_DEFINED) */ |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 2847 | |
Patrik Stridvall | 4a73973 | 1999-07-04 11:01:21 +0000 | [diff] [blame] | 2848 | #ifndef SID_DEFINED |
| 2849 | #define SID_DEFINED |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 2850 | typedef struct _SID { |
| 2851 | BYTE Revision; |
| 2852 | BYTE SubAuthorityCount; |
| 2853 | SID_IDENTIFIER_AUTHORITY IdentifierAuthority; |
| 2854 | DWORD SubAuthority[1]; |
| 2855 | } SID,*PSID; |
Patrik Stridvall | 4a73973 | 1999-07-04 11:01:21 +0000 | [diff] [blame] | 2856 | #endif /* !defined(SID_DEFINED) */ |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 2857 | |
Juergen Schmied | 7f0c5f3 | 1999-03-09 17:46:10 +0000 | [diff] [blame] | 2858 | #define SID_REVISION (1) /* Current revision */ |
| 2859 | #define SID_MAX_SUB_AUTHORITIES (15) /* current max subauths */ |
| 2860 | #define SID_RECOMMENDED_SUB_AUTHORITIES (1) /* recommended subauths */ |
| 2861 | |
| 2862 | |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 2863 | /* |
| 2864 | * ACL |
| 2865 | */ |
| 2866 | |
Juergen Schmied | bc3c4d4 | 2000-01-12 04:59:42 +0000 | [diff] [blame] | 2867 | #define ACL_REVISION1 1 |
| 2868 | #define ACL_REVISION2 2 |
| 2869 | #define ACL_REVISION3 3 |
| 2870 | #define ACL_REVISION4 4 |
| 2871 | |
| 2872 | #define MIN_ACL_REVISION ACL_REVISION2 |
| 2873 | #define MAX_ACL_REVISION ACL_REVISION4 |
| 2874 | |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 2875 | typedef struct _ACL { |
| 2876 | BYTE AclRevision; |
| 2877 | BYTE Sbz1; |
| 2878 | WORD AclSize; |
| 2879 | WORD AceCount; |
| 2880 | WORD Sbz2; |
| 2881 | } ACL, *PACL; |
| 2882 | |
Juergen Schmied | 3426d85 | 1999-02-19 16:29:05 +0000 | [diff] [blame] | 2883 | /* SECURITY_DESCRIPTOR */ |
| 2884 | #define SECURITY_DESCRIPTOR_REVISION 1 |
| 2885 | #define SECURITY_DESCRIPTOR_REVISION1 1 |
| 2886 | |
| 2887 | |
| 2888 | #define SE_OWNER_DEFAULTED 0x0001 |
| 2889 | #define SE_GROUP_DEFAULTED 0x0002 |
| 2890 | #define SE_DACL_PRESENT 0x0004 |
| 2891 | #define SE_DACL_DEFAULTED 0x0008 |
| 2892 | #define SE_SACL_PRESENT 0x0010 |
| 2893 | #define SE_SACL_DEFAULTED 0x0020 |
| 2894 | #define SE_SELF_RELATIVE 0x8000 |
| 2895 | |
Patrik Stridvall | 4a73973 | 1999-07-04 11:01:21 +0000 | [diff] [blame] | 2896 | typedef DWORD SECURITY_INFORMATION, *PSECURITY_INFORMATION; |
| 2897 | typedef WORD SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL; |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 2898 | |
| 2899 | /* The security descriptor structure */ |
| 2900 | typedef struct { |
| 2901 | BYTE Revision; |
| 2902 | BYTE Sbz1; |
| 2903 | SECURITY_DESCRIPTOR_CONTROL Control; |
Juergen Schmied | bc3c4d4 | 2000-01-12 04:59:42 +0000 | [diff] [blame] | 2904 | DWORD Owner; |
| 2905 | DWORD Group; |
| 2906 | DWORD Sacl; |
| 2907 | DWORD Dacl; |
| 2908 | } SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE; |
| 2909 | |
| 2910 | typedef struct { |
| 2911 | BYTE Revision; |
| 2912 | BYTE Sbz1; |
| 2913 | SECURITY_DESCRIPTOR_CONTROL Control; |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 2914 | PSID Owner; |
| 2915 | PSID Group; |
| 2916 | PACL Sacl; |
| 2917 | PACL Dacl; |
| 2918 | } SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR; |
| 2919 | |
Juergen Schmied | 3426d85 | 1999-02-19 16:29:05 +0000 | [diff] [blame] | 2920 | #define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR)) |
| 2921 | |
Patrik Stridvall | c7a8dde | 1999-04-25 12:36:53 +0000 | [diff] [blame] | 2922 | #include "poppack.h" |
| 2923 | |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 2924 | #endif /* _SECURITY_DEFINED */ |
| 2925 | |
Patrik Stridvall | c7a8dde | 1999-04-25 12:36:53 +0000 | [diff] [blame] | 2926 | #include "pshpack1.h" |
| 2927 | |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 2928 | /* |
| 2929 | * SID_AND_ATTRIBUTES |
| 2930 | */ |
| 2931 | |
| 2932 | typedef struct _SID_AND_ATTRIBUTES { |
| 2933 | PSID Sid; |
| 2934 | DWORD Attributes; |
| 2935 | } SID_AND_ATTRIBUTES ; |
| 2936 | |
Juergen Schmied | 044db46 | 1999-12-11 23:19:54 +0000 | [diff] [blame] | 2937 | /* security entities */ |
| 2938 | #define SECURITY_NULL_RID (0x00000000L) |
| 2939 | #define SECURITY_WORLD_RID (0x00000000L) |
| 2940 | #define SECURITY_LOCAL_RID (0X00000000L) |
| 2941 | |
| 2942 | #define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0} |
| 2943 | |
| 2944 | /* S-1-1 */ |
| 2945 | #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1} |
| 2946 | |
| 2947 | /* S-1-2 */ |
| 2948 | #define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2} |
| 2949 | |
| 2950 | /* S-1-3 */ |
| 2951 | #define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3} |
| 2952 | #define SECURITY_CREATOR_OWNER_RID (0x00000000L) |
| 2953 | #define SECURITY_CREATOR_GROUP_RID (0x00000001L) |
| 2954 | #define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L) |
| 2955 | #define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L) |
| 2956 | |
| 2957 | /* S-1-4 */ |
| 2958 | #define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4} |
| 2959 | |
| 2960 | /* S-1-5 */ |
| 2961 | #define SECURITY_NT_AUTHORITY {0,0,0,0,0,5} |
Juergen Schmied | bc3c4d4 | 2000-01-12 04:59:42 +0000 | [diff] [blame] | 2962 | #define SECURITY_DIALUP_RID 0x00000001L |
| 2963 | #define SECURITY_NETWORK_RID 0x00000002L |
| 2964 | #define SECURITY_BATCH_RID 0x00000003L |
| 2965 | #define SECURITY_INTERACTIVE_RID 0x00000004L |
| 2966 | #define SECURITY_LOGON_IDS_RID 0x00000005L |
| 2967 | #define SECURITY_SERVICE_RID 0x00000006L |
| 2968 | #define SECURITY_ANONYMOUS_LOGON_RID 0x00000007L |
| 2969 | #define SECURITY_PROXY_RID 0x00000008L |
| 2970 | #define SECURITY_ENTERPRISE_CONTROLLERS_RID 0x00000009L |
| 2971 | #define SECURITY_PRINCIPAL_SELF_RID 0x0000000AL |
| 2972 | #define SECURITY_AUTHENTICATED_USER_RID 0x0000000BL |
| 2973 | #define SECURITY_RESTRICTED_CODE_RID 0x0000000CL |
| 2974 | #define SECURITY_TERMINAL_SERVER_RID 0x0000000DL |
| 2975 | #define SECURITY_LOCAL_SYSTEM_RID 0x00000012L |
| 2976 | #define SECURITY_NT_NON_UNIQUE 0x00000015L |
| 2977 | #define SECURITY_BUILTIN_DOMAIN_RID 0x00000020L |
| 2978 | |
| 2979 | #define DOMAIN_GROUP_RID_ADMINS 0x00000200L |
| 2980 | #define DOMAIN_GROUP_RID_USERS 0x00000201L |
| 2981 | #define DOMAIN_GROUP_RID_GUESTS 0x00000202L |
| 2982 | |
| 2983 | #define DOMAIN_ALIAS_RID_ADMINS 0x00000220L |
| 2984 | #define DOMAIN_ALIAS_RID_USERS 0x00000221L |
| 2985 | #define DOMAIN_ALIAS_RID_GUESTS 0x00000222L |
Juergen Schmied | 044db46 | 1999-12-11 23:19:54 +0000 | [diff] [blame] | 2986 | |
| 2987 | #define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID |
| 2988 | |
| 2989 | #define SECURITY_LOGON_IDS_RID_COUNT (3L) |
| 2990 | |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 2991 | /* |
| 2992 | * TOKEN_USER |
| 2993 | */ |
| 2994 | |
| 2995 | typedef struct _TOKEN_USER { |
| 2996 | SID_AND_ATTRIBUTES User; |
| 2997 | } TOKEN_USER; |
| 2998 | |
| 2999 | /* |
| 3000 | * TOKEN_GROUPS |
| 3001 | */ |
| 3002 | |
| 3003 | typedef struct _TOKEN_GROUPS { |
| 3004 | DWORD GroupCount; |
| 3005 | SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY]; |
| 3006 | } TOKEN_GROUPS; |
| 3007 | |
| 3008 | /* |
| 3009 | * LUID_AND_ATTRIBUTES |
| 3010 | */ |
| 3011 | |
Patrik Stridvall | 311e456 | 1999-09-19 14:20:33 +0000 | [diff] [blame] | 3012 | typedef union _LARGE_INTEGER { |
| 3013 | struct { |
| 3014 | DWORD LowPart; |
| 3015 | LONG HighPart; |
| 3016 | } DUMMYSTRUCTNAME; |
| 3017 | LONGLONG QuadPart; |
Paul Quinn | ea1640f | 1999-03-10 18:03:53 +0000 | [diff] [blame] | 3018 | } LARGE_INTEGER, *LPLARGE_INTEGER, *PLARGE_INTEGER; |
Michael Veksler | 17822f4 | 1999-02-09 15:46:25 +0000 | [diff] [blame] | 3019 | |
Patrik Stridvall | 311e456 | 1999-09-19 14:20:33 +0000 | [diff] [blame] | 3020 | typedef union _ULARGE_INTEGER { |
| 3021 | struct { |
| 3022 | DWORD LowPart; |
Alexandre Julliard | d76f9f9 | 2000-10-01 01:40:42 +0000 | [diff] [blame] | 3023 | DWORD HighPart; |
Patrik Stridvall | 311e456 | 1999-09-19 14:20:33 +0000 | [diff] [blame] | 3024 | } DUMMYSTRUCTNAME; |
Alexandre Julliard | d76f9f9 | 2000-10-01 01:40:42 +0000 | [diff] [blame] | 3025 | ULONGLONG QuadPart; |
Paul Quinn | ea1640f | 1999-03-10 18:03:53 +0000 | [diff] [blame] | 3026 | } ULARGE_INTEGER, *LPULARGE_INTEGER, *PULARGE_INTEGER; |
Michael Veksler | 17822f4 | 1999-02-09 15:46:25 +0000 | [diff] [blame] | 3027 | |
Paul Quinn | ea1640f | 1999-03-10 18:03:53 +0000 | [diff] [blame] | 3028 | /* |
| 3029 | * Locally Unique Identifier |
| 3030 | */ |
| 3031 | |
| 3032 | typedef LARGE_INTEGER LUID,*PLUID; |
Michael Veksler | 17822f4 | 1999-02-09 15:46:25 +0000 | [diff] [blame] | 3033 | |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 3034 | typedef struct _LUID_AND_ATTRIBUTES { |
| 3035 | LUID Luid; |
| 3036 | DWORD Attributes; |
| 3037 | } LUID_AND_ATTRIBUTES; |
| 3038 | |
| 3039 | /* |
Patrik Stridvall | 4a73973 | 1999-07-04 11:01:21 +0000 | [diff] [blame] | 3040 | * PRIVILEGE_SET |
| 3041 | */ |
| 3042 | |
| 3043 | typedef struct _PRIVILEGE_SET { |
| 3044 | DWORD PrivilegeCount; |
| 3045 | DWORD Control; |
| 3046 | LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY]; |
| 3047 | } PRIVILEGE_SET, *PPRIVILEGE_SET; |
| 3048 | |
| 3049 | /* |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 3050 | * TOKEN_PRIVILEGES |
| 3051 | */ |
| 3052 | |
| 3053 | typedef struct _TOKEN_PRIVILEGES { |
| 3054 | DWORD PrivilegeCount; |
| 3055 | LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]; |
Juergen Schmied | cdbdab7 | 1999-02-12 13:44:38 +0000 | [diff] [blame] | 3056 | } TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES; |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 3057 | |
| 3058 | /* |
| 3059 | * TOKEN_OWNER |
| 3060 | */ |
| 3061 | |
| 3062 | typedef struct _TOKEN_OWNER { |
| 3063 | PSID Owner; |
| 3064 | } TOKEN_OWNER; |
| 3065 | |
| 3066 | /* |
| 3067 | * TOKEN_PRIMARY_GROUP |
| 3068 | */ |
| 3069 | |
| 3070 | typedef struct _TOKEN_PRIMARY_GROUP { |
| 3071 | PSID PrimaryGroup; |
| 3072 | } TOKEN_PRIMARY_GROUP; |
| 3073 | |
Paul Quinn | ea1640f | 1999-03-10 18:03:53 +0000 | [diff] [blame] | 3074 | |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 3075 | /* |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 3076 | * TOKEN_DEFAULT_DACL |
| 3077 | */ |
| 3078 | |
| 3079 | typedef struct _TOKEN_DEFAULT_DACL { |
Juergen Schmied | cdbdab7 | 1999-02-12 13:44:38 +0000 | [diff] [blame] | 3080 | PACL DefaultDacl; |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 3081 | } TOKEN_DEFAULT_DACL; |
| 3082 | |
| 3083 | /* |
| 3084 | * TOKEN_SOURCEL |
| 3085 | */ |
| 3086 | |
| 3087 | typedef struct _TOKEN_SOURCE { |
| 3088 | char Sourcename[8]; |
| 3089 | LUID SourceIdentifier; |
| 3090 | } TOKEN_SOURCE; |
| 3091 | |
| 3092 | /* |
| 3093 | * TOKEN_TYPE |
| 3094 | */ |
| 3095 | |
| 3096 | typedef enum tagTOKEN_TYPE { |
| 3097 | TokenPrimary = 1, |
| 3098 | TokenImpersonation |
| 3099 | } TOKEN_TYPE; |
| 3100 | |
| 3101 | /* |
| 3102 | * SECURITY_IMPERSONATION_LEVEL |
| 3103 | */ |
| 3104 | |
| 3105 | typedef enum _SECURITY_IMPERSONATION_LEVEL { |
| 3106 | SecurityAnonymous, |
| 3107 | SecurityIdentification, |
| 3108 | SecurityImpersonation, |
| 3109 | SecurityDelegation |
Patrik Stridvall | 4a73973 | 1999-07-04 11:01:21 +0000 | [diff] [blame] | 3110 | } SECURITY_IMPERSONATION_LEVEL, *PSECURITY_IMPERSONATION_LEVEL; |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 3111 | |
| 3112 | |
Keith Matthews | 3979647 | 1999-03-13 12:53:39 +0000 | [diff] [blame] | 3113 | typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE, |
| 3114 | * PSECURITY_CONTEXT_TRACKING_MODE; |
Patrik Stridvall | 0f8bc5b | 1999-04-22 16:27:50 +0000 | [diff] [blame] | 3115 | /* |
| 3116 | * Quality of Service |
| 3117 | */ |
Keith Matthews | 3979647 | 1999-03-13 12:53:39 +0000 | [diff] [blame] | 3118 | |
| 3119 | typedef struct _SECURITY_QUALITY_OF_SERVICE { |
| 3120 | DWORD Length; |
| 3121 | SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; |
| 3122 | SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode; |
| 3123 | BOOL EffectiveOnly; |
| 3124 | } SECURITY_QUALITY_OF_SERVICE, *PSECURITY_QUALITY_OF_SERVICE; |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 3125 | |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 3126 | /* |
| 3127 | * TOKEN_STATISTICS |
| 3128 | */ |
| 3129 | |
| 3130 | typedef struct _TOKEN_STATISTICS { |
| 3131 | LUID TokenId; |
| 3132 | LUID AuthenticationId; |
| 3133 | LARGE_INTEGER ExpirationTime; |
| 3134 | TOKEN_TYPE TokenType; |
| 3135 | SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; |
| 3136 | DWORD DynamicCharged; |
| 3137 | DWORD DynamicAvailable; |
| 3138 | DWORD GroupCount; |
| 3139 | DWORD PrivilegeCount; |
| 3140 | LUID ModifiedId; |
| 3141 | } TOKEN_STATISTICS; |
| 3142 | |
Juergen Schmied | 7f0c5f3 | 1999-03-09 17:46:10 +0000 | [diff] [blame] | 3143 | /* |
| 3144 | * ACLs of NT |
| 3145 | */ |
| 3146 | |
| 3147 | #define ACL_REVISION 2 |
| 3148 | |
| 3149 | #define ACL_REVISION1 1 |
| 3150 | #define ACL_REVISION2 2 |
| 3151 | |
| 3152 | /* ACEs, directly starting after an ACL */ |
| 3153 | typedef struct _ACE_HEADER { |
| 3154 | BYTE AceType; |
| 3155 | BYTE AceFlags; |
| 3156 | WORD AceSize; |
| 3157 | } ACE_HEADER,*PACE_HEADER; |
| 3158 | |
| 3159 | /* AceType */ |
| 3160 | #define ACCESS_ALLOWED_ACE_TYPE 0 |
| 3161 | #define ACCESS_DENIED_ACE_TYPE 1 |
| 3162 | #define SYSTEM_AUDIT_ACE_TYPE 2 |
| 3163 | #define SYSTEM_ALARM_ACE_TYPE 3 |
| 3164 | |
| 3165 | /* inherit AceFlags */ |
| 3166 | #define OBJECT_INHERIT_ACE 0x01 |
| 3167 | #define CONTAINER_INHERIT_ACE 0x02 |
| 3168 | #define NO_PROPAGATE_INHERIT_ACE 0x04 |
| 3169 | #define INHERIT_ONLY_ACE 0x08 |
| 3170 | #define VALID_INHERIT_FLAGS 0x0F |
| 3171 | |
| 3172 | /* AceFlags mask for what events we (should) audit */ |
| 3173 | #define SUCCESSFUL_ACCESS_ACE_FLAG 0x40 |
| 3174 | #define FAILED_ACCESS_ACE_FLAG 0x80 |
| 3175 | |
| 3176 | /* different ACEs depending on AceType |
| 3177 | * SidStart marks the begin of a SID |
| 3178 | * so the thing finally looks like this: |
| 3179 | * 0: ACE_HEADER |
| 3180 | * 4: ACCESS_MASK |
| 3181 | * 8... : SID |
| 3182 | */ |
| 3183 | typedef struct _ACCESS_ALLOWED_ACE { |
| 3184 | ACE_HEADER Header; |
| 3185 | DWORD Mask; |
| 3186 | DWORD SidStart; |
| 3187 | } ACCESS_ALLOWED_ACE,*PACCESS_ALLOWED_ACE; |
| 3188 | |
| 3189 | typedef struct _ACCESS_DENIED_ACE { |
| 3190 | ACE_HEADER Header; |
| 3191 | DWORD Mask; |
| 3192 | DWORD SidStart; |
| 3193 | } ACCESS_DENIED_ACE,*PACCESS_DENIED_ACE; |
| 3194 | |
| 3195 | typedef struct _SYSTEM_AUDIT_ACE { |
| 3196 | ACE_HEADER Header; |
| 3197 | DWORD Mask; |
| 3198 | DWORD SidStart; |
| 3199 | } SYSTEM_AUDIT_ACE,*PSYSTEM_AUDIT_ACE; |
| 3200 | |
| 3201 | typedef struct _SYSTEM_ALARM_ACE { |
| 3202 | ACE_HEADER Header; |
| 3203 | DWORD Mask; |
| 3204 | DWORD SidStart; |
| 3205 | } SYSTEM_ALARM_ACE,*PSYSTEM_ALARM_ACE; |
| 3206 | |
| 3207 | typedef enum tagSID_NAME_USE { |
| 3208 | SidTypeUser = 1, |
| 3209 | SidTypeGroup, |
| 3210 | SidTypeDomain, |
| 3211 | SidTypeAlias, |
| 3212 | SidTypeWellKnownGroup, |
| 3213 | SidTypeDeletedAccount, |
| 3214 | SidTypeInvalid, |
| 3215 | SidTypeUnknown |
| 3216 | } SID_NAME_USE,*PSID_NAME_USE; |
| 3217 | |
Alexandre Julliard | 03468f7 | 1998-02-15 19:40:49 +0000 | [diff] [blame] | 3218 | /* Access rights */ |
| 3219 | |
Gerald Pfeifer | 43bcf40 | 2000-05-23 21:13:04 +0000 | [diff] [blame] | 3220 | /* DELETE may be already defined via /usr/include/arpa/nameser_compat.h */ |
| 3221 | #undef DELETE |
Alexandre Julliard | 03468f7 | 1998-02-15 19:40:49 +0000 | [diff] [blame] | 3222 | #define DELETE 0x00010000 |
| 3223 | #define READ_CONTROL 0x00020000 |
| 3224 | #define WRITE_DAC 0x00040000 |
| 3225 | #define WRITE_OWNER 0x00080000 |
| 3226 | #define SYNCHRONIZE 0x00100000 |
| 3227 | #define STANDARD_RIGHTS_REQUIRED 0x000f0000 |
| 3228 | |
| 3229 | #define STANDARD_RIGHTS_READ READ_CONTROL |
| 3230 | #define STANDARD_RIGHTS_WRITE READ_CONTROL |
| 3231 | #define STANDARD_RIGHTS_EXECUTE READ_CONTROL |
| 3232 | |
| 3233 | #define STANDARD_RIGHTS_ALL 0x001f0000 |
| 3234 | |
| 3235 | #define SPECIFIC_RIGHTS_ALL 0x0000ffff |
| 3236 | |
| 3237 | #define GENERIC_READ 0x80000000 |
| 3238 | #define GENERIC_WRITE 0x40000000 |
| 3239 | #define GENERIC_EXECUTE 0x20000000 |
| 3240 | #define GENERIC_ALL 0x10000000 |
| 3241 | |
Alexandre Julliard | 2fab2ef | 1999-11-23 19:41:34 +0000 | [diff] [blame] | 3242 | #define MAXIMUM_ALLOWED 0x02000000 |
| 3243 | #define ACCESS_SYSTEM_SECURITY 0x01000000 |
| 3244 | |
Alexandre Julliard | 03468f7 | 1998-02-15 19:40:49 +0000 | [diff] [blame] | 3245 | #define EVENT_MODIFY_STATE 0x0002 |
| 3246 | #define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3) |
| 3247 | |
| 3248 | #define SEMAPHORE_MODIFY_STATE 0x0002 |
| 3249 | #define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3) |
| 3250 | |
| 3251 | #define MUTEX_MODIFY_STATE 0x0001 |
| 3252 | #define MUTEX_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1) |
| 3253 | |
Alexandre Julliard | ea1afce | 2000-08-22 20:08:37 +0000 | [diff] [blame] | 3254 | #define TIMER_QUERY_STATE 0x0001 |
| 3255 | #define TIMER_MODIFY_STATE 0x0002 |
| 3256 | #define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3) |
| 3257 | |
Alexandre Julliard | 03468f7 | 1998-02-15 19:40:49 +0000 | [diff] [blame] | 3258 | #define PROCESS_TERMINATE 0x0001 |
| 3259 | #define PROCESS_CREATE_THREAD 0x0002 |
| 3260 | #define PROCESS_VM_OPERATION 0x0008 |
| 3261 | #define PROCESS_VM_READ 0x0010 |
| 3262 | #define PROCESS_VM_WRITE 0x0020 |
| 3263 | #define PROCESS_DUP_HANDLE 0x0040 |
| 3264 | #define PROCESS_CREATE_PROCESS 0x0080 |
| 3265 | #define PROCESS_SET_QUOTA 0x0100 |
| 3266 | #define PROCESS_SET_INFORMATION 0x0200 |
| 3267 | #define PROCESS_QUERY_INFORMATION 0x0400 |
| 3268 | #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xfff) |
| 3269 | |
| 3270 | #define THREAD_TERMINATE 0x0001 |
| 3271 | #define THREAD_SUSPEND_RESUME 0x0002 |
| 3272 | #define THREAD_GET_CONTEXT 0x0008 |
| 3273 | #define THREAD_SET_CONTEXT 0x0010 |
| 3274 | #define THREAD_SET_INFORMATION 0x0020 |
| 3275 | #define THREAD_QUERY_INFORMATION 0x0040 |
| 3276 | #define THREAD_SET_THREAD_TOKEN 0x0080 |
| 3277 | #define THREAD_IMPERSONATE 0x0100 |
| 3278 | #define THREAD_DIRECT_IMPERSONATION 0x0200 |
| 3279 | #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3ff) |
| 3280 | |
Paul Quinn | ea1640f | 1999-03-10 18:03:53 +0000 | [diff] [blame] | 3281 | #define THREAD_BASE_PRIORITY_LOWRT 15 |
| 3282 | #define THREAD_BASE_PRIORITY_MAX 2 |
| 3283 | #define THREAD_BASE_PRIORITY_MIN -2 |
| 3284 | #define THREAD_BASE_PRIORITY_IDLE -15 |
| 3285 | |
Alexandre Julliard | 03468f7 | 1998-02-15 19:40:49 +0000 | [diff] [blame] | 3286 | #define FILE_READ_DATA 0x0001 /* file & pipe */ |
| 3287 | #define FILE_LIST_DIRECTORY 0x0001 /* directory */ |
| 3288 | #define FILE_WRITE_DATA 0x0002 /* file & pipe */ |
| 3289 | #define FILE_ADD_FILE 0x0002 /* directory */ |
| 3290 | #define FILE_APPEND_DATA 0x0004 /* file */ |
| 3291 | #define FILE_ADD_SUBDIRECTORY 0x0004 /* directory */ |
| 3292 | #define FILE_CREATE_PIPE_INSTANCE 0x0004 /* named pipe */ |
| 3293 | #define FILE_READ_EA 0x0008 /* file & directory */ |
| 3294 | #define FILE_READ_PROPERTIES FILE_READ_EA |
| 3295 | #define FILE_WRITE_EA 0x0010 /* file & directory */ |
| 3296 | #define FILE_WRITE_PROPERTIES FILE_WRITE_EA |
| 3297 | #define FILE_EXECUTE 0x0020 /* file */ |
| 3298 | #define FILE_TRAVERSE 0x0020 /* directory */ |
| 3299 | #define FILE_DELETE_CHILD 0x0040 /* directory */ |
| 3300 | #define FILE_READ_ATTRIBUTES 0x0080 /* all */ |
| 3301 | #define FILE_WRITE_ATTRIBUTES 0x0100 /* all */ |
| 3302 | #define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1ff) |
| 3303 | |
| 3304 | #define FILE_GENERIC_READ (STANDARD_RIGHTS_READ | FILE_READ_DATA | \ |
| 3305 | FILE_READ_ATTRIBUTES | FILE_READ_EA | \ |
| 3306 | SYNCHRONIZE) |
| 3307 | #define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | \ |
| 3308 | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | \ |
| 3309 | FILE_APPEND_DATA | SYNCHRONIZE) |
| 3310 | #define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE | FILE_EXECUTE | \ |
| 3311 | FILE_READ_ATTRIBUTES | SYNCHRONIZE) |
| 3312 | |
Alexandre Julliard | a845b88 | 1998-06-01 10:44:35 +0000 | [diff] [blame] | 3313 | |
Francois Gouget | 5353224 | 2000-05-24 21:03:48 +0000 | [diff] [blame] | 3314 | /* File attribute flags */ |
Michael Veksler | 17822f4 | 1999-02-09 15:46:25 +0000 | [diff] [blame] | 3315 | #define FILE_SHARE_READ 0x00000001L |
| 3316 | #define FILE_SHARE_WRITE 0x00000002L |
| 3317 | #define FILE_SHARE_DELETE 0x00000004L |
| 3318 | #define FILE_ATTRIBUTE_READONLY 0x00000001L |
| 3319 | #define FILE_ATTRIBUTE_HIDDEN 0x00000002L |
| 3320 | #define FILE_ATTRIBUTE_SYSTEM 0x00000004L |
| 3321 | #define FILE_ATTRIBUTE_LABEL 0x00000008L /* Not in Windows API */ |
| 3322 | #define FILE_ATTRIBUTE_DIRECTORY 0x00000010L |
| 3323 | #define FILE_ATTRIBUTE_ARCHIVE 0x00000020L |
| 3324 | #define FILE_ATTRIBUTE_NORMAL 0x00000080L |
| 3325 | #define FILE_ATTRIBUTE_TEMPORARY 0x00000100L |
| 3326 | #define FILE_ATTRIBUTE_ATOMIC_WRITE 0x00000200L |
| 3327 | #define FILE_ATTRIBUTE_XACTION_WRITE 0x00000400L |
| 3328 | #define FILE_ATTRIBUTE_COMPRESSED 0x00000800L |
| 3329 | #define FILE_ATTRIBUTE_OFFLINE 0x00001000L |
Andreas Mohr | 220312e | 2000-10-19 20:38:38 +0000 | [diff] [blame] | 3330 | #define FILE_ATTRIBUTE_SYMLINK 0x80000000L /* Not in Windows API */ |
Michael Veksler | 17822f4 | 1999-02-09 15:46:25 +0000 | [diff] [blame] | 3331 | |
Francois Gouget | 5353224 | 2000-05-24 21:03:48 +0000 | [diff] [blame] | 3332 | /* File notification flags */ |
| 3333 | #define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001 |
| 3334 | #define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002 |
| 3335 | #define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004 |
| 3336 | #define FILE_NOTIFY_CHANGE_SIZE 0x00000008 |
| 3337 | #define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010 |
| 3338 | #define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020 |
| 3339 | #define FILE_NOTIFY_CHANGE_CREATION 0x00000040 |
| 3340 | #define FILE_NOTIFY_CHANGE_SECURITY 0x00000100 |
| 3341 | |
| 3342 | #define FILE_ACTION_ADDED 0x00000001 |
| 3343 | #define FILE_ACTION_REMOVED 0x00000002 |
| 3344 | #define FILE_ACTION_MODIFIED 0x00000003 |
| 3345 | #define FILE_ACTION_RENAMED_OLD_NAME 0x00000004 |
| 3346 | #define FILE_ACTION_RENAMED_NEW_NAME 0x00000005 |
| 3347 | |
| 3348 | |
| 3349 | #define FILE_CASE_SENSITIVE_SEARCH 0x00000001 |
| 3350 | #define FILE_CASE_PRESERVED_NAMES 0x00000002 |
| 3351 | #define FILE_UNICODE_ON_DISK 0x00000004 |
| 3352 | #define FILE_PERSISTENT_ACLS 0x00000008 |
| 3353 | #define FILE_FILE_COMPRESSION 0x00000010 |
| 3354 | #define FILE_VOLUME_IS_COMPRESSED 0x00008000 |
| 3355 | |
Michael Veksler | 17822f4 | 1999-02-09 15:46:25 +0000 | [diff] [blame] | 3356 | /* File alignments (NT) */ |
| 3357 | #define FILE_BYTE_ALIGNMENT 0x00000000 |
| 3358 | #define FILE_WORD_ALIGNMENT 0x00000001 |
| 3359 | #define FILE_LONG_ALIGNMENT 0x00000003 |
| 3360 | #define FILE_QUAD_ALIGNMENT 0x00000007 |
| 3361 | #define FILE_OCTA_ALIGNMENT 0x0000000f |
| 3362 | #define FILE_32_BYTE_ALIGNMENT 0x0000001f |
| 3363 | #define FILE_64_BYTE_ALIGNMENT 0x0000003f |
| 3364 | #define FILE_128_BYTE_ALIGNMENT 0x0000007f |
| 3365 | #define FILE_256_BYTE_ALIGNMENT 0x000000ff |
| 3366 | #define FILE_512_BYTE_ALIGNMENT 0x000001ff |
| 3367 | |
Andreas Mohr | 32a5b63 | 2000-03-26 14:41:10 +0000 | [diff] [blame] | 3368 | #define REG_NONE 0 /* no type */ |
| 3369 | #define REG_SZ 1 /* string type (ASCII) */ |
| 3370 | #define REG_EXPAND_SZ 2 /* string, includes %ENVVAR% (expanded by caller) (ASCII) */ |
| 3371 | #define REG_BINARY 3 /* binary format, callerspecific */ |
| 3372 | /* YES, REG_DWORD == REG_DWORD_LITTLE_ENDIAN */ |
| 3373 | #define REG_DWORD 4 /* DWORD in little endian format */ |
| 3374 | #define REG_DWORD_LITTLE_ENDIAN 4 /* DWORD in little endian format */ |
| 3375 | #define REG_DWORD_BIG_ENDIAN 5 /* DWORD in big endian format */ |
| 3376 | #define REG_LINK 6 /* symbolic link (UNICODE) */ |
| 3377 | #define REG_MULTI_SZ 7 /* multiple strings, delimited by \0, terminated by \0\0 (ASCII) */ |
| 3378 | #define REG_RESOURCE_LIST 8 /* resource list? huh? */ |
| 3379 | #define REG_FULL_RESOURCE_DESCRIPTOR 9 /* full resource descriptor? huh? */ |
| 3380 | #define REG_RESOURCE_REQUIREMENTS_LIST 10 |
| 3381 | |
| 3382 | /* ----------------------------- begin registry ----------------------------- */ |
| 3383 | |
Alexandre Julliard | a845b88 | 1998-06-01 10:44:35 +0000 | [diff] [blame] | 3384 | /* Registry security values */ |
Andreas Mohr | 32a5b63 | 2000-03-26 14:41:10 +0000 | [diff] [blame] | 3385 | #define OWNER_SECURITY_INFORMATION 0x00000001 |
| 3386 | #define GROUP_SECURITY_INFORMATION 0x00000002 |
| 3387 | #define DACL_SECURITY_INFORMATION 0x00000004 |
| 3388 | #define SACL_SECURITY_INFORMATION 0x00000008 |
| 3389 | |
| 3390 | #define REG_OPTION_RESERVED 0x00000000 |
| 3391 | #define REG_OPTION_NON_VOLATILE 0x00000000 |
| 3392 | #define REG_OPTION_VOLATILE 0x00000001 |
| 3393 | #define REG_OPTION_CREATE_LINK 0x00000002 |
| 3394 | #define REG_OPTION_BACKUP_RESTORE 0x00000004 /* FIXME */ |
| 3395 | #define REG_OPTION_OPEN_LINK 0x00000008 |
| 3396 | #define REG_LEGAL_OPTION (REG_OPTION_RESERVED| \ |
| 3397 | REG_OPTION_NON_VOLATILE| \ |
| 3398 | REG_OPTION_VOLATILE| \ |
| 3399 | REG_OPTION_CREATE_LINK| \ |
| 3400 | REG_OPTION_BACKUP_RESTORE| \ |
| 3401 | REG_OPTION_OPEN_LINK) |
| 3402 | |
| 3403 | |
| 3404 | #define REG_CREATED_NEW_KEY 0x00000001 |
| 3405 | #define REG_OPENED_EXISTING_KEY 0x00000002 |
| 3406 | |
| 3407 | /* For RegNotifyChangeKeyValue */ |
| 3408 | #define REG_NOTIFY_CHANGE_NAME 0x1 |
| 3409 | |
| 3410 | #define KEY_QUERY_VALUE 0x00000001 |
| 3411 | #define KEY_SET_VALUE 0x00000002 |
| 3412 | #define KEY_CREATE_SUB_KEY 0x00000004 |
| 3413 | #define KEY_ENUMERATE_SUB_KEYS 0x00000008 |
| 3414 | #define KEY_NOTIFY 0x00000010 |
| 3415 | #define KEY_CREATE_LINK 0x00000020 |
| 3416 | |
| 3417 | #define KEY_READ ((STANDARD_RIGHTS_READ| \ |
| 3418 | KEY_QUERY_VALUE| \ |
| 3419 | KEY_ENUMERATE_SUB_KEYS| \ |
| 3420 | KEY_NOTIFY) \ |
| 3421 | & (~SYNCHRONIZE) \ |
| 3422 | ) |
| 3423 | #define KEY_WRITE ((STANDARD_RIGHTS_WRITE| \ |
| 3424 | KEY_SET_VALUE| \ |
| 3425 | KEY_CREATE_SUB_KEY) \ |
| 3426 | & (~SYNCHRONIZE) \ |
| 3427 | ) |
| 3428 | #define KEY_EXECUTE ((KEY_READ) \ |
| 3429 | & (~SYNCHRONIZE)) \ |
| 3430 | ) |
| 3431 | #define KEY_ALL_ACCESS ((STANDARD_RIGHTS_ALL| \ |
| 3432 | KEY_QUERY_VALUE| \ |
| 3433 | KEY_SET_VALUE| \ |
| 3434 | KEY_CREATE_SUB_KEY| \ |
| 3435 | KEY_ENUMERATE_SUB_KEYS| \ |
| 3436 | KEY_NOTIFY| \ |
| 3437 | KEY_CREATE_LINK) \ |
| 3438 | & (~SYNCHRONIZE) \ |
| 3439 | ) |
| 3440 | /* ------------------------------ end registry ------------------------------ */ |
| 3441 | |
Alexandre Julliard | a845b88 | 1998-06-01 10:44:35 +0000 | [diff] [blame] | 3442 | |
Peter Hunnisett | 565b008 | 2000-09-19 02:43:00 +0000 | [diff] [blame] | 3443 | #define EVENTLOG_SUCCESS 0x0000 |
| 3444 | #define EVENTLOG_ERROR_TYPE 0x0001 |
| 3445 | #define EVENTLOG_WARNING_TYPE 0x0002 |
| 3446 | #define EVENTLOG_INFORMATION_TYPE 0x0004 |
| 3447 | #define EVENTLOG_AUDIT_SUCCESS 0x0008 |
| 3448 | #define EVENTLOG_AUDIT_FAILURE 0x0010 |
| 3449 | |
| 3450 | #define SERVICE_BOOT_START 0x00000000 |
| 3451 | #define SERVICE_SYSTEM_START 0x00000001 |
| 3452 | #define SERVICE_AUTO_START 0x00000002 |
| 3453 | #define SERVICE_DEMAND_START 0x00000003 |
| 3454 | #define SERVICE_DISABLED 0x00000004 |
| 3455 | |
| 3456 | #define SERVICE_ERROR_IGNORE 0x00000000 |
| 3457 | #define SERVICE_ERROR_NORMAL 0x00000001 |
| 3458 | #define SERVICE_ERROR_SEVERE 0x00000002 |
| 3459 | #define SERVICE_ERROR_CRITICAL 0x00000003 |
| 3460 | |
| 3461 | /* Service types */ |
| 3462 | #define SERVICE_KERNEL_DRIVER 0x00000001 |
| 3463 | #define SERVICE_FILE_SYSTEM_DRIVER 0x00000002 |
| 3464 | #define SERVICE_ADAPTER 0x00000004 |
| 3465 | #define SERVICE_RECOGNIZER_DRIVER 0x00000008 |
| 3466 | |
| 3467 | #define SERVICE_DRIVER ( SERVICE_KERNEL_DRIVER | SERVICE_FILE_SYSTEM_DRIVER | \ |
| 3468 | SERVICE_RECOGNIZER_DRIVER ) |
| 3469 | |
| 3470 | #define SERVICE_WIN32_OWN_PROCESS 0x00000010 |
| 3471 | #define SERVICE_WIN32_SHARE_PROCESS 0x00000020 |
| 3472 | #define SERVICE_WIN32 (SERVICE_WIN32_OWN_PROCESS | SERVICE_WIN32_SHARE_PROCESS) |
| 3473 | |
| 3474 | #define SERVICE_INTERACTIVE_PROCESS 0x00000100 |
| 3475 | |
| 3476 | #define SERVICE_TYPE_ALL ( SERVICE_WIN32 | SERVICE_ADAPTER | \ |
| 3477 | SERVICE_DRIVER | SERVICE_INTERACTIVE_PROCESS ) |
| 3478 | |
| 3479 | |
| 3480 | typedef enum _CM_SERVICE_NODE_TYPE |
| 3481 | { |
| 3482 | DriverType = SERVICE_KERNEL_DRIVER, |
| 3483 | FileSystemType = SERVICE_FILE_SYSTEM_DRIVER, |
| 3484 | Win32ServiceOwnProcess = SERVICE_WIN32_OWN_PROCESS, |
| 3485 | Win32ServiceShareProcess = SERVICE_WIN32_SHARE_PROCESS, |
| 3486 | AdapterType = SERVICE_ADAPTER, |
| 3487 | RecognizerType = SERVICE_RECOGNIZER_DRIVER |
| 3488 | } SERVICE_NODE_TYPE; |
| 3489 | |
| 3490 | typedef enum _CM_SERVICE_LOAD_TYPE |
| 3491 | { |
| 3492 | BootLoad = SERVICE_BOOT_START, |
| 3493 | SystemLoad = SERVICE_SYSTEM_START, |
| 3494 | AutoLoad = SERVICE_AUTO_START, |
| 3495 | DemandLoad = SERVICE_DEMAND_START, |
| 3496 | DisableLoad = SERVICE_DISABLED |
| 3497 | } SERVICE_LOAD_TYPE; |
| 3498 | |
| 3499 | typedef enum _CM_ERROR_CONTROL_TYPE |
| 3500 | { |
| 3501 | IgnoreError = SERVICE_ERROR_IGNORE, |
| 3502 | NormalError = SERVICE_ERROR_NORMAL, |
| 3503 | SevereError = SERVICE_ERROR_SEVERE, |
| 3504 | CriticalError = SERVICE_ERROR_CRITICAL |
| 3505 | } SERVICE_ERROR_TYPE; |
| 3506 | |
| 3507 | |
| 3508 | |
Juergen Schmied | 9f50d04 | 2000-02-26 19:35:50 +0000 | [diff] [blame] | 3509 | #define RtlEqualMemory(Destination, Source, Length) (!memcmp((Destination),(Source),(Length))) |
| 3510 | #define RtlMoveMemory(Destination, Source, Length) memmove((Destination),(Source),(Length)) |
| 3511 | #define RtlCopyMemory(Destination, Source, Length) memcpy((Destination),(Source),(Length)) |
| 3512 | #define RtlFillMemory(Destination, Length, Fill) memset((Destination),(Fill),(Length)) |
| 3513 | #define RtlZeroMemory(Destination, Length) memset((Destination),0,(Length)) |
| 3514 | |
Francois Gouget | 5e4b7de | 2000-10-13 23:13:01 +0000 | [diff] [blame] | 3515 | #include "guiddef.h" |
| 3516 | |
Patrik Stridvall | c7a8dde | 1999-04-25 12:36:53 +0000 | [diff] [blame] | 3517 | #include "poppack.h" |
Joerg Mayer | 8de3ba8 | 1999-04-03 16:26:36 +0000 | [diff] [blame] | 3518 | |
Josh DuBois | 9f758cc | 2001-02-20 00:49:12 +0000 | [diff] [blame] | 3519 | typedef struct _RTL_CRITICAL_SECTION_DEBUG |
| 3520 | { |
| 3521 | WORD Type; |
| 3522 | WORD CreatorBackTraceIndex; |
| 3523 | struct _RTL_CRITICAL_SECTION *CriticalSection; |
| 3524 | LIST_ENTRY ProcessLocksList; |
| 3525 | DWORD EntryCount; |
| 3526 | DWORD ContentionCount; |
| 3527 | DWORD Spare[ 2 ]; |
| 3528 | } RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG; |
| 3529 | |
| 3530 | typedef struct _RTL_CRITICAL_SECTION { |
| 3531 | PRTL_CRITICAL_SECTION_DEBUG DebugInfo; |
| 3532 | LONG LockCount; |
| 3533 | LONG RecursionCount; |
| 3534 | HANDLE OwningThread; |
| 3535 | HANDLE LockSemaphore; |
| 3536 | ULONG_PTR SpinCount; |
| 3537 | } RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION; |
| 3538 | |
Alexandre Julliard | 329f068 | 1996-04-14 13:21:20 +0000 | [diff] [blame] | 3539 | #endif /* __WINE_WINNT_H */ |