Take message filtering into account when updating the static data for
[wine/wine-kai.git] / include / winnt.h
blob1121fea3fe14eeda78ea33cbaf7f1d568115c214
1 /*
2 * Win32 definitions for Windows NT
4 * Copyright 1996 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef _WINNT_
22 #define _WINNT_
24 #include <basetsd.h>
26 #ifndef RC_INVOKED
27 #include <ctype.h>
28 #include <stddef.h>
29 #include <string.h>
30 #endif
32 #define NTAPI __stdcall
34 #if (defined(_M_IX86) || defined(_M_IA64) || defined(_M_AMD64) || defined(__MINGW32__)) && !defined(MIDL_PASS)
35 # if defined(_MSC_VER)
36 # define DECLSPEC_IMPORT __declspec(dllimport)
37 # elif defined(__MINGW32__)
38 # define DECLSPEC_IMPORT __attribute__((dllimport))
39 # else
40 # define DECLSPEC_IMPORT
41 # endif
42 #else
43 # define DECLSPEC_IMPORT
44 #endif
46 #ifndef DECLSPEC_NORETURN
47 # if defined(_MSC_VER) && (_MSC_VER >= 1200) && !defined(MIDL_PASS)
48 # define DECLSPEC_NORETURN __declspec(noreturn)
49 # elif defined(__GNUC__)
50 # define DECLSPEC_NORETURN __attribute__((noreturn))
51 # else
52 # define DECLSPEC_NORETURN
53 # endif
54 #endif
56 #ifndef DECLSPEC_ALIGN
57 # if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
58 # define DECLSPEC_ALIGN(x) __declspec(align(x))
59 # elif defined(__GNUC__)
60 # define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
61 # else
62 # define DECLSPEC_ALIGN(x)
63 # endif
64 #endif
66 #ifndef DECLSPEC_CACHEALIGN
67 # define DECLSPEC_CACHEALIGN DECLSPEC_ALIGN(128)
68 #endif
70 #ifndef DECLSPEC_UUID
71 # if defined(_MSC_VER) && (_MSC_VER >= 1100) && defined (__cplusplus)
72 # define DECLSPEC_UUID(x) __declspec(uuid(x))
73 # else
74 # define DECLSPEC_UUID(x)
75 # endif
76 #endif
78 #ifndef DECLSPEC_NOVTABLE
79 # if defined(_MSC_VER) && (_MSC_VER >= 1100) && defined(__cplusplus)
80 # define DECLSPEC_NOVTABLE __declspec(novtable)
81 # else
82 # define DECLSPEC_NOVTABLE
83 # endif
84 #endif
86 #ifndef DECLSPEC_SELECTANY
87 #if defined(_MSC_VER) && (_MSC_VER >= 1100)
88 #define DECLSPEC_SELECTANY __declspec(selectany)
89 #else
90 #define DECLSPEC_SELECTANY
91 #endif
92 #endif
94 #ifndef NOP_FUNCTION
95 # if defined(_MSC_VER) && (_MSC_VER >= 1210)
96 # define NOP_FUNCTION __noop
97 # else
98 # define NOP_FUNCTION (void)0
99 # endif
100 #endif
102 #ifndef DECLSPEC_ADDRSAFE
103 # if defined(_MSC_VER) && (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64))
104 # define DECLSPEC_ADDRSAFE __declspec(address_safe)
105 # else
106 # define DECLSPEC_ADDRSAFE
107 # endif
108 #endif
110 #ifndef FORCEINLINE
111 # if defined(_MSC_VER) && (_MSC_VER >= 1200)
112 # define FORCEINLINE __forceinline
113 # elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2)))
114 # define FORCEINLINE __attribute__((always_inline))
115 # else
116 # define FORCEINLINE inline
117 # endif
118 #endif
120 #ifndef DECLSPEC_DEPRECATED
121 # if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
122 # define DECLSPEC_DEPRECATED __declspec(deprecated)
123 # define DEPRECATE_SUPPORTED
124 # elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2)))
125 # define DECLSPEC_DEPRECATED __attribute__((deprecated))
126 # define DEPRECATE_SUPPORTED
127 # else
128 # define DECLSPEC_DEPRECATED
129 # undef DEPRECATE_SUPPORTED
130 # endif
131 #endif
133 /* Anonymous union/struct handling */
135 #ifndef NONAMELESSSTRUCT
136 # ifdef __GNUC__
137 /* Anonymous struct support starts with gcc 2.96 or gcc/g++ 3.x */
138 # if (__GNUC__ < 2) || ((__GNUC__ == 2) && (defined(__cplusplus) || (__GNUC_MINOR__ < 96)))
139 # define NONAMELESSSTRUCT
140 # endif
141 # elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
142 # define NONAMELESSSTRUCT
143 # endif
144 #endif /* NONAMELESSSTRUCT */
146 #ifndef NONAMELESSUNION
147 # ifdef __GNUC__
148 /* Anonymous unions support starts with gcc 2.96/g++ 2.95 */
149 # if (__GNUC__ < 2) || ((__GNUC__ == 2) && ((__GNUC_MINOR__ < 95) || ((__GNUC_MINOR__ == 95) && !defined(__cplusplus))))
150 # define NONAMELESSUNION
151 # endif
152 # elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
153 # define NONAMELESSUNION
154 # endif
155 #endif /* NONAMELESSUNION */
157 #ifndef NONAMELESSSTRUCT
158 #define DUMMYSTRUCTNAME
159 #define DUMMYSTRUCTNAME1
160 #define DUMMYSTRUCTNAME2
161 #define DUMMYSTRUCTNAME3
162 #define DUMMYSTRUCTNAME4
163 #define DUMMYSTRUCTNAME5
164 #else /* !defined(NONAMELESSSTRUCT) */
165 #define DUMMYSTRUCTNAME s
166 #define DUMMYSTRUCTNAME1 s1
167 #define DUMMYSTRUCTNAME2 s2
168 #define DUMMYSTRUCTNAME3 s3
169 #define DUMMYSTRUCTNAME4 s4
170 #define DUMMYSTRUCTNAME5 s5
171 #endif /* !defined(NONAMELESSSTRUCT) */
173 #ifndef NONAMELESSUNION
174 #define DUMMYUNIONNAME
175 #define DUMMYUNIONNAME1
176 #define DUMMYUNIONNAME2
177 #define DUMMYUNIONNAME3
178 #define DUMMYUNIONNAME4
179 #define DUMMYUNIONNAME5
180 #define DUMMYUNIONNAME6
181 #define DUMMYUNIONNAME7
182 #define DUMMYUNIONNAME8
183 #else /* !defined(NONAMELESSUNION) */
184 #define DUMMYUNIONNAME u
185 #define DUMMYUNIONNAME1 u1
186 #define DUMMYUNIONNAME2 u2
187 #define DUMMYUNIONNAME3 u3
188 #define DUMMYUNIONNAME4 u4
189 #define DUMMYUNIONNAME5 u5
190 #define DUMMYUNIONNAME6 u6
191 #define DUMMYUNIONNAME7 u7
192 #define DUMMYUNIONNAME8 u8
193 #endif /* !defined(NONAMELESSUNION) */
195 /* C99 restrict support */
197 #if defined(ENABLE_RESTRICTED) && !defined(MIDL_PASS) && !defined(RC_INVOKED)
198 # if defined(_MSC_VER) && defined(_M_MRX000)
199 # define RESTRICTED_POINTER __restrict
200 # elif defined(__GNUC__) && ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)))
201 # define RESTRICTED_POINTER __restrict
202 # else
203 # define RESTRICTED_POINTER
204 # endif
205 #else
206 # define RESTRICTED_POINTER
207 #endif
209 /* C99 unaligned support */
211 #if defined(_MSC_VER) && (defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64))
212 # define UNALIGNED __unaligned
213 # ifdef _WIN64
214 # define UNALIGNED64 __unaligned
215 # else
216 # define UNALIGNED64
217 # endif
218 #else
219 # define UNALIGNED
220 # define UNALIGNED64
221 #endif
223 /* Alignment macros */
225 #if defined(_WIN64) || (defined(_MSC_VER) && defined(_M_ALPHA)) || defined(__alpha__)
226 #define MAX_NATURAL_ALIGNMENT sizeof(ULONGLONG)
227 #define MEMORY_ALLOCATION_ALIGNMENT 16
228 #else
229 #define MAX_NATURAL_ALIGNMENT sizeof(DWORD)
230 #define MEMORY_ALLOCATION_ALIGNMENT 8
231 #endif
233 #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
234 # define TYPE_ALIGNMENT(t) __alignof(t)
235 #elif defined(__GNUC__)
236 # define TYPE_ALIGNMENT(t) __alignof__(t)
237 #else
238 # define TYPE_ALIGNMENT(t) FIELD_OFFSET(struct { char x; t test; }, test)
239 #endif
241 #ifdef _WIN64
242 # define PROBE_ALIGNMENT(_s) \
243 (TYPE_ALIGNMENT(_s) > TYPE_ALIGNMENT(DWORD) ? \
244 TYPE_ALIGNMENT(_s) : TYPE_ALIGNMENT(DWORD))
245 # define PROBE_ALIGNMENT32(_s) TYPE_ALIGNMENT(DWORD)
246 #else
247 # define PROBE_ALIGNMENT(_s) TYPE_ALIGNMENT(DWORD)
248 #endif
250 /* Compile time assertion */
252 #if defined(_MSC_VER)
253 # define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1]
254 #elif defined(__GNUC__)
255 # define C_ASSERT(e) extern char __C_ASSERT__[(e)?1:-1]
256 #endif
258 /* Eliminate Microsoft C/C++ compiler warning 4715 */
259 #if (_MSC_VER > 1200)
260 # define DEFAULT_UNREACHABLE default: __assume(0)
261 #else
262 # define DEFAULT_UNREACHABLE
263 #endif
265 /* Error Masks */
266 #define APPLICATION_ERROR_MASK 0x20000000
267 #define ERROR_SEVERITY_SUCCESS 0x00000000
268 #define ERROR_SEVERITY_INFORMATIONAL 0x40000000
269 #define ERROR_SEVERITY_WARNING 0x80000000
270 #define ERROR_SEVERITY_ERROR 0xC0000000
272 /* Microsoft's macros for declaring functions */
274 #ifdef __cplusplus
275 # define EXTERN_C extern "C"
276 #else
277 # define EXTERN_C extern
278 #endif
280 #define STDMETHODCALLTYPE __stdcall
281 #define STDMETHODVCALLTYPE __cdecl
282 #define STDAPICALLTYPE __stdcall
283 #define STDAPIVCALLTYPE __cdecl
285 #define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
286 #define STDAPI_(type) EXTERN_C type STDAPICALLTYPE
287 #define STDMETHODIMP HRESULT STDMETHODCALLTYPE
288 #define STDMETHODIMP_(type) type STDMETHODCALLTYPE
289 #define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
290 #define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE
291 #define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
292 #define STDMETHODIMPV_(type) type STDMETHODVCALLTYPE
294 /* Define the basic types */
295 #ifndef VOID
296 #define VOID void
297 #endif
298 typedef VOID *PVOID;
299 typedef BYTE BOOLEAN, *PBOOLEAN;
300 typedef char CHAR, *PCHAR;
301 typedef short SHORT, *PSHORT;
302 typedef long LONG, *PLONG;
304 /* Some systems might have wchar_t, but we really need 16 bit characters */
305 #ifdef WINE_UNICODE_NATIVE
306 typedef wchar_t WCHAR, *PWCHAR;
307 #else
308 typedef unsigned short WCHAR, *PWCHAR;
309 #endif
311 /* 'Extended/Wide' numerical types */
312 #ifndef _ULONGLONG_
313 # define _ULONGLONG_
314 # ifdef _MSC_VER
315 typedef signed __int64 LONGLONG, *PLONGLONG;
316 typedef unsigned __int64 ULONGLONG, *PULONGLONG;
317 # else
318 typedef signed __int64 DECLSPEC_ALIGN(8) LONGLONG, *PLONGLONG;
319 typedef unsigned __int64 DECLSPEC_ALIGN(8) ULONGLONG, *PULONGLONG;
320 # endif
321 #endif
323 #ifndef _DWORDLONG_
324 # define _DWORDLONG_
325 # ifdef _MSC_VER
326 typedef ULONGLONG DWORDLONG, *PDWORDLONG;
327 # else
328 typedef ULONGLONG DECLSPEC_ALIGN(8) DWORDLONG, *PDWORDLONG;
329 # endif
330 #endif
332 /* ANSI string types */
333 typedef CHAR *PCH, *LPCH;
334 typedef const CHAR *PCCH, *LPCCH;
335 typedef CHAR *PSTR, *LPSTR, *NPSTR;
336 typedef const CHAR *PCSTR, *LPCSTR;
338 /* Unicode string types */
339 typedef WCHAR *PWCH, *LPWCH;
340 typedef const WCHAR *PCWCH, *LPCWCH;
341 typedef WCHAR *PWSTR, *LPWSTR, *NWPSTR;
342 typedef const WCHAR *PCWSTR, *LPCWSTR;
344 /* Neutral character and string types */
345 /* These are only defined for Winelib, i.e. _not_ defined for
346 * the emulator. The reason is they depend on the UNICODE
347 * macro which only exists in the user's code.
349 #ifndef __WINESRC__
350 # ifdef UNICODE
351 # ifndef _TCHAR_DEFINED
352 typedef WCHAR TCHAR, *PTCHAR;
353 # define _TCHAR_DEFINED
354 #endif
355 typedef LPWSTR PTSTR, LPTSTR;
356 typedef LPCWSTR PCTSTR, LPCTSTR;
357 # define __TEXT(string) L##string
358 # else /* UNICODE */
359 # ifndef _TCHAR_DEFINED
360 typedef CHAR TCHAR, *PTCHAR;
361 # define _TCHAR_DEFINED
362 # endif
363 typedef LPSTR PTSTR, LPTSTR;
364 typedef LPCSTR PCTSTR, LPCTSTR;
365 # define __TEXT(string) string
366 # endif /* UNICODE */
367 # define TEXT(quote) __TEXT(quote)
368 #endif /* __WINESRC__ */
370 /* Misc common WIN32 types */
371 typedef char CCHAR;
372 typedef LONG HRESULT;
373 typedef DWORD LCID, *PLCID;
374 typedef WORD LANGID;
375 typedef DWORD EXECUTION_STATE;
377 /* Handle type */
379 typedef void *HANDLE;
380 typedef HANDLE *PHANDLE, *LPHANDLE;
382 #ifdef STRICT
383 #define DECLARE_HANDLE(a) typedef struct a##__ { int unused; } *a
384 #else /*STRICT*/
385 #define DECLARE_HANDLE(a) typedef HANDLE a
386 #endif /*STRICT*/
388 /* Defines */
390 #ifndef WIN32_NO_STATUS
392 #define STATUS_WAIT_0 0x00000000
393 #define STATUS_ABANDONED_WAIT_0 0x00000080
394 #define STATUS_USER_APC 0x000000C0
395 #define STATUS_TIMEOUT 0x00000102
396 #define STATUS_PENDING 0x00000103
397 #define STATUS_SEGMENT_NOTIFICATION 0x40000005
398 #define STATUS_GUARD_PAGE_VIOLATION 0x80000001
399 #define STATUS_DATATYPE_MISALIGNMENT 0x80000002
400 #define STATUS_BREAKPOINT 0x80000003
401 #define STATUS_SINGLE_STEP 0x80000004
402 #define STATUS_ACCESS_VIOLATION 0xC0000005
403 #define STATUS_IN_PAGE_ERROR 0xC0000006
404 #define STATUS_INVALID_HANDLE 0xC0000008
405 #define STATUS_NO_MEMORY 0xC0000017
406 #define STATUS_ILLEGAL_INSTRUCTION 0xC000001D
407 #define STATUS_NONCONTINUABLE_EXCEPTION 0xC0000025
408 #define STATUS_INVALID_DISPOSITION 0xC0000026
409 #define STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008C
410 #define STATUS_FLOAT_DENORMAL_OPERAND 0xC000008D
411 #define STATUS_FLOAT_DIVIDE_BY_ZERO 0xC000008E
412 #define STATUS_FLOAT_INEXACT_RESULT 0xC000008F
413 #define STATUS_FLOAT_INVALID_OPERATION 0xC0000090
414 #define STATUS_FLOAT_OVERFLOW 0xC0000091
415 #define STATUS_FLOAT_STACK_CHECK 0xC0000092
416 #define STATUS_FLOAT_UNDERFLOW 0xC0000093
417 #define STATUS_INTEGER_DIVIDE_BY_ZERO 0xC0000094
418 #define STATUS_INTEGER_OVERFLOW 0xC0000095
419 #define STATUS_PRIVILEGED_INSTRUCTION 0xC0000096
420 #define STATUS_STACK_OVERFLOW 0xC00000FD
421 #define STATUS_CONTROL_C_EXIT 0xC000013A
422 #define STATUS_FLOAT_MULTIPLE_FAULTS 0xC00002B4
423 #define STATUS_FLOAT_MULTIPLE_TRAPS 0xC00002B5
424 #define STATUS_REG_NAT_CONSUMPTION 0xC00002C9
425 #define STATUS_SXS_EARLY_DEACTIVATION 0xC015000F
426 #define STATUS_SXS_INVALID_DEACTIVATION 0xC0150010
428 /* status values for ContinueDebugEvent */
429 #define DBG_EXCEPTION_HANDLED 0x00010001
430 #define DBG_CONTINUE 0x00010002
431 #define DBG_TERMINATE_THREAD 0x40010003
432 #define DBG_TERMINATE_PROCESS 0x40010004
433 #define DBG_CONTROL_C 0x40010005
434 #define DBG_CONTROL_BREAK 0x40010008
435 #define DBG_COMMAND_EXCEPTION 0x40010009
436 #define DBG_EXCEPTION_NOT_HANDLED 0x80010001
438 #endif /* WIN32_NO_STATUS */
440 /* Argument 1 passed to the DllEntryProc. */
441 #define DLL_PROCESS_DETACH 0 /* detach process (unload library) */
442 #define DLL_PROCESS_ATTACH 1 /* attach process (load library) */
443 #define DLL_THREAD_ATTACH 2 /* attach new thread */
444 #define DLL_THREAD_DETACH 3 /* detach thread */
447 /* u.x.wProcessorArchitecture (NT) */
448 #define PROCESSOR_ARCHITECTURE_INTEL 0
449 #define PROCESSOR_ARCHITECTURE_MIPS 1
450 #define PROCESSOR_ARCHITECTURE_ALPHA 2
451 #define PROCESSOR_ARCHITECTURE_PPC 3
452 #define PROCESSOR_ARCHITECTURE_SHX 4
453 #define PROCESSOR_ARCHITECTURE_ARM 5
454 #define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
456 /* dwProcessorType */
457 #define PROCESSOR_INTEL_386 386
458 #define PROCESSOR_INTEL_486 486
459 #define PROCESSOR_INTEL_PENTIUM 586
460 #define PROCESSOR_INTEL_860 860
461 #define PROCESSOR_MIPS_R2000 2000
462 #define PROCESSOR_MIPS_R3000 3000
463 #define PROCESSOR_MIPS_R4000 4000
464 #define PROCESSOR_ALPHA_21064 21064
465 #define PROCESSOR_PPC_601 601
466 #define PROCESSOR_PPC_603 603
467 #define PROCESSOR_PPC_604 604
468 #define PROCESSOR_PPC_620 620
469 #define PROCESSOR_HITACHI_SH3 10003
470 #define PROCESSOR_HITACHI_SH3E 10004
471 #define PROCESSOR_HITACHI_SH4 10005
472 #define PROCESSOR_MOTOROLA_821 821
473 #define PROCESSOR_SHx_SH3 103
474 #define PROCESSOR_SHx_SH4 104
475 #define PROCESSOR_STRONGARM 2577
476 #define PROCESSOR_ARM720 1824 /* 0x720 */
477 #define PROCESSOR_ARM820 2080 /* 0x820 */
478 #define PROCESSOR_ARM920 2336 /* 0x920 */
479 #define PROCESSOR_ARM_7TDMI 70001
481 #define MAXIMUM_PROCESSORS 32
482 typedef struct _MEMORY_BASIC_INFORMATION
484 LPVOID BaseAddress;
485 LPVOID AllocationBase;
486 DWORD AllocationProtect;
487 DWORD RegionSize;
488 DWORD State;
489 DWORD Protect;
490 DWORD Type;
491 } MEMORY_BASIC_INFORMATION, *PMEMORY_BASIC_INFORMATION;
493 #define PAGE_NOACCESS 0x01
494 #define PAGE_READONLY 0x02
495 #define PAGE_READWRITE 0x04
496 #define PAGE_WRITECOPY 0x08
497 #define PAGE_EXECUTE 0x10
498 #define PAGE_EXECUTE_READ 0x20
499 #define PAGE_EXECUTE_READWRITE 0x40
500 #define PAGE_EXECUTE_WRITECOPY 0x80
501 #define PAGE_GUARD 0x100
502 #define PAGE_NOCACHE 0x200
504 #define MEM_COMMIT 0x00001000
505 #define MEM_RESERVE 0x00002000
506 #define MEM_DECOMMIT 0x00004000
507 #define MEM_RELEASE 0x00008000
508 #define MEM_FREE 0x00010000
509 #define MEM_PRIVATE 0x00020000
510 #define MEM_MAPPED 0x00040000
511 #define MEM_RESET 0x00080000
512 #define MEM_TOP_DOWN 0x00100000
513 #define MEM_PHYSICAL 0x00400000
514 #ifdef __WINESRC__
515 #define MEM_SYSTEM 0x80000000
516 #endif
518 #define SEC_FILE 0x00800000
519 #define SEC_IMAGE 0x01000000
520 #define SEC_RESERVE 0x04000000
521 #define SEC_COMMIT 0x08000000
522 #define SEC_NOCACHE 0x10000000
523 #define MEM_IMAGE SEC_IMAGE
526 #define MINCHAR 0x80
527 #define MAXCHAR 0x7f
528 #define MINSHORT 0x8000
529 #define MAXSHORT 0x7fff
530 #define MINLONG 0x80000000
531 #define MAXLONG 0x7fffffff
532 #define MAXBYTE 0xff
533 #define MAXWORD 0xffff
534 #define MAXDWORD 0xffffffff
536 #define FIELD_OFFSET(type, field) \
537 ((LONG)(INT)&(((type *)0)->field))
539 #define CONTAINING_RECORD(address, type, field) \
540 ((type *)((PCHAR)(address) - (PCHAR)(&((type *)0)->field)))
542 /* Types */
544 typedef struct _LIST_ENTRY {
545 struct _LIST_ENTRY *Flink;
546 struct _LIST_ENTRY *Blink;
547 } LIST_ENTRY, *PLIST_ENTRY, * RESTRICTED_POINTER PRLIST_ENTRY;
549 typedef struct _SINGLE_LIST_ENTRY {
550 struct _SINGLE_LIST_ENTRY *Next;
551 } SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY;
553 /* Heap flags */
555 #define HEAP_NO_SERIALIZE 0x00000001
556 #define HEAP_GROWABLE 0x00000002
557 #define HEAP_GENERATE_EXCEPTIONS 0x00000004
558 #define HEAP_ZERO_MEMORY 0x00000008
559 #define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010
560 #define HEAP_TAIL_CHECKING_ENABLED 0x00000020
561 #define HEAP_FREE_CHECKING_ENABLED 0x00000040
562 #define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080
563 #define HEAP_CREATE_ALIGN_16 0x00010000
564 #define HEAP_CREATE_ENABLE_TRACING 0x00020000
566 /* This flag allows it to create heaps shared by all processes under win95,
567 FIXME: correct name */
568 #define HEAP_SHARED 0x04000000
570 /* Processor feature flags. */
571 #define PF_FLOATING_POINT_PRECISION_ERRATA 0
572 #define PF_FLOATING_POINT_EMULATED 1
573 #define PF_COMPARE_EXCHANGE_DOUBLE 2
574 #define PF_MMX_INSTRUCTIONS_AVAILABLE 3
575 #define PF_PPC_MOVEMEM_64BIT_OK 4
576 #define PF_ALPHA_BYTE_INSTRUCTIONS 5
577 #define PF_XMMI_INSTRUCTIONS_AVAILABLE 6
578 #define PF_3DNOW_INSTRUCTIONS_AVAILABLE 7
579 #define PF_RDTSC_INSTRUCTION_AVAILABLE 8
580 #define PF_PAE_ENABLED 9
581 #define PF_XMMI64_INSTRUCTIONS_AVAILABLE 10
584 /* Execution state flags */
585 #define ES_SYSTEM_REQUIRED 0x00000001
586 #define ES_DISPLAY_REQUIRED 0x00000002
587 #define ES_USER_PRESENT 0x00000004
588 #define ES_CONTINUOUS 0x80000000
590 /* The Win32 register context */
592 /* CONTEXT is the CPU-dependent context; it should be used */
593 /* wherever a platform-specific context is needed (e.g. exception */
594 /* handling, Win32 register functions). */
596 /* CONTEXT86 is the i386-specific context; it should be used */
597 /* wherever only a 386 context makes sense (e.g. DOS interrupts, */
598 /* Win16 register functions), so that this code can be compiled */
599 /* on all platforms. */
601 #define SIZE_OF_80387_REGISTERS 80
603 typedef struct _FLOATING_SAVE_AREA
605 DWORD ControlWord;
606 DWORD StatusWord;
607 DWORD TagWord;
608 DWORD ErrorOffset;
609 DWORD ErrorSelector;
610 DWORD DataOffset;
611 DWORD DataSelector;
612 BYTE RegisterArea[SIZE_OF_80387_REGISTERS];
613 DWORD Cr0NpxState;
614 } FLOATING_SAVE_AREA, *PFLOATING_SAVE_AREA;
616 #define MAXIMUM_SUPPORTED_EXTENSION 512
618 typedef struct _CONTEXT86
620 DWORD ContextFlags;
622 /* These are selected by CONTEXT_DEBUG_REGISTERS */
623 DWORD Dr0;
624 DWORD Dr1;
625 DWORD Dr2;
626 DWORD Dr3;
627 DWORD Dr6;
628 DWORD Dr7;
630 /* These are selected by CONTEXT_FLOATING_POINT */
631 FLOATING_SAVE_AREA FloatSave;
633 /* These are selected by CONTEXT_SEGMENTS */
634 DWORD SegGs;
635 DWORD SegFs;
636 DWORD SegEs;
637 DWORD SegDs;
639 /* These are selected by CONTEXT_INTEGER */
640 DWORD Edi;
641 DWORD Esi;
642 DWORD Ebx;
643 DWORD Edx;
644 DWORD Ecx;
645 DWORD Eax;
647 /* These are selected by CONTEXT_CONTROL */
648 DWORD Ebp;
649 DWORD Eip;
650 DWORD SegCs;
651 DWORD EFlags;
652 DWORD Esp;
653 DWORD SegSs;
655 BYTE ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];
656 } CONTEXT86;
658 #define CONTEXT_X86 0x00010000
659 #define CONTEXT_i386 CONTEXT_X86
660 #define CONTEXT_i486 CONTEXT_X86
662 #define CONTEXT86_CONTROL (CONTEXT_i386 | 0x0001) /* SS:SP, CS:IP, FLAGS, BP */
663 #define CONTEXT86_INTEGER (CONTEXT_i386 | 0x0002) /* AX, BX, CX, DX, SI, DI */
664 #define CONTEXT86_SEGMENTS (CONTEXT_i386 | 0x0004) /* DS, ES, FS, GS */
665 #define CONTEXT86_FLOATING_POINT (CONTEXT_i386 | 0x0008L) /* 387 state */
666 #define CONTEXT86_DEBUG_REGISTERS (CONTEXT_i386 | 0x0010L) /* DB 0-3,6,7 */
667 #define CONTEXT86_FULL (CONTEXT86_CONTROL | CONTEXT86_INTEGER | CONTEXT86_SEGMENTS)
669 /* i386 context definitions */
670 #ifdef __i386__
672 #define CONTEXT_CONTROL CONTEXT86_CONTROL
673 #define CONTEXT_INTEGER CONTEXT86_INTEGER
674 #define CONTEXT_SEGMENTS CONTEXT86_SEGMENTS
675 #define CONTEXT_FLOATING_POINT CONTEXT86_FLOATING_POINT
676 #define CONTEXT_DEBUG_REGISTERS CONTEXT86_DEBUG_REGISTERS
677 #define CONTEXT_FULL CONTEXT86_FULL
679 typedef CONTEXT86 CONTEXT;
681 #endif /* __i386__ */
683 typedef struct _LDT_ENTRY {
684 WORD LimitLow;
685 WORD BaseLow;
686 union {
687 struct {
688 BYTE BaseMid;
689 BYTE Flags1;/*Declare as bytes to avoid alignment problems */
690 BYTE Flags2;
691 BYTE BaseHi;
692 } Bytes;
693 struct {
694 unsigned BaseMid : 8;
695 unsigned Type : 5;
696 unsigned Dpl : 2;
697 unsigned Pres : 1;
698 unsigned LimitHi : 4;
699 unsigned Sys : 1;
700 unsigned Reserved_0 : 1;
701 unsigned Default_Big : 1;
702 unsigned Granularity : 1;
703 unsigned BaseHi : 8;
704 } Bits;
705 } HighWord;
706 } LDT_ENTRY, *PLDT_ENTRY;
708 /* Alpha context definitions */
709 #ifdef _ALPHA_
711 #define CONTEXT_ALPHA 0x00020000
713 #define CONTEXT_CONTROL (CONTEXT_ALPHA | 0x00000001L)
714 #define CONTEXT_FLOATING_POINT (CONTEXT_ALPHA | 0x00000002L)
715 #define CONTEXT_INTEGER (CONTEXT_ALPHA | 0x00000004L)
716 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
718 typedef struct _CONTEXT
720 /* selected by CONTEXT_FLOATING_POINT */
721 ULONGLONG FltF0;
722 ULONGLONG FltF1;
723 ULONGLONG FltF2;
724 ULONGLONG FltF3;
725 ULONGLONG FltF4;
726 ULONGLONG FltF5;
727 ULONGLONG FltF6;
728 ULONGLONG FltF7;
729 ULONGLONG FltF8;
730 ULONGLONG FltF9;
731 ULONGLONG FltF10;
732 ULONGLONG FltF11;
733 ULONGLONG FltF12;
734 ULONGLONG FltF13;
735 ULONGLONG FltF14;
736 ULONGLONG FltF15;
737 ULONGLONG FltF16;
738 ULONGLONG FltF17;
739 ULONGLONG FltF18;
740 ULONGLONG FltF19;
741 ULONGLONG FltF20;
742 ULONGLONG FltF21;
743 ULONGLONG FltF22;
744 ULONGLONG FltF23;
745 ULONGLONG FltF24;
746 ULONGLONG FltF25;
747 ULONGLONG FltF26;
748 ULONGLONG FltF27;
749 ULONGLONG FltF28;
750 ULONGLONG FltF29;
751 ULONGLONG FltF30;
752 ULONGLONG FltF31;
754 /* selected by CONTEXT_INTEGER */
755 ULONGLONG IntV0;
756 ULONGLONG IntT0;
757 ULONGLONG IntT1;
758 ULONGLONG IntT2;
759 ULONGLONG IntT3;
760 ULONGLONG IntT4;
761 ULONGLONG IntT5;
762 ULONGLONG IntT6;
763 ULONGLONG IntT7;
764 ULONGLONG IntS0;
765 ULONGLONG IntS1;
766 ULONGLONG IntS2;
767 ULONGLONG IntS3;
768 ULONGLONG IntS4;
769 ULONGLONG IntS5;
770 ULONGLONG IntFp;
771 ULONGLONG IntA0;
772 ULONGLONG IntA1;
773 ULONGLONG IntA2;
774 ULONGLONG IntA3;
775 ULONGLONG IntA4;
776 ULONGLONG IntA5;
777 ULONGLONG IntT8;
778 ULONGLONG IntT9;
779 ULONGLONG IntT10;
780 ULONGLONG IntT11;
781 ULONGLONG IntRa;
782 ULONGLONG IntT12;
783 ULONGLONG IntAt;
784 ULONGLONG IntGp;
785 ULONGLONG IntSp;
786 ULONGLONG IntZero;
788 /* selected by CONTEXT_FLOATING_POINT */
789 ULONGLONG Fpcr;
790 ULONGLONG SoftFpcr;
792 /* selected by CONTEXT_CONTROL */
793 ULONGLONG Fir;
794 DWORD Psr;
795 DWORD ContextFlags;
796 DWORD Fill[4];
797 } CONTEXT;
799 #define _QUAD_PSR_OFFSET HighSoftFpcr
800 #define _QUAD_FLAGS_OFFSET HighFir
802 #endif /* _ALPHA_ */
804 /* Mips context definitions */
805 #ifdef _MIPS_
807 #define CONTEXT_R4000 0x00010000
809 #define CONTEXT_CONTROL (CONTEXT_R4000 | 0x00000001)
810 #define CONTEXT_FLOATING_POINT (CONTEXT_R4000 | 0x00000002)
811 #define CONTEXT_INTEGER (CONTEXT_R4000 | 0x00000004)
813 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
815 typedef struct _CONTEXT
817 DWORD Argument[4];
818 /* These are selected by CONTEXT_FLOATING_POINT */
819 DWORD FltF0;
820 DWORD FltF1;
821 DWORD FltF2;
822 DWORD FltF3;
823 DWORD FltF4;
824 DWORD FltF5;
825 DWORD FltF6;
826 DWORD FltF7;
827 DWORD FltF8;
828 DWORD FltF9;
829 DWORD FltF10;
830 DWORD FltF11;
831 DWORD FltF12;
832 DWORD FltF13;
833 DWORD FltF14;
834 DWORD FltF15;
835 DWORD FltF16;
836 DWORD FltF17;
837 DWORD FltF18;
838 DWORD FltF19;
839 DWORD FltF20;
840 DWORD FltF21;
841 DWORD FltF22;
842 DWORD FltF23;
843 DWORD FltF24;
844 DWORD FltF25;
845 DWORD FltF26;
846 DWORD FltF27;
847 DWORD FltF28;
848 DWORD FltF29;
849 DWORD FltF30;
850 DWORD FltF31;
852 /* These are selected by CONTEXT_INTEGER */
853 DWORD IntZero;
854 DWORD IntAt;
855 DWORD IntV0;
856 DWORD IntV1;
857 DWORD IntA0;
858 DWORD IntA1;
859 DWORD IntA2;
860 DWORD IntA3;
861 DWORD IntT0;
862 DWORD IntT1;
863 DWORD IntT2;
864 DWORD IntT3;
865 DWORD IntT4;
866 DWORD IntT5;
867 DWORD IntT6;
868 DWORD IntT7;
869 DWORD IntS0;
870 DWORD IntS1;
871 DWORD IntS2;
872 DWORD IntS3;
873 DWORD IntS4;
874 DWORD IntS5;
875 DWORD IntS6;
876 DWORD IntS7;
877 DWORD IntT8;
878 DWORD IntT9;
879 DWORD IntK0;
880 DWORD IntK1;
881 DWORD IntGp;
882 DWORD IntSp;
883 DWORD IntS8;
884 DWORD IntRa;
885 DWORD IntLo;
886 DWORD IntHi;
888 /* These are selected by CONTEXT_FLOATING_POINT */
889 DWORD Fsr;
891 /* These are selected by CONTEXT_CONTROL */
892 DWORD Fir;
893 DWORD Psr;
895 DWORD ContextFlags;
896 DWORD Fill[2];
897 } CONTEXT;
899 #endif /* _MIPS_ */
901 /* PowerPC context definitions */
902 #ifdef __powerpc__
904 #define CONTEXT_CONTROL 0x0001
905 #define CONTEXT_FLOATING_POINT 0x0002
906 #define CONTEXT_INTEGER 0x0004
907 #define CONTEXT_DEBUG_REGISTERS 0x0008
908 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
910 typedef struct
912 /* These are selected by CONTEXT_FLOATING_POINT */
913 double Fpr0;
914 double Fpr1;
915 double Fpr2;
916 double Fpr3;
917 double Fpr4;
918 double Fpr5;
919 double Fpr6;
920 double Fpr7;
921 double Fpr8;
922 double Fpr9;
923 double Fpr10;
924 double Fpr11;
925 double Fpr12;
926 double Fpr13;
927 double Fpr14;
928 double Fpr15;
929 double Fpr16;
930 double Fpr17;
931 double Fpr18;
932 double Fpr19;
933 double Fpr20;
934 double Fpr21;
935 double Fpr22;
936 double Fpr23;
937 double Fpr24;
938 double Fpr25;
939 double Fpr26;
940 double Fpr27;
941 double Fpr28;
942 double Fpr29;
943 double Fpr30;
944 double Fpr31;
945 double Fpscr;
947 /* These are selected by CONTEXT_INTEGER */
948 DWORD Gpr0;
949 DWORD Gpr1;
950 DWORD Gpr2;
951 DWORD Gpr3;
952 DWORD Gpr4;
953 DWORD Gpr5;
954 DWORD Gpr6;
955 DWORD Gpr7;
956 DWORD Gpr8;
957 DWORD Gpr9;
958 DWORD Gpr10;
959 DWORD Gpr11;
960 DWORD Gpr12;
961 DWORD Gpr13;
962 DWORD Gpr14;
963 DWORD Gpr15;
964 DWORD Gpr16;
965 DWORD Gpr17;
966 DWORD Gpr18;
967 DWORD Gpr19;
968 DWORD Gpr20;
969 DWORD Gpr21;
970 DWORD Gpr22;
971 DWORD Gpr23;
972 DWORD Gpr24;
973 DWORD Gpr25;
974 DWORD Gpr26;
975 DWORD Gpr27;
976 DWORD Gpr28;
977 DWORD Gpr29;
978 DWORD Gpr30;
979 DWORD Gpr31;
981 DWORD Cr;
982 DWORD Xer;
984 /* These are selected by CONTEXT_CONTROL */
985 DWORD Msr;
986 DWORD Iar; /* Instruction Address Register , aka PC ... */
987 DWORD Lr;
988 DWORD Ctr;
990 DWORD ContextFlags;
992 DWORD Dar; /* Fault registers for coredump */
993 DWORD Dsisr;
994 DWORD Trap; /* number of powerpc exception taken */
996 /* These are selected by CONTEXT_DEBUG_REGISTERS */
997 DWORD Dr0;
998 DWORD Dr1;
999 DWORD Dr2;
1000 DWORD Dr3;
1001 DWORD Dr4;
1002 DWORD Dr5;
1003 DWORD Dr6;
1004 DWORD Dr7;
1005 } CONTEXT;
1007 typedef struct _STACK_FRAME_HEADER
1009 DWORD BackChain;
1010 DWORD GlueSaved1;
1011 DWORD GlueSaved2;
1012 DWORD Reserved1;
1013 DWORD Spare1;
1014 DWORD Spare2;
1016 DWORD Parameter0;
1017 DWORD Parameter1;
1018 DWORD Parameter2;
1019 DWORD Parameter3;
1020 DWORD Parameter4;
1021 DWORD Parameter5;
1022 DWORD Parameter6;
1023 DWORD Parameter7;
1024 } STACK_FRAME_HEADER,*PSTACK_FRAME_HEADER;
1026 #endif /* __powerpc__ */
1028 #ifdef __ALPHA__
1031 * FIXME:
1033 * I have no idea if any of this is right as I just ripped
1034 * it from mingw-win32api.
1038 #define CONTEXT_ALPHA 0x20000
1039 #define CONTEXT_CONTROL (CONTEXT_ALPHA|1L)
1040 #define CONTEXT_FLOATING_POINT (CONTEXT_ALPHA|2L)
1041 #define CONTEXT_INTEGER (CONTEXT_ALPHA|4L)
1042 #define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_FLOATING_POINT|CONTEXT_INTEGER)
1043 typedef struct _CONTEXT {
1044 ULONGLONG FltF0;
1045 ULONGLONG FltF1;
1046 ULONGLONG FltF2;
1047 ULONGLONG FltF3;
1048 ULONGLONG FltF4;
1049 ULONGLONG FltF5;
1050 ULONGLONG FltF6;
1051 ULONGLONG FltF7;
1052 ULONGLONG FltF8;
1053 ULONGLONG FltF9;
1054 ULONGLONG FltF10;
1055 ULONGLONG FltF11;
1056 ULONGLONG FltF12;
1057 ULONGLONG FltF13;
1058 ULONGLONG FltF14;
1059 ULONGLONG FltF15;
1060 ULONGLONG FltF16;
1061 ULONGLONG FltF17;
1062 ULONGLONG FltF18;
1063 ULONGLONG FltF19;
1064 ULONGLONG FltF20;
1065 ULONGLONG FltF21;
1066 ULONGLONG FltF22;
1067 ULONGLONG FltF23;
1068 ULONGLONG FltF24;
1069 ULONGLONG FltF25;
1070 ULONGLONG FltF26;
1071 ULONGLONG FltF27;
1072 ULONGLONG FltF28;
1073 ULONGLONG FltF29;
1074 ULONGLONG FltF30;
1075 ULONGLONG FltF31;
1076 ULONGLONG IntV0;
1077 ULONGLONG IntT0;
1078 ULONGLONG IntT1;
1079 ULONGLONG IntT2;
1080 ULONGLONG IntT3;
1081 ULONGLONG IntT4;
1082 ULONGLONG IntT5;
1083 ULONGLONG IntT6;
1084 ULONGLONG IntT7;
1085 ULONGLONG IntS0;
1086 ULONGLONG IntS1;
1087 ULONGLONG IntS2;
1088 ULONGLONG IntS3;
1089 ULONGLONG IntS4;
1090 ULONGLONG IntS5;
1091 ULONGLONG IntFp;
1092 ULONGLONG IntA0;
1093 ULONGLONG IntA1;
1094 ULONGLONG IntA2;
1095 ULONGLONG IntA3;
1096 ULONGLONG IntA4;
1097 ULONGLONG IntA5;
1098 ULONGLONG IntT8;
1099 ULONGLONG IntT9;
1100 ULONGLONG IntT10;
1101 ULONGLONG IntT11;
1102 ULONGLONG IntRa;
1103 ULONGLONG IntT12;
1104 ULONGLONG IntAt;
1105 ULONGLONG IntGp;
1106 ULONGLONG IntSp;
1107 ULONGLONG IntZero;
1108 ULONGLONG Fpcr;
1109 ULONGLONG SoftFpcr;
1110 ULONGLONG Fir;
1111 DWORD Psr;
1112 DWORD ContextFlags;
1113 DWORD Fill[4];
1114 } CONTEXT;
1116 #endif /* __ALPHA__ */
1118 #ifdef __sparc__
1121 * FIXME:
1123 * There is no official CONTEXT structure defined for the SPARC
1124 * architecture, so I just made one up.
1126 * This structure is valid only for 32-bit SPARC architectures,
1127 * not for 64-bit SPARC.
1129 * Note that this structure contains only the 'top-level' registers;
1130 * the rest of the register window chain is not visible.
1132 * The layout follows the Solaris 'prgregset_t' structure.
1136 #define CONTEXT_SPARC 0x10000000
1138 #define CONTEXT_CONTROL (CONTEXT_SPARC | 0x00000001)
1139 #define CONTEXT_FLOATING_POINT (CONTEXT_SPARC | 0x00000002)
1140 #define CONTEXT_INTEGER (CONTEXT_SPARC | 0x00000004)
1142 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
1144 typedef struct _CONTEXT
1146 DWORD ContextFlags;
1148 /* These are selected by CONTEXT_INTEGER */
1149 DWORD g0;
1150 DWORD g1;
1151 DWORD g2;
1152 DWORD g3;
1153 DWORD g4;
1154 DWORD g5;
1155 DWORD g6;
1156 DWORD g7;
1157 DWORD o0;
1158 DWORD o1;
1159 DWORD o2;
1160 DWORD o3;
1161 DWORD o4;
1162 DWORD o5;
1163 DWORD o6;
1164 DWORD o7;
1165 DWORD l0;
1166 DWORD l1;
1167 DWORD l2;
1168 DWORD l3;
1169 DWORD l4;
1170 DWORD l5;
1171 DWORD l6;
1172 DWORD l7;
1173 DWORD i0;
1174 DWORD i1;
1175 DWORD i2;
1176 DWORD i3;
1177 DWORD i4;
1178 DWORD i5;
1179 DWORD i6;
1180 DWORD i7;
1182 /* These are selected by CONTEXT_CONTROL */
1183 DWORD psr;
1184 DWORD pc;
1185 DWORD npc;
1186 DWORD y;
1187 DWORD wim;
1188 DWORD tbr;
1190 /* FIXME: floating point registers missing */
1192 } CONTEXT;
1194 #endif /* __sparc__ */
1196 #if !defined(CONTEXT_FULL) && !defined(RC_INVOKED)
1197 #error You need to define a CONTEXT for your CPU
1198 #endif
1200 typedef CONTEXT *PCONTEXT;
1203 * Language IDs
1206 #define MAKELCID(l, s) (MAKELONG(l, s))
1208 #define MAKELANGID(p, s) ((((WORD)(s))<<10) | (WORD)(p))
1209 #define PRIMARYLANGID(l) ((WORD)(l) & 0x3ff)
1210 #define SUBLANGID(l) ((WORD)(l) >> 10)
1212 #define LANGIDFROMLCID(lcid) ((WORD)(lcid))
1213 #define SORTIDFROMLCID(lcid) ((WORD)((((DWORD)(lcid)) >> 16) & 0x0f))
1215 #define LANG_SYSTEM_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT))
1216 #define LANG_USER_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT))
1217 #define LOCALE_SYSTEM_DEFAULT (MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT))
1218 #define LOCALE_USER_DEFAULT (MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT))
1219 #define LOCALE_NEUTRAL (MAKELCID(MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL),SORT_DEFAULT))
1221 #define UNREFERENCED_PARAMETER(u) (u)
1222 #define DBG_UNREFERENCED_PARAMETER(u) (u)
1223 #define DBG_UNREFERENCED_LOCAL_VARIABLE(u) (u)
1225 /* FIXME: are the symbolic names correct for LIDs: 0x17, 0x28,
1226 * 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x3a, 0x3b, 0x3c
1228 #define LANG_NEUTRAL 0x00
1229 #define LANG_INVARIANT 0x7f
1231 #define LANG_AFRIKAANS 0x36
1232 #define LANG_ALBANIAN 0x1c
1233 #define LANG_ARABIC 0x01
1234 #define LANG_ARMENIAN 0x2b
1235 #define LANG_ASSAMESE 0x4d
1236 #define LANG_AZERI 0x2c
1237 #define LANG_BASQUE 0x2d
1238 #define LANG_BELARUSIAN 0x23
1239 #define LANG_BENGALI 0x45
1240 #define LANG_BULGARIAN 0x02
1241 #define LANG_CATALAN 0x03
1242 #define LANG_CHINESE 0x04
1243 #define LANG_CROATIAN 0x1a
1244 #define LANG_CZECH 0x05
1245 #define LANG_DANISH 0x06
1246 #define LANG_DIVEHI 0x65
1247 #define LANG_DUTCH 0x13
1248 #define LANG_ENGLISH 0x09
1249 #define LANG_ESTONIAN 0x25
1250 #define LANG_FAEROESE 0x38
1251 #define LANG_FARSI 0x29
1252 #define LANG_FINNISH 0x0b
1253 #define LANG_FRENCH 0x0c
1254 #define LANG_GALICIAN 0x56
1255 #define LANG_GEORGIAN 0x37
1256 #define LANG_GERMAN 0x07
1257 #define LANG_GREEK 0x08
1258 #define LANG_GUJARATI 0x47
1259 #define LANG_HEBREW 0x0d
1260 #define LANG_HINDI 0x39
1261 #define LANG_HUNGARIAN 0x0e
1262 #define LANG_ICELANDIC 0x0f
1263 #define LANG_INDONESIAN 0x21
1264 #define LANG_ITALIAN 0x10
1265 #define LANG_JAPANESE 0x11
1266 #define LANG_KANNADA 0x4b
1267 #define LANG_KASHMIRI 0x60
1268 #define LANG_KAZAK 0x3f
1269 #define LANG_KONKANI 0x57
1270 #define LANG_KOREAN 0x12
1271 #define LANG_KYRGYZ 0x40
1272 #define LANG_LATVIAN 0x26
1273 #define LANG_LITHUANIAN 0x27
1274 #define LANG_MACEDONIAN 0x2f
1275 #define LANG_MALAY 0x3e
1276 #define LANG_MALAYALAM 0x4c
1277 #define LANG_MANIPURI 0x58
1278 #define LANG_MARATHI 0x4e
1279 #define LANG_MONGOLIAN 0x50
1280 #define LANG_NEPALI 0x61
1281 #define LANG_NORWEGIAN 0x14
1282 #define LANG_ORIYA 0x48
1283 #define LANG_POLISH 0x15
1284 #define LANG_PORTUGUESE 0x16
1285 #define LANG_PUNJABI 0x46
1286 #define LANG_ROMANIAN 0x18
1287 #define LANG_RUSSIAN 0x19
1288 #define LANG_SANSKRIT 0x4f
1289 #define LANG_SERBIAN 0x1a
1290 #define LANG_SINDHI 0x59
1291 #define LANG_SLOVAK 0x1b
1292 #define LANG_SLOVENIAN 0x24
1293 #define LANG_SPANISH 0x0a
1294 #define LANG_SWAHILI 0x41
1295 #define LANG_SWEDISH 0x1d
1296 #define LANG_SYRIAC 0x5a
1297 #define LANG_TAMIL 0x49
1298 #define LANG_TATAR 0x44
1299 #define LANG_TELUGU 0x4a
1300 #define LANG_THAI 0x1e
1301 #define LANG_TURKISH 0x1f
1302 #define LANG_UKRAINIAN 0x22
1303 #define LANG_URDU 0x20
1304 #define LANG_UZBEK 0x43
1305 #define LANG_VIETNAMESE 0x2a
1307 /* FIXME: these are not in the Windows header */
1308 #define LANG_GAELIC 0x3c
1309 #define LANG_MALTESE 0x3a
1310 #define LANG_MAORI 0x28
1311 #define LANG_RHAETO_ROMANCE 0x17
1312 #define LANG_SAAMI 0x3b
1313 #define LANG_SORBIAN 0x2e
1314 #define LANG_SUTU 0x30
1315 #define LANG_TSONGA 0x31
1316 #define LANG_TSWANA 0x32
1317 #define LANG_VENDA 0x33
1318 #define LANG_XHOSA 0x34
1319 #define LANG_ZULU 0x35
1321 /* non standard; keep the number high enough (but < 0xff) */
1322 #define LANG_ESPERANTO 0x8f
1323 #define LANG_WALON 0x90
1324 #define LANG_CORNISH 0x91
1325 #define LANG_WELSH 0x92
1326 #define LANG_BRETON 0x93
1328 /* Sublanguage definitions */
1329 #define SUBLANG_NEUTRAL 0x00 /* language neutral */
1330 #define SUBLANG_DEFAULT 0x01 /* user default */
1331 #define SUBLANG_SYS_DEFAULT 0x02 /* system default */
1333 #define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
1334 #define SUBLANG_ARABIC_IRAQ 0x02
1335 #define SUBLANG_ARABIC_EGYPT 0x03
1336 #define SUBLANG_ARABIC_LIBYA 0x04
1337 #define SUBLANG_ARABIC_ALGERIA 0x05
1338 #define SUBLANG_ARABIC_MOROCCO 0x06
1339 #define SUBLANG_ARABIC_TUNISIA 0x07
1340 #define SUBLANG_ARABIC_OMAN 0x08
1341 #define SUBLANG_ARABIC_YEMEN 0x09
1342 #define SUBLANG_ARABIC_SYRIA 0x0a
1343 #define SUBLANG_ARABIC_JORDAN 0x0b
1344 #define SUBLANG_ARABIC_LEBANON 0x0c
1345 #define SUBLANG_ARABIC_KUWAIT 0x0d
1346 #define SUBLANG_ARABIC_UAE 0x0e
1347 #define SUBLANG_ARABIC_BAHRAIN 0x0f
1348 #define SUBLANG_ARABIC_QATAR 0x10
1349 #define SUBLANG_AZERI_LATIN 0x01
1350 #define SUBLANG_AZERI_CYRILLIC 0x02
1351 #define SUBLANG_CHINESE_TRADITIONAL 0x01
1352 #define SUBLANG_CHINESE_SIMPLIFIED 0x02
1353 #define SUBLANG_CHINESE_HONGKONG 0x03
1354 #define SUBLANG_CHINESE_SINGAPORE 0x04
1355 #define SUBLANG_CHINESE_MACAU 0x05
1356 #define SUBLANG_DUTCH 0x01
1357 #define SUBLANG_DUTCH_BELGIAN 0x02
1358 #define SUBLANG_ENGLISH_US 0x01
1359 #define SUBLANG_ENGLISH_UK 0x02
1360 #define SUBLANG_ENGLISH_AUS 0x03
1361 #define SUBLANG_ENGLISH_CAN 0x04
1362 #define SUBLANG_ENGLISH_NZ 0x05
1363 #define SUBLANG_ENGLISH_EIRE 0x06
1364 #define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07
1365 #define SUBLANG_ENGLISH_JAMAICA 0x08
1366 #define SUBLANG_ENGLISH_CARIBBEAN 0x09
1367 #define SUBLANG_ENGLISH_BELIZE 0x0a
1368 #define SUBLANG_ENGLISH_TRINIDAD 0x0b
1369 #define SUBLANG_ENGLISH_ZIMBABWE 0x0c
1370 #define SUBLANG_ENGLISH_PHILIPPINES 0x0d
1371 #define SUBLANG_FRENCH 0x01
1372 #define SUBLANG_FRENCH_BELGIAN 0x02
1373 #define SUBLANG_FRENCH_CANADIAN 0x03
1374 #define SUBLANG_FRENCH_SWISS 0x04
1375 #define SUBLANG_FRENCH_LUXEMBOURG 0x05
1376 #define SUBLANG_FRENCH_MONACO 0x06
1377 #define SUBLANG_GERMAN 0x01
1378 #define SUBLANG_GERMAN_SWISS 0x02
1379 #define SUBLANG_GERMAN_AUSTRIAN 0x03
1380 #define SUBLANG_GERMAN_LUXEMBOURG 0x04
1381 #define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
1382 #define SUBLANG_ITALIAN 0x01
1383 #define SUBLANG_ITALIAN_SWISS 0x02
1384 #define SUBLANG_KASHMIRI_SASIA 0x02
1385 #define SUBLANG_KASHMIRI_INDIA 0x02
1386 #define SUBLANG_KOREAN 0x01
1387 #define SUBLANG_LITHUANIAN 0x01
1388 #define SUBLANG_MALAY_MALAYSIA 0x01
1389 #define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
1390 #define SUBLANG_NEPALI_INDIA 0x02
1391 #define SUBLANG_NORWEGIAN_BOKMAL 0x01
1392 #define SUBLANG_NORWEGIAN_NYNORSK 0x02
1393 #define SUBLANG_PORTUGUESE 0x02
1394 #define SUBLANG_PORTUGUESE_BRAZILIAN 0x01
1395 #define SUBLANG_SERBIAN_LATIN 0x02
1396 #define SUBLANG_SERBIAN_CYRILLIC 0x03
1397 #define SUBLANG_SPANISH 0x01
1398 #define SUBLANG_SPANISH_MEXICAN 0x02
1399 #define SUBLANG_SPANISH_MODERN 0x03
1400 #define SUBLANG_SPANISH_GUATEMALA 0x04
1401 #define SUBLANG_SPANISH_COSTA_RICA 0x05
1402 #define SUBLANG_SPANISH_PANAMA 0x06
1403 #define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07
1404 #define SUBLANG_SPANISH_VENEZUELA 0x08
1405 #define SUBLANG_SPANISH_COLOMBIA 0x09
1406 #define SUBLANG_SPANISH_PERU 0x0a
1407 #define SUBLANG_SPANISH_ARGENTINA 0x0b
1408 #define SUBLANG_SPANISH_ECUADOR 0x0c
1409 #define SUBLANG_SPANISH_CHILE 0x0d
1410 #define SUBLANG_SPANISH_URUGUAY 0x0e
1411 #define SUBLANG_SPANISH_PARAGUAY 0x0f
1412 #define SUBLANG_SPANISH_BOLIVIA 0x10
1413 #define SUBLANG_SPANISH_EL_SALVADOR 0x11
1414 #define SUBLANG_SPANISH_HONDURAS 0x12
1415 #define SUBLANG_SPANISH_NICARAGUA 0x13
1416 #define SUBLANG_SPANISH_PUERTO_RICO 0x14
1417 #define SUBLANG_SWEDISH 0x01
1418 #define SUBLANG_SWEDISH_FINLAND 0x02
1419 #define SUBLANG_URDU_PAKISTAN 0x01
1420 #define SUBLANG_URDU_INDIA 0x02
1421 #define SUBLANG_UZBEK_LATIN 0x01
1422 #define SUBLANG_UZBEK_CYRILLIC 0x02
1424 /* FIXME: these are not in the Windows header */
1425 #define SUBLANG_DUTCH_SURINAM 0x03
1426 #define SUBLANG_ROMANIAN 0x01
1427 #define SUBLANG_ROMANIAN_MOLDAVIA 0x02
1428 #define SUBLANG_RUSSIAN 0x01
1429 #define SUBLANG_RUSSIAN_MOLDAVIA 0x02
1430 #define SUBLANG_CROATIAN 0x01
1431 #define SUBLANG_LITHUANIAN_CLASSIC 0x02
1432 #define SUBLANG_GAELIC 0x01
1433 #define SUBLANG_GAELIC_SCOTTISH 0x02
1434 #define SUBLANG_GAELIC_MANX 0x03
1438 * Sort definitions
1441 #define SORT_DEFAULT 0x0
1442 #define SORT_JAPANESE_XJIS 0x0
1443 #define SORT_JAPANESE_UNICODE 0x1
1444 #define SORT_CHINESE_BIG5 0x0
1445 #define SORT_CHINESE_UNICODE 0x1
1446 #define SORT_KOREAN_KSC 0x0
1447 #define SORT_KOREAN_UNICODE 0x1
1452 * Definitions for IsTextUnicode()
1455 #define IS_TEXT_UNICODE_ASCII16 0x0001
1456 #define IS_TEXT_UNICODE_STATISTICS 0x0002
1457 #define IS_TEXT_UNICODE_CONTROLS 0x0004
1458 #define IS_TEXT_UNICODE_SIGNATURE 0x0008
1459 #define IS_TEXT_UNICODE_UNICODE_MASK 0x000F
1460 #define IS_TEXT_UNICODE_REVERSE_ASCII16 0x0010
1461 #define IS_TEXT_UNICODE_REVERSE_STATISTICS 0x0020
1462 #define IS_TEXT_UNICODE_REVERSE_CONTROLS 0x0040
1463 #define IS_TEXT_UNICODE_REVERSE_SIGNATURE 0x0080
1464 #define IS_TEXT_UNICODE_REVERSE_MASK 0x00F0
1465 #define IS_TEXT_UNICODE_ILLEGAL_CHARS 0x0100
1466 #define IS_TEXT_UNICODE_ODD_LENGTH 0x0200
1467 #define IS_TEXT_UNICODE_DBCS_LEADBYTE 0x0400
1468 #define IS_TEXT_UNICODE_NOT_UNICODE_MASK 0x0F00
1469 #define IS_TEXT_UNICODE_NULL_BYTES 0x1000
1470 #define IS_TEXT_UNICODE_NOT_ASCII_MASK 0xF000
1472 #define MAXIMUM_WAIT_OBJECTS 64
1473 #define MAXIMUM_SUSPEND_COUNT 127
1477 * From OS/2 2.0 exception handling
1478 * Win32 seems to use the same flags as ExceptionFlags in an EXCEPTION_RECORD
1481 #define EH_NONCONTINUABLE 0x01
1482 #define EH_UNWINDING 0x02
1483 #define EH_EXIT_UNWIND 0x04
1484 #define EH_STACK_INVALID 0x08
1485 #define EH_NESTED_CALL 0x10
1487 #define EXCEPTION_CONTINUABLE 0
1488 #define EXCEPTION_NONCONTINUABLE EH_NONCONTINUABLE
1491 * The exception record used by Win32 to give additional information
1492 * about exception to exception handlers.
1495 #define EXCEPTION_MAXIMUM_PARAMETERS 15
1497 typedef struct _EXCEPTION_RECORD
1499 DWORD ExceptionCode;
1500 DWORD ExceptionFlags;
1501 struct _EXCEPTION_RECORD *ExceptionRecord;
1503 PVOID ExceptionAddress;
1504 DWORD NumberParameters;
1505 ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
1506 } EXCEPTION_RECORD, *PEXCEPTION_RECORD;
1509 * The exception pointers structure passed to exception filters
1510 * in except() and the UnhandledExceptionFilter().
1513 typedef struct _EXCEPTION_POINTERS
1515 PEXCEPTION_RECORD ExceptionRecord;
1516 PCONTEXT ContextRecord;
1517 } EXCEPTION_POINTERS, *PEXCEPTION_POINTERS;
1521 * The exception frame, used for registering exception handlers
1522 * Win32 cares only about this, but compilers generally emit
1523 * larger exception frames for their own use.
1526 struct _EXCEPTION_REGISTRATION_RECORD;
1528 typedef DWORD (*PEXCEPTION_HANDLER)(PEXCEPTION_RECORD,struct _EXCEPTION_REGISTRATION_RECORD*,
1529 PCONTEXT,struct _EXCEPTION_REGISTRATION_RECORD **);
1531 typedef struct _EXCEPTION_REGISTRATION_RECORD
1533 struct _EXCEPTION_REGISTRATION_RECORD *Prev;
1534 PEXCEPTION_HANDLER Handler;
1535 } EXCEPTION_REGISTRATION_RECORD;
1538 * function pointer to a exception filter
1541 typedef LONG (CALLBACK *PVECTORED_EXCEPTION_HANDLER)(PEXCEPTION_POINTERS ExceptionInfo);
1542 typedef LONG (CALLBACK *PTOP_LEVEL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS ExceptionInfo);
1543 typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;
1545 DWORD WINAPI UnhandledExceptionFilter( PEXCEPTION_POINTERS epointers );
1546 LPTOP_LEVEL_EXCEPTION_FILTER
1547 WINAPI SetUnhandledExceptionFilter( LPTOP_LEVEL_EXCEPTION_FILTER filter );
1549 typedef struct _NT_TIB
1551 struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;
1552 PVOID StackBase;
1553 PVOID StackLimit;
1554 PVOID SubSystemTib;
1555 union {
1556 PVOID FiberData;
1557 DWORD Version;
1558 } DUMMYUNIONNAME;
1559 PVOID ArbitraryUserPointer;
1560 struct _NT_TIB *Self;
1561 } NT_TIB, *PNT_TIB;
1563 struct _TEB;
1565 #if defined(__i386__) && defined(__GNUC__)
1566 extern inline struct _TEB * WINAPI NtCurrentTeb(void);
1567 extern inline struct _TEB * WINAPI NtCurrentTeb(void)
1569 struct _TEB *teb;
1570 __asm__(".byte 0x64\n\tmovl (0x18),%0" : "=r" (teb));
1571 return teb;
1573 #elif defined(__i386__) && defined(_MSC_VER)
1574 extern inline struct _TEB * WINAPI NtCurrentTeb(void)
1576 struct _TEB *teb;
1577 __asm mov eax, fs:[0x18];
1578 __asm mov teb, eax;
1579 return teb;
1581 #else
1582 extern struct _TEB * WINAPI NtCurrentTeb(void);
1583 #endif
1585 #ifdef NONAMELESSUNION
1586 #define GetCurrentFiber() (((NT_TIB *)NtCurrentTeb())->u.FiberData)
1587 #else
1588 #define GetCurrentFiber() (((NT_TIB *)NtCurrentTeb())->FiberData)
1589 #endif
1590 #define GetFiberData() (*(void **)GetCurrentFiber())
1593 * File formats definitions
1596 #include <pshpack2.h>
1597 typedef struct _IMAGE_DOS_HEADER {
1598 WORD e_magic; /* 00: MZ Header signature */
1599 WORD e_cblp; /* 02: Bytes on last page of file */
1600 WORD e_cp; /* 04: Pages in file */
1601 WORD e_crlc; /* 06: Relocations */
1602 WORD e_cparhdr; /* 08: Size of header in paragraphs */
1603 WORD e_minalloc; /* 0a: Minimum extra paragraphs needed */
1604 WORD e_maxalloc; /* 0c: Maximum extra paragraphs needed */
1605 WORD e_ss; /* 0e: Initial (relative) SS value */
1606 WORD e_sp; /* 10: Initial SP value */
1607 WORD e_csum; /* 12: Checksum */
1608 WORD e_ip; /* 14: Initial IP value */
1609 WORD e_cs; /* 16: Initial (relative) CS value */
1610 WORD e_lfarlc; /* 18: File address of relocation table */
1611 WORD e_ovno; /* 1a: Overlay number */
1612 WORD e_res[4]; /* 1c: Reserved words */
1613 WORD e_oemid; /* 24: OEM identifier (for e_oeminfo) */
1614 WORD e_oeminfo; /* 26: OEM information; e_oemid specific */
1615 WORD e_res2[10]; /* 28: Reserved words */
1616 DWORD e_lfanew; /* 3c: Offset to extended header */
1617 } IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER;
1618 #include <poppack.h>
1620 #define IMAGE_DOS_SIGNATURE 0x5A4D /* MZ */
1621 #define IMAGE_OS2_SIGNATURE 0x454E /* NE */
1622 #define IMAGE_OS2_SIGNATURE_LE 0x454C /* LE */
1623 #define IMAGE_OS2_SIGNATURE_LX 0x584C /* LX */
1624 #define IMAGE_VXD_SIGNATURE 0x454C /* LE */
1625 #define IMAGE_NT_SIGNATURE 0x00004550 /* PE00 */
1628 * This is the Windows executable (NE) header.
1629 * the name IMAGE_OS2_HEADER is misleading, but in the SDK this way.
1631 #include <pshpack2.h>
1632 typedef struct
1634 WORD ne_magic; /* 00 NE signature 'NE' */
1635 BYTE ne_ver; /* 02 Linker version number */
1636 BYTE ne_rev; /* 03 Linker revision number */
1637 WORD ne_enttab; /* 04 Offset to entry table relative to NE */
1638 WORD ne_cbenttab; /* 06 Length of entry table in bytes */
1639 LONG ne_crc; /* 08 Checksum */
1640 WORD ne_flags; /* 0c Flags about segments in this file */
1641 WORD ne_autodata; /* 0e Automatic data segment number */
1642 WORD ne_heap; /* 10 Initial size of local heap */
1643 WORD ne_stack; /* 12 Initial size of stack */
1644 DWORD ne_csip; /* 14 Initial CS:IP */
1645 DWORD ne_sssp; /* 18 Initial SS:SP */
1646 WORD ne_cseg; /* 1c # of entries in segment table */
1647 WORD ne_cmod; /* 1e # of entries in module reference tab. */
1648 WORD ne_cbnrestab; /* 20 Length of nonresident-name table */
1649 WORD ne_segtab; /* 22 Offset to segment table */
1650 WORD ne_rsrctab; /* 24 Offset to resource table */
1651 WORD ne_restab; /* 26 Offset to resident-name table */
1652 WORD ne_modtab; /* 28 Offset to module reference table */
1653 WORD ne_imptab; /* 2a Offset to imported name table */
1654 DWORD ne_nrestab; /* 2c Offset to nonresident-name table */
1655 WORD ne_cmovent; /* 30 # of movable entry points */
1656 WORD ne_align; /* 32 Logical sector alignment shift count */
1657 WORD ne_cres; /* 34 # of resource segments */
1658 BYTE ne_exetyp; /* 36 Flags indicating target OS */
1659 BYTE ne_flagsothers; /* 37 Additional information flags */
1660 WORD ne_pretthunks; /* 38 Offset to return thunks */
1661 WORD ne_psegrefbytes; /* 3a Offset to segment ref. bytes */
1662 WORD ne_swaparea; /* 3c Reserved by Microsoft */
1663 WORD ne_expver; /* 3e Expected Windows version number */
1664 } IMAGE_OS2_HEADER, *PIMAGE_OS2_HEADER;
1665 #include <poppack.h>
1667 #include <pshpack2.h>
1668 typedef struct _IMAGE_VXD_HEADER {
1669 WORD e32_magic;
1670 BYTE e32_border;
1671 BYTE e32_worder;
1672 DWORD e32_level;
1673 WORD e32_cpu;
1674 WORD e32_os;
1675 DWORD e32_ver;
1676 DWORD e32_mflags;
1677 DWORD e32_mpages;
1678 DWORD e32_startobj;
1679 DWORD e32_eip;
1680 DWORD e32_stackobj;
1681 DWORD e32_esp;
1682 DWORD e32_pagesize;
1683 DWORD e32_lastpagesize;
1684 DWORD e32_fixupsize;
1685 DWORD e32_fixupsum;
1686 DWORD e32_ldrsize;
1687 DWORD e32_ldrsum;
1688 DWORD e32_objtab;
1689 DWORD e32_objcnt;
1690 DWORD e32_objmap;
1691 DWORD e32_itermap;
1692 DWORD e32_rsrctab;
1693 DWORD e32_rsrccnt;
1694 DWORD e32_restab;
1695 DWORD e32_enttab;
1696 DWORD e32_dirtab;
1697 DWORD e32_dircnt;
1698 DWORD e32_fpagetab;
1699 DWORD e32_frectab;
1700 DWORD e32_impmod;
1701 DWORD e32_impmodcnt;
1702 DWORD e32_impproc;
1703 DWORD e32_pagesum;
1704 DWORD e32_datapage;
1705 DWORD e32_preload;
1706 DWORD e32_nrestab;
1707 DWORD e32_cbnrestab;
1708 DWORD e32_nressum;
1709 DWORD e32_autodata;
1710 DWORD e32_debuginfo;
1711 DWORD e32_debuglen;
1712 DWORD e32_instpreload;
1713 DWORD e32_instdemand;
1714 DWORD e32_heapsize;
1715 BYTE e32_res3[12];
1716 DWORD e32_winresoff;
1717 DWORD e32_winreslen;
1718 WORD e32_devid;
1719 WORD e32_ddkver;
1720 } IMAGE_VXD_HEADER, *PIMAGE_VXD_HEADER;
1721 #include <poppack.h>
1723 /* These defines describe the meanings of the bits in the Characteristics
1724 field */
1726 #define IMAGE_FILE_RELOCS_STRIPPED 0x0001 /* No relocation info */
1727 #define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002
1728 #define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004
1729 #define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008
1730 #define IMAGE_FILE_AGGRESIVE_WS_TRIM 0x0010
1731 #define IMAGE_FILE_LARGE_ADDRESS_AWARE 0x0020
1732 #define IMAGE_FILE_16BIT_MACHINE 0x0040
1733 #define IMAGE_FILE_BYTES_REVERSED_LO 0x0080
1734 #define IMAGE_FILE_32BIT_MACHINE 0x0100
1735 #define IMAGE_FILE_DEBUG_STRIPPED 0x0200
1736 #define IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP 0x0400
1737 #define IMAGE_FILE_NET_RUN_FROM_SWAP 0x0800
1738 #define IMAGE_FILE_SYSTEM 0x1000
1739 #define IMAGE_FILE_DLL 0x2000
1740 #define IMAGE_FILE_UP_SYSTEM_ONLY 0x4000
1741 #define IMAGE_FILE_BYTES_REVERSED_HI 0x8000
1743 /* These are the settings of the Machine field. */
1744 #define IMAGE_FILE_MACHINE_UNKNOWN 0
1745 #define IMAGE_FILE_MACHINE_I860 0x014d
1746 #define IMAGE_FILE_MACHINE_I386 0x014c
1747 #define IMAGE_FILE_MACHINE_R3000 0x0162
1748 #define IMAGE_FILE_MACHINE_R4000 0x0166
1749 #define IMAGE_FILE_MACHINE_R10000 0x0168
1750 #define IMAGE_FILE_MACHINE_WCEMIPSV2 0x0169
1751 #define IMAGE_FILE_MACHINE_ALPHA 0x0184
1752 #define IMAGE_FILE_MACHINE_SH3 0x01a2
1753 #define IMAGE_FILE_MACHINE_SH3DSP 0x01a3
1754 #define IMAGE_FILE_MACHINE_SH3E 0x01a4
1755 #define IMAGE_FILE_MACHINE_SH4 0x01a6
1756 #define IMAGE_FILE_MACHINE_SH5 0x01a8
1757 #define IMAGE_FILE_MACHINE_ARM 0x01c0
1758 #define IMAGE_FILE_MACHINE_THUMB 0x01c2
1759 #define IMAGE_FILE_MACHINE_AM33 0x01d3
1760 #define IMAGE_FILE_MACHINE_POWERPC 0x01f0
1761 #define IMAGE_FILE_MACHINE_POWERPCFP 0x01f1
1762 #define IMAGE_FILE_MACHINE_IA64 0x0200
1763 #define IMAGE_FILE_MACHINE_MIPS16 0x0266
1764 #define IMAGE_FILE_MACHINE_ALPHA64 0x0284
1765 #define IMAGE_FILE_MACHINE_MIPSFPU 0x0366
1766 #define IMAGE_FILE_MACHINE_MIPSFPU16 0x0466
1767 #define IMAGE_FILE_MACHINE_AXP64 IMAGE_FILE_MACHINE_ALPHA64
1768 #define IMAGE_FILE_MACHINE_TRICORE 0x0520
1769 #define IMAGE_FILE_MACHINE_CEF 0x0cef
1770 #define IMAGE_FILE_MACHINE_EBC 0x0ebc
1771 #define IMAGE_FILE_MACHINE_AMD64 0x8664
1772 #define IMAGE_FILE_MACHINE_M32R 0x9041
1773 #define IMAGE_FILE_MACHINE_CEE 0xc0ee
1775 #define IMAGE_SIZEOF_FILE_HEADER 20
1776 #define IMAGE_SIZEOF_ROM_OPTIONAL_HEADER 56
1777 #define IMAGE_SIZEOF_STD_OPTIONAL_HEADER 28
1778 #define IMAGE_SIZEOF_NT_OPTIONAL_HEADER 224
1779 #define IMAGE_SIZEOF_SHORT_NAME 8
1780 #define IMAGE_SIZEOF_SECTION_HEADER 40
1781 #define IMAGE_SIZEOF_SYMBOL 18
1782 #define IMAGE_SIZEOF_AUX_SYMBOL 18
1783 #define IMAGE_SIZEOF_RELOCATION 10
1784 #define IMAGE_SIZEOF_BASE_RELOCATION 8
1785 #define IMAGE_SIZEOF_LINENUMBER 6
1786 #define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
1788 /* Possible Magic values */
1789 #define IMAGE_NT_OPTIONAL_HDR_MAGIC 0x10b
1790 #define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
1792 /* These are indexes into the DataDirectory array */
1793 #define IMAGE_FILE_EXPORT_DIRECTORY 0
1794 #define IMAGE_FILE_IMPORT_DIRECTORY 1
1795 #define IMAGE_FILE_RESOURCE_DIRECTORY 2
1796 #define IMAGE_FILE_EXCEPTION_DIRECTORY 3
1797 #define IMAGE_FILE_SECURITY_DIRECTORY 4
1798 #define IMAGE_FILE_BASE_RELOCATION_TABLE 5
1799 #define IMAGE_FILE_DEBUG_DIRECTORY 6
1800 #define IMAGE_FILE_DESCRIPTION_STRING 7
1801 #define IMAGE_FILE_MACHINE_VALUE 8 /* Mips */
1802 #define IMAGE_FILE_THREAD_LOCAL_STORAGE 9
1803 #define IMAGE_FILE_CALLBACK_DIRECTORY 10
1805 /* Directory Entries, indices into the DataDirectory array */
1807 #define IMAGE_DIRECTORY_ENTRY_EXPORT 0
1808 #define IMAGE_DIRECTORY_ENTRY_IMPORT 1
1809 #define IMAGE_DIRECTORY_ENTRY_RESOURCE 2
1810 #define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3
1811 #define IMAGE_DIRECTORY_ENTRY_SECURITY 4
1812 #define IMAGE_DIRECTORY_ENTRY_BASERELOC 5
1813 #define IMAGE_DIRECTORY_ENTRY_DEBUG 6
1814 #define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7
1815 #define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 /* (MIPS GP) */
1816 #define IMAGE_DIRECTORY_ENTRY_TLS 9
1817 #define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10
1818 #define IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT 11
1819 #define IMAGE_DIRECTORY_ENTRY_IAT 12 /* Import Address Table */
1820 #define IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT 13
1821 #define IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR 14
1823 /* Subsystem Values */
1825 #define IMAGE_SUBSYSTEM_UNKNOWN 0
1826 #define IMAGE_SUBSYSTEM_NATIVE 1
1827 #define IMAGE_SUBSYSTEM_WINDOWS_GUI 2 /* Windows GUI subsystem */
1828 #define IMAGE_SUBSYSTEM_WINDOWS_CUI 3 /* Windows character subsystem */
1829 #define IMAGE_SUBSYSTEM_OS2_CUI 5
1830 #define IMAGE_SUBSYSTEM_POSIX_CUI 7
1831 #define IMAGE_SUBSYSTEM_NATIVE_WINDOWS 8 /* native Win9x driver */
1832 #define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9 /* Windows CE subsystem */
1833 #define IMAGE_SUBSYSTEM_EFI_APPLICATION 10
1834 #define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
1835 #define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
1836 #define IMAGE_SUBSYSTEM_EFI_ROM 13
1837 #define IMAGE_SUBSYSTEM_XBOX 14
1839 typedef struct _IMAGE_FILE_HEADER {
1840 WORD Machine;
1841 WORD NumberOfSections;
1842 DWORD TimeDateStamp;
1843 DWORD PointerToSymbolTable;
1844 DWORD NumberOfSymbols;
1845 WORD SizeOfOptionalHeader;
1846 WORD Characteristics;
1847 } IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;
1849 typedef struct _IMAGE_DATA_DIRECTORY {
1850 DWORD VirtualAddress;
1851 DWORD Size;
1852 } IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY;
1854 #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
1856 typedef struct _IMAGE_OPTIONAL_HEADER {
1858 /* Standard fields */
1860 WORD Magic; /* 0x10b or 0x107 */ /* 0x00 */
1861 BYTE MajorLinkerVersion;
1862 BYTE MinorLinkerVersion;
1863 DWORD SizeOfCode;
1864 DWORD SizeOfInitializedData;
1865 DWORD SizeOfUninitializedData;
1866 DWORD AddressOfEntryPoint; /* 0x10 */
1867 DWORD BaseOfCode;
1868 DWORD BaseOfData;
1870 /* NT additional fields */
1872 DWORD ImageBase;
1873 DWORD SectionAlignment; /* 0x20 */
1874 DWORD FileAlignment;
1875 WORD MajorOperatingSystemVersion;
1876 WORD MinorOperatingSystemVersion;
1877 WORD MajorImageVersion;
1878 WORD MinorImageVersion;
1879 WORD MajorSubsystemVersion; /* 0x30 */
1880 WORD MinorSubsystemVersion;
1881 DWORD Win32VersionValue;
1882 DWORD SizeOfImage;
1883 DWORD SizeOfHeaders;
1884 DWORD CheckSum; /* 0x40 */
1885 WORD Subsystem;
1886 WORD DllCharacteristics;
1887 DWORD SizeOfStackReserve;
1888 DWORD SizeOfStackCommit;
1889 DWORD SizeOfHeapReserve; /* 0x50 */
1890 DWORD SizeOfHeapCommit;
1891 DWORD LoaderFlags;
1892 DWORD NumberOfRvaAndSizes;
1893 IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; /* 0x60 */
1894 /* 0xE0 */
1895 } IMAGE_OPTIONAL_HEADER, *PIMAGE_OPTIONAL_HEADER;
1897 typedef struct _IMAGE_NT_HEADERS {
1898 DWORD Signature; /* "PE"\0\0 */ /* 0x00 */
1899 IMAGE_FILE_HEADER FileHeader; /* 0x04 */
1900 IMAGE_OPTIONAL_HEADER OptionalHeader; /* 0x18 */
1901 } IMAGE_NT_HEADERS, *PIMAGE_NT_HEADERS;
1903 #define IMAGE_SIZEOF_SHORT_NAME 8
1905 typedef struct _IMAGE_SECTION_HEADER {
1906 BYTE Name[IMAGE_SIZEOF_SHORT_NAME];
1907 union {
1908 DWORD PhysicalAddress;
1909 DWORD VirtualSize;
1910 } Misc;
1911 DWORD VirtualAddress;
1912 DWORD SizeOfRawData;
1913 DWORD PointerToRawData;
1914 DWORD PointerToRelocations;
1915 DWORD PointerToLinenumbers;
1916 WORD NumberOfRelocations;
1917 WORD NumberOfLinenumbers;
1918 DWORD Characteristics;
1919 } IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;
1921 #define IMAGE_SIZEOF_SECTION_HEADER 40
1923 #define IMAGE_FIRST_SECTION(ntheader) \
1924 ((PIMAGE_SECTION_HEADER)((LPBYTE)&((PIMAGE_NT_HEADERS)(ntheader))->OptionalHeader + \
1925 ((PIMAGE_NT_HEADERS)(ntheader))->FileHeader.SizeOfOptionalHeader))
1927 /* These defines are for the Characteristics bitfield. */
1928 /* #define IMAGE_SCN_TYPE_REG 0x00000000 - Reserved */
1929 /* #define IMAGE_SCN_TYPE_DSECT 0x00000001 - Reserved */
1930 /* #define IMAGE_SCN_TYPE_NOLOAD 0x00000002 - Reserved */
1931 /* #define IMAGE_SCN_TYPE_GROUP 0x00000004 - Reserved */
1932 #define IMAGE_SCN_TYPE_NO_PAD 0x00000008 /* Reserved */
1933 /* #define IMAGE_SCN_TYPE_COPY 0x00000010 - Reserved */
1935 #define IMAGE_SCN_CNT_CODE 0x00000020
1936 #define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040
1937 #define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080
1939 #define IMAGE_SCN_LNK_OTHER 0x00000100
1940 #define IMAGE_SCN_LNK_INFO 0x00000200
1941 /* #define IMAGE_SCN_TYPE_OVER 0x00000400 - Reserved */
1942 #define IMAGE_SCN_LNK_REMOVE 0x00000800
1943 #define IMAGE_SCN_LNK_COMDAT 0x00001000
1945 /* 0x00002000 - Reserved */
1946 /* #define IMAGE_SCN_MEM_PROTECTED 0x00004000 - Obsolete */
1947 #define IMAGE_SCN_MEM_FARDATA 0x00008000
1949 /* #define IMAGE_SCN_MEM_SYSHEAP 0x00010000 - Obsolete */
1950 #define IMAGE_SCN_MEM_PURGEABLE 0x00020000
1951 #define IMAGE_SCN_MEM_16BIT 0x00020000
1952 #define IMAGE_SCN_MEM_LOCKED 0x00040000
1953 #define IMAGE_SCN_MEM_PRELOAD 0x00080000
1955 #define IMAGE_SCN_ALIGN_1BYTES 0x00100000
1956 #define IMAGE_SCN_ALIGN_2BYTES 0x00200000
1957 #define IMAGE_SCN_ALIGN_4BYTES 0x00300000
1958 #define IMAGE_SCN_ALIGN_8BYTES 0x00400000
1959 #define IMAGE_SCN_ALIGN_16BYTES 0x00500000 /* Default */
1960 #define IMAGE_SCN_ALIGN_32BYTES 0x00600000
1961 #define IMAGE_SCN_ALIGN_64BYTES 0x00700000
1962 #define IMAGE_SCN_ALIGN_128BYTES 0x00800000
1963 #define IMAGE_SCN_ALIGN_256BYTES 0x00900000
1964 #define IMAGE_SCN_ALIGN_512BYTES 0x00A00000
1965 #define IMAGE_SCN_ALIGN_1024BYTES 0x00B00000
1966 #define IMAGE_SCN_ALIGN_2048BYTES 0x00C00000
1967 #define IMAGE_SCN_ALIGN_4096BYTES 0x00D00000
1968 #define IMAGE_SCN_ALIGN_8192BYTES 0x00E00000
1969 /* 0x00F00000 - Unused */
1970 #define IMAGE_SCN_ALIGN_MASK 0x00F00000
1972 #define IMAGE_SCN_LNK_NRELOC_OVFL 0x01000000
1975 #define IMAGE_SCN_MEM_DISCARDABLE 0x02000000
1976 #define IMAGE_SCN_MEM_NOT_CACHED 0x04000000
1977 #define IMAGE_SCN_MEM_NOT_PAGED 0x08000000
1978 #define IMAGE_SCN_MEM_SHARED 0x10000000
1979 #define IMAGE_SCN_MEM_EXECUTE 0x20000000
1980 #define IMAGE_SCN_MEM_READ 0x40000000
1981 #define IMAGE_SCN_MEM_WRITE 0x80000000
1983 #include <pshpack2.h>
1985 typedef struct _IMAGE_SYMBOL {
1986 union {
1987 BYTE ShortName[8];
1988 struct {
1989 DWORD Short;
1990 DWORD Long;
1991 } Name;
1992 DWORD LongName[2];
1993 } N;
1994 DWORD Value;
1995 SHORT SectionNumber;
1996 WORD Type;
1997 BYTE StorageClass;
1998 BYTE NumberOfAuxSymbols;
1999 } IMAGE_SYMBOL;
2000 typedef IMAGE_SYMBOL *PIMAGE_SYMBOL;
2002 #define IMAGE_SIZEOF_SYMBOL 18
2004 typedef struct _IMAGE_LINENUMBER {
2005 union {
2006 DWORD SymbolTableIndex;
2007 DWORD VirtualAddress;
2008 } Type;
2009 WORD Linenumber;
2010 } IMAGE_LINENUMBER;
2011 typedef IMAGE_LINENUMBER *PIMAGE_LINENUMBER;
2013 #define IMAGE_SIZEOF_LINENUMBER 6
2015 typedef union _IMAGE_AUX_SYMBOL {
2016 struct {
2017 DWORD TagIndex;
2018 union {
2019 struct {
2020 WORD Linenumber;
2021 WORD Size;
2022 } LnSz;
2023 DWORD TotalSize;
2024 } Misc;
2025 union {
2026 struct {
2027 DWORD PointerToLinenumber;
2028 DWORD PointerToNextFunction;
2029 } Function;
2030 struct {
2031 WORD Dimension[4];
2032 } Array;
2033 } FcnAry;
2034 WORD TvIndex;
2035 } Sym;
2036 struct {
2037 BYTE Name[IMAGE_SIZEOF_SYMBOL];
2038 } File;
2039 struct {
2040 DWORD Length;
2041 WORD NumberOfRelocations;
2042 WORD NumberOfLinenumbers;
2043 DWORD CheckSum;
2044 SHORT Number;
2045 BYTE Selection;
2046 } Section;
2047 } IMAGE_AUX_SYMBOL;
2048 typedef IMAGE_AUX_SYMBOL *PIMAGE_AUX_SYMBOL;
2050 #define IMAGE_SIZEOF_AUX_SYMBOL 18
2052 #include <poppack.h>
2054 #define IMAGE_SYM_UNDEFINED (SHORT)0
2055 #define IMAGE_SYM_ABSOLUTE (SHORT)-1
2056 #define IMAGE_SYM_DEBUG (SHORT)-2
2058 #define IMAGE_SYM_TYPE_NULL 0x0000
2059 #define IMAGE_SYM_TYPE_VOID 0x0001
2060 #define IMAGE_SYM_TYPE_CHAR 0x0002
2061 #define IMAGE_SYM_TYPE_SHORT 0x0003
2062 #define IMAGE_SYM_TYPE_INT 0x0004
2063 #define IMAGE_SYM_TYPE_LONG 0x0005
2064 #define IMAGE_SYM_TYPE_FLOAT 0x0006
2065 #define IMAGE_SYM_TYPE_DOUBLE 0x0007
2066 #define IMAGE_SYM_TYPE_STRUCT 0x0008
2067 #define IMAGE_SYM_TYPE_UNION 0x0009
2068 #define IMAGE_SYM_TYPE_ENUM 0x000A
2069 #define IMAGE_SYM_TYPE_MOE 0x000B
2070 #define IMAGE_SYM_TYPE_BYTE 0x000C
2071 #define IMAGE_SYM_TYPE_WORD 0x000D
2072 #define IMAGE_SYM_TYPE_UINT 0x000E
2073 #define IMAGE_SYM_TYPE_DWORD 0x000F
2074 #define IMAGE_SYM_TYPE_PCODE 0x8000
2076 #define IMAGE_SYM_DTYPE_NULL 0
2077 #define IMAGE_SYM_DTYPE_POINTER 1
2078 #define IMAGE_SYM_DTYPE_FUNCTION 2
2079 #define IMAGE_SYM_DTYPE_ARRAY 3
2081 #define IMAGE_SYM_CLASS_END_OF_FUNCTION (BYTE )-1
2082 #define IMAGE_SYM_CLASS_NULL 0x0000
2083 #define IMAGE_SYM_CLASS_AUTOMATIC 0x0001
2084 #define IMAGE_SYM_CLASS_EXTERNAL 0x0002
2085 #define IMAGE_SYM_CLASS_STATIC 0x0003
2086 #define IMAGE_SYM_CLASS_REGISTER 0x0004
2087 #define IMAGE_SYM_CLASS_EXTERNAL_DEF 0x0005
2088 #define IMAGE_SYM_CLASS_LABEL 0x0006
2089 #define IMAGE_SYM_CLASS_UNDEFINED_LABEL 0x0007
2090 #define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 0x0008
2091 #define IMAGE_SYM_CLASS_ARGUMENT 0x0009
2092 #define IMAGE_SYM_CLASS_STRUCT_TAG 0x000A
2093 #define IMAGE_SYM_CLASS_MEMBER_OF_UNION 0x000B
2094 #define IMAGE_SYM_CLASS_UNION_TAG 0x000C
2095 #define IMAGE_SYM_CLASS_TYPE_DEFINITION 0x000D
2096 #define IMAGE_SYM_CLASS_UNDEFINED_STATIC 0x000E
2097 #define IMAGE_SYM_CLASS_ENUM_TAG 0x000F
2098 #define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 0x0010
2099 #define IMAGE_SYM_CLASS_REGISTER_PARAM 0x0011
2100 #define IMAGE_SYM_CLASS_BIT_FIELD 0x0012
2102 #define IMAGE_SYM_CLASS_FAR_EXTERNAL 0x0044
2103 #define IMAGE_SYM_CLASS_BLOCK 0x0064
2104 #define IMAGE_SYM_CLASS_FUNCTION 0x0065
2105 #define IMAGE_SYM_CLASS_END_OF_STRUCT 0x0066
2106 #define IMAGE_SYM_CLASS_FILE 0x0067
2107 #define IMAGE_SYM_CLASS_SECTION 0x0068
2108 #define IMAGE_SYM_CLASS_WEAK_EXTERNAL 0x0069
2110 #define N_BTMASK 0x000F
2111 #define N_TMASK 0x0030
2112 #define N_TMASK1 0x00C0
2113 #define N_TMASK2 0x00F0
2114 #define N_BTSHFT 4
2115 #define N_TSHIFT 2
2117 #define BTYPE(x) ((x) & N_BTMASK)
2119 #ifndef ISPTR
2120 #define ISPTR(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT))
2121 #endif
2123 #ifndef ISFCN
2124 #define ISFCN(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_FUNCTION << N_BTSHFT))
2125 #endif
2127 #ifndef ISARY
2128 #define ISARY(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_ARRAY << N_BTSHFT))
2129 #endif
2131 #ifndef ISTAG
2132 #define ISTAG(x) ((x)==IMAGE_SYM_CLASS_STRUCT_TAG || (x)==IMAGE_SYM_CLASS_UNION_TAG || (x)==IMAGE_SYM_CLASS_ENUM_TAG)
2133 #endif
2135 #ifndef INCREF
2136 #define INCREF(x) ((((x)&~N_BTMASK)<<N_TSHIFT)|(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT)|((x)&N_BTMASK))
2137 #endif
2138 #ifndef DECREF
2139 #define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
2140 #endif
2142 #define IMAGE_COMDAT_SELECT_NODUPLICATES 1
2143 #define IMAGE_COMDAT_SELECT_ANY 2
2144 #define IMAGE_COMDAT_SELECT_SAME_SIZE 3
2145 #define IMAGE_COMDAT_SELECT_EXACT_MATCH 4
2146 #define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
2147 #define IMAGE_COMDAT_SELECT_LARGEST 6
2148 #define IMAGE_COMDAT_SELECT_NEWEST 7
2150 #define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
2151 #define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
2152 #define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
2154 /* Export module directory */
2156 typedef struct _IMAGE_EXPORT_DIRECTORY {
2157 DWORD Characteristics;
2158 DWORD TimeDateStamp;
2159 WORD MajorVersion;
2160 WORD MinorVersion;
2161 DWORD Name;
2162 DWORD Base;
2163 DWORD NumberOfFunctions;
2164 DWORD NumberOfNames;
2165 DWORD AddressOfFunctions;
2166 DWORD AddressOfNames;
2167 DWORD AddressOfNameOrdinals;
2168 } IMAGE_EXPORT_DIRECTORY,*PIMAGE_EXPORT_DIRECTORY;
2170 /* Import name entry */
2171 typedef struct _IMAGE_IMPORT_BY_NAME {
2172 WORD Hint;
2173 BYTE Name[1];
2174 } IMAGE_IMPORT_BY_NAME,*PIMAGE_IMPORT_BY_NAME;
2176 /* Import thunk */
2177 typedef struct _IMAGE_THUNK_DATA {
2178 union {
2179 LPBYTE ForwarderString;
2180 PDWORD Function;
2181 DWORD Ordinal;
2182 PIMAGE_IMPORT_BY_NAME AddressOfData;
2183 } u1;
2184 } IMAGE_THUNK_DATA,*PIMAGE_THUNK_DATA;
2186 /* Import module directory */
2188 typedef struct _IMAGE_IMPORT_DESCRIPTOR {
2189 union {
2190 DWORD Characteristics; /* 0 for terminating null import descriptor */
2191 PIMAGE_THUNK_DATA OriginalFirstThunk; /* RVA to original unbound IAT */
2192 } u;
2193 DWORD TimeDateStamp; /* 0 if not bound,
2194 * -1 if bound, and real date\time stamp
2195 * in IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT
2196 * (new BIND)
2197 * otherwise date/time stamp of DLL bound to
2198 * (Old BIND)
2200 DWORD ForwarderChain; /* -1 if no forwarders */
2201 DWORD Name;
2202 /* RVA to IAT (if bound this IAT has actual addresses) */
2203 PIMAGE_THUNK_DATA FirstThunk;
2204 } IMAGE_IMPORT_DESCRIPTOR,*PIMAGE_IMPORT_DESCRIPTOR;
2206 #define IMAGE_ORDINAL_FLAG 0x80000000
2207 #define IMAGE_SNAP_BY_ORDINAL(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG) != 0)
2208 #define IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff)
2210 typedef struct _IMAGE_BOUND_IMPORT_DESCRIPTOR
2212 DWORD TimeDateStamp;
2213 WORD OffsetModuleName;
2214 WORD NumberOfModuleForwarderRefs;
2215 /* Array of zero or more IMAGE_BOUND_FORWARDER_REF follows */
2216 } IMAGE_BOUND_IMPORT_DESCRIPTOR, *PIMAGE_BOUND_IMPORT_DESCRIPTOR;
2218 typedef struct _IMAGE_BOUND_FORWARDER_REF
2220 DWORD TimeDateStamp;
2221 WORD OffsetModuleName;
2222 WORD Reserved;
2223 } IMAGE_BOUND_FORWARDER_REF, *PIMAGE_BOUND_FORWARDER_REF;
2225 typedef struct _IMAGE_BASE_RELOCATION
2227 DWORD VirtualAddress;
2228 DWORD SizeOfBlock;
2229 /* WORD TypeOffset[1]; */
2230 } IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION;
2232 #include <pshpack2.h>
2234 typedef struct _IMAGE_RELOCATION
2236 union {
2237 DWORD VirtualAddress;
2238 DWORD RelocCount;
2239 } DUMMYUNIONNAME;
2240 DWORD SymbolTableIndex;
2241 WORD Type;
2242 } IMAGE_RELOCATION, *PIMAGE_RELOCATION;
2244 #include <poppack.h>
2246 #define IMAGE_SIZEOF_RELOCATION 10
2248 /* generic relocation types */
2249 #define IMAGE_REL_BASED_ABSOLUTE 0
2250 #define IMAGE_REL_BASED_HIGH 1
2251 #define IMAGE_REL_BASED_LOW 2
2252 #define IMAGE_REL_BASED_HIGHLOW 3
2253 #define IMAGE_REL_BASED_HIGHADJ 4
2254 #define IMAGE_REL_BASED_MIPS_JMPADDR 5
2255 #define IMAGE_REL_BASED_SECTION 6
2256 #define IMAGE_REL_BASED_REL 7
2257 #define IMAGE_REL_BASED_MIPS_JMPADDR16 9
2258 #define IMAGE_REL_BASED_IA64_IMM64 9 /* yes, 9 too */
2259 #define IMAGE_REL_BASED_DIR64 10
2260 #define IMAGE_REL_BASED_HIGH3ADJ 11
2262 /* I386 relocation types */
2263 #define IMAGE_REL_I386_ABSOLUTE 0
2264 #define IMAGE_REL_I386_DIR16 1
2265 #define IMAGE_REL_I386_REL16 2
2266 #define IMAGE_REL_I386_DIR32 6
2267 #define IMAGE_REL_I386_DIR32NB 7
2268 #define IMAGE_REL_I386_SEG12 9
2269 #define IMAGE_REL_I386_SECTION 10
2270 #define IMAGE_REL_I386_SECREL 11
2271 #define IMAGE_REL_I386_REL32 20
2273 /* MIPS relocation types */
2274 #define IMAGE_REL_MIPS_ABSOLUTE 0x0000
2275 #define IMAGE_REL_MIPS_REFHALF 0x0001
2276 #define IMAGE_REL_MIPS_REFWORD 0x0002
2277 #define IMAGE_REL_MIPS_JMPADDR 0x0003
2278 #define IMAGE_REL_MIPS_REFHI 0x0004
2279 #define IMAGE_REL_MIPS_REFLO 0x0005
2280 #define IMAGE_REL_MIPS_GPREL 0x0006
2281 #define IMAGE_REL_MIPS_LITERAL 0x0007
2282 #define IMAGE_REL_MIPS_SECTION 0x000A
2283 #define IMAGE_REL_MIPS_SECREL 0x000B
2284 #define IMAGE_REL_MIPS_SECRELLO 0x000C
2285 #define IMAGE_REL_MIPS_SECRELHI 0x000D
2286 #define IMAGE_REL_MIPS_JMPADDR16 0x0010
2287 #define IMAGE_REL_MIPS_REFWORDNB 0x0022
2288 #define IMAGE_REL_MIPS_PAIR 0x0025
2290 /* ALPHA relocation types */
2291 #define IMAGE_REL_ALPHA_ABSOLUTE 0x0000
2292 #define IMAGE_REL_ALPHA_REFLONG 0x0001
2293 #define IMAGE_REL_ALPHA_REFQUAD 0x0002
2294 #define IMAGE_REL_ALPHA_GPREL 0x0003
2295 #define IMAGE_REL_ALPHA_LITERAL 0x0004
2296 #define IMAGE_REL_ALPHA_LITUSE 0x0005
2297 #define IMAGE_REL_ALPHA_GPDISP 0x0006
2298 #define IMAGE_REL_ALPHA_BRADDR 0x0007
2299 #define IMAGE_REL_ALPHA_HINT 0x0008
2300 #define IMAGE_REL_ALPHA_INLINE_REFLONG 0x0009
2301 #define IMAGE_REL_ALPHA_REFHI 0x000A
2302 #define IMAGE_REL_ALPHA_REFLO 0x000B
2303 #define IMAGE_REL_ALPHA_PAIR 0x000C
2304 #define IMAGE_REL_ALPHA_MATCH 0x000D
2305 #define IMAGE_REL_ALPHA_SECTION 0x000E
2306 #define IMAGE_REL_ALPHA_SECREL 0x000F
2307 #define IMAGE_REL_ALPHA_REFLONGNB 0x0010
2308 #define IMAGE_REL_ALPHA_SECRELLO 0x0011
2309 #define IMAGE_REL_ALPHA_SECRELHI 0x0012
2310 #define IMAGE_REL_ALPHA_REFQ3 0x0013
2311 #define IMAGE_REL_ALPHA_REFQ2 0x0014
2312 #define IMAGE_REL_ALPHA_REFQ1 0x0015
2313 #define IMAGE_REL_ALPHA_GPRELLO 0x0016
2314 #define IMAGE_REL_ALPHA_GPRELHI 0x0017
2316 /* PowerPC relocation types */
2317 #define IMAGE_REL_PPC_ABSOLUTE 0x0000
2318 #define IMAGE_REL_PPC_ADDR64 0x0001
2319 #define IMAGE_REL_PPC_ADDR 0x0002
2320 #define IMAGE_REL_PPC_ADDR24 0x0003
2321 #define IMAGE_REL_PPC_ADDR16 0x0004
2322 #define IMAGE_REL_PPC_ADDR14 0x0005
2323 #define IMAGE_REL_PPC_REL24 0x0006
2324 #define IMAGE_REL_PPC_REL14 0x0007
2325 #define IMAGE_REL_PPC_TOCREL16 0x0008
2326 #define IMAGE_REL_PPC_TOCREL14 0x0009
2327 #define IMAGE_REL_PPC_ADDR32NB 0x000A
2328 #define IMAGE_REL_PPC_SECREL 0x000B
2329 #define IMAGE_REL_PPC_SECTION 0x000C
2330 #define IMAGE_REL_PPC_IFGLUE 0x000D
2331 #define IMAGE_REL_PPC_IMGLUE 0x000E
2332 #define IMAGE_REL_PPC_SECREL16 0x000F
2333 #define IMAGE_REL_PPC_REFHI 0x0010
2334 #define IMAGE_REL_PPC_REFLO 0x0011
2335 #define IMAGE_REL_PPC_PAIR 0x0012
2336 #define IMAGE_REL_PPC_SECRELLO 0x0013
2337 #define IMAGE_REL_PPC_SECRELHI 0x0014
2338 #define IMAGE_REL_PPC_GPREL 0x0015
2339 #define IMAGE_REL_PPC_TYPEMASK 0x00FF
2340 /* modifier bits */
2341 #define IMAGE_REL_PPC_NEG 0x0100
2342 #define IMAGE_REL_PPC_BRTAKEN 0x0200
2343 #define IMAGE_REL_PPC_BRNTAKEN 0x0400
2344 #define IMAGE_REL_PPC_TOCDEFN 0x0800
2346 /* SH3 ? relocation type */
2347 #define IMAGE_REL_SH3_ABSOLUTE 0x0000
2348 #define IMAGE_REL_SH3_DIRECT16 0x0001
2349 #define IMAGE_REL_SH3_DIRECT 0x0002
2350 #define IMAGE_REL_SH3_DIRECT8 0x0003
2351 #define IMAGE_REL_SH3_DIRECT8_WORD 0x0004
2352 #define IMAGE_REL_SH3_DIRECT8_LONG 0x0005
2353 #define IMAGE_REL_SH3_DIRECT4 0x0006
2354 #define IMAGE_REL_SH3_DIRECT4_WORD 0x0007
2355 #define IMAGE_REL_SH3_DIRECT4_LONG 0x0008
2356 #define IMAGE_REL_SH3_PCREL8_WORD 0x0009
2357 #define IMAGE_REL_SH3_PCREL8_LONG 0x000A
2358 #define IMAGE_REL_SH3_PCREL12_WORD 0x000B
2359 #define IMAGE_REL_SH3_STARTOF_SECTION 0x000C
2360 #define IMAGE_REL_SH3_SIZEOF_SECTION 0x000D
2361 #define IMAGE_REL_SH3_SECTION 0x000E
2362 #define IMAGE_REL_SH3_SECREL 0x000F
2363 #define IMAGE_REL_SH3_DIRECT32_NB 0x0010
2365 /* ARM (Archimedes?) relocation types */
2366 #define IMAGE_REL_ARM_ABSOLUTE 0x0000
2367 #define IMAGE_REL_ARM_ADDR 0x0001
2368 #define IMAGE_REL_ARM_ADDR32NB 0x0002
2369 #define IMAGE_REL_ARM_BRANCH24 0x0003
2370 #define IMAGE_REL_ARM_BRANCH11 0x0004
2371 #define IMAGE_REL_ARM_SECTION 0x000E
2372 #define IMAGE_REL_ARM_SECREL 0x000F
2374 /* IA64 relocation types */
2375 #define IMAGE_REL_IA64_ABSOLUTE 0x0000
2376 #define IMAGE_REL_IA64_IMM14 0x0001
2377 #define IMAGE_REL_IA64_IMM22 0x0002
2378 #define IMAGE_REL_IA64_IMM64 0x0003
2379 #define IMAGE_REL_IA64_DIR 0x0004
2380 #define IMAGE_REL_IA64_DIR64 0x0005
2381 #define IMAGE_REL_IA64_PCREL21B 0x0006
2382 #define IMAGE_REL_IA64_PCREL21M 0x0007
2383 #define IMAGE_REL_IA64_PCREL21F 0x0008
2384 #define IMAGE_REL_IA64_GPREL22 0x0009
2385 #define IMAGE_REL_IA64_LTOFF22 0x000A
2386 #define IMAGE_REL_IA64_SECTION 0x000B
2387 #define IMAGE_REL_IA64_SECREL22 0x000C
2388 #define IMAGE_REL_IA64_SECREL64I 0x000D
2389 #define IMAGE_REL_IA64_SECREL 0x000E
2390 #define IMAGE_REL_IA64_LTOFF64 0x000F
2391 #define IMAGE_REL_IA64_DIR32NB 0x0010
2392 #define IMAGE_REL_IA64_RESERVED_11 0x0011
2393 #define IMAGE_REL_IA64_RESERVED_12 0x0012
2394 #define IMAGE_REL_IA64_RESERVED_13 0x0013
2395 #define IMAGE_REL_IA64_RESERVED_14 0x0014
2396 #define IMAGE_REL_IA64_RESERVED_15 0x0015
2397 #define IMAGE_REL_IA64_RESERVED_16 0x0016
2398 #define IMAGE_REL_IA64_ADDEND 0x001F
2400 /* archive format */
2402 #define IMAGE_ARCHIVE_START_SIZE 8
2403 #define IMAGE_ARCHIVE_START "!<arch>\n"
2404 #define IMAGE_ARCHIVE_END "`\n"
2405 #define IMAGE_ARCHIVE_PAD "\n"
2406 #define IMAGE_ARCHIVE_LINKER_MEMBER "/ "
2407 #define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
2409 typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER
2411 BYTE Name[16];
2412 BYTE Date[12];
2413 BYTE UserID[6];
2414 BYTE GroupID[6];
2415 BYTE Mode[8];
2416 BYTE Size[10];
2417 BYTE EndHeader[2];
2418 } IMAGE_ARCHIVE_MEMBER_HEADER, *PIMAGE_ARCHIVE_MEMBER_HEADER;
2420 #define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
2423 * Resource directory stuff
2425 typedef struct _IMAGE_RESOURCE_DIRECTORY {
2426 DWORD Characteristics;
2427 DWORD TimeDateStamp;
2428 WORD MajorVersion;
2429 WORD MinorVersion;
2430 WORD NumberOfNamedEntries;
2431 WORD NumberOfIdEntries;
2432 /* IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[]; */
2433 } IMAGE_RESOURCE_DIRECTORY,*PIMAGE_RESOURCE_DIRECTORY;
2435 #define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000
2436 #define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000
2438 typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
2439 union {
2440 struct {
2441 #ifdef BITFIELDS_BIGENDIAN
2442 unsigned NameIsString:1;
2443 unsigned NameOffset:31;
2444 #else
2445 unsigned NameOffset:31;
2446 unsigned NameIsString:1;
2447 #endif
2448 } DUMMYSTRUCTNAME1;
2449 DWORD Name;
2450 struct {
2451 #ifdef WORDS_BIGENDIAN
2452 WORD __pad;
2453 WORD Id;
2454 #else
2455 WORD Id;
2456 WORD __pad;
2457 #endif
2458 } DUMMYSTRUCTNAME2;
2459 } DUMMYUNIONNAME1;
2460 union {
2461 DWORD OffsetToData;
2462 struct {
2463 #ifdef BITFIELDS_BIGENDIAN
2464 unsigned DataIsDirectory:1;
2465 unsigned OffsetToDirectory:31;
2466 #else
2467 unsigned OffsetToDirectory:31;
2468 unsigned DataIsDirectory:1;
2469 #endif
2470 } DUMMYSTRUCTNAME3;
2471 } DUMMYUNIONNAME2;
2472 } IMAGE_RESOURCE_DIRECTORY_ENTRY,*PIMAGE_RESOURCE_DIRECTORY_ENTRY;
2475 typedef struct _IMAGE_RESOURCE_DIRECTORY_STRING {
2476 WORD Length;
2477 CHAR NameString[ 1 ];
2478 } IMAGE_RESOURCE_DIRECTORY_STRING,*PIMAGE_RESOURCE_DIRECTORY_STRING;
2480 typedef struct _IMAGE_RESOURCE_DIR_STRING_U {
2481 WORD Length;
2482 WCHAR NameString[ 1 ];
2483 } IMAGE_RESOURCE_DIR_STRING_U,*PIMAGE_RESOURCE_DIR_STRING_U;
2485 typedef struct _IMAGE_RESOURCE_DATA_ENTRY {
2486 DWORD OffsetToData;
2487 DWORD Size;
2488 DWORD CodePage;
2489 DWORD Reserved;
2490 } IMAGE_RESOURCE_DATA_ENTRY,*PIMAGE_RESOURCE_DATA_ENTRY;
2493 typedef VOID (CALLBACK *PIMAGE_TLS_CALLBACK)(
2494 LPVOID DllHandle,DWORD Reason,LPVOID Reserved
2497 typedef struct _IMAGE_TLS_DIRECTORY {
2498 DWORD StartAddressOfRawData;
2499 DWORD EndAddressOfRawData;
2500 LPDWORD AddressOfIndex;
2501 PIMAGE_TLS_CALLBACK *AddressOfCallBacks;
2502 DWORD SizeOfZeroFill;
2503 DWORD Characteristics;
2504 } IMAGE_TLS_DIRECTORY,*PIMAGE_TLS_DIRECTORY;
2506 typedef struct _IMAGE_DEBUG_DIRECTORY {
2507 DWORD Characteristics;
2508 DWORD TimeDateStamp;
2509 WORD MajorVersion;
2510 WORD MinorVersion;
2511 DWORD Type;
2512 DWORD SizeOfData;
2513 DWORD AddressOfRawData;
2514 DWORD PointerToRawData;
2515 } IMAGE_DEBUG_DIRECTORY, *PIMAGE_DEBUG_DIRECTORY;
2517 #define IMAGE_DEBUG_TYPE_UNKNOWN 0
2518 #define IMAGE_DEBUG_TYPE_COFF 1
2519 #define IMAGE_DEBUG_TYPE_CODEVIEW 2
2520 #define IMAGE_DEBUG_TYPE_FPO 3
2521 #define IMAGE_DEBUG_TYPE_MISC 4
2522 #define IMAGE_DEBUG_TYPE_EXCEPTION 5
2523 #define IMAGE_DEBUG_TYPE_FIXUP 6
2524 #define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7
2525 #define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8
2526 #define IMAGE_DEBUG_TYPE_BORLAND 9
2527 #define IMAGE_DEBUG_TYPE_RESERVED10 10
2529 typedef struct _IMAGE_COFF_SYMBOLS_HEADER {
2530 DWORD NumberOfSymbols;
2531 DWORD LvaToFirstSymbol;
2532 DWORD NumberOfLinenumbers;
2533 DWORD LvaToFirstLinenumber;
2534 DWORD RvaToFirstByteOfCode;
2535 DWORD RvaToLastByteOfCode;
2536 DWORD RvaToFirstByteOfData;
2537 DWORD RvaToLastByteOfData;
2538 } IMAGE_COFF_SYMBOLS_HEADER, *PIMAGE_COFF_SYMBOLS_HEADER;
2540 #define FRAME_FPO 0
2541 #define FRAME_TRAP 1
2542 #define FRAME_TSS 2
2543 #define FRAME_NONFPO 3
2545 typedef struct _FPO_DATA {
2546 DWORD ulOffStart;
2547 DWORD cbProcSize;
2548 DWORD cdwLocals;
2549 WORD cdwParams;
2550 WORD cbProlog : 8;
2551 WORD cbRegs : 3;
2552 WORD fHasSEH : 1;
2553 WORD fUseBP : 1;
2554 WORD reserved : 1;
2555 WORD cbFrame : 2;
2556 } FPO_DATA, *PFPO_DATA;
2558 typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY {
2559 DWORD Size;
2560 DWORD TimeDateStamp;
2561 WORD MajorVersion;
2562 WORD MinorVersion;
2563 DWORD GlobalFlagsClear;
2564 DWORD GlobalFlagsSet;
2565 DWORD CriticalSectionDefaultTimeout;
2566 DWORD DeCommitFreeBlockThreshold;
2567 DWORD DeCommitTotalFreeThreshold;
2568 PVOID LockPrefixTable;
2569 DWORD MaximumAllocationSize;
2570 DWORD VirtualMemoryThreshold;
2571 DWORD ProcessHeapFlags;
2572 DWORD ProcessAffinityMask;
2573 WORD CSDVersion;
2574 WORD Reserved1;
2575 PVOID EditList;
2576 DWORD SecurityCookie;
2577 DWORD SEHandlerTable;
2578 DWORD SEHandlerCount;
2579 } IMAGE_LOAD_CONFIG_DIRECTORY, *PIMAGE_LOAD_CONFIG_DIRECTORY;
2581 typedef struct _IMAGE_FUNCTION_ENTRY {
2582 DWORD StartingAddress;
2583 DWORD EndingAddress;
2584 DWORD EndOfPrologue;
2585 } IMAGE_FUNCTION_ENTRY, *PIMAGE_FUNCTION_ENTRY;
2587 #define IMAGE_DEBUG_MISC_EXENAME 1
2589 typedef struct _IMAGE_DEBUG_MISC {
2590 DWORD DataType;
2591 DWORD Length;
2592 BYTE Unicode;
2593 BYTE Reserved[ 3 ];
2594 BYTE Data[ 1 ];
2595 } IMAGE_DEBUG_MISC, *PIMAGE_DEBUG_MISC;
2597 /* This is the structure that appears at the very start of a .DBG file. */
2599 typedef struct _IMAGE_SEPARATE_DEBUG_HEADER {
2600 WORD Signature;
2601 WORD Flags;
2602 WORD Machine;
2603 WORD Characteristics;
2604 DWORD TimeDateStamp;
2605 DWORD CheckSum;
2606 DWORD ImageBase;
2607 DWORD SizeOfImage;
2608 DWORD NumberOfSections;
2609 DWORD ExportedNamesSize;
2610 DWORD DebugDirectorySize;
2611 DWORD SectionAlignment;
2612 DWORD Reserved[ 2 ];
2613 } IMAGE_SEPARATE_DEBUG_HEADER,*PIMAGE_SEPARATE_DEBUG_HEADER;
2615 #define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944
2618 typedef struct tagMESSAGE_RESOURCE_ENTRY {
2619 WORD Length;
2620 WORD Flags;
2621 BYTE Text[1];
2622 } MESSAGE_RESOURCE_ENTRY,*PMESSAGE_RESOURCE_ENTRY;
2623 #define MESSAGE_RESOURCE_UNICODE 0x0001
2625 typedef struct tagMESSAGE_RESOURCE_BLOCK {
2626 DWORD LowId;
2627 DWORD HighId;
2628 DWORD OffsetToEntries;
2629 } MESSAGE_RESOURCE_BLOCK,*PMESSAGE_RESOURCE_BLOCK;
2631 typedef struct tagMESSAGE_RESOURCE_DATA {
2632 DWORD NumberOfBlocks;
2633 MESSAGE_RESOURCE_BLOCK Blocks[ 1 ];
2634 } MESSAGE_RESOURCE_DATA,*PMESSAGE_RESOURCE_DATA;
2637 * Here follows typedefs for security and tokens.
2641 * First a constant for the following typedefs.
2644 #define ANYSIZE_ARRAY 1
2646 /* FIXME: Orphan. What does it point to? */
2647 typedef PVOID PACCESS_TOKEN;
2648 typedef PVOID PSECURITY_DESCRIPTOR;
2649 typedef PVOID PSID;
2652 * TOKEN_INFORMATION_CLASS
2655 typedef enum _TOKEN_INFORMATION_CLASS {
2656 TokenUser = 1,
2657 TokenGroups,
2658 TokenPrivileges,
2659 TokenOwner,
2660 TokenPrimaryGroup,
2661 TokenDefaultDacl,
2662 TokenSource,
2663 TokenType,
2664 TokenImpersonationLevel,
2665 TokenStatistics,
2666 TokenRestrictedSids,
2667 TokenSessionId,
2668 TokenGroupsAndPrivileges,
2669 TokenSessionReference,
2670 TokenSandBoxInert
2671 } TOKEN_INFORMATION_CLASS;
2673 #define TOKEN_TOKEN_ADJUST_DEFAULT 0x0080
2674 #define TOKEN_ADJUST_GROUPS 0x0040
2675 #define TOKEN_ADJUST_PRIVILEGES 0x0020
2676 #define TOKEN_ADJUST_SESSIONID 0x0100
2677 #define TOKEN_ASSIGN_PRIMARY 0x0001
2678 #define TOKEN_DUPLICATE 0x0002
2679 #define TOKEN_EXECUTE STANDARD_RIGHTS_EXECUTE
2680 #define TOKEN_IMPERSONATE 0x0004
2681 #define TOKEN_QUERY 0x0008
2682 #define TOKEN_QUERY_SOURCE 0x0010
2683 #define TOKEN_ADJUST_DEFAULT 0x0080
2684 #define TOKEN_READ (STANDARD_RIGHTS_READ|TOKEN_QUERY)
2685 #define TOKEN_WRITE (STANDARD_RIGHTS_WRITE | \
2686 TOKEN_ADJUST_PRIVILEGES | \
2687 TOKEN_ADJUST_GROUPS | \
2688 TOKEN_ADJUST_DEFAULT )
2689 #define TOKEN_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
2690 TOKEN_ASSIGN_PRIMARY | \
2691 TOKEN_DUPLICATE | \
2692 TOKEN_IMPERSONATE | \
2693 TOKEN_QUERY | \
2694 TOKEN_QUERY_SOURCE | \
2695 TOKEN_ADJUST_PRIVILEGES | \
2696 TOKEN_ADJUST_GROUPS | \
2697 TOKEN_ADJUST_SESSIONID | \
2698 TOKEN_ADJUST_DEFAULT )
2700 #ifndef _SECURITY_DEFINED
2701 #define _SECURITY_DEFINED
2704 typedef DWORD ACCESS_MASK, *PACCESS_MASK;
2706 typedef struct _GENERIC_MAPPING {
2707 ACCESS_MASK GenericRead;
2708 ACCESS_MASK GenericWrite;
2709 ACCESS_MASK GenericExecute;
2710 ACCESS_MASK GenericAll;
2711 } GENERIC_MAPPING, *PGENERIC_MAPPING;
2713 #ifndef SID_IDENTIFIER_AUTHORITY_DEFINED
2714 #define SID_IDENTIFIER_AUTHORITY_DEFINED
2715 typedef struct {
2716 BYTE Value[6];
2717 } SID_IDENTIFIER_AUTHORITY, *PSID_IDENTIFIER_AUTHORITY;
2718 #endif /* !defined(SID_IDENTIFIER_AUTHORITY_DEFINED) */
2720 #ifndef SID_DEFINED
2721 #define SID_DEFINED
2722 typedef struct _SID {
2723 BYTE Revision;
2724 BYTE SubAuthorityCount;
2725 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
2726 DWORD SubAuthority[1];
2727 } SID,*PISID;
2728 #endif /* !defined(SID_DEFINED) */
2730 #define SID_REVISION (1) /* Current revision */
2731 #define SID_MAX_SUB_AUTHORITIES (15) /* current max subauths */
2732 #define SID_RECOMMENDED_SUB_AUTHORITIES (1) /* recommended subauths */
2736 * ACL
2739 #define ACL_REVISION1 1
2740 #define ACL_REVISION2 2
2741 #define ACL_REVISION3 3
2742 #define ACL_REVISION4 4
2744 #define MIN_ACL_REVISION ACL_REVISION2
2745 #define MAX_ACL_REVISION ACL_REVISION4
2747 typedef struct _ACL {
2748 BYTE AclRevision;
2749 BYTE Sbz1;
2750 WORD AclSize;
2751 WORD AceCount;
2752 WORD Sbz2;
2753 } ACL, *PACL;
2755 typedef enum _ACL_INFORMATION_CLASS
2757 AclRevisionInformation = 1,
2758 AclSizeInformation
2759 } ACL_INFORMATION_CLASS;
2761 typedef struct _ACL_REVISION_INFORMATION
2763 DWORD AclRevision;
2764 } ACL_REVISION_INFORMATION, *PACL_REVISION_INFORMATION;
2766 typedef struct _ACL_SIZE_INFORMATION
2768 DWORD AceCount;
2769 DWORD AclBytesInUse;
2770 DWORD AclBytesFree;
2771 } ACL_SIZE_INFORMATION, *PACL_SIZE_INFORMATION;
2773 /* SECURITY_DESCRIPTOR */
2774 #define SECURITY_DESCRIPTOR_REVISION 1
2775 #define SECURITY_DESCRIPTOR_REVISION1 1
2779 * Privilege Names
2781 #define SE_CREATE_TOKEN_NAME TEXT("SeCreateTokenPrivilege")
2782 #define SE_ASSIGNPRIMARYTOKEN_NAME TEXT("SeAssignPrimaryTokenPrivilege")
2783 #define SE_LOCK_MEMORY_NAME TEXT("SeLockMemoryPrivilege")
2784 #define SE_INCREASE_QUOTA_NAME TEXT("SeIncreaseQuotaPrivilege")
2785 #define SE_UNSOLICITED_INPUT_NAME TEXT("SeUnsolicitedInputPrivilege")
2786 #define SE_MACHINE_ACCOUNT_NAME TEXT("SeMachineAccountPrivilege")
2787 #define SE_TCB_NAME TEXT("SeTcbPrivilege")
2788 #define SE_SECURITY_NAME TEXT("SeSecurityPrivilege")
2789 #define SE_TAKE_OWNERSHIP_NAME TEXT("SeTakeOwnershipPrivilege")
2790 #define SE_LOAD_DRIVER_NAME TEXT("SeLoadDriverPrivilege")
2791 #define SE_SYSTEM_PROFILE_NAME TEXT("SeSystemProfilePrivilege")
2792 #define SE_SYSTEMTIME_NAME TEXT("SeSystemtimePrivilege")
2793 #define SE_PROF_SINGLE_PROCESS_NAME TEXT("SeProfileSingleProcessPrivilege")
2794 #define SE_INC_BASE_PRIORITY_NAME TEXT("SeIncreaseBasePriorityPrivilege")
2795 #define SE_CREATE_PAGEFILE_NAME TEXT("SeCreatePagefilePrivilege")
2796 #define SE_CREATE_PERMANENT_NAME TEXT("SeCreatePermanentPrivilege")
2797 #define SE_BACKUP_NAME TEXT("SeBackupPrivilege")
2798 #define SE_RESTORE_NAME TEXT("SeRestorePrivilege")
2799 #define SE_SHUTDOWN_NAME TEXT("SeShutdownPrivilege")
2800 #define SE_DEBUG_NAME TEXT("SeDebugPrivilege")
2801 #define SE_AUDIT_NAME TEXT("SeAuditPrivilege")
2802 #define SE_SYSTEM_ENVIRONMENT_NAME TEXT("SeSystemEnvironmentPrivilege")
2803 #define SE_CHANGE_NOTIFY_NAME TEXT("SeChangeNotifyPrivilege")
2804 #define SE_REMOTE_SHUTDOWN_NAME TEXT("SeRemoteShutdownPrivilege")
2805 #define SE_UNDOCK_NAME TEXT("SeUndockPrivilege")
2806 #define SE_ENABLE_DELEGATION_NAME TEXT("SeEnableDelegationPrivilege")
2807 #define SE_MANAGE_VOLUME_NAME TEXT("SeManageVolumePrivilege")
2808 #define SE_IMPERSONATE_NAME TEXT("SeImpersonatePrivilege")
2809 #define SE_CREATE_GLOBAL_NAME TEXT("SeCreateGlobalPrivilege")
2811 #define SE_GROUP_MANDATORY 0x00000001
2812 #define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002
2813 #define SE_GROUP_ENABLED 0x00000004
2814 #define SE_GROUP_OWNER 0x00000008
2815 #define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010
2816 #define SE_GROUP_LOGON_ID 0xC0000000
2817 #define SE_GROUP_RESOURCE 0x20000000
2819 #define SE_PRIVILEGE_ENABLED_BY_DEFAULT 0x00000001
2820 #define SE_PRIVILEGE_ENABLED 0x00000002
2821 #define SE_PRIVILEGE_REMOVE 0x00000004
2822 #define SE_PRIVILEGE_USED_FOR_ACCESS 0x80000000
2824 #define SE_OWNER_DEFAULTED 0x00000001
2825 #define SE_GROUP_DEFAULTED 0x00000002
2826 #define SE_DACL_PRESENT 0x00000004
2827 #define SE_DACL_DEFAULTED 0x00000008
2828 #define SE_SACL_PRESENT 0x00000010
2829 #define SE_SACL_DEFAULTED 0x00000020
2830 #define SE_DACL_AUTO_INHERIT_REQ 0x00000100
2831 #define SE_SACL_AUTO_INHERIT_REQ 0x00000200
2832 #define SE_DACL_AUTO_INHERITED 0x00000400
2833 #define SE_SACL_AUTO_INHERITED 0x00000800
2834 #define SE_DACL_PROTECTED 0x00001000
2835 #define SE_SACL_PROTECTED 0x00002000
2836 #define SE_SELF_RELATIVE 0x00008000
2838 typedef DWORD SECURITY_INFORMATION, *PSECURITY_INFORMATION;
2839 typedef WORD SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;
2841 /* The security descriptor structure */
2842 typedef struct {
2843 BYTE Revision;
2844 BYTE Sbz1;
2845 SECURITY_DESCRIPTOR_CONTROL Control;
2846 DWORD Owner;
2847 DWORD Group;
2848 DWORD Sacl;
2849 DWORD Dacl;
2850 } SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE;
2852 typedef struct {
2853 BYTE Revision;
2854 BYTE Sbz1;
2855 SECURITY_DESCRIPTOR_CONTROL Control;
2856 PSID Owner;
2857 PSID Group;
2858 PACL Sacl;
2859 PACL Dacl;
2860 } SECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR;
2862 #define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR))
2864 #endif /* _SECURITY_DEFINED */
2867 * SID_AND_ATTRIBUTES
2870 typedef struct _SID_AND_ATTRIBUTES {
2871 PSID Sid;
2872 DWORD Attributes;
2873 } SID_AND_ATTRIBUTES;
2875 /* security entities */
2876 #define SECURITY_NULL_RID (0x00000000L)
2877 #define SECURITY_WORLD_RID (0x00000000L)
2878 #define SECURITY_LOCAL_RID (0X00000000L)
2880 #define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0}
2882 /* S-1-1 */
2883 #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
2885 /* S-1-2 */
2886 #define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2}
2888 /* S-1-3 */
2889 #define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3}
2890 #define SECURITY_CREATOR_OWNER_RID (0x00000000L)
2891 #define SECURITY_CREATOR_GROUP_RID (0x00000001L)
2892 #define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L)
2893 #define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L)
2895 /* S-1-4 */
2896 #define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4}
2898 /* S-1-5 */
2899 #define SECURITY_NT_AUTHORITY {0,0,0,0,0,5}
2900 #define SECURITY_DIALUP_RID 0x00000001L
2901 #define SECURITY_NETWORK_RID 0x00000002L
2902 #define SECURITY_BATCH_RID 0x00000003L
2903 #define SECURITY_INTERACTIVE_RID 0x00000004L
2904 #define SECURITY_LOGON_IDS_RID 0x00000005L
2905 #define SECURITY_SERVICE_RID 0x00000006L
2906 #define SECURITY_ANONYMOUS_LOGON_RID 0x00000007L
2907 #define SECURITY_PROXY_RID 0x00000008L
2908 #define SECURITY_ENTERPRISE_CONTROLLERS_RID 0x00000009L
2909 #define SECURITY_PRINCIPAL_SELF_RID 0x0000000AL
2910 #define SECURITY_AUTHENTICATED_USER_RID 0x0000000BL
2911 #define SECURITY_RESTRICTED_CODE_RID 0x0000000CL
2912 #define SECURITY_TERMINAL_SERVER_RID 0x0000000DL
2913 #define SECURITY_LOCAL_SYSTEM_RID 0x00000012L
2914 #define SECURITY_NT_NON_UNIQUE 0x00000015L
2915 #define SECURITY_BUILTIN_DOMAIN_RID 0x00000020L
2917 #define DOMAIN_GROUP_RID_ADMINS 0x00000200L
2918 #define DOMAIN_GROUP_RID_USERS 0x00000201L
2919 #define DOMAIN_GROUP_RID_GUESTS 0x00000202L
2921 #define DOMAIN_ALIAS_RID_ADMINS 0x00000220L
2922 #define DOMAIN_ALIAS_RID_USERS 0x00000221L
2923 #define DOMAIN_ALIAS_RID_GUESTS 0x00000222L
2925 #define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID
2927 #define SECURITY_LOGON_IDS_RID_COUNT (3L)
2930 * TOKEN_USER
2933 typedef struct _TOKEN_USER {
2934 SID_AND_ATTRIBUTES User;
2935 } TOKEN_USER, *PTOKEN_USER;
2938 * TOKEN_GROUPS
2941 typedef struct _TOKEN_GROUPS {
2942 DWORD GroupCount;
2943 SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY];
2944 } TOKEN_GROUPS, *PTOKEN_GROUPS;
2947 * LUID_AND_ATTRIBUTES
2950 typedef union _LARGE_INTEGER {
2951 struct {
2952 #ifdef WORDS_BIGENDIAN
2953 LONG HighPart;
2954 DWORD LowPart;
2955 #else
2956 DWORD LowPart;
2957 LONG HighPart;
2958 #endif
2959 } u;
2960 #ifndef NONAMELESSSTRUCT
2961 struct {
2962 #ifdef WORDS_BIGENDIAN
2963 LONG HighPart;
2964 DWORD LowPart;
2965 #else
2966 DWORD LowPart;
2967 LONG HighPart;
2968 #endif
2970 #endif
2971 LONGLONG QuadPart;
2972 } LARGE_INTEGER, *PLARGE_INTEGER;
2974 typedef union _ULARGE_INTEGER {
2975 struct {
2976 #ifdef WORDS_BIGENDIAN
2977 DWORD HighPart;
2978 DWORD LowPart;
2979 #else
2980 DWORD LowPart;
2981 DWORD HighPart;
2982 #endif
2983 } u;
2984 #ifndef NONAMELESSSTRUCT
2985 struct {
2986 #ifdef WORDS_BIGENDIAN
2987 DWORD HighPart;
2988 DWORD LowPart;
2989 #else
2990 DWORD LowPart;
2991 DWORD HighPart;
2992 #endif
2994 #endif
2995 ULONGLONG QuadPart;
2996 } ULARGE_INTEGER, *PULARGE_INTEGER;
2999 * Locally Unique Identifier
3002 typedef struct _LUID {
3003 DWORD LowPart;
3004 LONG HighPart;
3005 } LUID, *PLUID;
3007 #include <pshpack4.h>
3008 typedef struct _LUID_AND_ATTRIBUTES {
3009 LUID Luid;
3010 DWORD Attributes;
3011 } LUID_AND_ATTRIBUTES, *PLUID_AND_ATTRIBUTES;
3012 #include <poppack.h>
3015 * PRIVILEGE_SET
3018 typedef struct _PRIVILEGE_SET {
3019 DWORD PrivilegeCount;
3020 DWORD Control;
3021 LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY];
3022 } PRIVILEGE_SET, *PPRIVILEGE_SET;
3025 * TOKEN_PRIVILEGES
3028 typedef struct _TOKEN_PRIVILEGES {
3029 DWORD PrivilegeCount;
3030 LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY];
3031 } TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES;
3034 * TOKEN_OWNER
3037 typedef struct _TOKEN_OWNER {
3038 PSID Owner;
3039 } TOKEN_OWNER;
3042 * TOKEN_PRIMARY_GROUP
3045 typedef struct _TOKEN_PRIMARY_GROUP {
3046 PSID PrimaryGroup;
3047 } TOKEN_PRIMARY_GROUP;
3051 * TOKEN_DEFAULT_DACL
3054 typedef struct _TOKEN_DEFAULT_DACL {
3055 PACL DefaultDacl;
3056 } TOKEN_DEFAULT_DACL;
3059 * TOKEN_SOURCEL
3062 #define TOKEN_SOURCE_LENGTH 8
3064 typedef struct _TOKEN_SOURCE {
3065 char SourceName[TOKEN_SOURCE_LENGTH];
3066 LUID SourceIdentifier;
3067 } TOKEN_SOURCE;
3070 * TOKEN_TYPE
3073 typedef enum tagTOKEN_TYPE {
3074 TokenPrimary = 1,
3075 TokenImpersonation
3076 } TOKEN_TYPE;
3079 * SECURITY_IMPERSONATION_LEVEL
3082 typedef enum _SECURITY_IMPERSONATION_LEVEL {
3083 SecurityAnonymous,
3084 SecurityIdentification,
3085 SecurityImpersonation,
3086 SecurityDelegation
3087 } SECURITY_IMPERSONATION_LEVEL, *PSECURITY_IMPERSONATION_LEVEL;
3090 typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE,
3091 * PSECURITY_CONTEXT_TRACKING_MODE;
3093 * Quality of Service
3096 typedef struct _SECURITY_QUALITY_OF_SERVICE {
3097 DWORD Length;
3098 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
3099 SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode;
3100 BOOLEAN EffectiveOnly;
3101 } SECURITY_QUALITY_OF_SERVICE, *PSECURITY_QUALITY_OF_SERVICE;
3104 * TOKEN_STATISTICS
3107 #include <pshpack4.h>
3108 typedef struct _TOKEN_STATISTICS {
3109 LUID TokenId;
3110 LUID AuthenticationId;
3111 LARGE_INTEGER ExpirationTime;
3112 TOKEN_TYPE TokenType;
3113 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
3114 DWORD DynamicCharged;
3115 DWORD DynamicAvailable;
3116 DWORD GroupCount;
3117 DWORD PrivilegeCount;
3118 LUID ModifiedId;
3119 } TOKEN_STATISTICS;
3120 #include <poppack.h>
3123 * ACLs of NT
3126 #define ACL_REVISION 2
3128 #define ACL_REVISION1 1
3129 #define ACL_REVISION2 2
3131 /* ACEs, directly starting after an ACL */
3132 typedef struct _ACE_HEADER {
3133 BYTE AceType;
3134 BYTE AceFlags;
3135 WORD AceSize;
3136 } ACE_HEADER,*PACE_HEADER;
3138 /* AceType */
3139 #define ACCESS_ALLOWED_ACE_TYPE 0
3140 #define ACCESS_DENIED_ACE_TYPE 1
3141 #define SYSTEM_AUDIT_ACE_TYPE 2
3142 #define SYSTEM_ALARM_ACE_TYPE 3
3144 /* inherit AceFlags */
3145 #define OBJECT_INHERIT_ACE 0x01
3146 #define CONTAINER_INHERIT_ACE 0x02
3147 #define NO_PROPAGATE_INHERIT_ACE 0x04
3148 #define INHERIT_ONLY_ACE 0x08
3149 #define INHERITED_ACE 0x10
3150 #define VALID_INHERIT_FLAGS 0x0F
3152 /* AceFlags mask for what events we (should) audit */
3153 #define SUCCESSFUL_ACCESS_ACE_FLAG 0x40
3154 #define FAILED_ACCESS_ACE_FLAG 0x80
3156 /* different ACEs depending on AceType
3157 * SidStart marks the begin of a SID
3158 * so the thing finally looks like this:
3159 * 0: ACE_HEADER
3160 * 4: ACCESS_MASK
3161 * 8... : SID
3163 typedef struct _ACCESS_ALLOWED_ACE {
3164 ACE_HEADER Header;
3165 DWORD Mask;
3166 DWORD SidStart;
3167 } ACCESS_ALLOWED_ACE,*PACCESS_ALLOWED_ACE;
3169 typedef struct _ACCESS_DENIED_ACE {
3170 ACE_HEADER Header;
3171 DWORD Mask;
3172 DWORD SidStart;
3173 } ACCESS_DENIED_ACE,*PACCESS_DENIED_ACE;
3175 typedef struct _SYSTEM_AUDIT_ACE {
3176 ACE_HEADER Header;
3177 DWORD Mask;
3178 DWORD SidStart;
3179 } SYSTEM_AUDIT_ACE,*PSYSTEM_AUDIT_ACE;
3181 typedef struct _SYSTEM_ALARM_ACE {
3182 ACE_HEADER Header;
3183 DWORD Mask;
3184 DWORD SidStart;
3185 } SYSTEM_ALARM_ACE,*PSYSTEM_ALARM_ACE;
3187 typedef enum tagSID_NAME_USE {
3188 SidTypeUser = 1,
3189 SidTypeGroup,
3190 SidTypeDomain,
3191 SidTypeAlias,
3192 SidTypeWellKnownGroup,
3193 SidTypeDeletedAccount,
3194 SidTypeInvalid,
3195 SidTypeUnknown
3196 } SID_NAME_USE,*PSID_NAME_USE;
3198 /* Access rights */
3200 /* DELETE may be already defined via /usr/include/arpa/nameser_compat.h */
3201 #undef DELETE
3202 #define DELETE 0x00010000
3203 #define READ_CONTROL 0x00020000
3204 #define WRITE_DAC 0x00040000
3205 #define WRITE_OWNER 0x00080000
3206 #define SYNCHRONIZE 0x00100000
3207 #define STANDARD_RIGHTS_REQUIRED 0x000f0000
3209 #define STANDARD_RIGHTS_READ READ_CONTROL
3210 #define STANDARD_RIGHTS_WRITE READ_CONTROL
3211 #define STANDARD_RIGHTS_EXECUTE READ_CONTROL
3213 #define STANDARD_RIGHTS_ALL 0x001f0000
3215 #define SPECIFIC_RIGHTS_ALL 0x0000ffff
3217 #define GENERIC_READ 0x80000000
3218 #define GENERIC_WRITE 0x40000000
3219 #define GENERIC_EXECUTE 0x20000000
3220 #define GENERIC_ALL 0x10000000
3222 #define MAXIMUM_ALLOWED 0x02000000
3223 #define ACCESS_SYSTEM_SECURITY 0x01000000
3225 #define EVENT_QUERY_STATE 0x0001
3226 #define EVENT_MODIFY_STATE 0x0002
3227 #define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
3229 #define SEMAPHORE_MODIFY_STATE 0x0002
3230 #define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
3232 #define MUTEX_MODIFY_STATE 0x0001
3233 #define MUTEX_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1)
3235 #define TIMER_QUERY_STATE 0x0001
3236 #define TIMER_MODIFY_STATE 0x0002
3237 #define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
3239 #define PROCESS_TERMINATE 0x0001
3240 #define PROCESS_CREATE_THREAD 0x0002
3241 #define PROCESS_VM_OPERATION 0x0008
3242 #define PROCESS_VM_READ 0x0010
3243 #define PROCESS_VM_WRITE 0x0020
3244 #define PROCESS_DUP_HANDLE 0x0040
3245 #define PROCESS_CREATE_PROCESS 0x0080
3246 #define PROCESS_SET_QUOTA 0x0100
3247 #define PROCESS_SET_INFORMATION 0x0200
3248 #define PROCESS_QUERY_INFORMATION 0x0400
3249 #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xfff)
3251 #define THREAD_TERMINATE 0x0001
3252 #define THREAD_SUSPEND_RESUME 0x0002
3253 #define THREAD_GET_CONTEXT 0x0008
3254 #define THREAD_SET_CONTEXT 0x0010
3255 #define THREAD_SET_INFORMATION 0x0020
3256 #define THREAD_QUERY_INFORMATION 0x0040
3257 #define THREAD_SET_THREAD_TOKEN 0x0080
3258 #define THREAD_IMPERSONATE 0x0100
3259 #define THREAD_DIRECT_IMPERSONATION 0x0200
3260 #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3ff)
3262 #define THREAD_BASE_PRIORITY_LOWRT 15
3263 #define THREAD_BASE_PRIORITY_MAX 2
3264 #define THREAD_BASE_PRIORITY_MIN -2
3265 #define THREAD_BASE_PRIORITY_IDLE -15
3267 #define SECTION_QUERY 0x0001
3268 #define SECTION_MAP_WRITE 0x0002
3269 #define SECTION_MAP_READ 0x0004
3270 #define SECTION_MAP_EXECUTE 0x0008
3271 #define SECTION_EXTEND_SIZE 0x0010
3272 #define SECTION_MAP_EXECUTE_EXPLICIT 0x0020
3273 #define SECTION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|0x01f)
3275 #define FILE_READ_DATA 0x0001 /* file & pipe */
3276 #define FILE_LIST_DIRECTORY 0x0001 /* directory */
3277 #define FILE_WRITE_DATA 0x0002 /* file & pipe */
3278 #define FILE_ADD_FILE 0x0002 /* directory */
3279 #define FILE_APPEND_DATA 0x0004 /* file */
3280 #define FILE_ADD_SUBDIRECTORY 0x0004 /* directory */
3281 #define FILE_CREATE_PIPE_INSTANCE 0x0004 /* named pipe */
3282 #define FILE_READ_EA 0x0008 /* file & directory */
3283 #define FILE_READ_PROPERTIES FILE_READ_EA
3284 #define FILE_WRITE_EA 0x0010 /* file & directory */
3285 #define FILE_WRITE_PROPERTIES FILE_WRITE_EA
3286 #define FILE_EXECUTE 0x0020 /* file */
3287 #define FILE_TRAVERSE 0x0020 /* directory */
3288 #define FILE_DELETE_CHILD 0x0040 /* directory */
3289 #define FILE_READ_ATTRIBUTES 0x0080 /* all */
3290 #define FILE_WRITE_ATTRIBUTES 0x0100 /* all */
3291 #define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1ff)
3293 #define FILE_GENERIC_READ (STANDARD_RIGHTS_READ | FILE_READ_DATA | \
3294 FILE_READ_ATTRIBUTES | FILE_READ_EA | \
3295 SYNCHRONIZE)
3296 #define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | \
3297 FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | \
3298 FILE_APPEND_DATA | SYNCHRONIZE)
3299 #define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE | FILE_EXECUTE | \
3300 FILE_READ_ATTRIBUTES | SYNCHRONIZE)
3303 /* File attribute flags */
3304 #define FILE_SHARE_READ 0x00000001L
3305 #define FILE_SHARE_WRITE 0x00000002L
3306 #define FILE_SHARE_DELETE 0x00000004L
3308 #define FILE_ATTRIBUTE_READONLY 0x00000001
3309 #define FILE_ATTRIBUTE_HIDDEN 0x00000002
3310 #define FILE_ATTRIBUTE_SYSTEM 0x00000004
3311 #define FILE_ATTRIBUTE_DIRECTORY 0x00000010
3312 #define FILE_ATTRIBUTE_ARCHIVE 0x00000020
3313 #define FILE_ATTRIBUTE_NORMAL 0x00000080
3314 #define FILE_ATTRIBUTE_TEMPORARY 0x00000100
3315 #define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
3316 #define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
3317 #define FILE_ATTRIBUTE_COMPRESSED 0x00000800
3318 #define FILE_ATTRIBUTE_OFFLINE 0x00001000
3319 #define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
3320 #define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
3322 /* File notification flags */
3323 #define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
3324 #define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
3325 #define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
3326 #define FILE_NOTIFY_CHANGE_SIZE 0x00000008
3327 #define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
3328 #define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
3329 #define FILE_NOTIFY_CHANGE_CREATION 0x00000040
3330 #define FILE_NOTIFY_CHANGE_SECURITY 0x00000100
3332 #define FILE_ACTION_ADDED 0x00000001
3333 #define FILE_ACTION_REMOVED 0x00000002
3334 #define FILE_ACTION_MODIFIED 0x00000003
3335 #define FILE_ACTION_RENAMED_OLD_NAME 0x00000004
3336 #define FILE_ACTION_RENAMED_NEW_NAME 0x00000005
3339 #define FILE_CASE_SENSITIVE_SEARCH 0x00000001
3340 #define FILE_CASE_PRESERVED_NAMES 0x00000002
3341 #define FILE_UNICODE_ON_DISK 0x00000004
3342 #define FILE_PERSISTENT_ACLS 0x00000008
3343 #define FILE_FILE_COMPRESSION 0x00000010
3344 #define FILE_VOLUME_IS_COMPRESSED 0x00008000
3345 #define FILE_SUPPORTS_OBJECT_IDS 0x00010000
3346 #define FILE_SUPPORTS_ENCRYPTION 0x00020000
3347 #define FILE_NAMED_STREAMS 0x00040000
3348 #define FILE_READ_ONLY_VOLUME 0x00080000
3350 /* File alignments (NT) */
3351 #define FILE_BYTE_ALIGNMENT 0x00000000
3352 #define FILE_WORD_ALIGNMENT 0x00000001
3353 #define FILE_LONG_ALIGNMENT 0x00000003
3354 #define FILE_QUAD_ALIGNMENT 0x00000007
3355 #define FILE_OCTA_ALIGNMENT 0x0000000f
3356 #define FILE_32_BYTE_ALIGNMENT 0x0000001f
3357 #define FILE_64_BYTE_ALIGNMENT 0x0000003f
3358 #define FILE_128_BYTE_ALIGNMENT 0x0000007f
3359 #define FILE_256_BYTE_ALIGNMENT 0x000000ff
3360 #define FILE_512_BYTE_ALIGNMENT 0x000001ff
3362 #define MAILSLOT_NO_MESSAGE ((DWORD)-1)
3363 #define MAILSLOT_WAIT_FOREVER ((DWORD)-1)
3365 #define REG_NONE 0 /* no type */
3366 #define REG_SZ 1 /* string type (ASCII) */
3367 #define REG_EXPAND_SZ 2 /* string, includes %ENVVAR% (expanded by caller) (ASCII) */
3368 #define REG_BINARY 3 /* binary format, callerspecific */
3369 /* YES, REG_DWORD == REG_DWORD_LITTLE_ENDIAN */
3370 #define REG_DWORD 4 /* DWORD in little endian format */
3371 #define REG_DWORD_LITTLE_ENDIAN 4 /* DWORD in little endian format */
3372 #define REG_DWORD_BIG_ENDIAN 5 /* DWORD in big endian format */
3373 #define REG_LINK 6 /* symbolic link (UNICODE) */
3374 #define REG_MULTI_SZ 7 /* multiple strings, delimited by \0, terminated by \0\0 (ASCII) */
3375 #define REG_RESOURCE_LIST 8 /* resource list? huh? */
3376 #define REG_FULL_RESOURCE_DESCRIPTOR 9 /* full resource descriptor? huh? */
3377 #define REG_RESOURCE_REQUIREMENTS_LIST 10
3378 #define REG_QWORD 11 /* QWORD in little endian format */
3379 #define REG_QWORD_LITTLE_ENDIAN 11 /* QWORD in little endian format */
3381 /* ----------------------------- begin power management --------------------- */
3383 typedef enum _LATENCY_TIME {
3384 LT_DONT_CARE,
3385 LT_LOWEST_LATENCY
3386 } LATENCY_TIME, *PLATENCY_TIME;
3388 /* ----------------------------- begin registry ----------------------------- */
3390 /* Registry security values */
3391 #define OWNER_SECURITY_INFORMATION 0x00000001
3392 #define GROUP_SECURITY_INFORMATION 0x00000002
3393 #define DACL_SECURITY_INFORMATION 0x00000004
3394 #define SACL_SECURITY_INFORMATION 0x00000008
3396 #define REG_OPTION_RESERVED 0x00000000
3397 #define REG_OPTION_NON_VOLATILE 0x00000000
3398 #define REG_OPTION_VOLATILE 0x00000001
3399 #define REG_OPTION_CREATE_LINK 0x00000002
3400 #define REG_OPTION_BACKUP_RESTORE 0x00000004 /* FIXME */
3401 #define REG_OPTION_OPEN_LINK 0x00000008
3402 #define REG_LEGAL_OPTION (REG_OPTION_RESERVED| \
3403 REG_OPTION_NON_VOLATILE| \
3404 REG_OPTION_VOLATILE| \
3405 REG_OPTION_CREATE_LINK| \
3406 REG_OPTION_BACKUP_RESTORE| \
3407 REG_OPTION_OPEN_LINK)
3410 #define REG_CREATED_NEW_KEY 0x00000001
3411 #define REG_OPENED_EXISTING_KEY 0x00000002
3413 /* For RegNotifyChangeKeyValue */
3414 #define REG_NOTIFY_CHANGE_NAME 0x01
3415 #define REG_NOTIFY_CHANGE_ATTRIBUTES 0x02
3416 #define REG_NOTIFY_CHANGE_LAST_SET 0x04
3417 #define REG_NOTIFY_CHANGE_SECURITY 0x08
3419 #define KEY_QUERY_VALUE 0x00000001
3420 #define KEY_SET_VALUE 0x00000002
3421 #define KEY_CREATE_SUB_KEY 0x00000004
3422 #define KEY_ENUMERATE_SUB_KEYS 0x00000008
3423 #define KEY_NOTIFY 0x00000010
3424 #define KEY_CREATE_LINK 0x00000020
3426 /* for RegKeyRestore flags */
3427 #define REG_WHOLE_HIVE_VOLATILE 0x00000001
3428 #define REG_REFRESH_HIVE 0x00000002
3429 #define REG_NO_LAZY_FLUSH 0x00000004
3430 #define REG_FORCE_RESTORE 0x00000008
3432 #define KEY_READ ((STANDARD_RIGHTS_READ| \
3433 KEY_QUERY_VALUE| \
3434 KEY_ENUMERATE_SUB_KEYS| \
3435 KEY_NOTIFY) \
3436 & (~SYNCHRONIZE) \
3438 #define KEY_WRITE ((STANDARD_RIGHTS_WRITE| \
3439 KEY_SET_VALUE| \
3440 KEY_CREATE_SUB_KEY) \
3441 & (~SYNCHRONIZE) \
3443 #define KEY_EXECUTE ((KEY_READ) & (~SYNCHRONIZE))
3444 #define KEY_ALL_ACCESS ((STANDARD_RIGHTS_ALL| \
3445 KEY_QUERY_VALUE| \
3446 KEY_SET_VALUE| \
3447 KEY_CREATE_SUB_KEY| \
3448 KEY_ENUMERATE_SUB_KEYS| \
3449 KEY_NOTIFY| \
3450 KEY_CREATE_LINK) \
3451 & (~SYNCHRONIZE) \
3453 /* ------------------------------ end registry ------------------------------ */
3456 #define EVENTLOG_SUCCESS 0x0000
3457 #define EVENTLOG_ERROR_TYPE 0x0001
3458 #define EVENTLOG_WARNING_TYPE 0x0002
3459 #define EVENTLOG_INFORMATION_TYPE 0x0004
3460 #define EVENTLOG_AUDIT_SUCCESS 0x0008
3461 #define EVENTLOG_AUDIT_FAILURE 0x0010
3463 #define SERVICE_BOOT_START 0x00000000
3464 #define SERVICE_SYSTEM_START 0x00000001
3465 #define SERVICE_AUTO_START 0x00000002
3466 #define SERVICE_DEMAND_START 0x00000003
3467 #define SERVICE_DISABLED 0x00000004
3469 #define SERVICE_ERROR_IGNORE 0x00000000
3470 #define SERVICE_ERROR_NORMAL 0x00000001
3471 #define SERVICE_ERROR_SEVERE 0x00000002
3472 #define SERVICE_ERROR_CRITICAL 0x00000003
3474 /* Service types */
3475 #define SERVICE_KERNEL_DRIVER 0x00000001
3476 #define SERVICE_FILE_SYSTEM_DRIVER 0x00000002
3477 #define SERVICE_ADAPTER 0x00000004
3478 #define SERVICE_RECOGNIZER_DRIVER 0x00000008
3480 #define SERVICE_DRIVER ( SERVICE_KERNEL_DRIVER | SERVICE_FILE_SYSTEM_DRIVER | \
3481 SERVICE_RECOGNIZER_DRIVER )
3483 #define SERVICE_WIN32_OWN_PROCESS 0x00000010
3484 #define SERVICE_WIN32_SHARE_PROCESS 0x00000020
3485 #define SERVICE_WIN32 (SERVICE_WIN32_OWN_PROCESS | SERVICE_WIN32_SHARE_PROCESS)
3487 #define SERVICE_INTERACTIVE_PROCESS 0x00000100
3489 #define SERVICE_TYPE_ALL ( SERVICE_WIN32 | SERVICE_ADAPTER | \
3490 SERVICE_DRIVER | SERVICE_INTERACTIVE_PROCESS )
3493 typedef enum _CM_SERVICE_NODE_TYPE
3495 DriverType = SERVICE_KERNEL_DRIVER,
3496 FileSystemType = SERVICE_FILE_SYSTEM_DRIVER,
3497 Win32ServiceOwnProcess = SERVICE_WIN32_OWN_PROCESS,
3498 Win32ServiceShareProcess = SERVICE_WIN32_SHARE_PROCESS,
3499 AdapterType = SERVICE_ADAPTER,
3500 RecognizerType = SERVICE_RECOGNIZER_DRIVER
3501 } SERVICE_NODE_TYPE;
3503 typedef enum _CM_SERVICE_LOAD_TYPE
3505 BootLoad = SERVICE_BOOT_START,
3506 SystemLoad = SERVICE_SYSTEM_START,
3507 AutoLoad = SERVICE_AUTO_START,
3508 DemandLoad = SERVICE_DEMAND_START,
3509 DisableLoad = SERVICE_DISABLED
3510 } SERVICE_LOAD_TYPE;
3512 typedef enum _CM_ERROR_CONTROL_TYPE
3514 IgnoreError = SERVICE_ERROR_IGNORE,
3515 NormalError = SERVICE_ERROR_NORMAL,
3516 SevereError = SERVICE_ERROR_SEVERE,
3517 CriticalError = SERVICE_ERROR_CRITICAL
3518 } SERVICE_ERROR_TYPE;
3522 #define RtlEqualMemory(Destination, Source, Length) (!memcmp((Destination),(Source),(Length)))
3523 #define RtlMoveMemory(Destination, Source, Length) memmove((Destination),(Source),(Length))
3524 #define RtlCopyMemory(Destination, Source, Length) memcpy((Destination),(Source),(Length))
3525 #define RtlFillMemory(Destination, Length, Fill) memset((Destination),(Fill),(Length))
3526 #define RtlZeroMemory(Destination, Length) memset((Destination),0,(Length))
3528 #include <guiddef.h>
3530 typedef struct _OBJECT_TYPE_LIST {
3531 WORD Level;
3532 WORD Sbz;
3533 GUID *ObjectType;
3534 } OBJECT_TYPE_LIST, *POBJECT_TYPE_LIST;
3536 typedef struct _RTL_CRITICAL_SECTION_DEBUG
3538 WORD Type;
3539 WORD CreatorBackTraceIndex;
3540 struct _RTL_CRITICAL_SECTION *CriticalSection;
3541 LIST_ENTRY ProcessLocksList;
3542 DWORD EntryCount;
3543 DWORD ContentionCount;
3544 DWORD Spare[ 2 ];
3545 } RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG;
3547 typedef struct _RTL_CRITICAL_SECTION {
3548 PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
3549 LONG LockCount;
3550 LONG RecursionCount;
3551 HANDLE OwningThread;
3552 HANDLE LockSemaphore;
3553 ULONG_PTR SpinCount;
3554 } RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
3556 typedef VOID (NTAPI * WAITORTIMERCALLBACKFUNC) (PVOID, BOOLEAN );
3558 #include <pshpack8.h>
3559 typedef struct _IO_COUNTERS {
3560 ULONGLONG DECLSPEC_ALIGN(8) ReadOperationCount;
3561 ULONGLONG DECLSPEC_ALIGN(8) WriteOperationCount;
3562 ULONGLONG DECLSPEC_ALIGN(8) OtherOperationCount;
3563 ULONGLONG DECLSPEC_ALIGN(8) ReadTransferCount;
3564 ULONGLONG DECLSPEC_ALIGN(8) WriteTransferCount;
3565 ULONGLONG DECLSPEC_ALIGN(8) OtherTransferCount;
3566 } IO_COUNTERS, *PIO_COUNTERS;
3567 #include <poppack.h>
3569 typedef struct {
3570 DWORD dwOSVersionInfoSize;
3571 DWORD dwMajorVersion;
3572 DWORD dwMinorVersion;
3573 DWORD dwBuildNumber;
3574 DWORD dwPlatformId;
3575 CHAR szCSDVersion[128];
3576 } OSVERSIONINFOA, *POSVERSIONINFOA, *LPOSVERSIONINFOA;
3578 typedef struct {
3579 DWORD dwOSVersionInfoSize;
3580 DWORD dwMajorVersion;
3581 DWORD dwMinorVersion;
3582 DWORD dwBuildNumber;
3583 DWORD dwPlatformId;
3584 WCHAR szCSDVersion[128];
3585 } OSVERSIONINFOW, *POSVERSIONINFOW, *LPOSVERSIONINFOW, RTL_OSVERSIONINFOW, *PRTL_OSVERSIONINFOW;
3587 DECL_WINELIB_TYPE_AW(OSVERSIONINFO)
3588 DECL_WINELIB_TYPE_AW(POSVERSIONINFO)
3589 DECL_WINELIB_TYPE_AW(LPOSVERSIONINFO)
3591 typedef struct {
3592 DWORD dwOSVersionInfoSize;
3593 DWORD dwMajorVersion;
3594 DWORD dwMinorVersion;
3595 DWORD dwBuildNumber;
3596 DWORD dwPlatformId;
3597 CHAR szCSDVersion[128];
3598 WORD wServicePackMajor;
3599 WORD wServicePackMinor;
3600 WORD wSuiteMask;
3601 BYTE wProductType;
3602 BYTE wReserved;
3603 } OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA;
3605 typedef struct {
3606 DWORD dwOSVersionInfoSize;
3607 DWORD dwMajorVersion;
3608 DWORD dwMinorVersion;
3609 DWORD dwBuildNumber;
3610 DWORD dwPlatformId;
3611 WCHAR szCSDVersion[128];
3612 WORD wServicePackMajor;
3613 WORD wServicePackMinor;
3614 WORD wSuiteMask;
3615 BYTE wProductType;
3616 BYTE wReserved;
3617 } OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW, RTL_OSVERSIONINFOEXW, *PRTL_OSVERSIONINFOEXW;
3619 DECL_WINELIB_TYPE_AW(OSVERSIONINFOEX)
3620 DECL_WINELIB_TYPE_AW(POSVERSIONINFOEX)
3621 DECL_WINELIB_TYPE_AW(LPOSVERSIONINFOEX)
3623 ULONGLONG WINAPI VerSetConditionMask(ULONGLONG,DWORD,BYTE);
3625 #define VER_SET_CONDITION(_m_,_t_,_c_) ((_m_)=VerSetConditionMask((_m_),(_t_),(_c_)))
3627 #define VER_PLATFORM_WIN32s 0
3628 #define VER_PLATFORM_WIN32_WINDOWS 1
3629 #define VER_PLATFORM_WIN32_NT 2
3631 #define VER_MINORVERSION 0x00000001
3632 #define VER_MAJORVERSION 0x00000002
3633 #define VER_BUILDNUMBER 0x00000004
3634 #define VER_PLATFORMID 0x00000008
3635 #define VER_SERVICEPACKMINOR 0x00000010
3636 #define VER_SERVICEPACKMAJOR 0x00000020
3637 #define VER_SUITENAME 0x00000040
3638 #define VER_PRODUCT_TYPE 0x00000080
3640 #define VER_NT_WORKSTATION 1
3641 #define VER_NT_DOMAIN_CONTROLLER 2
3642 #define VER_NT_SERVER 3
3644 #define VER_SUITE_SMALLBUSINESS 0x00000001
3645 #define VER_SUITE_ENTERPRISE 0x00000002
3646 #define VER_SUITE_BACKOFFICE 0x00000004
3647 #define VER_SUITE_COMMUNICATIONS 0x00000008
3648 #define VER_SUITE_TERMINAL 0x00000010
3649 #define VER_SUITE_SMALLBUSINESS_RESTRICTED 0x00000020
3650 #define VER_SUITE_EMBEDDEDNT 0x00000040
3651 #define VER_SUITE_DATACENTER 0x00000080
3652 #define VER_SUITE_SINGLEUSERTS 0x00000100
3653 #define VER_SUITE_PERSONAL 0x00000200
3654 #define VER_SUITE_BLADE 0x00000400
3656 #define VER_EQUAL 1
3657 #define VER_GREATER 2
3658 #define VER_GREATER_EQUAL 3
3659 #define VER_LESS 4
3660 #define VER_LESS_EQUAL 5
3661 #define VER_AND 6
3662 #define VER_OR 7
3664 #endif /* _WINNT_ */