2 * Win32 definitions for Windows NT
4 * Copyright 1996 Alexandre Julliard
21 /* Argument 1 passed to the DllEntryProc. */
22 #define DLL_PROCESS_DETACH 0 /* detach process (unload library) */
23 #define DLL_PROCESS_ATTACH 1 /* attach process (load library) */
24 #define DLL_THREAD_ATTACH 2 /* attach new thread */
25 #define DLL_THREAD_DETACH 3 /* detach thread */
28 /* u.x.wProcessorArchitecture (NT) */
29 #define PROCESSOR_ARCHITECTURE_INTEL 0
30 #define PROCESSOR_ARCHITECTURE_MIPS 1
31 #define PROCESSOR_ARCHITECTURE_ALPHA 2
32 #define PROCESSOR_ARCHITECTURE_PPC 3
33 #define PROCESSOR_ARCHITECTURE_SHX 4
34 #define PROCESSOR_ARCHITECTURE_ARM 5
35 #define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
38 #define PROCESSOR_INTEL_386 386
39 #define PROCESSOR_INTEL_486 486
40 #define PROCESSOR_INTEL_PENTIUM 586
41 #define PROCESSOR_INTEL_860 860
42 #define PROCESSOR_MIPS_R2000 2000
43 #define PROCESSOR_MIPS_R3000 3000
44 #define PROCESSOR_MIPS_R4000 4000
45 #define PROCESSOR_ALPHA_21064 21064
46 #define PROCESSOR_PPC_601 601
47 #define PROCESSOR_PPC_603 603
48 #define PROCESSOR_PPC_604 604
49 #define PROCESSOR_PPC_620 620
50 #define PROCESSOR_HITACHI_SH3 10003
51 #define PROCESSOR_HITACHI_SH3E 10004
52 #define PROCESSOR_HITACHI_SH4 10005
53 #define PROCESSOR_MOTOROLA_821 821
54 #define PROCESSOR_SHx_SH3 103
55 #define PROCESSOR_SHx_SH4 104
56 #define PROCESSOR_STRONGARM 2577
57 #define PROCESSOR_ARM720 1824 /* 0x720 */
58 #define PROCESSOR_ARM820 2080 /* 0x820 */
59 #define PROCESSOR_ARM920 2336 /* 0x920 */
60 #define PROCESSOR_ARM_7TDMI 70001
62 typedef struct _MEMORY_BASIC_INFORMATION
65 LPVOID AllocationBase
;
66 DWORD AllocationProtect
;
71 } MEMORY_BASIC_INFORMATION
,*LPMEMORY_BASIC_INFORMATION
,*PMEMORY_BASIC_INFORMATION
;
73 #define PAGE_NOACCESS 0x01
74 #define PAGE_READONLY 0x02
75 #define PAGE_READWRITE 0x04
76 #define PAGE_WRITECOPY 0x08
77 #define PAGE_EXECUTE 0x10
78 #define PAGE_EXECUTE_READ 0x20
79 #define PAGE_EXECUTE_READWRITE 0x40
80 #define PAGE_EXECUTE_WRITECOPY 0x80
81 #define PAGE_GUARD 0x100
82 #define PAGE_NOCACHE 0x200
84 #define MEM_COMMIT 0x00001000
85 #define MEM_RESERVE 0x00002000
86 #define MEM_DECOMMIT 0x00004000
87 #define MEM_RELEASE 0x00008000
88 #define MEM_FREE 0x00010000
89 #define MEM_PRIVATE 0x00020000
90 #define MEM_MAPPED 0x00040000
91 #define MEM_RESET 0x00080000
92 #define MEM_TOP_DOWN 0x00100000
94 #define MEM_SYSTEM 0x80000000
97 #define SEC_FILE 0x00800000
98 #define SEC_IMAGE 0x01000000
99 #define SEC_RESERVE 0x04000000
100 #define SEC_COMMIT 0x08000000
101 #define SEC_NOCACHE 0x10000000
102 #define MEM_IMAGE SEC_IMAGE
107 #define MINSHORT 0x8000
108 #define MAXSHORT 0x7fff
109 #define MINLONG 0x80000000
110 #define MAXLONG 0x7fffffff
112 #define MAXWORD 0xffff
113 #define MAXDWORD 0xffffffff
115 #define FIELD_OFFSET(type, field) \
116 ((LONG)(INT)&(((type *)0)->field))
118 #define CONTAINING_RECORD(address, type, field) \
119 ((type *)((PCHAR)(address) - (PCHAR)(&((type *)0)->field)))
123 /* TCHAR data types definitions for Winelib. */
124 /* These types are _not_ defined for the emulator, because they */
125 /* depend on the UNICODE macro that only exists in user's code. */
129 typedef WCHAR TCHAR
, *PTCHAR
;
130 typedef LPWSTR PTSTR
, LPTSTR
;
131 typedef LPCWSTR PCTSTR
, LPCTSTR
;
132 #define __TEXT(string) L##string /*probably wrong */
134 typedef char TCHAR
, *PTCHAR
;
135 typedef LPSTR PTSTR
, LPTSTR
;
136 typedef LPCSTR PCTSTR
, LPCTSTR
;
137 #define __TEXT(string) string
138 # endif /* UNICODE */
139 #endif /* __WINE__ */
140 #define TEXT(quote) __TEXT(quote)
142 typedef BYTE BOOLEAN
;
143 typedef BOOLEAN
*PBOOLEAN
;
147 typedef __uint64 DWORDLONG
, *PDWORDLONG
;
152 typedef __int64 LONGLONG
, *PLONGLONG
;
153 typedef __uint64 ULONGLONG
, *PULONGLONG
;
156 typedef struct _LIST_ENTRY
{
157 struct _LIST_ENTRY
*Flink
;
158 struct _LIST_ENTRY
*Blink
;
159 } LIST_ENTRY
, *PLIST_ENTRY
;
161 typedef struct _SINGLE_LIST_ENTRY
{
162 struct _SINGLE_LIST_ENTRY
*Next
;
163 } SINGLE_LIST_ENTRY
, *PSINGLE_LIST_ENTRY
;
167 #define HEAP_NO_SERIALIZE 0x00000001
168 #define HEAP_GROWABLE 0x00000002
169 #define HEAP_GENERATE_EXCEPTIONS 0x00000004
170 #define HEAP_ZERO_MEMORY 0x00000008
171 #define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010
172 #define HEAP_TAIL_CHECKING_ENABLED 0x00000020
173 #define HEAP_FREE_CHECKING_ENABLED 0x00000040
174 #define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080
175 #define HEAP_CREATE_ALIGN_16 0x00010000
176 #define HEAP_CREATE_ENABLE_TRACING 0x00020000
178 /* This flag allows it to create heaps shared by all processes under win95,
179 FIXME: correct name */
180 #define HEAP_SHARED 0x04000000
182 #define HEAP_WINE_SEGPTR 0x10000000 /* Not a Win32 flag */
183 #define HEAP_WINE_CODESEG 0x20000000 /* Not a Win32 flag */
184 #define HEAP_WINE_CODE16SEG 0x40000000 /* Not a Win32 flag */
186 /* Processor feature flags. */
187 #define PF_FLOATING_POINT_PRECISION_ERRATA 0
188 #define PF_FLOATING_POINT_EMULATED 1
189 #define PF_COMPARE_EXCHANGE_DOUBLE 2
190 #define PF_MMX_INSTRUCTIONS_AVAILABLE 3
191 #define PF_PPC_MOVEMEM_64BIT_OK 4
192 #define PF_ALPHA_BYTE_INSTRUCTIONS 5
195 /* The Win32 register context */
197 /* CONTEXT is the CPU-dependent context; it should be used */
198 /* wherever a platform-specific context is needed (e.g. exception */
199 /* handling, Win32 register functions). */
201 /* CONTEXT86 is the i386-specific context; it should be used */
202 /* wherever only a 386 context makes sense (e.g. DOS interrupts, */
203 /* Win16 register functions), so that this code can be compiled */
204 /* on all platforms. */
206 #define SIZE_OF_80387_REGISTERS 80
208 typedef struct _FLOATING_SAVE_AREA
217 BYTE RegisterArea
[SIZE_OF_80387_REGISTERS
];
219 } FLOATING_SAVE_AREA
, *PFLOATING_SAVE_AREA
;
221 typedef struct _CONTEXT86
225 /* These are selected by CONTEXT_DEBUG_REGISTERS */
233 /* These are selected by CONTEXT_FLOATING_POINT */
234 FLOATING_SAVE_AREA FloatSave
;
236 /* These are selected by CONTEXT_SEGMENTS */
242 /* These are selected by CONTEXT_INTEGER */
250 /* These are selected by CONTEXT_CONTROL */
259 #define CONTEXT_X86 0x00010000
260 #define CONTEXT_i386 CONTEXT_X86
261 #define CONTEXT_i486 CONTEXT_X86
263 #define CONTEXT86_CONTROL (CONTEXT_i386 | 0x0001) /* SS:SP, CS:IP, FLAGS, BP */
264 #define CONTEXT86_INTEGER (CONTEXT_i386 | 0x0002) /* AX, BX, CX, DX, SI, DI */
265 #define CONTEXT86_SEGMENTS (CONTEXT_i386 | 0x0004) /* DS, ES, FS, GS */
266 #define CONTEXT86_FLOATING_POINT (CONTEXT_i386 | 0x0008L) /* 387 state */
267 #define CONTEXT86_DEBUG_REGISTERS (CONTEXT_i386 | 0x0010L) /* DB 0-3,6,7 */
268 #define CONTEXT86_FULL (CONTEXT86_CONTROL | CONTEXT86_INTEGER | CONTEXT86_SEGMENTS)
270 /* i386 context definitions */
273 #define CONTEXT_CONTROL CONTEXT86_CONTROL
274 #define CONTEXT_INTEGER CONTEXT86_INTEGER
275 #define CONTEXT_SEGMENTS CONTEXT86_SEGMENTS
276 #define CONTEXT_FLOATING_POINT CONTEXT86_FLOATING_POINT
277 #define CONTEXT_DEBUG_REGISTERS CONTEXT86_DEBUG_REGISTERS
278 #define CONTEXT_FULL CONTEXT86_FULL
280 typedef CONTEXT86 CONTEXT
;
282 #endif /* __i386__ */
284 /* Alpha context definitions */
287 #define CONTEXT_ALPHA 0x00020000
289 #define CONTEXT_CONTROL (CONTEXT_ALPHA | 0x00000001L)
290 #define CONTEXT_FLOATING_POINT (CONTEXT_ALPHA | 0x00000002L)
291 #define CONTEXT_INTEGER (CONTEXT_ALPHA | 0x00000004L)
292 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
294 typedef struct _CONTEXT
296 /* selected by CONTEXT_FLOATING_POINT */
330 /* selected by CONTEXT_INTEGER */
364 /* selected by CONTEXT_FLOATING_POINT */
368 /* selected by CONTEXT_CONTROL */
375 #define _QUAD_PSR_OFFSET HighSoftFpcr
376 #define _QUAD_FLAGS_OFFSET HighFir
380 /* Mips context definitions */
383 #define CONTEXT_R4000 0x00010000
385 #define CONTEXT_CONTROL (CONTEXT_R4000 | 0x00000001)
386 #define CONTEXT_FLOATING_POINT (CONTEXT_R4000 | 0x00000002)
387 #define CONTEXT_INTEGER (CONTEXT_R4000 | 0x00000004)
389 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
391 typedef struct _CONTEXT
394 /* These are selected by CONTEXT_FLOATING_POINT */
428 /* These are selected by CONTEXT_INTEGER */
464 /* These are selected by CONTEXT_FLOATING_POINT */
467 /* These are selected by CONTEXT_CONTROL */
477 /* PowerPC context definitions */
480 #define CONTEXT_CONTROL 0x0001
481 #define CONTEXT_FLOATING_POINT 0x0002
482 #define CONTEXT_INTEGER 0x0004
483 #define CONTEXT_DEBUG_REGISTERS 0x0008
484 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
488 /* These are selected by CONTEXT_FLOATING_POINT */
523 /* These are selected by CONTEXT_INTEGER */
560 /* These are selected by CONTEXT_CONTROL */
569 /* These are selected by CONTEXT_DEBUG_REGISTERS */
580 typedef struct _STACK_FRAME_HEADER
597 } STACK_FRAME_HEADER
,*PSTACK_FRAME_HEADER
;
606 * There is no official CONTEXT structure defined for the SPARC
607 * architecture, so I just made one up.
609 * This structure is valid only for 32-bit SPARC architectures,
610 * not for 64-bit SPARC.
612 * Note that this structure contains only the 'top-level' registers;
613 * the rest of the register window chain is not visible.
615 * The layout follows the Solaris 'prgregset_t' structure.
619 #define CONTEXT_SPARC 0x10000000
621 #define CONTEXT_CONTROL (CONTEXT_SPARC | 0x00000001)
622 #define CONTEXT_FLOATING_POINT (CONTEXT_SPARC | 0x00000002)
623 #define CONTEXT_INTEGER (CONTEXT_SPARC | 0x00000004)
625 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
627 typedef struct _CONTEXT
631 /* These are selected by CONTEXT_INTEGER */
665 /* These are selected by CONTEXT_CONTROL */
673 /* FIXME: floating point registers missing */
677 #endif /* __sparc__ */
679 #if !defined(CONTEXT_FULL) && !defined(RC_INVOKED)
680 #error You need to define a CONTEXT for your CPU
683 typedef CONTEXT
*PCONTEXT
;
684 typedef HANDLE
*PHANDLE
;
688 /* Macros for easier access to i386 context registers */
690 #define AX_reg(context) (*(WORD*)&(context)->Eax)
691 #define BX_reg(context) (*(WORD*)&(context)->Ebx)
692 #define CX_reg(context) (*(WORD*)&(context)->Ecx)
693 #define DX_reg(context) (*(WORD*)&(context)->Edx)
694 #define SI_reg(context) (*(WORD*)&(context)->Esi)
695 #define DI_reg(context) (*(WORD*)&(context)->Edi)
696 #define BP_reg(context) (*(WORD*)&(context)->Ebp)
698 #define AL_reg(context) (*(BYTE*)&(context)->Eax)
699 #define AH_reg(context) (*((BYTE*)&(context)->Eax + 1))
700 #define BL_reg(context) (*(BYTE*)&(context)->Ebx)
701 #define BH_reg(context) (*((BYTE*)&(context)->Ebx + 1))
702 #define CL_reg(context) (*(BYTE*)&(context)->Ecx)
703 #define CH_reg(context) (*((BYTE*)&(context)->Ecx + 1))
704 #define DL_reg(context) (*(BYTE*)&(context)->Edx)
705 #define DH_reg(context) (*((BYTE*)&(context)->Edx + 1))
707 #define SET_CFLAG(context) ((context)->EFlags |= 0x0001)
708 #define RESET_CFLAG(context) ((context)->EFlags &= ~0x0001)
709 #define SET_ZFLAG(context) ((context)->EFlags |= 0x0040)
710 #define RESET_ZFLAG(context) ((context)->EFlags &= ~0x0040)
711 #define ISV86(context) ((context)->EFlags & 0x00020000)
714 /* Macros to retrieve the current context */
718 #ifdef NEED_UNDERSCORE_PREFIX
719 # define __ASM_NAME(name) "_" name
721 # define __ASM_NAME(name) name
724 #ifdef NEED_TYPE_IN_DEF
725 # define __ASM_FUNC(name) ".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"
727 # define __ASM_FUNC(name) ".type " __ASM_NAME(name) ",@function"
731 # define __ASM_GLOBAL_FUNC(name,code) \
732 __asm__( ".align 4\n\t" \
733 ".globl " __ASM_NAME(#name) "\n\t" \
734 __ASM_FUNC(#name) "\n" \
735 __ASM_NAME(#name) ":\n\t" \
738 # define __ASM_GLOBAL_FUNC(name,code) \
739 void __asm_dummy_##name(void) { \
740 asm( ".align 4\n\t" \
741 ".globl " __ASM_NAME(#name) "\n\t" \
742 __ASM_FUNC(#name) "\n" \
743 __ASM_NAME(#name) ":\n\t" \
746 #endif /* __GNUC__ */
748 #define _DEFINE_REGS_ENTRYPOINT( name, fn, args ) \
749 __ASM_GLOBAL_FUNC( name, \
750 "call " __ASM_NAME("CALL32_Regs") "\n\t" \
751 ".long " __ASM_NAME(#fn) "\n\t" \
752 ".byte " #args ", " #args )
753 #define DEFINE_REGS_ENTRYPOINT_0( name, fn ) \
754 extern void WINAPI name(void); \
755 _DEFINE_REGS_ENTRYPOINT( name, fn, 0 )
756 #define DEFINE_REGS_ENTRYPOINT_1( name, fn, t1 ) \
757 extern void WINAPI name( t1 a1 ); \
758 _DEFINE_REGS_ENTRYPOINT( name, fn, 4 )
759 #define DEFINE_REGS_ENTRYPOINT_2( name, fn, t1, t2 ) \
760 extern void WINAPI name( t1 a1, t2 a2 ); \
761 _DEFINE_REGS_ENTRYPOINT( name, fn, 8 )
762 #define DEFINE_REGS_ENTRYPOINT_3( name, fn, t1, t2, t3 ) \
763 extern void WINAPI name( t1 a1, t2 a2, t3 a3 ); \
764 _DEFINE_REGS_ENTRYPOINT( name, fn, 12 )
765 #define DEFINE_REGS_ENTRYPOINT_4( name, fn, t1, t2, t3, t4 ) \
766 extern void WINAPI name( t1 a1, t2 a2, t3 a3, t4 a4 ); \
767 _DEFINE_REGS_ENTRYPOINT( name, fn, 16 )
769 #endif /* __i386__ */
772 /* FIXME: use getcontext() to retrieve full context */
773 #define _GET_CONTEXT \
775 do { memset(&context, 0, sizeof(CONTEXT)); \
776 context.ContextFlags = CONTEXT_CONTROL; \
777 context.pc = (DWORD)__builtin_return_address(0); \
780 #define DEFINE_REGS_ENTRYPOINT_0( name, fn ) \
781 void WINAPI name ( void ) \
782 { _GET_CONTEXT; fn( &context ); }
783 #define DEFINE_REGS_ENTRYPOINT_1( name, fn, t1 ) \
784 void WINAPI name ( t1 a1 ) \
785 { _GET_CONTEXT; fn( a1, &context ); }
786 #define DEFINE_REGS_ENTRYPOINT_2( name, fn, t1, t2 ) \
787 void WINAPI name ( t1 a1, t2 a2 ) \
788 { _GET_CONTEXT; fn( a1, a2, &context ); }
789 #define DEFINE_REGS_ENTRYPOINT_3( name, fn, t1, t2, t3 ) \
790 void WINAPI name ( t1 a1, t2 a2, t3 a3 ) \
791 { _GET_CONTEXT; fn( a1, a2, a3, &context ); }
792 #define DEFINE_REGS_ENTRYPOINT_4( name, fn, t1, t2, t3, t4 ) \
793 void WINAPI name ( t1 a1, t2 a2, t3 a3, t4 a4 ) \
794 { _GET_CONTEXT; fn( a1, a2, a3, a4, &context ); }
796 #endif /* __sparc__ */
798 #ifndef DEFINE_REGS_ENTRYPOINT_0
799 #error You need to define DEFINE_REGS_ENTRYPOINT macros for your CPU
802 /* Constructor functions */
805 # define DECL_GLOBAL_CONSTRUCTOR(func) \
806 static void func(void) __attribute__((constructor)); \
807 static void func(void)
810 # define DECL_GLOBAL_CONSTRUCTOR(func) \
811 static void __dummy_init_##func(void) { \
812 asm(".section .init,\"ax\"\n\t" \
813 "call " #func "\n\t" \
815 static void func(void)
816 # else /* __i386__ */
817 # error You must define the DECL_GLOBAL_CONSTRUCTOR macro for your platform
819 #endif /* __GNUC__ */
821 /* Segment register access */
825 # define __DEFINE_GET_SEG(seg) \
826 extern inline unsigned short __get_##seg(void) \
827 { unsigned short res; __asm__("movw %%" #seg ",%w0" : "=r"(res)); return res; }
828 # define __DEFINE_SET_SEG(seg) \
829 extern inline void __set_##seg(int val) { __asm__("movw %w0,%%" #seg : : "r" (val)); }
830 # else /* __GNUC__ */
831 # define __DEFINE_GET_SEG(seg) extern unsigned short __get_##seg(void);
832 # define __DEFINE_SET_SEG(seg) extern void __set_##seg(unsigned int);
833 # endif /* __GNUC__ */
835 # define __DEFINE_GET_SEG(seg) inline static unsigned short __get_##seg(void) { return 0; }
836 # define __DEFINE_SET_SEG(seg) /* nothing */
837 #endif /* __i386__ */
847 #undef __DEFINE_GET_SEG
848 #undef __DEFINE_SET_SEG
850 #endif /* __WINE__ */
858 #define MAKELCID(l, s) (MAKELONG(l, s))
860 #define MAKELANGID(p, s) ((((WORD)(s))<<10) | (WORD)(p))
861 #define PRIMARYLANGID(l) ((WORD)(l) & 0x3ff)
862 #define SUBLANGID(l) ((WORD)(l) >> 10)
864 #define LANGIDFROMLCID(lcid) ((WORD)(lcid))
865 #define SORTIDFROMLCID(lcid) ((WORD)((((DWORD)(lcid)) >> 16) & 0x0f))
867 #define LANG_SYSTEM_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT))
868 #define LANG_USER_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT))
869 #define LOCALE_SYSTEM_DEFAULT (MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT))
870 #define LOCALE_USER_DEFAULT (MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT))
871 #define LOCALE_NEUTRAL (MAKELCID(MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL),SORT_DEFAULT))
873 /* FIXME: are the symbolic names correct for LIDs: 0x17, 0x20, 0x28,
874 * 0x2a, 0x2b, 0x2c, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
875 * 0x37, 0x39, 0x3a, 0x3b, 0x3c, 0x3e, 0x3f, 0x41, 0x43, 0x44,
876 * 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e,
879 #define LANG_NEUTRAL 0x00
880 #define LANG_AFRIKAANS 0x36
881 #define LANG_ALBANIAN 0x1c
882 #define LANG_ARABIC 0x01
883 #define LANG_ARMENIAN 0x2b
884 #define LANG_ASSAMESE 0x4d
885 #define LANG_AZERI 0x2c
886 #define LANG_BASQUE 0x2d
887 #define LANG_BENGALI 0x45
888 #define LANG_BULGARIAN 0x02
889 #define LANG_BYELORUSSIAN 0x23
890 #define LANG_CATALAN 0x03
891 #define LANG_CHINESE 0x04
892 #define LANG_SERBO_CROATIAN 0x1a
893 #define LANG_CROATIAN LANG_SERBO_CROATIAN
894 #define LANG_SERBIAN LANG_SERBO_CROATIAN
895 #define LANG_CZECH 0x05
896 #define LANG_DANISH 0x06
897 #define LANG_DUTCH 0x13
898 #define LANG_ENGLISH 0x09
899 #define LANG_ESTONIAN 0x25
900 #define LANG_FAEROESE 0x38
901 #define LANG_FARSI 0x29
902 #define LANG_FINNISH 0x0b
903 #define LANG_FRENCH 0x0c
904 #define LANG_GAELIC 0x3c
905 #define LANG_GEORGIAN 0x37
906 #define LANG_GERMAN 0x07
907 #define LANG_GREEK 0x08
908 #define LANG_GUJARATI 0x47
909 #define LANG_HEBREW 0x0D
910 #define LANG_HINDI 0x39
911 #define LANG_HUNGARIAN 0x0e
912 #define LANG_ICELANDIC 0x0f
913 #define LANG_INDONESIAN 0x21
914 #define LANG_ITALIAN 0x10
915 #define LANG_JAPANESE 0x11
916 #define LANG_KANNADA 0x4b
917 #define LANG_KAZAKH 0x3f
918 #define LANG_KONKANI 0x57
919 #define LANG_KOREAN 0x12
920 #define LANG_LATVIAN 0x26
921 #define LANG_LITHUANIAN 0x27
922 #define LANG_MACEDONIAN 0x2f
923 #define LANG_MALAY 0x3e
924 #define LANG_MALAYALAM 0x4c
925 #define LANG_MALTESE 0x3a
926 #define LANG_MAORI 0x28
927 #define LANG_MARATHI 0x4e
928 #define LANG_NORWEGIAN 0x14
929 #define LANG_ORIYA 0x48
930 #define LANG_POLISH 0x15
931 #define LANG_PORTUGUESE 0x16
932 #define LANG_PUNJABI 0x46
933 #define LANG_RHAETO_ROMANCE 0x17
934 #define LANG_ROMANIAN 0x18
935 #define LANG_RUSSIAN 0x19
936 #define LANG_SAAMI 0x3b
937 #define LANG_SANSKRIT 0x4f
938 #define LANG_SLOVAK 0x1b
939 #define LANG_SLOVENIAN 0x24
940 #define LANG_SORBIAN 0x2e
941 #define LANG_SPANISH 0x0a
942 #define LANG_SUTU 0x30
943 #define LANG_SWAHILI 0x41
944 #define LANG_SWEDISH 0x1d
945 #define LANG_TAMIL 0x49
946 #define LANG_TATAR 0x44
947 #define LANG_TELUGU 0x4a
948 #define LANG_THAI 0x1e
949 #define LANG_TSONGA 0x31
950 #define LANG_TSWANA 0x32
951 #define LANG_TURKISH 0x1f
952 #define LANG_UKRAINIAN 0x22
953 #define LANG_URDU 0x20
954 #define LANG_UZBEK 0x43
955 #define LANG_VENDA 0x33
956 #define LANG_VIETNAMESE 0x2a
957 #define LANG_XHOSA 0x34
958 #define LANG_ZULU 0x35
959 /* non standard; keep the number high enough (but < 0xff) */
960 #define LANG_ESPERANTO 0x8f
961 #define LANG_WALON 0x90
962 #define LANG_CORNISH 0x91
963 #define LANG_WELSH 0x92
964 #define LANG_BRETON 0x93
966 /* Sublanguage definitions */
967 #define SUBLANG_NEUTRAL 0x00 /* language neutral */
968 #define SUBLANG_DEFAULT 0x01 /* user default */
969 #define SUBLANG_SYS_DEFAULT 0x02 /* system default */
971 #define SUBLANG_ARABIC 0x01
972 #define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
973 #define SUBLANG_ARABIC_IRAQ 0x02
974 #define SUBLANG_ARABIC_EGYPT 0x03
975 #define SUBLANG_ARABIC_LIBYA 0x04
976 #define SUBLANG_ARABIC_ALGERIA 0x05
977 #define SUBLANG_ARABIC_MOROCCO 0x06
978 #define SUBLANG_ARABIC_TUNISIA 0x07
979 #define SUBLANG_ARABIC_OMAN 0x08
980 #define SUBLANG_ARABIC_YEMEN 0x09
981 #define SUBLANG_ARABIC_SYRIA 0x0a
982 #define SUBLANG_ARABIC_JORDAN 0x0b
983 #define SUBLANG_ARABIC_LEBANON 0x0c
984 #define SUBLANG_ARABIC_KUWAIT 0x0d
985 #define SUBLANG_ARABIC_UAE 0x0e
986 #define SUBLANG_ARABIC_BAHRAIN 0x0f
987 #define SUBLANG_ARABIC_QATAR 0x10
988 #define SUBLANG_CHINESE_TRADITIONAL 0x01
989 #define SUBLANG_CHINESE_SIMPLIFIED 0x02
990 #define SUBLANG_CHINESE_HONGKONG 0x03
991 #define SUBLANG_CHINESE_SINGAPORE 0x04
992 #define SUBLANG_CHINESE_MACAU 0x05
993 #define SUBLANG_DUTCH 0x01
994 #define SUBLANG_DUTCH_BELGIAN 0x02
995 #define SUBLANG_DUTCH_SURINAM 0x03
996 #define SUBLANG_ENGLISH_US 0x01
997 #define SUBLANG_ENGLISH_UK 0x02
998 #define SUBLANG_ENGLISH_AUS 0x03
999 #define SUBLANG_ENGLISH_CAN 0x04
1000 #define SUBLANG_ENGLISH_NZ 0x05
1001 #define SUBLANG_ENGLISH_EIRE 0x06
1002 #define SUBLANG_ENGLISH_SAFRICA 0x07
1003 #define SUBLANG_ENGLISH_JAMAICA 0x08
1004 #define SUBLANG_ENGLISH_CARRIBEAN 0x09
1005 #define SUBLANG_ENGLISH_BELIZE 0x0a
1006 #define SUBLANG_ENGLISH_TRINIDAD 0x0b
1007 #define SUBLANG_ENGLISH_ZIMBABWE 0x0c
1008 #define SUBLANG_ENGLISH_PHILIPPINES 0x0d
1009 #define SUBLANG_FRENCH 0x01
1010 #define SUBLANG_FRENCH_BELGIAN 0x02
1011 #define SUBLANG_FRENCH_CANADIAN 0x03
1012 #define SUBLANG_FRENCH_SWISS 0x04
1013 #define SUBLANG_FRENCH_LUXEMBOURG 0x05
1014 #define SUBLANG_FRENCH_MONACO 0x06
1015 #define SUBLANG_GERMAN 0x01
1016 #define SUBLANG_GERMAN_SWISS 0x02
1017 #define SUBLANG_GERMAN_AUSTRIAN 0x03
1018 #define SUBLANG_GERMAN_LUXEMBOURG 0x04
1019 #define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
1020 #define SUBLANG_ITALIAN 0x01
1021 #define SUBLANG_ITALIAN_SWISS 0x02
1022 #define SUBLANG_KOREAN 0x01
1023 #define SUBLANG_KOREAN_JOHAB 0x02
1024 #define SUBLANG_NORWEGIAN_BOKMAL 0x01
1025 #define SUBLANG_NORWEGIAN_NYNORSK 0x02
1026 #define SUBLANG_PORTUGUESE 0x02
1027 #define SUBLANG_PORTUGUESE_BRAZILIAN 0x01
1028 #define SUBLANG_SPANISH 0x01
1029 #define SUBLANG_SPANISH_MEXICAN 0x02
1030 #define SUBLANG_SPANISH_MODERN 0x03
1031 #define SUBLANG_SPANISH_GUATEMALA 0x04
1032 #define SUBLANG_SPANISH_COSTARICA 0x05
1033 #define SUBLANG_SPANISH_PANAMA 0x06
1034 #define SUBLANG_SPANISH_DOMINICAN 0x07
1035 #define SUBLANG_SPANISH_VENEZUELA 0x08
1036 #define SUBLANG_SPANISH_COLOMBIA 0x09
1037 #define SUBLANG_SPANISH_PERU 0x0a
1038 #define SUBLANG_SPANISH_ARGENTINA 0x0b
1039 #define SUBLANG_SPANISH_ECUADOR 0x0c
1040 #define SUBLANG_SPANISH_CHILE 0x0d
1041 #define SUBLANG_SPANISH_URUGUAY 0x0e
1042 #define SUBLANG_SPANISH_PARAGUAY 0x0f
1043 #define SUBLANG_SPANISH_BOLIVIA 0x10
1044 #define SUBLANG_SPANISH_EL_SALVADOR 0x11
1045 #define SUBLANG_SPANISH_HONDURAS 0x12
1046 #define SUBLANG_SPANISH_NICARAGUA 0x13
1047 #define SUBLANG_SPANISH_PUERTO_RICO 0x14
1048 /* FIXME: I don't know the symbolic names for those */
1049 #define SUBLANG_ROMANIAN 0x01
1050 #define SUBLANG_ROMANIAN_MOLDAVIA 0x02
1051 #define SUBLANG_RUSSIAN 0x01
1052 #define SUBLANG_RUSSIAN_MOLDAVIA 0x02
1053 #define SUBLANG_CROATIAN 0x01
1054 #define SUBLANG_SERBIAN 0x02
1055 #define SUBLANG_SERBIAN_LATIN 0x03
1056 #define SUBLANG_SWEDISH 0x01
1057 #define SUBLANG_SWEDISH_FINLAND 0x02
1058 #define SUBLANG_LITHUANIAN 0x01
1059 #define SUBLANG_LITHUANIAN_CLASSIC 0x02
1060 #define SUBLANG_AZERI 0x01
1061 #define SUBLANG_AZERI_CYRILLIC 0x02
1062 #define SUBLANG_GAELIC 0x01
1063 #define SUBLANG_GAELIC_SCOTTISH 0x02
1064 #define SUBLANG_GAELIC_MANX 0x03
1065 #define SUBLANG_MALAY 0x01
1066 #define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
1067 #define SUBLANG_UZBEK 0x01
1068 #define SUBLANG_UZBEK_CYRILLIC 0x02
1069 #define SUBLANG_URDU_PAKISTAN 0x01
1077 #define SORT_DEFAULT 0x0
1078 #define SORT_JAPANESE_XJIS 0x0
1079 #define SORT_JAPANESE_UNICODE 0x1
1080 #define SORT_CHINESE_BIG5 0x0
1081 #define SORT_CHINESE_UNICODE 0x1
1082 #define SORT_KOREAN_KSC 0x0
1083 #define SORT_KOREAN_UNICODE 0x1
1088 * Definitions for IsTextUnicode()
1091 #define IS_TEXT_UNICODE_ASCII16 0x0001
1092 #define IS_TEXT_UNICODE_STATISTICS 0x0002
1093 #define IS_TEXT_UNICODE_CONTROLS 0x0004
1094 #define IS_TEXT_UNICODE_SIGNATURE 0x0008
1095 #define IS_TEXT_UNICODE_UNICODE_MASK 0x000F
1096 #define IS_TEXT_UNICODE_REVERSE_ASCII16 0x0010
1097 #define IS_TEXT_UNICODE_REVERSE_STATISTICS 0x0020
1098 #define IS_TEXT_UNICODE_REVERSE_CONTROLS 0x0040
1099 #define IS_TEXT_UNICODE_REVERSE_SIGNATURE 0x0080
1100 #define IS_TEXT_UNICODE_REVERSE_MASK 0x00F0
1101 #define IS_TEXT_UNICODE_ILLEGAL_CHARS 0x0100
1102 #define IS_TEXT_UNICODE_ODD_LENGTH 0x0200
1103 #define IS_TEXT_UNICODE_DBCS_LEADBYTE 0x0400
1104 #define IS_TEXT_UNICODE_NOT_UNICODE_MASK 0x0F00
1105 #define IS_TEXT_UNICODE_NULL_BYTES 0x1000
1106 #define IS_TEXT_UNICODE_NOT_ASCII_MASK 0xF000
1114 #define STATUS_SUCCESS 0x00000000
1115 #define STATUS_WAIT_0 0x00000000
1116 #define STATUS_ABANDONED_WAIT_0 0x00000080
1117 #define STATUS_USER_APC 0x000000C0
1118 #define STATUS_TIMEOUT 0x00000102
1119 #define STATUS_PENDING 0x00000103
1121 #define STATUS_GUARD_PAGE_VIOLATION 0x80000001
1122 #define STATUS_DATATYPE_MISALIGNMENT 0x80000002
1123 #define STATUS_BREAKPOINT 0x80000003
1124 #define STATUS_SINGLE_STEP 0x80000004
1125 #define STATUS_BUFFER_OVERFLOW 0x80000005
1126 #define STATUS_NO_MORE_FILES 0x80000006
1127 #define STATUS_WAKE_SYSTEM_DEBUGGER 0x80000007
1129 #define STATUS_HANDLES_CLOSED 0x8000000A
1130 #define STATUS_NO_INHERITANCE 0x8000000B
1131 #define STATUS_GUID_SUBSTITUTION_MADE 0x8000000C
1132 #define STATUS_PARTIAL_COPY 0x8000000D
1133 #define STATUS_DEVICE_PAPER_EMPTY 0x8000000E
1134 #define STATUS_DEVICE_POWERED_OFF 0x8000000F
1135 #define STATUS_DEVICE_OFF_LINE 0x80000010
1136 #define STATUS_DEVICE_BUSY 0x80000011
1137 #define STATUS_NO_MORE_EAS 0x80000012
1138 #define STATUS_INVALID_EA_NAME 0x80000013
1139 #define STATUS_EA_LIST_INCONSISTENT 0x80000014
1140 #define STATUS_INVALID_EA_FLAG 0x80000015
1141 #define STATUS_VERIFY_REQUIRED 0x80000016
1142 #define STATUS_EXTRANEOUS_INFORMATION 0x80000017
1143 #define STATUS_RXACT_COMMIT_NECESSARY 0x80000018
1144 #define STATUS_NO_MORE_ENTRIES 0x8000001A
1145 #define STATUS_FILEMARK_DETECTED 0x8000001B
1146 #define STATUS_MEDIA_CHANGED 0x8000001C
1147 #define STATUS_BUS_RESET 0x8000001D
1148 #define STATUS_END_OF_MEDIA 0x8000001E
1149 #define STATUS_BEGINNING_OF_MEDIA 0x8000001F
1150 #define STATUS_MEDIA_CHECK 0x80000020
1151 #define STATUS_SETMARK_DETECTED 0x80000021
1152 #define STATUS_NO_DATA_DETECTED 0x80000022
1153 #define STATUS_REDIRECTOR_HAS_OPEN_HANDLES 0x80000023
1154 #define STATUS_SERVER_HAS_OPEN_HANDLES 0x80000024
1155 #define STATUS_ALREADY_DISCONNECTED 0x80000025
1156 #define STATUS_LONGJUMP 0x80000026
1158 #define STATUS_UNSUCCESSFUL 0xC0000001
1159 #define STATUS_NOT_IMPLEMENTED 0xC0000002
1160 #define STATUS_INVALID_INFO_CLASS 0xC0000003
1161 #define STATUS_INFO_LENGTH_MISMATCH 0xC0000004
1162 #define STATUS_ACCESS_VIOLATION 0xC0000005
1163 #define STATUS_IN_PAGE_ERROR 0xC0000006
1164 #define STATUS_PAGEFILE_QUOTA 0xC0000007
1165 #define STATUS_INVALID_HANDLE 0xC0000008
1166 #define STATUS_BAD_INITIAL_STACK 0xC0000009
1167 #define STATUS_BAD_INITIAL_PC 0xC000000A
1168 #define STATUS_INVALID_CID 0xC000000B
1169 #define STATUS_TIMER_NOT_CANCELED 0xC000000C
1170 #define STATUS_INVALID_PARAMETER 0xC000000D
1171 #define STATUS_NO_SUCH_DEVICE 0xC000000E
1172 #define STATUS_NO_SUCH_FILE 0xC000000F
1173 #define STATUS_INVALID_DEVICE_REQUEST 0xC0000010
1174 #define STATUS_END_OF_FILE 0xC0000011
1175 #define STATUS_WRONG_VOLUME 0xC0000012
1176 #define STATUS_NO_MEDIA_IN_DEVICE 0xC0000013
1177 #define STATUS_UNRECOGNIZED_MEDIA 0xC0000014
1178 #define STATUS_NONEXISTENT_SECTOR 0xC0000015
1179 #define STATUS_MORE_PROCESSING_REQUIRED 0xC0000016
1180 #define STATUS_NO_MEMORY 0xC0000017
1181 #define STATUS_CONFLICTING_ADDRESSES 0xC0000018
1182 #define STATUS_NOT_MAPPED_VIEW 0xC0000019
1183 #define STATUS_UNABLE_TO_FREE_VM 0xC000001A
1184 #define STATUS_UNABLE_TO_DELETE_SECTION 0xC000001B
1185 #define STATUS_INVALID_SYSTEM_SERVICE 0xC000001C
1186 #define STATUS_ILLEGAL_INSTRUCTION 0xC000001D
1187 #define STATUS_INVALID_LOCK_SEQUENCE 0xC000001E
1188 #define STATUS_INVALID_VIEW_SIZE 0xC000001F
1189 #define STATUS_INVALID_FILE_FOR_SECTION 0xC0000020
1190 #define STATUS_ALREADY_COMMITTED 0xC0000021
1191 #define STATUS_ACCESS_DENIED 0xC0000022
1192 #define STATUS_BUFFER_TOO_SMALL 0xC0000023
1193 #define STATUS_OBJECT_TYPE_MISMATCH 0xC0000024
1194 #define STATUS_NONCONTINUABLE_EXCEPTION 0xC0000025
1195 #define STATUS_INVALID_DISPOSITION 0xC0000026
1196 #define STATUS_UNWIND 0xC0000027
1197 #define STATUS_BAD_STACK 0xC0000028
1198 #define STATUS_INVALID_UNWIND_TARGET 0xC0000029
1199 #define STATUS_NOT_LOCKED 0xC000002A
1200 #define STATUS_PARITY_ERROR 0xC000002B
1201 #define STATUS_UNABLE_TO_DECOMMIT_VM 0xC000002C
1202 #define STATUS_NOT_COMMITTED 0xC000002D
1203 #define STATUS_INVALID_PORT_ATTRIBUTES 0xC000002E
1204 #define STATUS_PORT_MESSAGE_TOO_LONG 0xC000002F
1205 #define STATUS_INVALID_PARAMETER_MIX 0xC0000030
1206 #define STATUS_INVALID_QUOTA_LOWER 0xC0000031
1207 #define STATUS_DISK_CORRUPT_ERROR 0xC0000032
1208 #define STATUS_OBJECT_NAME_INVALID 0xC0000033
1209 #define STATUS_OBJECT_NAME_NOT_FOUND 0xC0000034
1210 #define STATUS_OBJECT_NAME_COLLISION 0xC0000035
1211 #define STATUS_PORT_DISCONNECTED 0xC0000037
1212 #define STATUS_DEVICE_ALREADY_ATTACHED 0xC0000038
1213 #define STATUS_OBJECT_PATH_INVALID 0xC0000039
1214 #define STATUS_OBJECT_PATH_NOT_FOUND 0xC000003A
1215 #define STATUS_PATH_SYNTAX_BAD 0xC000003B
1216 #define STATUS_DATA_OVERRUN 0xC000003C
1217 #define STATUS_DATA_LATE_ERROR 0xC000003D
1218 #define STATUS_DATA_ERROR 0xC000003E
1219 #define STATUS_CRC_ERROR 0xC000003F
1220 #define STATUS_SECTION_TOO_BIG 0xC0000040
1221 #define STATUS_PORT_CONNECTION_REFUSED 0xC0000041
1222 #define STATUS_INVALID_PORT_HANDLE 0xC0000042
1223 #define STATUS_SHARING_VIOLATION 0xC0000043
1224 #define STATUS_QUOTA_EXCEEDED 0xC0000044
1225 #define STATUS_INVALID_PAGE_PROTECTION 0xC0000045
1226 #define STATUS_MUTANT_NOT_OWNED 0xC0000046
1227 #define STATUS_SEMAPHORE_LIMIT_EXCEEDED 0xC0000047
1228 #define STATUS_PORT_ALREADY_SET 0xC0000048
1229 #define STATUS_SUSPEND_COUNT_EXCEEDED 0xC000004A
1230 #define STATUS_LOCK_NOT_GRANTED 0xC0000054 /* FIXME: not sure */
1231 #define STATUS_FILE_LOCK_CONFLICT 0xC0000055 /* FIXME: not sure */
1232 #define STATUS_UNKNOWN_REVISION 0xC0000058
1233 #define STATUS_INVALID_SECURITY_DESCR 0xC0000079
1234 #define STATUS_DISK_FULL 0xC000007F
1235 #define STATUS_SECTION_NOT_EXTENDED 0xC0000087
1236 #define STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008C
1237 #define STATUS_FLOAT_DENORMAL_OPERAND 0xC000008D
1238 #define STATUS_FLOAT_DIVIDE_BY_ZERO 0xC000008E
1239 #define STATUS_FLOAT_INEXACT_RESULT 0xC000008F
1240 #define STATUS_FLOAT_INVALID_OPERATION 0xC0000090
1241 #define STATUS_FLOAT_OVERFLOW 0xC0000091
1242 #define STATUS_FLOAT_STACK_CHECK 0xC0000092
1243 #define STATUS_FLOAT_UNDERFLOW 0xC0000093
1244 #define STATUS_INTEGER_DIVIDE_BY_ZERO 0xC0000094
1245 #define STATUS_INTEGER_OVERFLOW 0xC0000095
1246 #define STATUS_PRIVILEGED_INSTRUCTION 0xC0000096
1247 #define STATUS_MEDIA_WRITE_PROTECTED 0XC00000A2
1248 #define STATUS_INVALID_PARAMETER_2 0xC00000F0
1249 #define STATUS_STACK_OVERFLOW 0xC00000FD
1250 #define STATUS_DIRECTORY_NOT_EMPTY 0xC0000101
1251 #define STATUS_TOO_MANY_OPENED_FILES 0xC000011F
1252 #define STATUS_CONTROL_C_EXIT 0xC000013A
1253 #define STATUS_PIPE_BROKEN 0xC000014B
1254 #define STATUS_NOT_REGISTRY_FILE 0xC000015C
1255 #define STATUS_PARTITION_FAILURE 0xC0000172
1256 #define STATUS_INVALID_BLOCK_LENGTH 0xC0000173
1257 #define STATUS_DEVICE_NOT_PARTITIONED 0xC0000174
1258 #define STATUS_UNABLE_TO_LOCK_MEDIA 0xC0000175
1259 #define STATUS_UNABLE_TO_UNLOAD_MEDIA 0xC0000176
1260 #define STATUS_EOM_OVERFLOW 0xC0000177
1261 #define STATUS_NO_MEDIA 0xC0000178
1262 #define STATUS_NO_SUCH_MEMBER 0xC000017A
1263 #define STATUS_INVALID_MEMBER 0xC000017B
1264 #define STATUS_KEY_DELETED 0xC000017C
1265 #define STATUS_NO_LOG_SPACE 0xC000017D
1266 #define STATUS_TOO_MANY_SIDS 0xC000017E
1267 #define STATUS_LM_CROSS_ENCRYPTION_REQUIRED 0xC000017F
1268 #define STATUS_KEY_HAS_CHILDREN 0xC0000180
1269 #define STATUS_CHILD_MUST_BE_VOLATILE 0xC0000181
1270 #define STATUS_DEVICE_CONFIGURATION_ERROR0xC0000182
1271 #define STATUS_DRIVER_INTERNAL_ERROR 0xC0000183
1272 #define STATUS_INVALID_DEVICE_STATE 0xC0000184
1273 #define STATUS_IO_DEVICE_ERROR 0xC0000185
1274 #define STATUS_DEVICE_PROTOCOL_ERROR 0xC0000186
1275 #define STATUS_BACKUP_CONTROLLER 0xC0000187
1276 #define STATUS_LOG_FILE_FULL 0xC0000188
1277 #define STATUS_TOO_LATE 0xC0000189
1278 #define STATUS_NO_TRUST_LSA_SECRET 0xC000018A
1279 #define STATUS_NO_TRUST_SAM_ACCOUNT 0xC000018B
1280 #define STATUS_TRUSTED_DOMAIN_FAILURE 0xC000018C
1281 #define STATUS_TRUSTED_RELATIONSHIP_FAILURE 0xC000018D
1282 #define STATUS_EVENTLOG_FILE_CORRUPT 0xC000018E
1283 #define STATUS_EVENTLOG_CANT_START 0xC000018F
1284 #define STATUS_TRUST_FAILURE 0xC0000190
1285 #define STATUS_MUTANT_LIMIT_EXCEEDED 0xC0000191
1286 #define STATUS_NETLOGON_NOT_STARTED 0xC0000192
1287 #define STATUS_ACCOUNT_EXPIRED 0xC0000193
1288 #define STATUS_POSSIBLE_DEADLOCK 0xC0000194
1289 #define STATUS_NETWORK_CREDENTIAL_CONFLICT 0xC0000195
1290 #define STATUS_REMOTE_SESSION_LIMIT 0xC0000196
1291 #define STATUS_EVENTLOG_FILE_CHANGED 0xC0000197
1292 #define STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT 0xC0000198
1293 #define STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT 0xC0000199
1294 #define STATUS_NOLOGON_SERVER_TRUST_ACCOUNT 0xC000019A
1295 #define STATUS_DOMAIN_TRUST_INCONSISTENT 0xC000019B
1296 #define STATUS_FS_DRIVER_REQUIRED 0xC000019C
1298 #define STATUS_RESOURCE_LANG_NOT_FOUND 0xC0000204
1300 #define MAXIMUM_WAIT_OBJECTS 64
1301 #define MAXIMUM_SUSPEND_COUNT 127
1305 * Return values from the actual exception handlers
1308 #define ExceptionContinueExecution 0
1309 #define ExceptionContinueSearch 1
1310 #define ExceptionNestedException 2
1311 #define ExceptionCollidedUnwind 3
1314 * Return values from filters in except() and from UnhandledExceptionFilter
1317 #define EXCEPTION_EXECUTE_HANDLER 1
1318 #define EXCEPTION_CONTINUE_SEARCH 0
1319 #define EXCEPTION_CONTINUE_EXECUTION -1
1322 * From OS/2 2.0 exception handling
1323 * Win32 seems to use the same flags as ExceptionFlags in an EXCEPTION_RECORD
1326 #define EH_NONCONTINUABLE 0x01
1327 #define EH_UNWINDING 0x02
1328 #define EH_EXIT_UNWIND 0x04
1329 #define EH_STACK_INVALID 0x08
1330 #define EH_NESTED_CALL 0x10
1332 #define EXCEPTION_CONTINUABLE 0
1333 #define EXCEPTION_NONCONTINUABLE EH_NONCONTINUABLE
1336 * The exception record used by Win32 to give additional information
1337 * about exception to exception handlers.
1340 #define EXCEPTION_MAXIMUM_PARAMETERS 15
1342 typedef struct __EXCEPTION_RECORD
1344 DWORD ExceptionCode
;
1345 DWORD ExceptionFlags
;
1346 struct __EXCEPTION_RECORD
*ExceptionRecord
;
1348 LPVOID ExceptionAddress
;
1349 DWORD NumberParameters
;
1350 DWORD ExceptionInformation
[EXCEPTION_MAXIMUM_PARAMETERS
];
1351 } EXCEPTION_RECORD
, *PEXCEPTION_RECORD
;
1354 * The exception pointers structure passed to exception filters
1355 * in except() and the UnhandledExceptionFilter().
1358 typedef struct _EXCEPTION_POINTERS
1360 PEXCEPTION_RECORD ExceptionRecord
;
1361 PCONTEXT ContextRecord
;
1362 } EXCEPTION_POINTERS
, *PEXCEPTION_POINTERS
;
1366 * The exception frame, used for registering exception handlers
1367 * Win32 cares only about this, but compilers generally emit
1368 * larger exception frames for their own use.
1371 struct __EXCEPTION_FRAME
;
1373 typedef DWORD (*PEXCEPTION_HANDLER
)(PEXCEPTION_RECORD
,struct __EXCEPTION_FRAME
*,
1374 PCONTEXT
,struct __EXCEPTION_FRAME
**);
1376 typedef struct __EXCEPTION_FRAME
1378 struct __EXCEPTION_FRAME
*Prev
;
1379 PEXCEPTION_HANDLER Handler
;
1380 } EXCEPTION_FRAME
, *PEXCEPTION_FRAME
;
1382 #include "poppack.h"
1385 * function pointer to a exception filter
1388 typedef LONG
CALLBACK (*PTOP_LEVEL_EXCEPTION_FILTER
)(PEXCEPTION_POINTERS ExceptionInfo
);
1389 typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER
;
1391 DWORD WINAPI
UnhandledExceptionFilter( PEXCEPTION_POINTERS epointers
);
1392 LPTOP_LEVEL_EXCEPTION_FILTER
1393 WINAPI
SetUnhandledExceptionFilter( LPTOP_LEVEL_EXCEPTION_FILTER filter
);
1395 /* status values for ContinueDebugEvent */
1396 #define DBG_CONTINUE 0x00010002
1397 #define DBG_TERMINATE_THREAD 0x40010003
1398 #define DBG_TERMINATE_PROCESS 0x40010004
1399 #define DBG_CONTROL_C 0x40010005
1400 #define DBG_CONTROL_BREAK 0x40010008
1401 #define DBG_EXCEPTION_NOT_HANDLED 0x80010001
1403 typedef struct _NT_TIB
1405 struct _EXCEPTION_REGISTRATION_RECORD
*ExceptionList
;
1413 PVOID ArbitraryUserPointer
;
1414 struct _NT_TIB
*Self
;
1419 #if defined(__i386__) && defined(__GNUC__)
1420 extern inline struct _TEB WINAPI
*NtCurrentTeb(void);
1421 extern inline struct _TEB WINAPI
*NtCurrentTeb(void)
1424 __asm__(".byte 0x64\n\tmovl (0x18),%0" : "=r" (teb
));
1428 extern struct _TEB WINAPI
*NtCurrentTeb(void);
1433 * File formats definitions
1436 typedef struct _IMAGE_DOS_HEADER
{
1437 WORD e_magic
; /* 00: MZ Header signature */
1438 WORD e_cblp
; /* 02: Bytes on last page of file */
1439 WORD e_cp
; /* 04: Pages in file */
1440 WORD e_crlc
; /* 06: Relocations */
1441 WORD e_cparhdr
; /* 08: Size of header in paragraphs */
1442 WORD e_minalloc
; /* 0a: Minimum extra paragraphs needed */
1443 WORD e_maxalloc
; /* 0c: Maximum extra paragraphs needed */
1444 WORD e_ss
; /* 0e: Initial (relative) SS value */
1445 WORD e_sp
; /* 10: Initial SP value */
1446 WORD e_csum
; /* 12: Checksum */
1447 WORD e_ip
; /* 14: Initial IP value */
1448 WORD e_cs
; /* 16: Initial (relative) CS value */
1449 WORD e_lfarlc
; /* 18: File address of relocation table */
1450 WORD e_ovno
; /* 1a: Overlay number */
1451 WORD e_res
[4]; /* 1c: Reserved words */
1452 WORD e_oemid
; /* 24: OEM identifier (for e_oeminfo) */
1453 WORD e_oeminfo
; /* 26: OEM information; e_oemid specific */
1454 WORD e_res2
[10]; /* 28: Reserved words */
1455 DWORD e_lfanew
; /* 3c: Offset to extended header */
1456 } IMAGE_DOS_HEADER
, *PIMAGE_DOS_HEADER
;
1458 #define IMAGE_DOS_SIGNATURE 0x5A4D /* MZ */
1459 #define IMAGE_OS2_SIGNATURE 0x454E /* NE */
1460 #define IMAGE_OS2_SIGNATURE_LE 0x454C /* LE */
1461 #define IMAGE_OS2_SIGNATURE_LX 0x584C /* LX */
1462 #define IMAGE_VXD_SIGNATURE 0x454C /* LE */
1463 #define IMAGE_NT_SIGNATURE 0x00004550 /* PE00 */
1466 * This is the Windows executable (NE) header.
1467 * the name IMAGE_OS2_HEADER is misleading, but in the SDK this way.
1471 WORD ne_magic
; /* 00 NE signature 'NE' */
1472 BYTE ne_ver
; /* 02 Linker version number */
1473 BYTE ne_rev
; /* 03 Linker revision number */
1474 WORD ne_enttab
; /* 04 Offset to entry table relative to NE */
1475 WORD ne_cbenttab
; /* 06 Length of entry table in bytes */
1476 LONG ne_crc
; /* 08 Checksum */
1477 WORD ne_flags
; /* 0c Flags about segments in this file */
1478 WORD ne_autodata
; /* 0e Automatic data segment number */
1479 WORD ne_heap
; /* 10 Initial size of local heap */
1480 WORD ne_stack
; /* 12 Initial size of stack */
1481 DWORD ne_csip
; /* 14 Initial CS:IP */
1482 DWORD ne_sssp
; /* 18 Initial SS:SP */
1483 WORD ne_cseg
; /* 1c # of entries in segment table */
1484 WORD ne_cmod
; /* 1e # of entries in module reference tab. */
1485 WORD ne_cbnrestab
; /* 20 Length of nonresident-name table */
1486 WORD ne_segtab
; /* 22 Offset to segment table */
1487 WORD ne_rsrctab
; /* 24 Offset to resource table */
1488 WORD ne_restab
; /* 26 Offset to resident-name table */
1489 WORD ne_modtab
; /* 28 Offset to module reference table */
1490 WORD ne_imptab
; /* 2a Offset to imported name table */
1491 DWORD ne_nrestab
; /* 2c Offset to nonresident-name table */
1492 WORD ne_cmovent
; /* 30 # of movable entry points */
1493 WORD ne_align
; /* 32 Logical sector alignment shift count */
1494 WORD ne_cres
; /* 34 # of resource segments */
1495 BYTE ne_exetyp
; /* 36 Flags indicating target OS */
1496 BYTE ne_flagsothers
; /* 37 Additional information flags */
1497 WORD fastload_offset
; /* 38 Offset to fast load area (should be ne_pretthunks)*/
1498 WORD fastload_length
; /* 3a Length of fast load area (should be ne_psegrefbytes) */
1499 WORD ne_swaparea
; /* 3c Reserved by Microsoft */
1500 WORD ne_expver
; /* 3e Expected Windows version number */
1501 } IMAGE_OS2_HEADER
,*PIMAGE_OS2_HEADER
;
1503 typedef struct _IMAGE_VXD_HEADER
{
1518 DWORD e32_lastpagesize
;
1519 DWORD e32_fixupsize
;
1536 DWORD e32_impmodcnt
;
1542 DWORD e32_cbnrestab
;
1545 DWORD e32_debuginfo
;
1547 DWORD e32_instpreload
;
1548 DWORD e32_instdemand
;
1551 DWORD e32_winresoff
;
1552 DWORD e32_winreslen
;
1555 } IMAGE_VXD_HEADER
, *PIMAGE_VXD_HEADER
;
1558 /* These defines describe the meanings of the bits in the Characteristics
1561 #define IMAGE_FILE_RELOCS_STRIPPED 0x0001 /* No relocation info */
1562 #define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002
1563 #define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004
1564 #define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008
1565 #define IMAGE_FILE_16BIT_MACHINE 0x0040
1566 #define IMAGE_FILE_BYTES_REVERSED_LO 0x0080
1567 #define IMAGE_FILE_32BIT_MACHINE 0x0100
1568 #define IMAGE_FILE_DEBUG_STRIPPED 0x0200
1569 #define IMAGE_FILE_SYSTEM 0x1000
1570 #define IMAGE_FILE_DLL 0x2000
1571 #define IMAGE_FILE_BYTES_REVERSED_HI 0x8000
1573 /* These are the settings of the Machine field. */
1574 #define IMAGE_FILE_MACHINE_UNKNOWN 0
1575 #define IMAGE_FILE_MACHINE_I860 0x14d
1576 #define IMAGE_FILE_MACHINE_I386 0x14c
1577 #define IMAGE_FILE_MACHINE_R3000 0x162
1578 #define IMAGE_FILE_MACHINE_R4000 0x166
1579 #define IMAGE_FILE_MACHINE_R10000 0x168
1580 #define IMAGE_FILE_MACHINE_ALPHA 0x184
1581 #define IMAGE_FILE_MACHINE_POWERPC 0x1F0
1583 #define IMAGE_SIZEOF_FILE_HEADER 20
1585 /* Possible Magic values */
1586 #define IMAGE_NT_OPTIONAL_HDR_MAGIC 0x10b
1587 #define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
1589 /* These are indexes into the DataDirectory array */
1590 #define IMAGE_FILE_EXPORT_DIRECTORY 0
1591 #define IMAGE_FILE_IMPORT_DIRECTORY 1
1592 #define IMAGE_FILE_RESOURCE_DIRECTORY 2
1593 #define IMAGE_FILE_EXCEPTION_DIRECTORY 3
1594 #define IMAGE_FILE_SECURITY_DIRECTORY 4
1595 #define IMAGE_FILE_BASE_RELOCATION_TABLE 5
1596 #define IMAGE_FILE_DEBUG_DIRECTORY 6
1597 #define IMAGE_FILE_DESCRIPTION_STRING 7
1598 #define IMAGE_FILE_MACHINE_VALUE 8 /* Mips */
1599 #define IMAGE_FILE_THREAD_LOCAL_STORAGE 9
1600 #define IMAGE_FILE_CALLBACK_DIRECTORY 10
1602 /* Directory Entries, indices into the DataDirectory array */
1604 #define IMAGE_DIRECTORY_ENTRY_EXPORT 0
1605 #define IMAGE_DIRECTORY_ENTRY_IMPORT 1
1606 #define IMAGE_DIRECTORY_ENTRY_RESOURCE 2
1607 #define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3
1608 #define IMAGE_DIRECTORY_ENTRY_SECURITY 4
1609 #define IMAGE_DIRECTORY_ENTRY_BASERELOC 5
1610 #define IMAGE_DIRECTORY_ENTRY_DEBUG 6
1611 #define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7
1612 #define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 /* (MIPS GP) */
1613 #define IMAGE_DIRECTORY_ENTRY_TLS 9
1614 #define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10
1615 #define IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT 11
1616 #define IMAGE_DIRECTORY_ENTRY_IAT 12 /* Import Address Table */
1617 #define IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT 13
1618 #define IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR 14
1620 /* Subsystem Values */
1622 #define IMAGE_SUBSYSTEM_UNKNOWN 0
1623 #define IMAGE_SUBSYSTEM_NATIVE 1
1624 #define IMAGE_SUBSYSTEM_WINDOWS_GUI 2 /* Windows GUI subsystem */
1625 #define IMAGE_SUBSYSTEM_WINDOWS_CUI 3 /* Windows character subsystem*/
1626 #define IMAGE_SUBSYSTEM_OS2_CUI 5
1627 #define IMAGE_SUBSYSTEM_POSIX_CUI 7
1629 typedef struct _IMAGE_FILE_HEADER
{
1631 WORD NumberOfSections
;
1632 DWORD TimeDateStamp
;
1633 DWORD PointerToSymbolTable
;
1634 DWORD NumberOfSymbols
;
1635 WORD SizeOfOptionalHeader
;
1636 WORD Characteristics
;
1637 } IMAGE_FILE_HEADER
, *PIMAGE_FILE_HEADER
;
1639 typedef struct _IMAGE_DATA_DIRECTORY
{
1640 DWORD VirtualAddress
;
1642 } IMAGE_DATA_DIRECTORY
, *PIMAGE_DATA_DIRECTORY
;
1644 #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
1646 typedef struct _IMAGE_OPTIONAL_HEADER
{
1648 /* Standard fields */
1651 BYTE MajorLinkerVersion
;
1652 BYTE MinorLinkerVersion
;
1654 DWORD SizeOfInitializedData
;
1655 DWORD SizeOfUninitializedData
;
1656 DWORD AddressOfEntryPoint
;
1660 /* NT additional fields */
1663 DWORD SectionAlignment
;
1664 DWORD FileAlignment
;
1665 WORD MajorOperatingSystemVersion
;
1666 WORD MinorOperatingSystemVersion
;
1667 WORD MajorImageVersion
;
1668 WORD MinorImageVersion
;
1669 WORD MajorSubsystemVersion
;
1670 WORD MinorSubsystemVersion
;
1671 DWORD Win32VersionValue
;
1673 DWORD SizeOfHeaders
;
1676 WORD DllCharacteristics
;
1677 DWORD SizeOfStackReserve
;
1678 DWORD SizeOfStackCommit
;
1679 DWORD SizeOfHeapReserve
;
1680 DWORD SizeOfHeapCommit
;
1682 DWORD NumberOfRvaAndSizes
;
1683 IMAGE_DATA_DIRECTORY DataDirectory
[IMAGE_NUMBEROF_DIRECTORY_ENTRIES
];
1684 } IMAGE_OPTIONAL_HEADER
, *PIMAGE_OPTIONAL_HEADER
;
1686 typedef struct _IMAGE_NT_HEADERS
{
1688 IMAGE_FILE_HEADER FileHeader
;
1689 IMAGE_OPTIONAL_HEADER OptionalHeader
;
1690 } IMAGE_NT_HEADERS
, *PIMAGE_NT_HEADERS
;
1692 #define IMAGE_SIZEOF_SHORT_NAME 8
1694 typedef struct _IMAGE_SECTION_HEADER
{
1695 BYTE Name
[IMAGE_SIZEOF_SHORT_NAME
];
1697 DWORD PhysicalAddress
;
1700 DWORD VirtualAddress
;
1701 DWORD SizeOfRawData
;
1702 DWORD PointerToRawData
;
1703 DWORD PointerToRelocations
;
1704 DWORD PointerToLinenumbers
;
1705 WORD NumberOfRelocations
;
1706 WORD NumberOfLinenumbers
;
1707 DWORD Characteristics
;
1708 } IMAGE_SECTION_HEADER
, *PIMAGE_SECTION_HEADER
;
1710 #define IMAGE_SIZEOF_SECTION_HEADER 40
1712 #define IMAGE_FIRST_SECTION(ntheader) \
1713 ((PIMAGE_SECTION_HEADER)((LPBYTE)&((PIMAGE_NT_HEADERS)(ntheader))->OptionalHeader + \
1714 ((PIMAGE_NT_HEADERS)(ntheader))->FileHeader.SizeOfOptionalHeader))
1716 /* These defines are for the Characteristics bitfield. */
1717 /* #define IMAGE_SCN_TYPE_REG 0x00000000 - Reserved */
1718 /* #define IMAGE_SCN_TYPE_DSECT 0x00000001 - Reserved */
1719 /* #define IMAGE_SCN_TYPE_NOLOAD 0x00000002 - Reserved */
1720 /* #define IMAGE_SCN_TYPE_GROUP 0x00000004 - Reserved */
1721 /* #define IMAGE_SCN_TYPE_NO_PAD 0x00000008 - Reserved */
1722 /* #define IMAGE_SCN_TYPE_COPY 0x00000010 - Reserved */
1724 #define IMAGE_SCN_CNT_CODE 0x00000020
1725 #define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040
1726 #define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080
1728 #define IMAGE_SCN_LNK_OTHER 0x00000100
1729 #define IMAGE_SCN_LNK_INFO 0x00000200
1730 /* #define IMAGE_SCN_TYPE_OVER 0x00000400 - Reserved */
1731 #define IMAGE_SCN_LNK_REMOVE 0x00000800
1732 #define IMAGE_SCN_LNK_COMDAT 0x00001000
1734 /* 0x00002000 - Reserved */
1735 /* #define IMAGE_SCN_MEM_PROTECTED 0x00004000 - Obsolete */
1736 #define IMAGE_SCN_MEM_FARDATA 0x00008000
1738 /* #define IMAGE_SCN_MEM_SYSHEAP 0x00010000 - Obsolete */
1739 #define IMAGE_SCN_MEM_PURGEABLE 0x00020000
1740 #define IMAGE_SCN_MEM_16BIT 0x00020000
1741 #define IMAGE_SCN_MEM_LOCKED 0x00040000
1742 #define IMAGE_SCN_MEM_PRELOAD 0x00080000
1744 #define IMAGE_SCN_ALIGN_1BYTES 0x00100000
1745 #define IMAGE_SCN_ALIGN_2BYTES 0x00200000
1746 #define IMAGE_SCN_ALIGN_4BYTES 0x00300000
1747 #define IMAGE_SCN_ALIGN_8BYTES 0x00400000
1748 #define IMAGE_SCN_ALIGN_16BYTES 0x00500000 /* Default */
1749 #define IMAGE_SCN_ALIGN_32BYTES 0x00600000
1750 #define IMAGE_SCN_ALIGN_64BYTES 0x00700000
1751 /* 0x00800000 - Unused */
1753 #define IMAGE_SCN_LNK_NRELOC_OVFL 0x01000000
1756 #define IMAGE_SCN_MEM_DISCARDABLE 0x02000000
1757 #define IMAGE_SCN_MEM_NOT_CACHED 0x04000000
1758 #define IMAGE_SCN_MEM_NOT_PAGED 0x08000000
1759 #define IMAGE_SCN_MEM_SHARED 0x10000000
1760 #define IMAGE_SCN_MEM_EXECUTE 0x20000000
1761 #define IMAGE_SCN_MEM_READ 0x40000000
1762 #define IMAGE_SCN_MEM_WRITE 0x80000000
1764 #include "pshpack2.h"
1766 typedef struct _IMAGE_SYMBOL
{
1776 SHORT SectionNumber
;
1779 BYTE NumberOfAuxSymbols
;
1781 typedef IMAGE_SYMBOL
*PIMAGE_SYMBOL
;
1783 #define IMAGE_SIZEOF_SYMBOL 18
1785 typedef struct _IMAGE_LINENUMBER
{
1787 DWORD SymbolTableIndex
;
1788 DWORD VirtualAddress
;
1792 typedef IMAGE_LINENUMBER
*PIMAGE_LINENUMBER
;
1794 #define IMAGE_SIZEOF_LINENUMBER 6
1796 typedef union _IMAGE_AUX_SYMBOL
{
1808 DWORD PointerToLinenumber
;
1809 DWORD PointerToNextFunction
;
1818 BYTE Name
[IMAGE_SIZEOF_SYMBOL
];
1822 WORD NumberOfRelocations
;
1823 WORD NumberOfLinenumbers
;
1829 typedef IMAGE_AUX_SYMBOL
*PIMAGE_AUX_SYMBOL
;
1831 #define IMAGE_SIZEOF_AUX_SYMBOL 18
1833 #include "poppack.h"
1835 #define IMAGE_SYM_UNDEFINED (SHORT)0
1836 #define IMAGE_SYM_ABSOLUTE (SHORT)-1
1837 #define IMAGE_SYM_DEBUG (SHORT)-2
1839 #define IMAGE_SYM_TYPE_NULL 0x0000
1840 #define IMAGE_SYM_TYPE_VOID 0x0001
1841 #define IMAGE_SYM_TYPE_CHAR 0x0002
1842 #define IMAGE_SYM_TYPE_SHORT 0x0003
1843 #define IMAGE_SYM_TYPE_INT 0x0004
1844 #define IMAGE_SYM_TYPE_LONG 0x0005
1845 #define IMAGE_SYM_TYPE_FLOAT 0x0006
1846 #define IMAGE_SYM_TYPE_DOUBLE 0x0007
1847 #define IMAGE_SYM_TYPE_STRUCT 0x0008
1848 #define IMAGE_SYM_TYPE_UNION 0x0009
1849 #define IMAGE_SYM_TYPE_ENUM 0x000A
1850 #define IMAGE_SYM_TYPE_MOE 0x000B
1851 #define IMAGE_SYM_TYPE_BYTE 0x000C
1852 #define IMAGE_SYM_TYPE_WORD 0x000D
1853 #define IMAGE_SYM_TYPE_UINT 0x000E
1854 #define IMAGE_SYM_TYPE_DWORD 0x000F
1855 #define IMAGE_SYM_TYPE_PCODE 0x8000
1857 #define IMAGE_SYM_DTYPE_NULL 0
1858 #define IMAGE_SYM_DTYPE_POINTER 1
1859 #define IMAGE_SYM_DTYPE_FUNCTION 2
1860 #define IMAGE_SYM_DTYPE_ARRAY 3
1862 #define IMAGE_SYM_CLASS_END_OF_FUNCTION (BYTE )-1
1863 #define IMAGE_SYM_CLASS_NULL 0x0000
1864 #define IMAGE_SYM_CLASS_AUTOMATIC 0x0001
1865 #define IMAGE_SYM_CLASS_EXTERNAL 0x0002
1866 #define IMAGE_SYM_CLASS_STATIC 0x0003
1867 #define IMAGE_SYM_CLASS_REGISTER 0x0004
1868 #define IMAGE_SYM_CLASS_EXTERNAL_DEF 0x0005
1869 #define IMAGE_SYM_CLASS_LABEL 0x0006
1870 #define IMAGE_SYM_CLASS_UNDEFINED_LABEL 0x0007
1871 #define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 0x0008
1872 #define IMAGE_SYM_CLASS_ARGUMENT 0x0009
1873 #define IMAGE_SYM_CLASS_STRUCT_TAG 0x000A
1874 #define IMAGE_SYM_CLASS_MEMBER_OF_UNION 0x000B
1875 #define IMAGE_SYM_CLASS_UNION_TAG 0x000C
1876 #define IMAGE_SYM_CLASS_TYPE_DEFINITION 0x000D
1877 #define IMAGE_SYM_CLASS_UNDEFINED_STATIC 0x000E
1878 #define IMAGE_SYM_CLASS_ENUM_TAG 0x000F
1879 #define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 0x0010
1880 #define IMAGE_SYM_CLASS_REGISTER_PARAM 0x0011
1881 #define IMAGE_SYM_CLASS_BIT_FIELD 0x0012
1883 #define IMAGE_SYM_CLASS_FAR_EXTERNAL 0x0044
1884 #define IMAGE_SYM_CLASS_BLOCK 0x0064
1885 #define IMAGE_SYM_CLASS_FUNCTION 0x0065
1886 #define IMAGE_SYM_CLASS_END_OF_STRUCT 0x0066
1887 #define IMAGE_SYM_CLASS_FILE 0x0067
1888 #define IMAGE_SYM_CLASS_SECTION 0x0068
1889 #define IMAGE_SYM_CLASS_WEAK_EXTERNAL 0x0069
1891 #define N_BTMASK 0x000F
1892 #define N_TMASK 0x0030
1893 #define N_TMASK1 0x00C0
1894 #define N_TMASK2 0x00F0
1898 #define BTYPE(x) ((x) & N_BTMASK)
1901 #define ISPTR(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT))
1905 #define ISFCN(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_FUNCTION << N_BTSHFT))
1909 #define ISARY(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_ARRAY << N_BTSHFT))
1913 #define ISTAG(x) ((x)==IMAGE_SYM_CLASS_STRUCT_TAG || (x)==IMAGE_SYM_CLASS_UNION_TAG || (x)==IMAGE_SYM_CLASS_ENUM_TAG)
1917 #define INCREF(x) ((((x)&~N_BTMASK)<<N_TSHIFT)|(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT)|((x)&N_BTMASK))
1920 #define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
1923 #define IMAGE_COMDAT_SELECT_NODUPLICATES 1
1924 #define IMAGE_COMDAT_SELECT_ANY 2
1925 #define IMAGE_COMDAT_SELECT_SAME_SIZE 3
1926 #define IMAGE_COMDAT_SELECT_EXACT_MATCH 4
1927 #define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
1928 #define IMAGE_COMDAT_SELECT_LARGEST 6
1929 #define IMAGE_COMDAT_SELECT_NEWEST 7
1931 #define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
1932 #define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
1933 #define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
1935 /* Export module directory */
1937 typedef struct _IMAGE_EXPORT_DIRECTORY
{
1938 DWORD Characteristics
;
1939 DWORD TimeDateStamp
;
1944 DWORD NumberOfFunctions
;
1945 DWORD NumberOfNames
;
1946 DWORD AddressOfFunctions
;
1947 DWORD AddressOfNames
;
1948 DWORD AddressOfNameOrdinals
;
1949 } IMAGE_EXPORT_DIRECTORY
,*PIMAGE_EXPORT_DIRECTORY
;
1951 /* Import name entry */
1952 typedef struct _IMAGE_IMPORT_BY_NAME
{
1955 } IMAGE_IMPORT_BY_NAME
,*PIMAGE_IMPORT_BY_NAME
;
1958 typedef struct _IMAGE_THUNK_DATA
{
1960 LPBYTE ForwarderString
;
1963 PIMAGE_IMPORT_BY_NAME AddressOfData
;
1965 } IMAGE_THUNK_DATA
,*PIMAGE_THUNK_DATA
;
1967 /* Import module directory */
1969 typedef struct _IMAGE_IMPORT_DESCRIPTOR
{
1971 DWORD Characteristics
; /* 0 for terminating null import descriptor */
1972 PIMAGE_THUNK_DATA OriginalFirstThunk
; /* RVA to original unbound IAT */
1974 DWORD TimeDateStamp
; /* 0 if not bound,
1975 * -1 if bound, and real date\time stamp
1976 * in IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT
1978 * otherwise date/time stamp of DLL bound to
1981 DWORD ForwarderChain
; /* -1 if no forwarders */
1983 /* RVA to IAT (if bound this IAT has actual addresses) */
1984 PIMAGE_THUNK_DATA FirstThunk
;
1985 } IMAGE_IMPORT_DESCRIPTOR
,*PIMAGE_IMPORT_DESCRIPTOR
;
1987 #define IMAGE_ORDINAL_FLAG 0x80000000
1988 #define IMAGE_SNAP_BY_ORDINAL(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG) != 0)
1989 #define IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff)
1991 typedef struct _IMAGE_BOUND_IMPORT_DESCRIPTOR
1993 DWORD TimeDateStamp
;
1994 WORD OffsetModuleName
;
1995 WORD NumberOfModuleForwarderRefs
;
1996 /* Array of zero or more IMAGE_BOUND_FORWARDER_REF follows */
1997 } IMAGE_BOUND_IMPORT_DESCRIPTOR
, *PIMAGE_BOUND_IMPORT_DESCRIPTOR
;
1999 typedef struct _IMAGE_BOUND_FORWARDER_REF
2001 DWORD TimeDateStamp
;
2002 WORD OffsetModuleName
;
2004 } IMAGE_BOUND_FORWARDER_REF
, *PIMAGE_BOUND_FORWARDER_REF
;
2006 typedef struct _IMAGE_BASE_RELOCATION
2008 DWORD VirtualAddress
;
2011 } IMAGE_BASE_RELOCATION
,*PIMAGE_BASE_RELOCATION
;
2013 typedef struct _IMAGE_RELOCATION
2016 DWORD VirtualAddress
;
2019 DWORD SymbolTableIndex
;
2022 typedef IMAGE_RELOCATION
*PIMAGE_RELOCATION
;
2024 #define IMAGE_SIZEOF_RELOCATION 10
2026 /* generic relocation types */
2027 #define IMAGE_REL_BASED_ABSOLUTE 0
2028 #define IMAGE_REL_BASED_HIGH 1
2029 #define IMAGE_REL_BASED_LOW 2
2030 #define IMAGE_REL_BASED_HIGHLOW 3
2031 #define IMAGE_REL_BASED_HIGHADJ 4
2032 #define IMAGE_REL_BASED_MIPS_JMPADDR 5
2033 #define IMAGE_REL_BASED_SECTION 6
2034 #define IMAGE_REL_BASED_REL 7
2035 #define IMAGE_REL_BASED_MIPS_JMPADDR16 9
2036 #define IMAGE_REL_BASED_IA64_IMM64 9 /* yes, 9 too */
2037 #define IMAGE_REL_BASED_DIR64 10
2038 #define IMAGE_REL_BASED_HIGH3ADJ 11
2040 /* I386 relocation types */
2041 #define IMAGE_REL_I386_ABSOLUTE 0
2042 #define IMAGE_REL_I386_DIR16 1
2043 #define IMAGE_REL_I386_REL16 2
2044 #define IMAGE_REL_I386_DIR32 6
2045 #define IMAGE_REL_I386_DIR32NB 7
2046 #define IMAGE_REL_I386_SEG12 9
2047 #define IMAGE_REL_I386_SECTION 10
2048 #define IMAGE_REL_I386_SECREL 11
2049 #define IMAGE_REL_I386_REL32 20
2051 /* MIPS relocation types */
2052 #define IMAGE_REL_MIPS_ABSOLUTE 0x0000
2053 #define IMAGE_REL_MIPS_REFHALF 0x0001
2054 #define IMAGE_REL_MIPS_REFWORD 0x0002
2055 #define IMAGE_REL_MIPS_JMPADDR 0x0003
2056 #define IMAGE_REL_MIPS_REFHI 0x0004
2057 #define IMAGE_REL_MIPS_REFLO 0x0005
2058 #define IMAGE_REL_MIPS_GPREL 0x0006
2059 #define IMAGE_REL_MIPS_LITERAL 0x0007
2060 #define IMAGE_REL_MIPS_SECTION 0x000A
2061 #define IMAGE_REL_MIPS_SECREL 0x000B
2062 #define IMAGE_REL_MIPS_SECRELLO 0x000C
2063 #define IMAGE_REL_MIPS_SECRELHI 0x000D
2064 #define IMAGE_REL_MIPS_JMPADDR16 0x0010
2065 #define IMAGE_REL_MIPS_REFWORDNB 0x0022
2066 #define IMAGE_REL_MIPS_PAIR 0x0025
2068 /* ALPHA relocation types */
2069 #define IMAGE_REL_ALPHA_ABSOLUTE 0x0000
2070 #define IMAGE_REL_ALPHA_REFLONG 0x0001
2071 #define IMAGE_REL_ALPHA_REFQUAD 0x0002
2072 #define IMAGE_REL_ALPHA_GPREL 0x0003
2073 #define IMAGE_REL_ALPHA_LITERAL 0x0004
2074 #define IMAGE_REL_ALPHA_LITUSE 0x0005
2075 #define IMAGE_REL_ALPHA_GPDISP 0x0006
2076 #define IMAGE_REL_ALPHA_BRADDR 0x0007
2077 #define IMAGE_REL_ALPHA_HINT 0x0008
2078 #define IMAGE_REL_ALPHA_INLINE_REFLONG 0x0009
2079 #define IMAGE_REL_ALPHA_REFHI 0x000A
2080 #define IMAGE_REL_ALPHA_REFLO 0x000B
2081 #define IMAGE_REL_ALPHA_PAIR 0x000C
2082 #define IMAGE_REL_ALPHA_MATCH 0x000D
2083 #define IMAGE_REL_ALPHA_SECTION 0x000E
2084 #define IMAGE_REL_ALPHA_SECREL 0x000F
2085 #define IMAGE_REL_ALPHA_REFLONGNB 0x0010
2086 #define IMAGE_REL_ALPHA_SECRELLO 0x0011
2087 #define IMAGE_REL_ALPHA_SECRELHI 0x0012
2088 #define IMAGE_REL_ALPHA_REFQ3 0x0013
2089 #define IMAGE_REL_ALPHA_REFQ2 0x0014
2090 #define IMAGE_REL_ALPHA_REFQ1 0x0015
2091 #define IMAGE_REL_ALPHA_GPRELLO 0x0016
2092 #define IMAGE_REL_ALPHA_GPRELHI 0x0017
2094 /* PowerPC relocation types */
2095 #define IMAGE_REL_PPC_ABSOLUTE 0x0000
2096 #define IMAGE_REL_PPC_ADDR64 0x0001
2097 #define IMAGE_REL_PPC_ADDR 0x0002
2098 #define IMAGE_REL_PPC_ADDR24 0x0003
2099 #define IMAGE_REL_PPC_ADDR16 0x0004
2100 #define IMAGE_REL_PPC_ADDR14 0x0005
2101 #define IMAGE_REL_PPC_REL24 0x0006
2102 #define IMAGE_REL_PPC_REL14 0x0007
2103 #define IMAGE_REL_PPC_TOCREL16 0x0008
2104 #define IMAGE_REL_PPC_TOCREL14 0x0009
2105 #define IMAGE_REL_PPC_ADDR32NB 0x000A
2106 #define IMAGE_REL_PPC_SECREL 0x000B
2107 #define IMAGE_REL_PPC_SECTION 0x000C
2108 #define IMAGE_REL_PPC_IFGLUE 0x000D
2109 #define IMAGE_REL_PPC_IMGLUE 0x000E
2110 #define IMAGE_REL_PPC_SECREL16 0x000F
2111 #define IMAGE_REL_PPC_REFHI 0x0010
2112 #define IMAGE_REL_PPC_REFLO 0x0011
2113 #define IMAGE_REL_PPC_PAIR 0x0012
2114 #define IMAGE_REL_PPC_SECRELLO 0x0013
2115 #define IMAGE_REL_PPC_SECRELHI 0x0014
2116 #define IMAGE_REL_PPC_GPREL 0x0015
2117 #define IMAGE_REL_PPC_TYPEMASK 0x00FF
2119 #define IMAGE_REL_PPC_NEG 0x0100
2120 #define IMAGE_REL_PPC_BRTAKEN 0x0200
2121 #define IMAGE_REL_PPC_BRNTAKEN 0x0400
2122 #define IMAGE_REL_PPC_TOCDEFN 0x0800
2124 /* SH3 ? relocation type */
2125 #define IMAGE_REL_SH3_ABSOLUTE 0x0000
2126 #define IMAGE_REL_SH3_DIRECT16 0x0001
2127 #define IMAGE_REL_SH3_DIRECT 0x0002
2128 #define IMAGE_REL_SH3_DIRECT8 0x0003
2129 #define IMAGE_REL_SH3_DIRECT8_WORD 0x0004
2130 #define IMAGE_REL_SH3_DIRECT8_LONG 0x0005
2131 #define IMAGE_REL_SH3_DIRECT4 0x0006
2132 #define IMAGE_REL_SH3_DIRECT4_WORD 0x0007
2133 #define IMAGE_REL_SH3_DIRECT4_LONG 0x0008
2134 #define IMAGE_REL_SH3_PCREL8_WORD 0x0009
2135 #define IMAGE_REL_SH3_PCREL8_LONG 0x000A
2136 #define IMAGE_REL_SH3_PCREL12_WORD 0x000B
2137 #define IMAGE_REL_SH3_STARTOF_SECTION 0x000C
2138 #define IMAGE_REL_SH3_SIZEOF_SECTION 0x000D
2139 #define IMAGE_REL_SH3_SECTION 0x000E
2140 #define IMAGE_REL_SH3_SECREL 0x000F
2141 #define IMAGE_REL_SH3_DIRECT32_NB 0x0010
2143 /* ARM (Archimedes?) relocation types */
2144 #define IMAGE_REL_ARM_ABSOLUTE 0x0000
2145 #define IMAGE_REL_ARM_ADDR 0x0001
2146 #define IMAGE_REL_ARM_ADDR32NB 0x0002
2147 #define IMAGE_REL_ARM_BRANCH24 0x0003
2148 #define IMAGE_REL_ARM_BRANCH11 0x0004
2149 #define IMAGE_REL_ARM_SECTION 0x000E
2150 #define IMAGE_REL_ARM_SECREL 0x000F
2152 /* IA64 relocation types */
2153 #define IMAGE_REL_IA64_ABSOLUTE 0x0000
2154 #define IMAGE_REL_IA64_IMM14 0x0001
2155 #define IMAGE_REL_IA64_IMM22 0x0002
2156 #define IMAGE_REL_IA64_IMM64 0x0003
2157 #define IMAGE_REL_IA64_DIR 0x0004
2158 #define IMAGE_REL_IA64_DIR64 0x0005
2159 #define IMAGE_REL_IA64_PCREL21B 0x0006
2160 #define IMAGE_REL_IA64_PCREL21M 0x0007
2161 #define IMAGE_REL_IA64_PCREL21F 0x0008
2162 #define IMAGE_REL_IA64_GPREL22 0x0009
2163 #define IMAGE_REL_IA64_LTOFF22 0x000A
2164 #define IMAGE_REL_IA64_SECTION 0x000B
2165 #define IMAGE_REL_IA64_SECREL22 0x000C
2166 #define IMAGE_REL_IA64_SECREL64I 0x000D
2167 #define IMAGE_REL_IA64_SECREL 0x000E
2168 #define IMAGE_REL_IA64_LTOFF64 0x000F
2169 #define IMAGE_REL_IA64_DIR32NB 0x0010
2170 #define IMAGE_REL_IA64_RESERVED_11 0x0011
2171 #define IMAGE_REL_IA64_RESERVED_12 0x0012
2172 #define IMAGE_REL_IA64_RESERVED_13 0x0013
2173 #define IMAGE_REL_IA64_RESERVED_14 0x0014
2174 #define IMAGE_REL_IA64_RESERVED_15 0x0015
2175 #define IMAGE_REL_IA64_RESERVED_16 0x0016
2176 #define IMAGE_REL_IA64_ADDEND 0x001F
2178 /* archive format */
2180 #define IMAGE_ARCHIVE_START_SIZE 8
2181 #define IMAGE_ARCHIVE_START "!<arch>\n"
2182 #define IMAGE_ARCHIVE_END "`\n"
2183 #define IMAGE_ARCHIVE_PAD "\n"
2184 #define IMAGE_ARCHIVE_LINKER_MEMBER "/ "
2185 #define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
2187 typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER
2196 } IMAGE_ARCHIVE_MEMBER_HEADER
, *PIMAGE_ARCHIVE_MEMBER_HEADER
;
2198 #define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
2201 * Resource directory stuff
2203 typedef struct _IMAGE_RESOURCE_DIRECTORY
{
2204 DWORD Characteristics
;
2205 DWORD TimeDateStamp
;
2208 WORD NumberOfNamedEntries
;
2209 WORD NumberOfIdEntries
;
2210 /* IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[]; */
2211 } IMAGE_RESOURCE_DIRECTORY
,*PIMAGE_RESOURCE_DIRECTORY
;
2213 #define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000
2214 #define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000
2216 typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY
{
2219 unsigned NameOffset
:31;
2220 unsigned NameIsString
:1;
2228 unsigned OffsetToDirectory
:31;
2229 unsigned DataIsDirectory
:1;
2232 } IMAGE_RESOURCE_DIRECTORY_ENTRY
,*PIMAGE_RESOURCE_DIRECTORY_ENTRY
;
2235 typedef struct _IMAGE_RESOURCE_DIRECTORY_STRING
{
2237 CHAR NameString
[ 1 ];
2238 } IMAGE_RESOURCE_DIRECTORY_STRING
,*PIMAGE_RESOURCE_DIRECTORY_STRING
;
2240 typedef struct _IMAGE_RESOURCE_DIR_STRING_U
{
2242 WCHAR NameString
[ 1 ];
2243 } IMAGE_RESOURCE_DIR_STRING_U
,*PIMAGE_RESOURCE_DIR_STRING_U
;
2245 typedef struct _IMAGE_RESOURCE_DATA_ENTRY
{
2249 DWORD ResourceHandle
;
2250 } IMAGE_RESOURCE_DATA_ENTRY
,*PIMAGE_RESOURCE_DATA_ENTRY
;
2253 typedef VOID
CALLBACK (*PIMAGE_TLS_CALLBACK
)(
2254 LPVOID DllHandle
,DWORD Reason
,LPVOID Reserved
2257 typedef struct _IMAGE_TLS_DIRECTORY
{
2258 DWORD StartAddressOfRawData
;
2259 DWORD EndAddressOfRawData
;
2260 LPDWORD AddressOfIndex
;
2261 PIMAGE_TLS_CALLBACK
*AddressOfCallBacks
;
2262 DWORD SizeOfZeroFill
;
2263 DWORD Characteristics
;
2264 } IMAGE_TLS_DIRECTORY
,*PIMAGE_TLS_DIRECTORY
;
2266 typedef struct _IMAGE_DEBUG_DIRECTORY
{
2267 DWORD Characteristics
;
2268 DWORD TimeDateStamp
;
2273 DWORD AddressOfRawData
;
2274 DWORD PointerToRawData
;
2275 } IMAGE_DEBUG_DIRECTORY
, *PIMAGE_DEBUG_DIRECTORY
;
2277 #define IMAGE_DEBUG_TYPE_UNKNOWN 0
2278 #define IMAGE_DEBUG_TYPE_COFF 1
2279 #define IMAGE_DEBUG_TYPE_CODEVIEW 2
2280 #define IMAGE_DEBUG_TYPE_FPO 3
2281 #define IMAGE_DEBUG_TYPE_MISC 4
2282 #define IMAGE_DEBUG_TYPE_EXCEPTION 5
2283 #define IMAGE_DEBUG_TYPE_FIXUP 6
2284 #define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7
2285 #define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8
2286 #define IMAGE_DEBUG_TYPE_BORLAND 9
2287 #define IMAGE_DEBUG_TYPE_RESERVED10 10
2289 typedef struct _IMAGE_COFF_SYMBOLS_HEADER
{
2290 DWORD NumberOfSymbols
;
2291 DWORD LvaToFirstSymbol
;
2292 DWORD NumberOfLinenumbers
;
2293 DWORD LvaToFirstLinenumber
;
2294 DWORD RvaToFirstByteOfCode
;
2295 DWORD RvaToLastByteOfCode
;
2296 DWORD RvaToFirstByteOfData
;
2297 DWORD RvaToLastByteOfData
;
2298 } IMAGE_COFF_SYMBOLS_HEADER
, *PIMAGE_COFF_SYMBOLS_HEADER
;
2301 #define FRAME_TRAP 1
2303 #define FRAME_NONFPO 3
2305 typedef struct _FPO_DATA
{
2310 unsigned cbProlog
: 8;
2311 unsigned cbRegs
: 3;
2312 unsigned fHasSEH
: 1;
2313 unsigned fUseBP
: 1;
2314 unsigned reserved
: 1;
2315 unsigned cbFrame
: 2;
2316 } FPO_DATA
, *PFPO_DATA
;
2318 typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY
{
2319 DWORD Characteristics
;
2320 DWORD TimeDateStamp
;
2323 DWORD GlobalFlagsClear
;
2324 DWORD GlobalFlagsSet
;
2325 DWORD CriticalSectionDefaultTimeout
;
2326 DWORD DeCommitFreeBlockThreshold
;
2327 DWORD DeCommitTotalFreeThreshold
;
2328 PVOID LockPrefixTable
;
2329 DWORD MaximumAllocationSize
;
2330 DWORD VirtualMemoryThreshold
;
2331 DWORD ProcessHeapFlags
;
2332 DWORD ProcessAffinityMask
;
2337 } IMAGE_LOAD_CONFIG_DIRECTORY
, *PIMAGE_LOAD_CONFIG_DIRECTORY
;
2339 typedef struct _IMAGE_FUNCTION_ENTRY
{
2340 DWORD StartingAddress
;
2341 DWORD EndingAddress
;
2342 DWORD EndOfPrologue
;
2343 } IMAGE_FUNCTION_ENTRY
, *PIMAGE_FUNCTION_ENTRY
;
2345 #define IMAGE_DEBUG_MISC_EXENAME 1
2347 typedef struct _IMAGE_DEBUG_MISC
{
2353 } IMAGE_DEBUG_MISC
, *PIMAGE_DEBUG_MISC
;
2355 /* This is the structure that appears at the very start of a .DBG file. */
2357 typedef struct _IMAGE_SEPARATE_DEBUG_HEADER
{
2361 WORD Characteristics
;
2362 DWORD TimeDateStamp
;
2366 DWORD NumberOfSections
;
2367 DWORD ExportedNamesSize
;
2368 DWORD DebugDirectorySize
;
2369 DWORD SectionAlignment
;
2370 DWORD Reserved
[ 2 ];
2371 } IMAGE_SEPARATE_DEBUG_HEADER
,*PIMAGE_SEPARATE_DEBUG_HEADER
;
2373 #define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944
2376 typedef struct tagMESSAGE_RESOURCE_ENTRY
{
2380 } MESSAGE_RESOURCE_ENTRY
,*PMESSAGE_RESOURCE_ENTRY
;
2381 #define MESSAGE_RESOURCE_UNICODE 0x0001
2383 typedef struct tagMESSAGE_RESOURCE_BLOCK
{
2386 DWORD OffsetToEntries
;
2387 } MESSAGE_RESOURCE_BLOCK
,*PMESSAGE_RESOURCE_BLOCK
;
2389 typedef struct tagMESSAGE_RESOURCE_DATA
{
2390 DWORD NumberOfBlocks
;
2391 MESSAGE_RESOURCE_BLOCK Blocks
[ 1 ];
2392 } MESSAGE_RESOURCE_DATA
,*PMESSAGE_RESOURCE_DATA
;
2395 * Here follows typedefs for security and tokens.
2399 * First a constant for the following typdefs.
2402 #define ANYSIZE_ARRAY 1
2404 /* FIXME: Orphan. What does it point to? */
2405 typedef PVOID PACCESS_TOKEN
;
2408 * TOKEN_INFORMATION_CLASS
2411 typedef enum _TOKEN_INFORMATION_CLASS
{
2420 TokenImpersonationLevel
,
2422 } TOKEN_INFORMATION_CLASS
;
2424 #ifndef _SECURITY_DEFINED
2425 #define _SECURITY_DEFINED
2427 #include "pshpack1.h"
2429 typedef DWORD ACCESS_MASK
, *PACCESS_MASK
;
2431 typedef struct _GENERIC_MAPPING
{
2432 ACCESS_MASK GenericRead
;
2433 ACCESS_MASK GenericWrite
;
2434 ACCESS_MASK GenericExecute
;
2435 ACCESS_MASK GenericAll
;
2436 } GENERIC_MAPPING
, *PGENERIC_MAPPING
;
2438 #ifndef SID_IDENTIFIER_AUTHORITY_DEFINED
2439 #define SID_IDENTIFIER_AUTHORITY_DEFINED
2442 } SID_IDENTIFIER_AUTHORITY
,*PSID_IDENTIFIER_AUTHORITY
,*LPSID_IDENTIFIER_AUTHORITY
;
2443 #endif /* !defined(SID_IDENTIFIER_AUTHORITY_DEFINED) */
2447 typedef struct _SID
{
2449 BYTE SubAuthorityCount
;
2450 SID_IDENTIFIER_AUTHORITY IdentifierAuthority
;
2451 DWORD SubAuthority
[1];
2453 #endif /* !defined(SID_DEFINED) */
2455 #define SID_REVISION (1) /* Current revision */
2456 #define SID_MAX_SUB_AUTHORITIES (15) /* current max subauths */
2457 #define SID_RECOMMENDED_SUB_AUTHORITIES (1) /* recommended subauths */
2464 #define ACL_REVISION1 1
2465 #define ACL_REVISION2 2
2466 #define ACL_REVISION3 3
2467 #define ACL_REVISION4 4
2469 #define MIN_ACL_REVISION ACL_REVISION2
2470 #define MAX_ACL_REVISION ACL_REVISION4
2472 typedef struct _ACL
{
2480 /* SECURITY_DESCRIPTOR */
2481 #define SECURITY_DESCRIPTOR_REVISION 1
2482 #define SECURITY_DESCRIPTOR_REVISION1 1
2485 #define SE_OWNER_DEFAULTED 0x0001
2486 #define SE_GROUP_DEFAULTED 0x0002
2487 #define SE_DACL_PRESENT 0x0004
2488 #define SE_DACL_DEFAULTED 0x0008
2489 #define SE_SACL_PRESENT 0x0010
2490 #define SE_SACL_DEFAULTED 0x0020
2491 #define SE_SELF_RELATIVE 0x8000
2493 typedef DWORD SECURITY_INFORMATION
, *PSECURITY_INFORMATION
;
2494 typedef WORD SECURITY_DESCRIPTOR_CONTROL
, *PSECURITY_DESCRIPTOR_CONTROL
;
2496 /* The security descriptor structure */
2500 SECURITY_DESCRIPTOR_CONTROL Control
;
2505 } SECURITY_DESCRIPTOR_RELATIVE
, *PISECURITY_DESCRIPTOR_RELATIVE
;
2510 SECURITY_DESCRIPTOR_CONTROL Control
;
2515 } SECURITY_DESCRIPTOR
, *PSECURITY_DESCRIPTOR
;
2517 #define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR))
2519 #include "poppack.h"
2521 #endif /* _SECURITY_DEFINED */
2523 #include "pshpack1.h"
2526 * SID_AND_ATTRIBUTES
2529 typedef struct _SID_AND_ATTRIBUTES
{
2532 } SID_AND_ATTRIBUTES
;
2534 /* security entities */
2535 #define SECURITY_NULL_RID (0x00000000L)
2536 #define SECURITY_WORLD_RID (0x00000000L)
2537 #define SECURITY_LOCAL_RID (0X00000000L)
2539 #define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0}
2542 #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
2545 #define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2}
2548 #define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3}
2549 #define SECURITY_CREATOR_OWNER_RID (0x00000000L)
2550 #define SECURITY_CREATOR_GROUP_RID (0x00000001L)
2551 #define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L)
2552 #define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L)
2555 #define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4}
2558 #define SECURITY_NT_AUTHORITY {0,0,0,0,0,5}
2559 #define SECURITY_DIALUP_RID 0x00000001L
2560 #define SECURITY_NETWORK_RID 0x00000002L
2561 #define SECURITY_BATCH_RID 0x00000003L
2562 #define SECURITY_INTERACTIVE_RID 0x00000004L
2563 #define SECURITY_LOGON_IDS_RID 0x00000005L
2564 #define SECURITY_SERVICE_RID 0x00000006L
2565 #define SECURITY_ANONYMOUS_LOGON_RID 0x00000007L
2566 #define SECURITY_PROXY_RID 0x00000008L
2567 #define SECURITY_ENTERPRISE_CONTROLLERS_RID 0x00000009L
2568 #define SECURITY_PRINCIPAL_SELF_RID 0x0000000AL
2569 #define SECURITY_AUTHENTICATED_USER_RID 0x0000000BL
2570 #define SECURITY_RESTRICTED_CODE_RID 0x0000000CL
2571 #define SECURITY_TERMINAL_SERVER_RID 0x0000000DL
2572 #define SECURITY_LOCAL_SYSTEM_RID 0x00000012L
2573 #define SECURITY_NT_NON_UNIQUE 0x00000015L
2574 #define SECURITY_BUILTIN_DOMAIN_RID 0x00000020L
2576 #define DOMAIN_GROUP_RID_ADMINS 0x00000200L
2577 #define DOMAIN_GROUP_RID_USERS 0x00000201L
2578 #define DOMAIN_GROUP_RID_GUESTS 0x00000202L
2580 #define DOMAIN_ALIAS_RID_ADMINS 0x00000220L
2581 #define DOMAIN_ALIAS_RID_USERS 0x00000221L
2582 #define DOMAIN_ALIAS_RID_GUESTS 0x00000222L
2584 #define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID
2586 #define SECURITY_LOGON_IDS_RID_COUNT (3L)
2592 typedef struct _TOKEN_USER
{
2593 SID_AND_ATTRIBUTES User
;
2600 typedef struct _TOKEN_GROUPS
{
2602 SID_AND_ATTRIBUTES Groups
[ANYSIZE_ARRAY
];
2606 * LUID_AND_ATTRIBUTES
2609 typedef union _LARGE_INTEGER
{
2615 } LARGE_INTEGER
, *LPLARGE_INTEGER
, *PLARGE_INTEGER
;
2617 typedef union _ULARGE_INTEGER
{
2623 } ULARGE_INTEGER
, *LPULARGE_INTEGER
, *PULARGE_INTEGER
;
2626 * Locally Unique Identifier
2629 typedef LARGE_INTEGER LUID
,*PLUID
;
2631 typedef struct _LUID_AND_ATTRIBUTES
{
2634 } LUID_AND_ATTRIBUTES
;
2640 typedef struct _PRIVILEGE_SET
{
2641 DWORD PrivilegeCount
;
2643 LUID_AND_ATTRIBUTES Privilege
[ANYSIZE_ARRAY
];
2644 } PRIVILEGE_SET
, *PPRIVILEGE_SET
;
2650 typedef struct _TOKEN_PRIVILEGES
{
2651 DWORD PrivilegeCount
;
2652 LUID_AND_ATTRIBUTES Privileges
[ANYSIZE_ARRAY
];
2653 } TOKEN_PRIVILEGES
, *PTOKEN_PRIVILEGES
;
2659 typedef struct _TOKEN_OWNER
{
2664 * TOKEN_PRIMARY_GROUP
2667 typedef struct _TOKEN_PRIMARY_GROUP
{
2669 } TOKEN_PRIMARY_GROUP
;
2673 * TOKEN_DEFAULT_DACL
2676 typedef struct _TOKEN_DEFAULT_DACL
{
2678 } TOKEN_DEFAULT_DACL
;
2684 typedef struct _TOKEN_SOURCE
{
2686 LUID SourceIdentifier
;
2693 typedef enum tagTOKEN_TYPE
{
2699 * SECURITY_IMPERSONATION_LEVEL
2702 typedef enum _SECURITY_IMPERSONATION_LEVEL
{
2704 SecurityIdentification
,
2705 SecurityImpersonation
,
2707 } SECURITY_IMPERSONATION_LEVEL
, *PSECURITY_IMPERSONATION_LEVEL
;
2710 typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE
,
2711 * PSECURITY_CONTEXT_TRACKING_MODE
;
2713 * Quality of Service
2716 typedef struct _SECURITY_QUALITY_OF_SERVICE
{
2718 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
;
2719 SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode
;
2721 } SECURITY_QUALITY_OF_SERVICE
, *PSECURITY_QUALITY_OF_SERVICE
;
2727 typedef struct _TOKEN_STATISTICS
{
2729 LUID AuthenticationId
;
2730 LARGE_INTEGER ExpirationTime
;
2731 TOKEN_TYPE TokenType
;
2732 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
;
2733 DWORD DynamicCharged
;
2734 DWORD DynamicAvailable
;
2736 DWORD PrivilegeCount
;
2744 #define ACL_REVISION 2
2746 #define ACL_REVISION1 1
2747 #define ACL_REVISION2 2
2749 /* ACEs, directly starting after an ACL */
2750 typedef struct _ACE_HEADER
{
2754 } ACE_HEADER
,*PACE_HEADER
;
2757 #define ACCESS_ALLOWED_ACE_TYPE 0
2758 #define ACCESS_DENIED_ACE_TYPE 1
2759 #define SYSTEM_AUDIT_ACE_TYPE 2
2760 #define SYSTEM_ALARM_ACE_TYPE 3
2762 /* inherit AceFlags */
2763 #define OBJECT_INHERIT_ACE 0x01
2764 #define CONTAINER_INHERIT_ACE 0x02
2765 #define NO_PROPAGATE_INHERIT_ACE 0x04
2766 #define INHERIT_ONLY_ACE 0x08
2767 #define VALID_INHERIT_FLAGS 0x0F
2769 /* AceFlags mask for what events we (should) audit */
2770 #define SUCCESSFUL_ACCESS_ACE_FLAG 0x40
2771 #define FAILED_ACCESS_ACE_FLAG 0x80
2773 /* different ACEs depending on AceType
2774 * SidStart marks the begin of a SID
2775 * so the thing finally looks like this:
2780 typedef struct _ACCESS_ALLOWED_ACE
{
2784 } ACCESS_ALLOWED_ACE
,*PACCESS_ALLOWED_ACE
;
2786 typedef struct _ACCESS_DENIED_ACE
{
2790 } ACCESS_DENIED_ACE
,*PACCESS_DENIED_ACE
;
2792 typedef struct _SYSTEM_AUDIT_ACE
{
2796 } SYSTEM_AUDIT_ACE
,*PSYSTEM_AUDIT_ACE
;
2798 typedef struct _SYSTEM_ALARM_ACE
{
2802 } SYSTEM_ALARM_ACE
,*PSYSTEM_ALARM_ACE
;
2804 typedef enum tagSID_NAME_USE
{
2809 SidTypeWellKnownGroup
,
2810 SidTypeDeletedAccount
,
2813 } SID_NAME_USE
,*PSID_NAME_USE
;
2817 /* DELETE may be already defined via /usr/include/arpa/nameser_compat.h */
2819 #define DELETE 0x00010000
2820 #define READ_CONTROL 0x00020000
2821 #define WRITE_DAC 0x00040000
2822 #define WRITE_OWNER 0x00080000
2823 #define SYNCHRONIZE 0x00100000
2824 #define STANDARD_RIGHTS_REQUIRED 0x000f0000
2826 #define STANDARD_RIGHTS_READ READ_CONTROL
2827 #define STANDARD_RIGHTS_WRITE READ_CONTROL
2828 #define STANDARD_RIGHTS_EXECUTE READ_CONTROL
2830 #define STANDARD_RIGHTS_ALL 0x001f0000
2832 #define SPECIFIC_RIGHTS_ALL 0x0000ffff
2834 #define GENERIC_READ 0x80000000
2835 #define GENERIC_WRITE 0x40000000
2836 #define GENERIC_EXECUTE 0x20000000
2837 #define GENERIC_ALL 0x10000000
2839 #define MAXIMUM_ALLOWED 0x02000000
2840 #define ACCESS_SYSTEM_SECURITY 0x01000000
2842 #define EVENT_MODIFY_STATE 0x0002
2843 #define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
2845 #define SEMAPHORE_MODIFY_STATE 0x0002
2846 #define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
2848 #define MUTEX_MODIFY_STATE 0x0001
2849 #define MUTEX_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1)
2851 #define TIMER_QUERY_STATE 0x0001
2852 #define TIMER_MODIFY_STATE 0x0002
2853 #define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
2855 #define PROCESS_TERMINATE 0x0001
2856 #define PROCESS_CREATE_THREAD 0x0002
2857 #define PROCESS_VM_OPERATION 0x0008
2858 #define PROCESS_VM_READ 0x0010
2859 #define PROCESS_VM_WRITE 0x0020
2860 #define PROCESS_DUP_HANDLE 0x0040
2861 #define PROCESS_CREATE_PROCESS 0x0080
2862 #define PROCESS_SET_QUOTA 0x0100
2863 #define PROCESS_SET_INFORMATION 0x0200
2864 #define PROCESS_QUERY_INFORMATION 0x0400
2865 #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xfff)
2867 #define THREAD_TERMINATE 0x0001
2868 #define THREAD_SUSPEND_RESUME 0x0002
2869 #define THREAD_GET_CONTEXT 0x0008
2870 #define THREAD_SET_CONTEXT 0x0010
2871 #define THREAD_SET_INFORMATION 0x0020
2872 #define THREAD_QUERY_INFORMATION 0x0040
2873 #define THREAD_SET_THREAD_TOKEN 0x0080
2874 #define THREAD_IMPERSONATE 0x0100
2875 #define THREAD_DIRECT_IMPERSONATION 0x0200
2876 #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3ff)
2878 #define THREAD_BASE_PRIORITY_LOWRT 15
2879 #define THREAD_BASE_PRIORITY_MAX 2
2880 #define THREAD_BASE_PRIORITY_MIN -2
2881 #define THREAD_BASE_PRIORITY_IDLE -15
2883 #define FILE_READ_DATA 0x0001 /* file & pipe */
2884 #define FILE_LIST_DIRECTORY 0x0001 /* directory */
2885 #define FILE_WRITE_DATA 0x0002 /* file & pipe */
2886 #define FILE_ADD_FILE 0x0002 /* directory */
2887 #define FILE_APPEND_DATA 0x0004 /* file */
2888 #define FILE_ADD_SUBDIRECTORY 0x0004 /* directory */
2889 #define FILE_CREATE_PIPE_INSTANCE 0x0004 /* named pipe */
2890 #define FILE_READ_EA 0x0008 /* file & directory */
2891 #define FILE_READ_PROPERTIES FILE_READ_EA
2892 #define FILE_WRITE_EA 0x0010 /* file & directory */
2893 #define FILE_WRITE_PROPERTIES FILE_WRITE_EA
2894 #define FILE_EXECUTE 0x0020 /* file */
2895 #define FILE_TRAVERSE 0x0020 /* directory */
2896 #define FILE_DELETE_CHILD 0x0040 /* directory */
2897 #define FILE_READ_ATTRIBUTES 0x0080 /* all */
2898 #define FILE_WRITE_ATTRIBUTES 0x0100 /* all */
2899 #define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1ff)
2901 #define FILE_GENERIC_READ (STANDARD_RIGHTS_READ | FILE_READ_DATA | \
2902 FILE_READ_ATTRIBUTES | FILE_READ_EA | \
2904 #define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | \
2905 FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | \
2906 FILE_APPEND_DATA | SYNCHRONIZE)
2907 #define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE | FILE_EXECUTE | \
2908 FILE_READ_ATTRIBUTES | SYNCHRONIZE)
2911 /* File attribute flags */
2912 #define FILE_SHARE_READ 0x00000001L
2913 #define FILE_SHARE_WRITE 0x00000002L
2914 #define FILE_SHARE_DELETE 0x00000004L
2915 #define FILE_ATTRIBUTE_READONLY 0x00000001L
2916 #define FILE_ATTRIBUTE_HIDDEN 0x00000002L
2917 #define FILE_ATTRIBUTE_SYSTEM 0x00000004L
2918 #define FILE_ATTRIBUTE_LABEL 0x00000008L /* Not in Windows API */
2919 #define FILE_ATTRIBUTE_DIRECTORY 0x00000010L
2920 #define FILE_ATTRIBUTE_ARCHIVE 0x00000020L
2921 #define FILE_ATTRIBUTE_NORMAL 0x00000080L
2922 #define FILE_ATTRIBUTE_TEMPORARY 0x00000100L
2923 #define FILE_ATTRIBUTE_ATOMIC_WRITE 0x00000200L
2924 #define FILE_ATTRIBUTE_XACTION_WRITE 0x00000400L
2925 #define FILE_ATTRIBUTE_COMPRESSED 0x00000800L
2926 #define FILE_ATTRIBUTE_OFFLINE 0x00001000L
2927 #define FILE_ATTRIBUTE_SYMLINK 0x80000000L /* Not in Windows API */
2929 /* File notification flags */
2930 #define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
2931 #define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
2932 #define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
2933 #define FILE_NOTIFY_CHANGE_SIZE 0x00000008
2934 #define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
2935 #define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
2936 #define FILE_NOTIFY_CHANGE_CREATION 0x00000040
2937 #define FILE_NOTIFY_CHANGE_SECURITY 0x00000100
2939 #define FILE_ACTION_ADDED 0x00000001
2940 #define FILE_ACTION_REMOVED 0x00000002
2941 #define FILE_ACTION_MODIFIED 0x00000003
2942 #define FILE_ACTION_RENAMED_OLD_NAME 0x00000004
2943 #define FILE_ACTION_RENAMED_NEW_NAME 0x00000005
2946 #define FILE_CASE_SENSITIVE_SEARCH 0x00000001
2947 #define FILE_CASE_PRESERVED_NAMES 0x00000002
2948 #define FILE_UNICODE_ON_DISK 0x00000004
2949 #define FILE_PERSISTENT_ACLS 0x00000008
2950 #define FILE_FILE_COMPRESSION 0x00000010
2951 #define FILE_VOLUME_IS_COMPRESSED 0x00008000
2953 /* File alignments (NT) */
2954 #define FILE_BYTE_ALIGNMENT 0x00000000
2955 #define FILE_WORD_ALIGNMENT 0x00000001
2956 #define FILE_LONG_ALIGNMENT 0x00000003
2957 #define FILE_QUAD_ALIGNMENT 0x00000007
2958 #define FILE_OCTA_ALIGNMENT 0x0000000f
2959 #define FILE_32_BYTE_ALIGNMENT 0x0000001f
2960 #define FILE_64_BYTE_ALIGNMENT 0x0000003f
2961 #define FILE_128_BYTE_ALIGNMENT 0x0000007f
2962 #define FILE_256_BYTE_ALIGNMENT 0x000000ff
2963 #define FILE_512_BYTE_ALIGNMENT 0x000001ff
2965 #define REG_NONE 0 /* no type */
2966 #define REG_SZ 1 /* string type (ASCII) */
2967 #define REG_EXPAND_SZ 2 /* string, includes %ENVVAR% (expanded by caller) (ASCII) */
2968 #define REG_BINARY 3 /* binary format, callerspecific */
2969 /* YES, REG_DWORD == REG_DWORD_LITTLE_ENDIAN */
2970 #define REG_DWORD 4 /* DWORD in little endian format */
2971 #define REG_DWORD_LITTLE_ENDIAN 4 /* DWORD in little endian format */
2972 #define REG_DWORD_BIG_ENDIAN 5 /* DWORD in big endian format */
2973 #define REG_LINK 6 /* symbolic link (UNICODE) */
2974 #define REG_MULTI_SZ 7 /* multiple strings, delimited by \0, terminated by \0\0 (ASCII) */
2975 #define REG_RESOURCE_LIST 8 /* resource list? huh? */
2976 #define REG_FULL_RESOURCE_DESCRIPTOR 9 /* full resource descriptor? huh? */
2977 #define REG_RESOURCE_REQUIREMENTS_LIST 10
2979 /* ----------------------------- begin registry ----------------------------- */
2981 /* Registry security values */
2982 #define OWNER_SECURITY_INFORMATION 0x00000001
2983 #define GROUP_SECURITY_INFORMATION 0x00000002
2984 #define DACL_SECURITY_INFORMATION 0x00000004
2985 #define SACL_SECURITY_INFORMATION 0x00000008
2987 #define REG_OPTION_RESERVED 0x00000000
2988 #define REG_OPTION_NON_VOLATILE 0x00000000
2989 #define REG_OPTION_VOLATILE 0x00000001
2990 #define REG_OPTION_CREATE_LINK 0x00000002
2991 #define REG_OPTION_BACKUP_RESTORE 0x00000004 /* FIXME */
2992 #define REG_OPTION_OPEN_LINK 0x00000008
2993 #define REG_LEGAL_OPTION (REG_OPTION_RESERVED| \
2994 REG_OPTION_NON_VOLATILE| \
2995 REG_OPTION_VOLATILE| \
2996 REG_OPTION_CREATE_LINK| \
2997 REG_OPTION_BACKUP_RESTORE| \
2998 REG_OPTION_OPEN_LINK)
3001 #define REG_CREATED_NEW_KEY 0x00000001
3002 #define REG_OPENED_EXISTING_KEY 0x00000002
3004 /* For RegNotifyChangeKeyValue */
3005 #define REG_NOTIFY_CHANGE_NAME 0x1
3007 #define KEY_QUERY_VALUE 0x00000001
3008 #define KEY_SET_VALUE 0x00000002
3009 #define KEY_CREATE_SUB_KEY 0x00000004
3010 #define KEY_ENUMERATE_SUB_KEYS 0x00000008
3011 #define KEY_NOTIFY 0x00000010
3012 #define KEY_CREATE_LINK 0x00000020
3014 #define KEY_READ ((STANDARD_RIGHTS_READ| \
3016 KEY_ENUMERATE_SUB_KEYS| \
3020 #define KEY_WRITE ((STANDARD_RIGHTS_WRITE| \
3022 KEY_CREATE_SUB_KEY) \
3025 #define KEY_EXECUTE ((KEY_READ) \
3028 #define KEY_ALL_ACCESS ((STANDARD_RIGHTS_ALL| \
3031 KEY_CREATE_SUB_KEY| \
3032 KEY_ENUMERATE_SUB_KEYS| \
3037 /* ------------------------------ end registry ------------------------------ */
3040 typedef struct _RTL_CRITICAL_SECTION_DEBUG
3043 WORD CreatorBackTraceIndex
;
3044 struct _RTL_CRITICAL_SECTION
*CriticalSection
;
3045 LIST_ENTRY ProcessLocksList
;
3047 DWORD ContentionCount
;
3049 } RTL_CRITICAL_SECTION_DEBUG
, *PRTL_CRITICAL_SECTION_DEBUG
, RTL_RESOURCE_DEBUG
, *PRTL_RESOURCE_DEBUG
;
3051 typedef struct _RTL_CRITICAL_SECTION
{
3052 PRTL_CRITICAL_SECTION_DEBUG DebugInfo
;
3054 LONG RecursionCount
;
3055 HANDLE OwningThread
;
3056 HANDLE LockSemaphore
;
3057 ULONG_PTR SpinCount
;
3058 } RTL_CRITICAL_SECTION
, *PRTL_CRITICAL_SECTION
;
3061 #define EVENTLOG_SUCCESS 0x0000
3062 #define EVENTLOG_ERROR_TYPE 0x0001
3063 #define EVENTLOG_WARNING_TYPE 0x0002
3064 #define EVENTLOG_INFORMATION_TYPE 0x0004
3065 #define EVENTLOG_AUDIT_SUCCESS 0x0008
3066 #define EVENTLOG_AUDIT_FAILURE 0x0010
3068 #define SERVICE_BOOT_START 0x00000000
3069 #define SERVICE_SYSTEM_START 0x00000001
3070 #define SERVICE_AUTO_START 0x00000002
3071 #define SERVICE_DEMAND_START 0x00000003
3072 #define SERVICE_DISABLED 0x00000004
3074 #define SERVICE_ERROR_IGNORE 0x00000000
3075 #define SERVICE_ERROR_NORMAL 0x00000001
3076 #define SERVICE_ERROR_SEVERE 0x00000002
3077 #define SERVICE_ERROR_CRITICAL 0x00000003
3080 #define SERVICE_KERNEL_DRIVER 0x00000001
3081 #define SERVICE_FILE_SYSTEM_DRIVER 0x00000002
3082 #define SERVICE_ADAPTER 0x00000004
3083 #define SERVICE_RECOGNIZER_DRIVER 0x00000008
3085 #define SERVICE_DRIVER ( SERVICE_KERNEL_DRIVER | SERVICE_FILE_SYSTEM_DRIVER | \
3086 SERVICE_RECOGNIZER_DRIVER )
3088 #define SERVICE_WIN32_OWN_PROCESS 0x00000010
3089 #define SERVICE_WIN32_SHARE_PROCESS 0x00000020
3090 #define SERVICE_WIN32 (SERVICE_WIN32_OWN_PROCESS | SERVICE_WIN32_SHARE_PROCESS)
3092 #define SERVICE_INTERACTIVE_PROCESS 0x00000100
3094 #define SERVICE_TYPE_ALL ( SERVICE_WIN32 | SERVICE_ADAPTER | \
3095 SERVICE_DRIVER | SERVICE_INTERACTIVE_PROCESS )
3098 typedef enum _CM_SERVICE_NODE_TYPE
3100 DriverType
= SERVICE_KERNEL_DRIVER
,
3101 FileSystemType
= SERVICE_FILE_SYSTEM_DRIVER
,
3102 Win32ServiceOwnProcess
= SERVICE_WIN32_OWN_PROCESS
,
3103 Win32ServiceShareProcess
= SERVICE_WIN32_SHARE_PROCESS
,
3104 AdapterType
= SERVICE_ADAPTER
,
3105 RecognizerType
= SERVICE_RECOGNIZER_DRIVER
3106 } SERVICE_NODE_TYPE
;
3108 typedef enum _CM_SERVICE_LOAD_TYPE
3110 BootLoad
= SERVICE_BOOT_START
,
3111 SystemLoad
= SERVICE_SYSTEM_START
,
3112 AutoLoad
= SERVICE_AUTO_START
,
3113 DemandLoad
= SERVICE_DEMAND_START
,
3114 DisableLoad
= SERVICE_DISABLED
3115 } SERVICE_LOAD_TYPE
;
3117 typedef enum _CM_ERROR_CONTROL_TYPE
3119 IgnoreError
= SERVICE_ERROR_IGNORE
,
3120 NormalError
= SERVICE_ERROR_NORMAL
,
3121 SevereError
= SERVICE_ERROR_SEVERE
,
3122 CriticalError
= SERVICE_ERROR_CRITICAL
3123 } SERVICE_ERROR_TYPE
;
3127 #define RtlEqualMemory(Destination, Source, Length) (!memcmp((Destination),(Source),(Length)))
3128 #define RtlMoveMemory(Destination, Source, Length) memmove((Destination),(Source),(Length))
3129 #define RtlCopyMemory(Destination, Source, Length) memcpy((Destination),(Source),(Length))
3130 #define RtlFillMemory(Destination, Length, Fill) memset((Destination),(Fill),(Length))
3131 #define RtlZeroMemory(Destination, Length) memset((Destination),0,(Length))
3133 #include "guiddef.h"
3135 #include "poppack.h"
3137 #endif /* __WINE_WINNT_H */