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 #endif /* __WINE__ */
829 #define MAKELCID(l, s) (MAKELONG(l, s))
831 #define MAKELANGID(p, s) ((((WORD)(s))<<10) | (WORD)(p))
832 #define PRIMARYLANGID(l) ((WORD)(l) & 0x3ff)
833 #define SUBLANGID(l) ((WORD)(l) >> 10)
835 #define LANGIDFROMLCID(lcid) ((WORD)(lcid))
836 #define SORTIDFROMLCID(lcid) ((WORD)((((DWORD)(lcid)) >> 16) & 0x0f))
838 #define LANG_SYSTEM_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT))
839 #define LANG_USER_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT))
840 #define LOCALE_SYSTEM_DEFAULT (MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT))
841 #define LOCALE_USER_DEFAULT (MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT))
842 #define LOCALE_NEUTRAL (MAKELCID(MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL),SORT_DEFAULT))
844 /* FIXME: are the symbolic names correct for LIDs: 0x17, 0x20, 0x28,
845 * 0x2a, 0x2b, 0x2c, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
846 * 0x37, 0x39, 0x3a, 0x3b, 0x3c, 0x3e, 0x3f, 0x41, 0x43, 0x44,
847 * 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e,
850 #define LANG_NEUTRAL 0x00
851 #define LANG_AFRIKAANS 0x36
852 #define LANG_ALBANIAN 0x1c
853 #define LANG_ARABIC 0x01
854 #define LANG_ARMENIAN 0x2b
855 #define LANG_ASSAMESE 0x4d
856 #define LANG_AZERI 0x2c
857 #define LANG_BASQUE 0x2d
858 #define LANG_BENGALI 0x45
859 #define LANG_BULGARIAN 0x02
860 #define LANG_BYELORUSSIAN 0x23
861 #define LANG_CATALAN 0x03
862 #define LANG_CHINESE 0x04
863 #define LANG_SERBO_CROATIAN 0x1a
864 #define LANG_CROATIAN LANG_SERBO_CROATIAN
865 #define LANG_SERBIAN LANG_SERBO_CROATIAN
866 #define LANG_CZECH 0x05
867 #define LANG_DANISH 0x06
868 #define LANG_DUTCH 0x13
869 #define LANG_ENGLISH 0x09
870 #define LANG_ESTONIAN 0x25
871 #define LANG_FAEROESE 0x38
872 #define LANG_FARSI 0x29
873 #define LANG_FINNISH 0x0b
874 #define LANG_FRENCH 0x0c
875 #define LANG_GAELIC 0x3c
876 #define LANG_GEORGIAN 0x37
877 #define LANG_GERMAN 0x07
878 #define LANG_GREEK 0x08
879 #define LANG_GUJARATI 0x47
880 #define LANG_HEBREW 0x0D
881 #define LANG_HINDI 0x39
882 #define LANG_HUNGARIAN 0x0e
883 #define LANG_ICELANDIC 0x0f
884 #define LANG_INDONESIAN 0x21
885 #define LANG_ITALIAN 0x10
886 #define LANG_JAPANESE 0x11
887 #define LANG_KANNADA 0x4b
888 #define LANG_KAZAKH 0x3f
889 #define LANG_KONKANI 0x57
890 #define LANG_KOREAN 0x12
891 #define LANG_LATVIAN 0x26
892 #define LANG_LITHUANIAN 0x27
893 #define LANG_MACEDONIAN 0x2f
894 #define LANG_MALAY 0x3e
895 #define LANG_MALAYALAM 0x4c
896 #define LANG_MALTESE 0x3a
897 #define LANG_MAORI 0x28
898 #define LANG_MARATHI 0x4e
899 #define LANG_NORWEGIAN 0x14
900 #define LANG_ORIYA 0x48
901 #define LANG_POLISH 0x15
902 #define LANG_PORTUGUESE 0x16
903 #define LANG_PUNJABI 0x46
904 #define LANG_RHAETO_ROMANCE 0x17
905 #define LANG_ROMANIAN 0x18
906 #define LANG_RUSSIAN 0x19
907 #define LANG_SAAMI 0x3b
908 #define LANG_SANSKRIT 0x4f
909 #define LANG_SLOVAK 0x1b
910 #define LANG_SLOVENIAN 0x24
911 #define LANG_SORBIAN 0x2e
912 #define LANG_SPANISH 0x0a
913 #define LANG_SUTU 0x30
914 #define LANG_SWAHILI 0x41
915 #define LANG_SWEDISH 0x1d
916 #define LANG_TAMIL 0x49
917 #define LANG_TATAR 0x44
918 #define LANG_TELUGU 0x4a
919 #define LANG_THAI 0x1e
920 #define LANG_TSONGA 0x31
921 #define LANG_TSWANA 0x32
922 #define LANG_TURKISH 0x1f
923 #define LANG_UKRAINIAN 0x22
924 #define LANG_URDU 0x20
925 #define LANG_UZBEK 0x43
926 #define LANG_VENDA 0x33
927 #define LANG_VIETNAMESE 0x2a
928 #define LANG_XHOSA 0x34
929 #define LANG_ZULU 0x35
930 /* non standard; keep the number high enough (but < 0xff) */
931 #define LANG_ESPERANTO 0x8f
932 #define LANG_WALON 0x90
933 #define LANG_CORNISH 0x91
934 #define LANG_WELSH 0x92
935 #define LANG_BRETON 0x93
937 /* Sublanguage definitions */
938 #define SUBLANG_NEUTRAL 0x00 /* language neutral */
939 #define SUBLANG_DEFAULT 0x01 /* user default */
940 #define SUBLANG_SYS_DEFAULT 0x02 /* system default */
942 #define SUBLANG_ARABIC 0x01
943 #define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
944 #define SUBLANG_ARABIC_IRAQ 0x02
945 #define SUBLANG_ARABIC_EGYPT 0x03
946 #define SUBLANG_ARABIC_LIBYA 0x04
947 #define SUBLANG_ARABIC_ALGERIA 0x05
948 #define SUBLANG_ARABIC_MOROCCO 0x06
949 #define SUBLANG_ARABIC_TUNISIA 0x07
950 #define SUBLANG_ARABIC_OMAN 0x08
951 #define SUBLANG_ARABIC_YEMEN 0x09
952 #define SUBLANG_ARABIC_SYRIA 0x0a
953 #define SUBLANG_ARABIC_JORDAN 0x0b
954 #define SUBLANG_ARABIC_LEBANON 0x0c
955 #define SUBLANG_ARABIC_KUWAIT 0x0d
956 #define SUBLANG_ARABIC_UAE 0x0e
957 #define SUBLANG_ARABIC_BAHRAIN 0x0f
958 #define SUBLANG_ARABIC_QATAR 0x10
959 #define SUBLANG_CHINESE_TRADITIONAL 0x01
960 #define SUBLANG_CHINESE_SIMPLIFIED 0x02
961 #define SUBLANG_CHINESE_HONGKONG 0x03
962 #define SUBLANG_CHINESE_SINGAPORE 0x04
963 #define SUBLANG_CHINESE_MACAU 0x05
964 #define SUBLANG_DUTCH 0x01
965 #define SUBLANG_DUTCH_BELGIAN 0x02
966 #define SUBLANG_DUTCH_SURINAM 0x03
967 #define SUBLANG_ENGLISH_US 0x01
968 #define SUBLANG_ENGLISH_UK 0x02
969 #define SUBLANG_ENGLISH_AUS 0x03
970 #define SUBLANG_ENGLISH_CAN 0x04
971 #define SUBLANG_ENGLISH_NZ 0x05
972 #define SUBLANG_ENGLISH_EIRE 0x06
973 #define SUBLANG_ENGLISH_SAFRICA 0x07
974 #define SUBLANG_ENGLISH_JAMAICA 0x08
975 #define SUBLANG_ENGLISH_CARRIBEAN 0x09
976 #define SUBLANG_ENGLISH_BELIZE 0x0a
977 #define SUBLANG_ENGLISH_TRINIDAD 0x0b
978 #define SUBLANG_ENGLISH_ZIMBABWE 0x0c
979 #define SUBLANG_ENGLISH_PHILIPPINES 0x0d
980 #define SUBLANG_FRENCH 0x01
981 #define SUBLANG_FRENCH_BELGIAN 0x02
982 #define SUBLANG_FRENCH_CANADIAN 0x03
983 #define SUBLANG_FRENCH_SWISS 0x04
984 #define SUBLANG_FRENCH_LUXEMBOURG 0x05
985 #define SUBLANG_FRENCH_MONACO 0x06
986 #define SUBLANG_GERMAN 0x01
987 #define SUBLANG_GERMAN_SWISS 0x02
988 #define SUBLANG_GERMAN_AUSTRIAN 0x03
989 #define SUBLANG_GERMAN_LUXEMBOURG 0x04
990 #define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
991 #define SUBLANG_ITALIAN 0x01
992 #define SUBLANG_ITALIAN_SWISS 0x02
993 #define SUBLANG_KOREAN 0x01
994 #define SUBLANG_KOREAN_JOHAB 0x02
995 #define SUBLANG_NORWEGIAN_BOKMAL 0x01
996 #define SUBLANG_NORWEGIAN_NYNORSK 0x02
997 #define SUBLANG_PORTUGUESE 0x02
998 #define SUBLANG_PORTUGUESE_BRAZILIAN 0x01
999 #define SUBLANG_SPANISH 0x01
1000 #define SUBLANG_SPANISH_MEXICAN 0x02
1001 #define SUBLANG_SPANISH_MODERN 0x03
1002 #define SUBLANG_SPANISH_GUATEMALA 0x04
1003 #define SUBLANG_SPANISH_COSTARICA 0x05
1004 #define SUBLANG_SPANISH_PANAMA 0x06
1005 #define SUBLANG_SPANISH_DOMINICAN 0x07
1006 #define SUBLANG_SPANISH_VENEZUELA 0x08
1007 #define SUBLANG_SPANISH_COLOMBIA 0x09
1008 #define SUBLANG_SPANISH_PERU 0x0a
1009 #define SUBLANG_SPANISH_ARGENTINA 0x0b
1010 #define SUBLANG_SPANISH_ECUADOR 0x0c
1011 #define SUBLANG_SPANISH_CHILE 0x0d
1012 #define SUBLANG_SPANISH_URUGUAY 0x0e
1013 #define SUBLANG_SPANISH_PARAGUAY 0x0f
1014 #define SUBLANG_SPANISH_BOLIVIA 0x10
1015 #define SUBLANG_SPANISH_EL_SALVADOR 0x11
1016 #define SUBLANG_SPANISH_HONDURAS 0x12
1017 #define SUBLANG_SPANISH_NICARAGUA 0x13
1018 #define SUBLANG_SPANISH_PUERTO_RICO 0x14
1019 /* FIXME: I don't know the symbolic names for those */
1020 #define SUBLANG_ROMANIAN 0x01
1021 #define SUBLANG_ROMANIAN_MOLDAVIA 0x02
1022 #define SUBLANG_RUSSIAN 0x01
1023 #define SUBLANG_RUSSIAN_MOLDAVIA 0x02
1024 #define SUBLANG_CROATIAN 0x01
1025 #define SUBLANG_SERBIAN 0x02
1026 #define SUBLANG_SERBIAN_LATIN 0x03
1027 #define SUBLANG_SWEDISH 0x01
1028 #define SUBLANG_SWEDISH_FINLAND 0x02
1029 #define SUBLANG_LITHUANIAN 0x01
1030 #define SUBLANG_LITHUANIAN_CLASSIC 0x02
1031 #define SUBLANG_AZERI 0x01
1032 #define SUBLANG_AZERI_CYRILLIC 0x02
1033 #define SUBLANG_GAELIC 0x01
1034 #define SUBLANG_GAELIC_SCOTTISH 0x02
1035 #define SUBLANG_GAELIC_MANX 0x03
1036 #define SUBLANG_MALAY 0x01
1037 #define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
1038 #define SUBLANG_UZBEK 0x01
1039 #define SUBLANG_UZBEK_CYRILLIC 0x02
1040 #define SUBLANG_URDU_PAKISTAN 0x01
1048 #define SORT_DEFAULT 0x0
1049 #define SORT_JAPANESE_XJIS 0x0
1050 #define SORT_JAPANESE_UNICODE 0x1
1051 #define SORT_CHINESE_BIG5 0x0
1052 #define SORT_CHINESE_UNICODE 0x1
1053 #define SORT_KOREAN_KSC 0x0
1054 #define SORT_KOREAN_UNICODE 0x1
1059 * Definitions for IsTextUnicode()
1062 #define IS_TEXT_UNICODE_ASCII16 0x0001
1063 #define IS_TEXT_UNICODE_STATISTICS 0x0002
1064 #define IS_TEXT_UNICODE_CONTROLS 0x0004
1065 #define IS_TEXT_UNICODE_SIGNATURE 0x0008
1066 #define IS_TEXT_UNICODE_UNICODE_MASK 0x000F
1067 #define IS_TEXT_UNICODE_REVERSE_ASCII16 0x0010
1068 #define IS_TEXT_UNICODE_REVERSE_STATISTICS 0x0020
1069 #define IS_TEXT_UNICODE_REVERSE_CONTROLS 0x0040
1070 #define IS_TEXT_UNICODE_REVERSE_SIGNATURE 0x0080
1071 #define IS_TEXT_UNICODE_REVERSE_MASK 0x00F0
1072 #define IS_TEXT_UNICODE_ILLEGAL_CHARS 0x0100
1073 #define IS_TEXT_UNICODE_ODD_LENGTH 0x0200
1074 #define IS_TEXT_UNICODE_DBCS_LEADBYTE 0x0400
1075 #define IS_TEXT_UNICODE_NOT_UNICODE_MASK 0x0F00
1076 #define IS_TEXT_UNICODE_NULL_BYTES 0x1000
1077 #define IS_TEXT_UNICODE_NOT_ASCII_MASK 0xF000
1085 #define STATUS_SUCCESS 0x00000000
1086 #define STATUS_WAIT_0 0x00000000
1087 #define STATUS_ABANDONED_WAIT_0 0x00000080
1088 #define STATUS_USER_APC 0x000000C0
1089 #define STATUS_TIMEOUT 0x00000102
1090 #define STATUS_PENDING 0x00000103
1092 #define STATUS_GUARD_PAGE_VIOLATION 0x80000001
1093 #define STATUS_DATATYPE_MISALIGNMENT 0x80000002
1094 #define STATUS_BREAKPOINT 0x80000003
1095 #define STATUS_SINGLE_STEP 0x80000004
1096 #define STATUS_BUFFER_OVERFLOW 0x80000005
1097 #define STATUS_NO_MORE_FILES 0x80000006
1098 #define STATUS_WAKE_SYSTEM_DEBUGGER 0x80000007
1100 #define STATUS_HANDLES_CLOSED 0x8000000A
1101 #define STATUS_NO_INHERITANCE 0x8000000B
1102 #define STATUS_GUID_SUBSTITUTION_MADE 0x8000000C
1103 #define STATUS_PARTIAL_COPY 0x8000000D
1104 #define STATUS_DEVICE_PAPER_EMPTY 0x8000000E
1105 #define STATUS_DEVICE_POWERED_OFF 0x8000000F
1106 #define STATUS_DEVICE_OFF_LINE 0x80000010
1107 #define STATUS_DEVICE_BUSY 0x80000011
1108 #define STATUS_NO_MORE_EAS 0x80000012
1109 #define STATUS_INVALID_EA_NAME 0x80000013
1110 #define STATUS_EA_LIST_INCONSISTENT 0x80000014
1111 #define STATUS_INVALID_EA_FLAG 0x80000015
1112 #define STATUS_VERIFY_REQUIRED 0x80000016
1113 #define STATUS_EXTRANEOUS_INFORMATION 0x80000017
1114 #define STATUS_RXACT_COMMIT_NECESSARY 0x80000018
1115 #define STATUS_NO_MORE_ENTRIES 0x8000001A
1116 #define STATUS_FILEMARK_DETECTED 0x8000001B
1117 #define STATUS_MEDIA_CHANGED 0x8000001C
1118 #define STATUS_BUS_RESET 0x8000001D
1119 #define STATUS_END_OF_MEDIA 0x8000001E
1120 #define STATUS_BEGINNING_OF_MEDIA 0x8000001F
1121 #define STATUS_MEDIA_CHECK 0x80000020
1122 #define STATUS_SETMARK_DETECTED 0x80000021
1123 #define STATUS_NO_DATA_DETECTED 0x80000022
1124 #define STATUS_REDIRECTOR_HAS_OPEN_HANDLES 0x80000023
1125 #define STATUS_SERVER_HAS_OPEN_HANDLES 0x80000024
1126 #define STATUS_ALREADY_DISCONNECTED 0x80000025
1127 #define STATUS_LONGJUMP 0x80000026
1129 #define STATUS_UNSUCCESSFUL 0xC0000001
1130 #define STATUS_NOT_IMPLEMENTED 0xC0000002
1131 #define STATUS_INVALID_INFO_CLASS 0xC0000003
1132 #define STATUS_INFO_LENGTH_MISMATCH 0xC0000004
1133 #define STATUS_ACCESS_VIOLATION 0xC0000005
1134 #define STATUS_IN_PAGE_ERROR 0xC0000006
1135 #define STATUS_PAGEFILE_QUOTA 0xC0000007
1136 #define STATUS_INVALID_HANDLE 0xC0000008
1137 #define STATUS_BAD_INITIAL_STACK 0xC0000009
1138 #define STATUS_BAD_INITIAL_PC 0xC000000A
1139 #define STATUS_INVALID_CID 0xC000000B
1140 #define STATUS_TIMER_NOT_CANCELED 0xC000000C
1141 #define STATUS_INVALID_PARAMETER 0xC000000D
1142 #define STATUS_NO_SUCH_DEVICE 0xC000000E
1143 #define STATUS_NO_SUCH_FILE 0xC000000F
1144 #define STATUS_INVALID_DEVICE_REQUEST 0xC0000010
1145 #define STATUS_END_OF_FILE 0xC0000011
1146 #define STATUS_WRONG_VOLUME 0xC0000012
1147 #define STATUS_NO_MEDIA_IN_DEVICE 0xC0000013
1148 #define STATUS_UNRECOGNIZED_MEDIA 0xC0000014
1149 #define STATUS_NONEXISTENT_SECTOR 0xC0000015
1150 #define STATUS_MORE_PROCESSING_REQUIRED 0xC0000016
1151 #define STATUS_NO_MEMORY 0xC0000017
1152 #define STATUS_CONFLICTING_ADDRESSES 0xC0000018
1153 #define STATUS_NOT_MAPPED_VIEW 0xC0000019
1154 #define STATUS_UNABLE_TO_FREE_VM 0xC000001A
1155 #define STATUS_UNABLE_TO_DELETE_SECTION 0xC000001B
1156 #define STATUS_INVALID_SYSTEM_SERVICE 0xC000001C
1157 #define STATUS_ILLEGAL_INSTRUCTION 0xC000001D
1158 #define STATUS_INVALID_LOCK_SEQUENCE 0xC000001E
1159 #define STATUS_INVALID_VIEW_SIZE 0xC000001F
1160 #define STATUS_INVALID_FILE_FOR_SECTION 0xC0000020
1161 #define STATUS_ALREADY_COMMITTED 0xC0000021
1162 #define STATUS_ACCESS_DENIED 0xC0000022
1163 #define STATUS_BUFFER_TOO_SMALL 0xC0000023
1164 #define STATUS_OBJECT_TYPE_MISMATCH 0xC0000024
1165 #define STATUS_NONCONTINUABLE_EXCEPTION 0xC0000025
1166 #define STATUS_INVALID_DISPOSITION 0xC0000026
1167 #define STATUS_UNWIND 0xC0000027
1168 #define STATUS_BAD_STACK 0xC0000028
1169 #define STATUS_INVALID_UNWIND_TARGET 0xC0000029
1170 #define STATUS_NOT_LOCKED 0xC000002A
1171 #define STATUS_PARITY_ERROR 0xC000002B
1172 #define STATUS_UNABLE_TO_DECOMMIT_VM 0xC000002C
1173 #define STATUS_NOT_COMMITTED 0xC000002D
1174 #define STATUS_INVALID_PORT_ATTRIBUTES 0xC000002E
1175 #define STATUS_PORT_MESSAGE_TOO_LONG 0xC000002F
1176 #define STATUS_INVALID_PARAMETER_MIX 0xC0000030
1177 #define STATUS_INVALID_QUOTA_LOWER 0xC0000031
1178 #define STATUS_DISK_CORRUPT_ERROR 0xC0000032
1179 #define STATUS_OBJECT_NAME_INVALID 0xC0000033
1180 #define STATUS_OBJECT_NAME_NOT_FOUND 0xC0000034
1181 #define STATUS_OBJECT_NAME_COLLISION 0xC0000035
1182 #define STATUS_PORT_DISCONNECTED 0xC0000037
1183 #define STATUS_DEVICE_ALREADY_ATTACHED 0xC0000038
1184 #define STATUS_OBJECT_PATH_INVALID 0xC0000039
1185 #define STATUS_OBJECT_PATH_NOT_FOUND 0xC000003A
1186 #define STATUS_PATH_SYNTAX_BAD 0xC000003B
1187 #define STATUS_DATA_OVERRUN 0xC000003C
1188 #define STATUS_DATA_LATE_ERROR 0xC000003D
1189 #define STATUS_DATA_ERROR 0xC000003E
1190 #define STATUS_CRC_ERROR 0xC000003F
1191 #define STATUS_SECTION_TOO_BIG 0xC0000040
1192 #define STATUS_PORT_CONNECTION_REFUSED 0xC0000041
1193 #define STATUS_INVALID_PORT_HANDLE 0xC0000042
1194 #define STATUS_SHARING_VIOLATION 0xC0000043
1195 #define STATUS_QUOTA_EXCEEDED 0xC0000044
1196 #define STATUS_INVALID_PAGE_PROTECTION 0xC0000045
1197 #define STATUS_MUTANT_NOT_OWNED 0xC0000046
1198 #define STATUS_SEMAPHORE_LIMIT_EXCEEDED 0xC0000047
1199 #define STATUS_PORT_ALREADY_SET 0xC0000048
1200 #define STATUS_SUSPEND_COUNT_EXCEEDED 0xC000004A
1201 #define STATUS_LOCK_NOT_GRANTED 0xC0000054 /* FIXME: not sure */
1202 #define STATUS_FILE_LOCK_CONFLICT 0xC0000055 /* FIXME: not sure */
1203 #define STATUS_UNKNOWN_REVISION 0xC0000058
1204 #define STATUS_INVALID_SECURITY_DESCR 0xC0000079
1205 #define STATUS_DISK_FULL 0xC000007F
1206 #define STATUS_SECTION_NOT_EXTENDED 0xC0000087
1207 #define STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008C
1208 #define STATUS_FLOAT_DENORMAL_OPERAND 0xC000008D
1209 #define STATUS_FLOAT_DIVIDE_BY_ZERO 0xC000008E
1210 #define STATUS_FLOAT_INEXACT_RESULT 0xC000008F
1211 #define STATUS_FLOAT_INVALID_OPERATION 0xC0000090
1212 #define STATUS_FLOAT_OVERFLOW 0xC0000091
1213 #define STATUS_FLOAT_STACK_CHECK 0xC0000092
1214 #define STATUS_FLOAT_UNDERFLOW 0xC0000093
1215 #define STATUS_INTEGER_DIVIDE_BY_ZERO 0xC0000094
1216 #define STATUS_INTEGER_OVERFLOW 0xC0000095
1217 #define STATUS_PRIVILEGED_INSTRUCTION 0xC0000096
1218 #define STATUS_MEDIA_WRITE_PROTECTED 0XC00000A2
1219 #define STATUS_INVALID_PARAMETER_2 0xC00000F0
1220 #define STATUS_STACK_OVERFLOW 0xC00000FD
1221 #define STATUS_DIRECTORY_NOT_EMPTY 0xC0000101
1222 #define STATUS_TOO_MANY_OPENED_FILES 0xC000011F
1223 #define STATUS_CONTROL_C_EXIT 0xC000013A
1224 #define STATUS_PIPE_BROKEN 0xC000014B
1225 #define STATUS_NOT_REGISTRY_FILE 0xC000015C
1226 #define STATUS_PARTITION_FAILURE 0xC0000172
1227 #define STATUS_INVALID_BLOCK_LENGTH 0xC0000173
1228 #define STATUS_DEVICE_NOT_PARTITIONED 0xC0000174
1229 #define STATUS_UNABLE_TO_LOCK_MEDIA 0xC0000175
1230 #define STATUS_UNABLE_TO_UNLOAD_MEDIA 0xC0000176
1231 #define STATUS_EOM_OVERFLOW 0xC0000177
1232 #define STATUS_NO_MEDIA 0xC0000178
1233 #define STATUS_NO_SUCH_MEMBER 0xC000017A
1234 #define STATUS_INVALID_MEMBER 0xC000017B
1235 #define STATUS_KEY_DELETED 0xC000017C
1236 #define STATUS_NO_LOG_SPACE 0xC000017D
1237 #define STATUS_TOO_MANY_SIDS 0xC000017E
1238 #define STATUS_LM_CROSS_ENCRYPTION_REQUIRED 0xC000017F
1239 #define STATUS_KEY_HAS_CHILDREN 0xC0000180
1240 #define STATUS_CHILD_MUST_BE_VOLATILE 0xC0000181
1241 #define STATUS_DEVICE_CONFIGURATION_ERROR0xC0000182
1242 #define STATUS_DRIVER_INTERNAL_ERROR 0xC0000183
1243 #define STATUS_INVALID_DEVICE_STATE 0xC0000184
1244 #define STATUS_IO_DEVICE_ERROR 0xC0000185
1245 #define STATUS_DEVICE_PROTOCOL_ERROR 0xC0000186
1246 #define STATUS_BACKUP_CONTROLLER 0xC0000187
1247 #define STATUS_LOG_FILE_FULL 0xC0000188
1248 #define STATUS_TOO_LATE 0xC0000189
1249 #define STATUS_NO_TRUST_LSA_SECRET 0xC000018A
1250 #define STATUS_NO_TRUST_SAM_ACCOUNT 0xC000018B
1251 #define STATUS_TRUSTED_DOMAIN_FAILURE 0xC000018C
1252 #define STATUS_TRUSTED_RELATIONSHIP_FAILURE 0xC000018D
1253 #define STATUS_EVENTLOG_FILE_CORRUPT 0xC000018E
1254 #define STATUS_EVENTLOG_CANT_START 0xC000018F
1255 #define STATUS_TRUST_FAILURE 0xC0000190
1256 #define STATUS_MUTANT_LIMIT_EXCEEDED 0xC0000191
1257 #define STATUS_NETLOGON_NOT_STARTED 0xC0000192
1258 #define STATUS_ACCOUNT_EXPIRED 0xC0000193
1259 #define STATUS_POSSIBLE_DEADLOCK 0xC0000194
1260 #define STATUS_NETWORK_CREDENTIAL_CONFLICT 0xC0000195
1261 #define STATUS_REMOTE_SESSION_LIMIT 0xC0000196
1262 #define STATUS_EVENTLOG_FILE_CHANGED 0xC0000197
1263 #define STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT 0xC0000198
1264 #define STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT 0xC0000199
1265 #define STATUS_NOLOGON_SERVER_TRUST_ACCOUNT 0xC000019A
1266 #define STATUS_DOMAIN_TRUST_INCONSISTENT 0xC000019B
1267 #define STATUS_FS_DRIVER_REQUIRED 0xC000019C
1269 #define STATUS_RESOURCE_LANG_NOT_FOUND 0xC0000204
1271 #define MAXIMUM_WAIT_OBJECTS 64
1272 #define MAXIMUM_SUSPEND_COUNT 127
1276 * Return values from the actual exception handlers
1279 #define ExceptionContinueExecution 0
1280 #define ExceptionContinueSearch 1
1281 #define ExceptionNestedException 2
1282 #define ExceptionCollidedUnwind 3
1285 * Return values from filters in except() and from UnhandledExceptionFilter
1288 #define EXCEPTION_EXECUTE_HANDLER 1
1289 #define EXCEPTION_CONTINUE_SEARCH 0
1290 #define EXCEPTION_CONTINUE_EXECUTION -1
1293 * From OS/2 2.0 exception handling
1294 * Win32 seems to use the same flags as ExceptionFlags in an EXCEPTION_RECORD
1297 #define EH_NONCONTINUABLE 0x01
1298 #define EH_UNWINDING 0x02
1299 #define EH_EXIT_UNWIND 0x04
1300 #define EH_STACK_INVALID 0x08
1301 #define EH_NESTED_CALL 0x10
1303 #define EXCEPTION_CONTINUABLE 0
1304 #define EXCEPTION_NONCONTINUABLE EH_NONCONTINUABLE
1307 * The exception record used by Win32 to give additional information
1308 * about exception to exception handlers.
1311 #define EXCEPTION_MAXIMUM_PARAMETERS 15
1313 typedef struct __EXCEPTION_RECORD
1315 DWORD ExceptionCode
;
1316 DWORD ExceptionFlags
;
1317 struct __EXCEPTION_RECORD
*ExceptionRecord
;
1319 LPVOID ExceptionAddress
;
1320 DWORD NumberParameters
;
1321 DWORD ExceptionInformation
[EXCEPTION_MAXIMUM_PARAMETERS
];
1322 } EXCEPTION_RECORD
, *PEXCEPTION_RECORD
;
1325 * The exception pointers structure passed to exception filters
1326 * in except() and the UnhandledExceptionFilter().
1329 typedef struct _EXCEPTION_POINTERS
1331 PEXCEPTION_RECORD ExceptionRecord
;
1332 PCONTEXT ContextRecord
;
1333 } EXCEPTION_POINTERS
, *PEXCEPTION_POINTERS
;
1337 * The exception frame, used for registering exception handlers
1338 * Win32 cares only about this, but compilers generally emit
1339 * larger exception frames for their own use.
1342 struct __EXCEPTION_FRAME
;
1344 typedef DWORD (*PEXCEPTION_HANDLER
)(PEXCEPTION_RECORD
,struct __EXCEPTION_FRAME
*,
1345 PCONTEXT
,struct __EXCEPTION_FRAME
**);
1347 typedef struct __EXCEPTION_FRAME
1349 struct __EXCEPTION_FRAME
*Prev
;
1350 PEXCEPTION_HANDLER Handler
;
1351 } EXCEPTION_FRAME
, *PEXCEPTION_FRAME
;
1353 #include "poppack.h"
1356 * function pointer to a exception filter
1359 typedef LONG
CALLBACK (*PTOP_LEVEL_EXCEPTION_FILTER
)(PEXCEPTION_POINTERS ExceptionInfo
);
1360 typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER
;
1362 DWORD WINAPI
UnhandledExceptionFilter( PEXCEPTION_POINTERS epointers
);
1363 LPTOP_LEVEL_EXCEPTION_FILTER
1364 WINAPI
SetUnhandledExceptionFilter( LPTOP_LEVEL_EXCEPTION_FILTER filter
);
1366 /* status values for ContinueDebugEvent */
1367 #define DBG_CONTINUE 0x00010002
1368 #define DBG_TERMINATE_THREAD 0x40010003
1369 #define DBG_TERMINATE_PROCESS 0x40010004
1370 #define DBG_CONTROL_C 0x40010005
1371 #define DBG_CONTROL_BREAK 0x40010008
1372 #define DBG_EXCEPTION_NOT_HANDLED 0x80010001
1374 typedef struct _NT_TIB
1376 struct _EXCEPTION_REGISTRATION_RECORD
*ExceptionList
;
1384 PVOID ArbitraryUserPointer
;
1385 struct _NT_TIB
*Self
;
1390 #if defined(__i386__) && defined(__GNUC__)
1391 extern inline struct _TEB WINAPI
*NtCurrentTeb(void);
1392 extern inline struct _TEB WINAPI
*NtCurrentTeb(void)
1395 __asm__(".byte 0x64\n\tmovl (0x18),%0" : "=r" (teb
));
1399 extern struct _TEB WINAPI
*NtCurrentTeb(void);
1404 * File formats definitions
1407 typedef struct _IMAGE_DOS_HEADER
{
1408 WORD e_magic
; /* 00: MZ Header signature */
1409 WORD e_cblp
; /* 02: Bytes on last page of file */
1410 WORD e_cp
; /* 04: Pages in file */
1411 WORD e_crlc
; /* 06: Relocations */
1412 WORD e_cparhdr
; /* 08: Size of header in paragraphs */
1413 WORD e_minalloc
; /* 0a: Minimum extra paragraphs needed */
1414 WORD e_maxalloc
; /* 0c: Maximum extra paragraphs needed */
1415 WORD e_ss
; /* 0e: Initial (relative) SS value */
1416 WORD e_sp
; /* 10: Initial SP value */
1417 WORD e_csum
; /* 12: Checksum */
1418 WORD e_ip
; /* 14: Initial IP value */
1419 WORD e_cs
; /* 16: Initial (relative) CS value */
1420 WORD e_lfarlc
; /* 18: File address of relocation table */
1421 WORD e_ovno
; /* 1a: Overlay number */
1422 WORD e_res
[4]; /* 1c: Reserved words */
1423 WORD e_oemid
; /* 24: OEM identifier (for e_oeminfo) */
1424 WORD e_oeminfo
; /* 26: OEM information; e_oemid specific */
1425 WORD e_res2
[10]; /* 28: Reserved words */
1426 DWORD e_lfanew
; /* 3c: Offset to extended header */
1427 } IMAGE_DOS_HEADER
, *PIMAGE_DOS_HEADER
;
1429 #define IMAGE_DOS_SIGNATURE 0x5A4D /* MZ */
1430 #define IMAGE_OS2_SIGNATURE 0x454E /* NE */
1431 #define IMAGE_OS2_SIGNATURE_LE 0x454C /* LE */
1432 #define IMAGE_OS2_SIGNATURE_LX 0x584C /* LX */
1433 #define IMAGE_VXD_SIGNATURE 0x454C /* LE */
1434 #define IMAGE_NT_SIGNATURE 0x00004550 /* PE00 */
1437 * This is the Windows executable (NE) header.
1438 * the name IMAGE_OS2_HEADER is misleading, but in the SDK this way.
1442 WORD ne_magic
; /* 00 NE signature 'NE' */
1443 BYTE ne_ver
; /* 02 Linker version number */
1444 BYTE ne_rev
; /* 03 Linker revision number */
1445 WORD ne_enttab
; /* 04 Offset to entry table relative to NE */
1446 WORD ne_cbenttab
; /* 06 Length of entry table in bytes */
1447 LONG ne_crc
; /* 08 Checksum */
1448 WORD ne_flags
; /* 0c Flags about segments in this file */
1449 WORD ne_autodata
; /* 0e Automatic data segment number */
1450 WORD ne_heap
; /* 10 Initial size of local heap */
1451 WORD ne_stack
; /* 12 Initial size of stack */
1452 DWORD ne_csip
; /* 14 Initial CS:IP */
1453 DWORD ne_sssp
; /* 18 Initial SS:SP */
1454 WORD ne_cseg
; /* 1c # of entries in segment table */
1455 WORD ne_cmod
; /* 1e # of entries in module reference tab. */
1456 WORD ne_cbnrestab
; /* 20 Length of nonresident-name table */
1457 WORD ne_segtab
; /* 22 Offset to segment table */
1458 WORD ne_rsrctab
; /* 24 Offset to resource table */
1459 WORD ne_restab
; /* 26 Offset to resident-name table */
1460 WORD ne_modtab
; /* 28 Offset to module reference table */
1461 WORD ne_imptab
; /* 2a Offset to imported name table */
1462 DWORD ne_nrestab
; /* 2c Offset to nonresident-name table */
1463 WORD ne_cmovent
; /* 30 # of movable entry points */
1464 WORD ne_align
; /* 32 Logical sector alignment shift count */
1465 WORD ne_cres
; /* 34 # of resource segments */
1466 BYTE ne_exetyp
; /* 36 Flags indicating target OS */
1467 BYTE ne_flagsothers
; /* 37 Additional information flags */
1468 WORD fastload_offset
; /* 38 Offset to fast load area (should be ne_pretthunks)*/
1469 WORD fastload_length
; /* 3a Length of fast load area (should be ne_psegrefbytes) */
1470 WORD ne_swaparea
; /* 3c Reserved by Microsoft */
1471 WORD ne_expver
; /* 3e Expected Windows version number */
1472 } IMAGE_OS2_HEADER
,*PIMAGE_OS2_HEADER
;
1474 typedef struct _IMAGE_VXD_HEADER
{
1489 DWORD e32_lastpagesize
;
1490 DWORD e32_fixupsize
;
1507 DWORD e32_impmodcnt
;
1513 DWORD e32_cbnrestab
;
1516 DWORD e32_debuginfo
;
1518 DWORD e32_instpreload
;
1519 DWORD e32_instdemand
;
1522 DWORD e32_winresoff
;
1523 DWORD e32_winreslen
;
1526 } IMAGE_VXD_HEADER
, *PIMAGE_VXD_HEADER
;
1529 /* These defines describe the meanings of the bits in the Characteristics
1532 #define IMAGE_FILE_RELOCS_STRIPPED 0x0001 /* No relocation info */
1533 #define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002
1534 #define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004
1535 #define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008
1536 #define IMAGE_FILE_16BIT_MACHINE 0x0040
1537 #define IMAGE_FILE_BYTES_REVERSED_LO 0x0080
1538 #define IMAGE_FILE_32BIT_MACHINE 0x0100
1539 #define IMAGE_FILE_DEBUG_STRIPPED 0x0200
1540 #define IMAGE_FILE_SYSTEM 0x1000
1541 #define IMAGE_FILE_DLL 0x2000
1542 #define IMAGE_FILE_BYTES_REVERSED_HI 0x8000
1544 /* These are the settings of the Machine field. */
1545 #define IMAGE_FILE_MACHINE_UNKNOWN 0
1546 #define IMAGE_FILE_MACHINE_I860 0x14d
1547 #define IMAGE_FILE_MACHINE_I386 0x14c
1548 #define IMAGE_FILE_MACHINE_R3000 0x162
1549 #define IMAGE_FILE_MACHINE_R4000 0x166
1550 #define IMAGE_FILE_MACHINE_R10000 0x168
1551 #define IMAGE_FILE_MACHINE_ALPHA 0x184
1552 #define IMAGE_FILE_MACHINE_POWERPC 0x1F0
1554 #define IMAGE_SIZEOF_FILE_HEADER 20
1556 /* Possible Magic values */
1557 #define IMAGE_NT_OPTIONAL_HDR_MAGIC 0x10b
1558 #define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
1560 /* These are indexes into the DataDirectory array */
1561 #define IMAGE_FILE_EXPORT_DIRECTORY 0
1562 #define IMAGE_FILE_IMPORT_DIRECTORY 1
1563 #define IMAGE_FILE_RESOURCE_DIRECTORY 2
1564 #define IMAGE_FILE_EXCEPTION_DIRECTORY 3
1565 #define IMAGE_FILE_SECURITY_DIRECTORY 4
1566 #define IMAGE_FILE_BASE_RELOCATION_TABLE 5
1567 #define IMAGE_FILE_DEBUG_DIRECTORY 6
1568 #define IMAGE_FILE_DESCRIPTION_STRING 7
1569 #define IMAGE_FILE_MACHINE_VALUE 8 /* Mips */
1570 #define IMAGE_FILE_THREAD_LOCAL_STORAGE 9
1571 #define IMAGE_FILE_CALLBACK_DIRECTORY 10
1573 /* Directory Entries, indices into the DataDirectory array */
1575 #define IMAGE_DIRECTORY_ENTRY_EXPORT 0
1576 #define IMAGE_DIRECTORY_ENTRY_IMPORT 1
1577 #define IMAGE_DIRECTORY_ENTRY_RESOURCE 2
1578 #define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3
1579 #define IMAGE_DIRECTORY_ENTRY_SECURITY 4
1580 #define IMAGE_DIRECTORY_ENTRY_BASERELOC 5
1581 #define IMAGE_DIRECTORY_ENTRY_DEBUG 6
1582 #define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7
1583 #define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 /* (MIPS GP) */
1584 #define IMAGE_DIRECTORY_ENTRY_TLS 9
1585 #define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10
1586 #define IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT 11
1587 #define IMAGE_DIRECTORY_ENTRY_IAT 12 /* Import Address Table */
1588 #define IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT 13
1589 #define IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR 14
1591 /* Subsystem Values */
1593 #define IMAGE_SUBSYSTEM_UNKNOWN 0
1594 #define IMAGE_SUBSYSTEM_NATIVE 1
1595 #define IMAGE_SUBSYSTEM_WINDOWS_GUI 2 /* Windows GUI subsystem */
1596 #define IMAGE_SUBSYSTEM_WINDOWS_CUI 3 /* Windows character subsystem*/
1597 #define IMAGE_SUBSYSTEM_OS2_CUI 5
1598 #define IMAGE_SUBSYSTEM_POSIX_CUI 7
1600 typedef struct _IMAGE_FILE_HEADER
{
1602 WORD NumberOfSections
;
1603 DWORD TimeDateStamp
;
1604 DWORD PointerToSymbolTable
;
1605 DWORD NumberOfSymbols
;
1606 WORD SizeOfOptionalHeader
;
1607 WORD Characteristics
;
1608 } IMAGE_FILE_HEADER
, *PIMAGE_FILE_HEADER
;
1610 typedef struct _IMAGE_DATA_DIRECTORY
{
1611 DWORD VirtualAddress
;
1613 } IMAGE_DATA_DIRECTORY
, *PIMAGE_DATA_DIRECTORY
;
1615 #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
1617 typedef struct _IMAGE_OPTIONAL_HEADER
{
1619 /* Standard fields */
1622 BYTE MajorLinkerVersion
;
1623 BYTE MinorLinkerVersion
;
1625 DWORD SizeOfInitializedData
;
1626 DWORD SizeOfUninitializedData
;
1627 DWORD AddressOfEntryPoint
;
1631 /* NT additional fields */
1634 DWORD SectionAlignment
;
1635 DWORD FileAlignment
;
1636 WORD MajorOperatingSystemVersion
;
1637 WORD MinorOperatingSystemVersion
;
1638 WORD MajorImageVersion
;
1639 WORD MinorImageVersion
;
1640 WORD MajorSubsystemVersion
;
1641 WORD MinorSubsystemVersion
;
1642 DWORD Win32VersionValue
;
1644 DWORD SizeOfHeaders
;
1647 WORD DllCharacteristics
;
1648 DWORD SizeOfStackReserve
;
1649 DWORD SizeOfStackCommit
;
1650 DWORD SizeOfHeapReserve
;
1651 DWORD SizeOfHeapCommit
;
1653 DWORD NumberOfRvaAndSizes
;
1654 IMAGE_DATA_DIRECTORY DataDirectory
[IMAGE_NUMBEROF_DIRECTORY_ENTRIES
];
1655 } IMAGE_OPTIONAL_HEADER
, *PIMAGE_OPTIONAL_HEADER
;
1657 typedef struct _IMAGE_NT_HEADERS
{
1659 IMAGE_FILE_HEADER FileHeader
;
1660 IMAGE_OPTIONAL_HEADER OptionalHeader
;
1661 } IMAGE_NT_HEADERS
, *PIMAGE_NT_HEADERS
;
1663 #define IMAGE_SIZEOF_SHORT_NAME 8
1665 typedef struct _IMAGE_SECTION_HEADER
{
1666 BYTE Name
[IMAGE_SIZEOF_SHORT_NAME
];
1668 DWORD PhysicalAddress
;
1671 DWORD VirtualAddress
;
1672 DWORD SizeOfRawData
;
1673 DWORD PointerToRawData
;
1674 DWORD PointerToRelocations
;
1675 DWORD PointerToLinenumbers
;
1676 WORD NumberOfRelocations
;
1677 WORD NumberOfLinenumbers
;
1678 DWORD Characteristics
;
1679 } IMAGE_SECTION_HEADER
, *PIMAGE_SECTION_HEADER
;
1681 #define IMAGE_SIZEOF_SECTION_HEADER 40
1683 #define IMAGE_FIRST_SECTION(ntheader) \
1684 ((PIMAGE_SECTION_HEADER)((LPBYTE)&((PIMAGE_NT_HEADERS)(ntheader))->OptionalHeader + \
1685 ((PIMAGE_NT_HEADERS)(ntheader))->FileHeader.SizeOfOptionalHeader))
1687 /* These defines are for the Characteristics bitfield. */
1688 /* #define IMAGE_SCN_TYPE_REG 0x00000000 - Reserved */
1689 /* #define IMAGE_SCN_TYPE_DSECT 0x00000001 - Reserved */
1690 /* #define IMAGE_SCN_TYPE_NOLOAD 0x00000002 - Reserved */
1691 /* #define IMAGE_SCN_TYPE_GROUP 0x00000004 - Reserved */
1692 /* #define IMAGE_SCN_TYPE_NO_PAD 0x00000008 - Reserved */
1693 /* #define IMAGE_SCN_TYPE_COPY 0x00000010 - Reserved */
1695 #define IMAGE_SCN_CNT_CODE 0x00000020
1696 #define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040
1697 #define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080
1699 #define IMAGE_SCN_LNK_OTHER 0x00000100
1700 #define IMAGE_SCN_LNK_INFO 0x00000200
1701 /* #define IMAGE_SCN_TYPE_OVER 0x00000400 - Reserved */
1702 #define IMAGE_SCN_LNK_REMOVE 0x00000800
1703 #define IMAGE_SCN_LNK_COMDAT 0x00001000
1705 /* 0x00002000 - Reserved */
1706 /* #define IMAGE_SCN_MEM_PROTECTED 0x00004000 - Obsolete */
1707 #define IMAGE_SCN_MEM_FARDATA 0x00008000
1709 /* #define IMAGE_SCN_MEM_SYSHEAP 0x00010000 - Obsolete */
1710 #define IMAGE_SCN_MEM_PURGEABLE 0x00020000
1711 #define IMAGE_SCN_MEM_16BIT 0x00020000
1712 #define IMAGE_SCN_MEM_LOCKED 0x00040000
1713 #define IMAGE_SCN_MEM_PRELOAD 0x00080000
1715 #define IMAGE_SCN_ALIGN_1BYTES 0x00100000
1716 #define IMAGE_SCN_ALIGN_2BYTES 0x00200000
1717 #define IMAGE_SCN_ALIGN_4BYTES 0x00300000
1718 #define IMAGE_SCN_ALIGN_8BYTES 0x00400000
1719 #define IMAGE_SCN_ALIGN_16BYTES 0x00500000 /* Default */
1720 #define IMAGE_SCN_ALIGN_32BYTES 0x00600000
1721 #define IMAGE_SCN_ALIGN_64BYTES 0x00700000
1722 /* 0x00800000 - Unused */
1724 #define IMAGE_SCN_LNK_NRELOC_OVFL 0x01000000
1727 #define IMAGE_SCN_MEM_DISCARDABLE 0x02000000
1728 #define IMAGE_SCN_MEM_NOT_CACHED 0x04000000
1729 #define IMAGE_SCN_MEM_NOT_PAGED 0x08000000
1730 #define IMAGE_SCN_MEM_SHARED 0x10000000
1731 #define IMAGE_SCN_MEM_EXECUTE 0x20000000
1732 #define IMAGE_SCN_MEM_READ 0x40000000
1733 #define IMAGE_SCN_MEM_WRITE 0x80000000
1735 #include "pshpack2.h"
1737 typedef struct _IMAGE_SYMBOL
{
1747 SHORT SectionNumber
;
1750 BYTE NumberOfAuxSymbols
;
1752 typedef IMAGE_SYMBOL
*PIMAGE_SYMBOL
;
1754 #define IMAGE_SIZEOF_SYMBOL 18
1756 typedef struct _IMAGE_LINENUMBER
{
1758 DWORD SymbolTableIndex
;
1759 DWORD VirtualAddress
;
1763 typedef IMAGE_LINENUMBER
*PIMAGE_LINENUMBER
;
1765 #define IMAGE_SIZEOF_LINENUMBER 6
1767 typedef union _IMAGE_AUX_SYMBOL
{
1779 DWORD PointerToLinenumber
;
1780 DWORD PointerToNextFunction
;
1789 BYTE Name
[IMAGE_SIZEOF_SYMBOL
];
1793 WORD NumberOfRelocations
;
1794 WORD NumberOfLinenumbers
;
1800 typedef IMAGE_AUX_SYMBOL
*PIMAGE_AUX_SYMBOL
;
1802 #define IMAGE_SIZEOF_AUX_SYMBOL 18
1804 #include "poppack.h"
1806 #define IMAGE_SYM_UNDEFINED (SHORT)0
1807 #define IMAGE_SYM_ABSOLUTE (SHORT)-1
1808 #define IMAGE_SYM_DEBUG (SHORT)-2
1810 #define IMAGE_SYM_TYPE_NULL 0x0000
1811 #define IMAGE_SYM_TYPE_VOID 0x0001
1812 #define IMAGE_SYM_TYPE_CHAR 0x0002
1813 #define IMAGE_SYM_TYPE_SHORT 0x0003
1814 #define IMAGE_SYM_TYPE_INT 0x0004
1815 #define IMAGE_SYM_TYPE_LONG 0x0005
1816 #define IMAGE_SYM_TYPE_FLOAT 0x0006
1817 #define IMAGE_SYM_TYPE_DOUBLE 0x0007
1818 #define IMAGE_SYM_TYPE_STRUCT 0x0008
1819 #define IMAGE_SYM_TYPE_UNION 0x0009
1820 #define IMAGE_SYM_TYPE_ENUM 0x000A
1821 #define IMAGE_SYM_TYPE_MOE 0x000B
1822 #define IMAGE_SYM_TYPE_BYTE 0x000C
1823 #define IMAGE_SYM_TYPE_WORD 0x000D
1824 #define IMAGE_SYM_TYPE_UINT 0x000E
1825 #define IMAGE_SYM_TYPE_DWORD 0x000F
1826 #define IMAGE_SYM_TYPE_PCODE 0x8000
1828 #define IMAGE_SYM_DTYPE_NULL 0
1829 #define IMAGE_SYM_DTYPE_POINTER 1
1830 #define IMAGE_SYM_DTYPE_FUNCTION 2
1831 #define IMAGE_SYM_DTYPE_ARRAY 3
1833 #define IMAGE_SYM_CLASS_END_OF_FUNCTION (BYTE )-1
1834 #define IMAGE_SYM_CLASS_NULL 0x0000
1835 #define IMAGE_SYM_CLASS_AUTOMATIC 0x0001
1836 #define IMAGE_SYM_CLASS_EXTERNAL 0x0002
1837 #define IMAGE_SYM_CLASS_STATIC 0x0003
1838 #define IMAGE_SYM_CLASS_REGISTER 0x0004
1839 #define IMAGE_SYM_CLASS_EXTERNAL_DEF 0x0005
1840 #define IMAGE_SYM_CLASS_LABEL 0x0006
1841 #define IMAGE_SYM_CLASS_UNDEFINED_LABEL 0x0007
1842 #define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 0x0008
1843 #define IMAGE_SYM_CLASS_ARGUMENT 0x0009
1844 #define IMAGE_SYM_CLASS_STRUCT_TAG 0x000A
1845 #define IMAGE_SYM_CLASS_MEMBER_OF_UNION 0x000B
1846 #define IMAGE_SYM_CLASS_UNION_TAG 0x000C
1847 #define IMAGE_SYM_CLASS_TYPE_DEFINITION 0x000D
1848 #define IMAGE_SYM_CLASS_UNDEFINED_STATIC 0x000E
1849 #define IMAGE_SYM_CLASS_ENUM_TAG 0x000F
1850 #define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 0x0010
1851 #define IMAGE_SYM_CLASS_REGISTER_PARAM 0x0011
1852 #define IMAGE_SYM_CLASS_BIT_FIELD 0x0012
1854 #define IMAGE_SYM_CLASS_FAR_EXTERNAL 0x0044
1855 #define IMAGE_SYM_CLASS_BLOCK 0x0064
1856 #define IMAGE_SYM_CLASS_FUNCTION 0x0065
1857 #define IMAGE_SYM_CLASS_END_OF_STRUCT 0x0066
1858 #define IMAGE_SYM_CLASS_FILE 0x0067
1859 #define IMAGE_SYM_CLASS_SECTION 0x0068
1860 #define IMAGE_SYM_CLASS_WEAK_EXTERNAL 0x0069
1862 #define N_BTMASK 0x000F
1863 #define N_TMASK 0x0030
1864 #define N_TMASK1 0x00C0
1865 #define N_TMASK2 0x00F0
1869 #define BTYPE(x) ((x) & N_BTMASK)
1872 #define ISPTR(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT))
1876 #define ISFCN(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_FUNCTION << N_BTSHFT))
1880 #define ISARY(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_ARRAY << N_BTSHFT))
1884 #define ISTAG(x) ((x)==IMAGE_SYM_CLASS_STRUCT_TAG || (x)==IMAGE_SYM_CLASS_UNION_TAG || (x)==IMAGE_SYM_CLASS_ENUM_TAG)
1888 #define INCREF(x) ((((x)&~N_BTMASK)<<N_TSHIFT)|(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT)|((x)&N_BTMASK))
1891 #define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
1894 #define IMAGE_COMDAT_SELECT_NODUPLICATES 1
1895 #define IMAGE_COMDAT_SELECT_ANY 2
1896 #define IMAGE_COMDAT_SELECT_SAME_SIZE 3
1897 #define IMAGE_COMDAT_SELECT_EXACT_MATCH 4
1898 #define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
1899 #define IMAGE_COMDAT_SELECT_LARGEST 6
1900 #define IMAGE_COMDAT_SELECT_NEWEST 7
1902 #define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
1903 #define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
1904 #define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
1906 /* Export module directory */
1908 typedef struct _IMAGE_EXPORT_DIRECTORY
{
1909 DWORD Characteristics
;
1910 DWORD TimeDateStamp
;
1915 DWORD NumberOfFunctions
;
1916 DWORD NumberOfNames
;
1917 DWORD AddressOfFunctions
;
1918 DWORD AddressOfNames
;
1919 DWORD AddressOfNameOrdinals
;
1920 } IMAGE_EXPORT_DIRECTORY
,*PIMAGE_EXPORT_DIRECTORY
;
1922 /* Import name entry */
1923 typedef struct _IMAGE_IMPORT_BY_NAME
{
1926 } IMAGE_IMPORT_BY_NAME
,*PIMAGE_IMPORT_BY_NAME
;
1929 typedef struct _IMAGE_THUNK_DATA
{
1931 LPBYTE ForwarderString
;
1934 PIMAGE_IMPORT_BY_NAME AddressOfData
;
1936 } IMAGE_THUNK_DATA
,*PIMAGE_THUNK_DATA
;
1938 /* Import module directory */
1940 typedef struct _IMAGE_IMPORT_DESCRIPTOR
{
1942 DWORD Characteristics
; /* 0 for terminating null import descriptor */
1943 PIMAGE_THUNK_DATA OriginalFirstThunk
; /* RVA to original unbound IAT */
1945 DWORD TimeDateStamp
; /* 0 if not bound,
1946 * -1 if bound, and real date\time stamp
1947 * in IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT
1949 * otherwise date/time stamp of DLL bound to
1952 DWORD ForwarderChain
; /* -1 if no forwarders */
1954 /* RVA to IAT (if bound this IAT has actual addresses) */
1955 PIMAGE_THUNK_DATA FirstThunk
;
1956 } IMAGE_IMPORT_DESCRIPTOR
,*PIMAGE_IMPORT_DESCRIPTOR
;
1958 #define IMAGE_ORDINAL_FLAG 0x80000000
1959 #define IMAGE_SNAP_BY_ORDINAL(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG) != 0)
1960 #define IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff)
1962 typedef struct _IMAGE_BOUND_IMPORT_DESCRIPTOR
1964 DWORD TimeDateStamp
;
1965 WORD OffsetModuleName
;
1966 WORD NumberOfModuleForwarderRefs
;
1967 /* Array of zero or more IMAGE_BOUND_FORWARDER_REF follows */
1968 } IMAGE_BOUND_IMPORT_DESCRIPTOR
, *PIMAGE_BOUND_IMPORT_DESCRIPTOR
;
1970 typedef struct _IMAGE_BOUND_FORWARDER_REF
1972 DWORD TimeDateStamp
;
1973 WORD OffsetModuleName
;
1975 } IMAGE_BOUND_FORWARDER_REF
, *PIMAGE_BOUND_FORWARDER_REF
;
1977 typedef struct _IMAGE_BASE_RELOCATION
1979 DWORD VirtualAddress
;
1982 } IMAGE_BASE_RELOCATION
,*PIMAGE_BASE_RELOCATION
;
1984 typedef struct _IMAGE_RELOCATION
1987 DWORD VirtualAddress
;
1990 DWORD SymbolTableIndex
;
1993 typedef IMAGE_RELOCATION
*PIMAGE_RELOCATION
;
1995 #define IMAGE_SIZEOF_RELOCATION 10
1997 /* generic relocation types */
1998 #define IMAGE_REL_BASED_ABSOLUTE 0
1999 #define IMAGE_REL_BASED_HIGH 1
2000 #define IMAGE_REL_BASED_LOW 2
2001 #define IMAGE_REL_BASED_HIGHLOW 3
2002 #define IMAGE_REL_BASED_HIGHADJ 4
2003 #define IMAGE_REL_BASED_MIPS_JMPADDR 5
2004 #define IMAGE_REL_BASED_SECTION 6
2005 #define IMAGE_REL_BASED_REL 7
2006 #define IMAGE_REL_BASED_MIPS_JMPADDR16 9
2007 #define IMAGE_REL_BASED_IA64_IMM64 9 /* yes, 9 too */
2008 #define IMAGE_REL_BASED_DIR64 10
2009 #define IMAGE_REL_BASED_HIGH3ADJ 11
2011 /* I386 relocation types */
2012 #define IMAGE_REL_I386_ABSOLUTE 0
2013 #define IMAGE_REL_I386_DIR16 1
2014 #define IMAGE_REL_I386_REL16 2
2015 #define IMAGE_REL_I386_DIR32 6
2016 #define IMAGE_REL_I386_DIR32NB 7
2017 #define IMAGE_REL_I386_SEG12 9
2018 #define IMAGE_REL_I386_SECTION 10
2019 #define IMAGE_REL_I386_SECREL 11
2020 #define IMAGE_REL_I386_REL32 20
2022 /* MIPS relocation types */
2023 #define IMAGE_REL_MIPS_ABSOLUTE 0x0000
2024 #define IMAGE_REL_MIPS_REFHALF 0x0001
2025 #define IMAGE_REL_MIPS_REFWORD 0x0002
2026 #define IMAGE_REL_MIPS_JMPADDR 0x0003
2027 #define IMAGE_REL_MIPS_REFHI 0x0004
2028 #define IMAGE_REL_MIPS_REFLO 0x0005
2029 #define IMAGE_REL_MIPS_GPREL 0x0006
2030 #define IMAGE_REL_MIPS_LITERAL 0x0007
2031 #define IMAGE_REL_MIPS_SECTION 0x000A
2032 #define IMAGE_REL_MIPS_SECREL 0x000B
2033 #define IMAGE_REL_MIPS_SECRELLO 0x000C
2034 #define IMAGE_REL_MIPS_SECRELHI 0x000D
2035 #define IMAGE_REL_MIPS_JMPADDR16 0x0010
2036 #define IMAGE_REL_MIPS_REFWORDNB 0x0022
2037 #define IMAGE_REL_MIPS_PAIR 0x0025
2039 /* ALPHA relocation types */
2040 #define IMAGE_REL_ALPHA_ABSOLUTE 0x0000
2041 #define IMAGE_REL_ALPHA_REFLONG 0x0001
2042 #define IMAGE_REL_ALPHA_REFQUAD 0x0002
2043 #define IMAGE_REL_ALPHA_GPREL 0x0003
2044 #define IMAGE_REL_ALPHA_LITERAL 0x0004
2045 #define IMAGE_REL_ALPHA_LITUSE 0x0005
2046 #define IMAGE_REL_ALPHA_GPDISP 0x0006
2047 #define IMAGE_REL_ALPHA_BRADDR 0x0007
2048 #define IMAGE_REL_ALPHA_HINT 0x0008
2049 #define IMAGE_REL_ALPHA_INLINE_REFLONG 0x0009
2050 #define IMAGE_REL_ALPHA_REFHI 0x000A
2051 #define IMAGE_REL_ALPHA_REFLO 0x000B
2052 #define IMAGE_REL_ALPHA_PAIR 0x000C
2053 #define IMAGE_REL_ALPHA_MATCH 0x000D
2054 #define IMAGE_REL_ALPHA_SECTION 0x000E
2055 #define IMAGE_REL_ALPHA_SECREL 0x000F
2056 #define IMAGE_REL_ALPHA_REFLONGNB 0x0010
2057 #define IMAGE_REL_ALPHA_SECRELLO 0x0011
2058 #define IMAGE_REL_ALPHA_SECRELHI 0x0012
2059 #define IMAGE_REL_ALPHA_REFQ3 0x0013
2060 #define IMAGE_REL_ALPHA_REFQ2 0x0014
2061 #define IMAGE_REL_ALPHA_REFQ1 0x0015
2062 #define IMAGE_REL_ALPHA_GPRELLO 0x0016
2063 #define IMAGE_REL_ALPHA_GPRELHI 0x0017
2065 /* PowerPC relocation types */
2066 #define IMAGE_REL_PPC_ABSOLUTE 0x0000
2067 #define IMAGE_REL_PPC_ADDR64 0x0001
2068 #define IMAGE_REL_PPC_ADDR 0x0002
2069 #define IMAGE_REL_PPC_ADDR24 0x0003
2070 #define IMAGE_REL_PPC_ADDR16 0x0004
2071 #define IMAGE_REL_PPC_ADDR14 0x0005
2072 #define IMAGE_REL_PPC_REL24 0x0006
2073 #define IMAGE_REL_PPC_REL14 0x0007
2074 #define IMAGE_REL_PPC_TOCREL16 0x0008
2075 #define IMAGE_REL_PPC_TOCREL14 0x0009
2076 #define IMAGE_REL_PPC_ADDR32NB 0x000A
2077 #define IMAGE_REL_PPC_SECREL 0x000B
2078 #define IMAGE_REL_PPC_SECTION 0x000C
2079 #define IMAGE_REL_PPC_IFGLUE 0x000D
2080 #define IMAGE_REL_PPC_IMGLUE 0x000E
2081 #define IMAGE_REL_PPC_SECREL16 0x000F
2082 #define IMAGE_REL_PPC_REFHI 0x0010
2083 #define IMAGE_REL_PPC_REFLO 0x0011
2084 #define IMAGE_REL_PPC_PAIR 0x0012
2085 #define IMAGE_REL_PPC_SECRELLO 0x0013
2086 #define IMAGE_REL_PPC_SECRELHI 0x0014
2087 #define IMAGE_REL_PPC_GPREL 0x0015
2088 #define IMAGE_REL_PPC_TYPEMASK 0x00FF
2090 #define IMAGE_REL_PPC_NEG 0x0100
2091 #define IMAGE_REL_PPC_BRTAKEN 0x0200
2092 #define IMAGE_REL_PPC_BRNTAKEN 0x0400
2093 #define IMAGE_REL_PPC_TOCDEFN 0x0800
2095 /* SH3 ? relocation type */
2096 #define IMAGE_REL_SH3_ABSOLUTE 0x0000
2097 #define IMAGE_REL_SH3_DIRECT16 0x0001
2098 #define IMAGE_REL_SH3_DIRECT 0x0002
2099 #define IMAGE_REL_SH3_DIRECT8 0x0003
2100 #define IMAGE_REL_SH3_DIRECT8_WORD 0x0004
2101 #define IMAGE_REL_SH3_DIRECT8_LONG 0x0005
2102 #define IMAGE_REL_SH3_DIRECT4 0x0006
2103 #define IMAGE_REL_SH3_DIRECT4_WORD 0x0007
2104 #define IMAGE_REL_SH3_DIRECT4_LONG 0x0008
2105 #define IMAGE_REL_SH3_PCREL8_WORD 0x0009
2106 #define IMAGE_REL_SH3_PCREL8_LONG 0x000A
2107 #define IMAGE_REL_SH3_PCREL12_WORD 0x000B
2108 #define IMAGE_REL_SH3_STARTOF_SECTION 0x000C
2109 #define IMAGE_REL_SH3_SIZEOF_SECTION 0x000D
2110 #define IMAGE_REL_SH3_SECTION 0x000E
2111 #define IMAGE_REL_SH3_SECREL 0x000F
2112 #define IMAGE_REL_SH3_DIRECT32_NB 0x0010
2114 /* ARM (Archimedes?) relocation types */
2115 #define IMAGE_REL_ARM_ABSOLUTE 0x0000
2116 #define IMAGE_REL_ARM_ADDR 0x0001
2117 #define IMAGE_REL_ARM_ADDR32NB 0x0002
2118 #define IMAGE_REL_ARM_BRANCH24 0x0003
2119 #define IMAGE_REL_ARM_BRANCH11 0x0004
2120 #define IMAGE_REL_ARM_SECTION 0x000E
2121 #define IMAGE_REL_ARM_SECREL 0x000F
2123 /* IA64 relocation types */
2124 #define IMAGE_REL_IA64_ABSOLUTE 0x0000
2125 #define IMAGE_REL_IA64_IMM14 0x0001
2126 #define IMAGE_REL_IA64_IMM22 0x0002
2127 #define IMAGE_REL_IA64_IMM64 0x0003
2128 #define IMAGE_REL_IA64_DIR 0x0004
2129 #define IMAGE_REL_IA64_DIR64 0x0005
2130 #define IMAGE_REL_IA64_PCREL21B 0x0006
2131 #define IMAGE_REL_IA64_PCREL21M 0x0007
2132 #define IMAGE_REL_IA64_PCREL21F 0x0008
2133 #define IMAGE_REL_IA64_GPREL22 0x0009
2134 #define IMAGE_REL_IA64_LTOFF22 0x000A
2135 #define IMAGE_REL_IA64_SECTION 0x000B
2136 #define IMAGE_REL_IA64_SECREL22 0x000C
2137 #define IMAGE_REL_IA64_SECREL64I 0x000D
2138 #define IMAGE_REL_IA64_SECREL 0x000E
2139 #define IMAGE_REL_IA64_LTOFF64 0x000F
2140 #define IMAGE_REL_IA64_DIR32NB 0x0010
2141 #define IMAGE_REL_IA64_RESERVED_11 0x0011
2142 #define IMAGE_REL_IA64_RESERVED_12 0x0012
2143 #define IMAGE_REL_IA64_RESERVED_13 0x0013
2144 #define IMAGE_REL_IA64_RESERVED_14 0x0014
2145 #define IMAGE_REL_IA64_RESERVED_15 0x0015
2146 #define IMAGE_REL_IA64_RESERVED_16 0x0016
2147 #define IMAGE_REL_IA64_ADDEND 0x001F
2149 /* archive format */
2151 #define IMAGE_ARCHIVE_START_SIZE 8
2152 #define IMAGE_ARCHIVE_START "!<arch>\n"
2153 #define IMAGE_ARCHIVE_END "`\n"
2154 #define IMAGE_ARCHIVE_PAD "\n"
2155 #define IMAGE_ARCHIVE_LINKER_MEMBER "/ "
2156 #define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
2158 typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER
2167 } IMAGE_ARCHIVE_MEMBER_HEADER
, *PIMAGE_ARCHIVE_MEMBER_HEADER
;
2169 #define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
2172 * Resource directory stuff
2174 typedef struct _IMAGE_RESOURCE_DIRECTORY
{
2175 DWORD Characteristics
;
2176 DWORD TimeDateStamp
;
2179 WORD NumberOfNamedEntries
;
2180 WORD NumberOfIdEntries
;
2181 /* IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[]; */
2182 } IMAGE_RESOURCE_DIRECTORY
,*PIMAGE_RESOURCE_DIRECTORY
;
2184 #define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000
2185 #define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000
2187 typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY
{
2190 unsigned NameOffset
:31;
2191 unsigned NameIsString
:1;
2199 unsigned OffsetToDirectory
:31;
2200 unsigned DataIsDirectory
:1;
2203 } IMAGE_RESOURCE_DIRECTORY_ENTRY
,*PIMAGE_RESOURCE_DIRECTORY_ENTRY
;
2206 typedef struct _IMAGE_RESOURCE_DIRECTORY_STRING
{
2208 CHAR NameString
[ 1 ];
2209 } IMAGE_RESOURCE_DIRECTORY_STRING
,*PIMAGE_RESOURCE_DIRECTORY_STRING
;
2211 typedef struct _IMAGE_RESOURCE_DIR_STRING_U
{
2213 WCHAR NameString
[ 1 ];
2214 } IMAGE_RESOURCE_DIR_STRING_U
,*PIMAGE_RESOURCE_DIR_STRING_U
;
2216 typedef struct _IMAGE_RESOURCE_DATA_ENTRY
{
2220 DWORD ResourceHandle
;
2221 } IMAGE_RESOURCE_DATA_ENTRY
,*PIMAGE_RESOURCE_DATA_ENTRY
;
2224 typedef VOID
CALLBACK (*PIMAGE_TLS_CALLBACK
)(
2225 LPVOID DllHandle
,DWORD Reason
,LPVOID Reserved
2228 typedef struct _IMAGE_TLS_DIRECTORY
{
2229 DWORD StartAddressOfRawData
;
2230 DWORD EndAddressOfRawData
;
2231 LPDWORD AddressOfIndex
;
2232 PIMAGE_TLS_CALLBACK
*AddressOfCallBacks
;
2233 DWORD SizeOfZeroFill
;
2234 DWORD Characteristics
;
2235 } IMAGE_TLS_DIRECTORY
,*PIMAGE_TLS_DIRECTORY
;
2237 typedef struct _IMAGE_DEBUG_DIRECTORY
{
2238 DWORD Characteristics
;
2239 DWORD TimeDateStamp
;
2244 DWORD AddressOfRawData
;
2245 DWORD PointerToRawData
;
2246 } IMAGE_DEBUG_DIRECTORY
, *PIMAGE_DEBUG_DIRECTORY
;
2248 #define IMAGE_DEBUG_TYPE_UNKNOWN 0
2249 #define IMAGE_DEBUG_TYPE_COFF 1
2250 #define IMAGE_DEBUG_TYPE_CODEVIEW 2
2251 #define IMAGE_DEBUG_TYPE_FPO 3
2252 #define IMAGE_DEBUG_TYPE_MISC 4
2253 #define IMAGE_DEBUG_TYPE_EXCEPTION 5
2254 #define IMAGE_DEBUG_TYPE_FIXUP 6
2255 #define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7
2256 #define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8
2257 #define IMAGE_DEBUG_TYPE_BORLAND 9
2258 #define IMAGE_DEBUG_TYPE_RESERVED10 10
2260 typedef struct _IMAGE_COFF_SYMBOLS_HEADER
{
2261 DWORD NumberOfSymbols
;
2262 DWORD LvaToFirstSymbol
;
2263 DWORD NumberOfLinenumbers
;
2264 DWORD LvaToFirstLinenumber
;
2265 DWORD RvaToFirstByteOfCode
;
2266 DWORD RvaToLastByteOfCode
;
2267 DWORD RvaToFirstByteOfData
;
2268 DWORD RvaToLastByteOfData
;
2269 } IMAGE_COFF_SYMBOLS_HEADER
, *PIMAGE_COFF_SYMBOLS_HEADER
;
2272 #define FRAME_TRAP 1
2274 #define FRAME_NONFPO 3
2276 typedef struct _FPO_DATA
{
2281 unsigned cbProlog
: 8;
2282 unsigned cbRegs
: 3;
2283 unsigned fHasSEH
: 1;
2284 unsigned fUseBP
: 1;
2285 unsigned reserved
: 1;
2286 unsigned cbFrame
: 2;
2287 } FPO_DATA
, *PFPO_DATA
;
2289 typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY
{
2290 DWORD Characteristics
;
2291 DWORD TimeDateStamp
;
2294 DWORD GlobalFlagsClear
;
2295 DWORD GlobalFlagsSet
;
2296 DWORD CriticalSectionDefaultTimeout
;
2297 DWORD DeCommitFreeBlockThreshold
;
2298 DWORD DeCommitTotalFreeThreshold
;
2299 PVOID LockPrefixTable
;
2300 DWORD MaximumAllocationSize
;
2301 DWORD VirtualMemoryThreshold
;
2302 DWORD ProcessHeapFlags
;
2303 DWORD ProcessAffinityMask
;
2308 } IMAGE_LOAD_CONFIG_DIRECTORY
, *PIMAGE_LOAD_CONFIG_DIRECTORY
;
2310 typedef struct _IMAGE_FUNCTION_ENTRY
{
2311 DWORD StartingAddress
;
2312 DWORD EndingAddress
;
2313 DWORD EndOfPrologue
;
2314 } IMAGE_FUNCTION_ENTRY
, *PIMAGE_FUNCTION_ENTRY
;
2316 #define IMAGE_DEBUG_MISC_EXENAME 1
2318 typedef struct _IMAGE_DEBUG_MISC
{
2324 } IMAGE_DEBUG_MISC
, *PIMAGE_DEBUG_MISC
;
2326 /* This is the structure that appears at the very start of a .DBG file. */
2328 typedef struct _IMAGE_SEPARATE_DEBUG_HEADER
{
2332 WORD Characteristics
;
2333 DWORD TimeDateStamp
;
2337 DWORD NumberOfSections
;
2338 DWORD ExportedNamesSize
;
2339 DWORD DebugDirectorySize
;
2340 DWORD SectionAlignment
;
2341 DWORD Reserved
[ 2 ];
2342 } IMAGE_SEPARATE_DEBUG_HEADER
,*PIMAGE_SEPARATE_DEBUG_HEADER
;
2344 #define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944
2347 typedef struct tagMESSAGE_RESOURCE_ENTRY
{
2351 } MESSAGE_RESOURCE_ENTRY
,*PMESSAGE_RESOURCE_ENTRY
;
2352 #define MESSAGE_RESOURCE_UNICODE 0x0001
2354 typedef struct tagMESSAGE_RESOURCE_BLOCK
{
2357 DWORD OffsetToEntries
;
2358 } MESSAGE_RESOURCE_BLOCK
,*PMESSAGE_RESOURCE_BLOCK
;
2360 typedef struct tagMESSAGE_RESOURCE_DATA
{
2361 DWORD NumberOfBlocks
;
2362 MESSAGE_RESOURCE_BLOCK Blocks
[ 1 ];
2363 } MESSAGE_RESOURCE_DATA
,*PMESSAGE_RESOURCE_DATA
;
2366 * Here follows typedefs for security and tokens.
2370 * First a constant for the following typdefs.
2373 #define ANYSIZE_ARRAY 1
2375 /* FIXME: Orphan. What does it point to? */
2376 typedef PVOID PACCESS_TOKEN
;
2379 * TOKEN_INFORMATION_CLASS
2382 typedef enum _TOKEN_INFORMATION_CLASS
{
2391 TokenImpersonationLevel
,
2393 } TOKEN_INFORMATION_CLASS
;
2395 #ifndef _SECURITY_DEFINED
2396 #define _SECURITY_DEFINED
2398 #include "pshpack1.h"
2400 typedef DWORD ACCESS_MASK
, *PACCESS_MASK
;
2402 typedef struct _GENERIC_MAPPING
{
2403 ACCESS_MASK GenericRead
;
2404 ACCESS_MASK GenericWrite
;
2405 ACCESS_MASK GenericExecute
;
2406 ACCESS_MASK GenericAll
;
2407 } GENERIC_MAPPING
, *PGENERIC_MAPPING
;
2409 #ifndef SID_IDENTIFIER_AUTHORITY_DEFINED
2410 #define SID_IDENTIFIER_AUTHORITY_DEFINED
2413 } SID_IDENTIFIER_AUTHORITY
,*PSID_IDENTIFIER_AUTHORITY
,*LPSID_IDENTIFIER_AUTHORITY
;
2414 #endif /* !defined(SID_IDENTIFIER_AUTHORITY_DEFINED) */
2418 typedef struct _SID
{
2420 BYTE SubAuthorityCount
;
2421 SID_IDENTIFIER_AUTHORITY IdentifierAuthority
;
2422 DWORD SubAuthority
[1];
2424 #endif /* !defined(SID_DEFINED) */
2426 #define SID_REVISION (1) /* Current revision */
2427 #define SID_MAX_SUB_AUTHORITIES (15) /* current max subauths */
2428 #define SID_RECOMMENDED_SUB_AUTHORITIES (1) /* recommended subauths */
2435 #define ACL_REVISION1 1
2436 #define ACL_REVISION2 2
2437 #define ACL_REVISION3 3
2438 #define ACL_REVISION4 4
2440 #define MIN_ACL_REVISION ACL_REVISION2
2441 #define MAX_ACL_REVISION ACL_REVISION4
2443 typedef struct _ACL
{
2451 /* SECURITY_DESCRIPTOR */
2452 #define SECURITY_DESCRIPTOR_REVISION 1
2453 #define SECURITY_DESCRIPTOR_REVISION1 1
2456 #define SE_OWNER_DEFAULTED 0x0001
2457 #define SE_GROUP_DEFAULTED 0x0002
2458 #define SE_DACL_PRESENT 0x0004
2459 #define SE_DACL_DEFAULTED 0x0008
2460 #define SE_SACL_PRESENT 0x0010
2461 #define SE_SACL_DEFAULTED 0x0020
2462 #define SE_SELF_RELATIVE 0x8000
2464 typedef DWORD SECURITY_INFORMATION
, *PSECURITY_INFORMATION
;
2465 typedef WORD SECURITY_DESCRIPTOR_CONTROL
, *PSECURITY_DESCRIPTOR_CONTROL
;
2467 /* The security descriptor structure */
2471 SECURITY_DESCRIPTOR_CONTROL Control
;
2476 } SECURITY_DESCRIPTOR_RELATIVE
, *PISECURITY_DESCRIPTOR_RELATIVE
;
2481 SECURITY_DESCRIPTOR_CONTROL Control
;
2486 } SECURITY_DESCRIPTOR
, *PSECURITY_DESCRIPTOR
;
2488 #define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR))
2490 #include "poppack.h"
2492 #endif /* _SECURITY_DEFINED */
2494 #include "pshpack1.h"
2497 * SID_AND_ATTRIBUTES
2500 typedef struct _SID_AND_ATTRIBUTES
{
2503 } SID_AND_ATTRIBUTES
;
2505 /* security entities */
2506 #define SECURITY_NULL_RID (0x00000000L)
2507 #define SECURITY_WORLD_RID (0x00000000L)
2508 #define SECURITY_LOCAL_RID (0X00000000L)
2510 #define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0}
2513 #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
2516 #define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2}
2519 #define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3}
2520 #define SECURITY_CREATOR_OWNER_RID (0x00000000L)
2521 #define SECURITY_CREATOR_GROUP_RID (0x00000001L)
2522 #define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L)
2523 #define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L)
2526 #define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4}
2529 #define SECURITY_NT_AUTHORITY {0,0,0,0,0,5}
2530 #define SECURITY_DIALUP_RID 0x00000001L
2531 #define SECURITY_NETWORK_RID 0x00000002L
2532 #define SECURITY_BATCH_RID 0x00000003L
2533 #define SECURITY_INTERACTIVE_RID 0x00000004L
2534 #define SECURITY_LOGON_IDS_RID 0x00000005L
2535 #define SECURITY_SERVICE_RID 0x00000006L
2536 #define SECURITY_ANONYMOUS_LOGON_RID 0x00000007L
2537 #define SECURITY_PROXY_RID 0x00000008L
2538 #define SECURITY_ENTERPRISE_CONTROLLERS_RID 0x00000009L
2539 #define SECURITY_PRINCIPAL_SELF_RID 0x0000000AL
2540 #define SECURITY_AUTHENTICATED_USER_RID 0x0000000BL
2541 #define SECURITY_RESTRICTED_CODE_RID 0x0000000CL
2542 #define SECURITY_TERMINAL_SERVER_RID 0x0000000DL
2543 #define SECURITY_LOCAL_SYSTEM_RID 0x00000012L
2544 #define SECURITY_NT_NON_UNIQUE 0x00000015L
2545 #define SECURITY_BUILTIN_DOMAIN_RID 0x00000020L
2547 #define DOMAIN_GROUP_RID_ADMINS 0x00000200L
2548 #define DOMAIN_GROUP_RID_USERS 0x00000201L
2549 #define DOMAIN_GROUP_RID_GUESTS 0x00000202L
2551 #define DOMAIN_ALIAS_RID_ADMINS 0x00000220L
2552 #define DOMAIN_ALIAS_RID_USERS 0x00000221L
2553 #define DOMAIN_ALIAS_RID_GUESTS 0x00000222L
2555 #define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID
2557 #define SECURITY_LOGON_IDS_RID_COUNT (3L)
2563 typedef struct _TOKEN_USER
{
2564 SID_AND_ATTRIBUTES User
;
2571 typedef struct _TOKEN_GROUPS
{
2573 SID_AND_ATTRIBUTES Groups
[ANYSIZE_ARRAY
];
2577 * LUID_AND_ATTRIBUTES
2580 typedef union _LARGE_INTEGER
{
2586 } LARGE_INTEGER
, *LPLARGE_INTEGER
, *PLARGE_INTEGER
;
2588 typedef union _ULARGE_INTEGER
{
2594 } ULARGE_INTEGER
, *LPULARGE_INTEGER
, *PULARGE_INTEGER
;
2597 * Locally Unique Identifier
2600 typedef LARGE_INTEGER LUID
,*PLUID
;
2602 typedef struct _LUID_AND_ATTRIBUTES
{
2605 } LUID_AND_ATTRIBUTES
;
2611 typedef struct _PRIVILEGE_SET
{
2612 DWORD PrivilegeCount
;
2614 LUID_AND_ATTRIBUTES Privilege
[ANYSIZE_ARRAY
];
2615 } PRIVILEGE_SET
, *PPRIVILEGE_SET
;
2621 typedef struct _TOKEN_PRIVILEGES
{
2622 DWORD PrivilegeCount
;
2623 LUID_AND_ATTRIBUTES Privileges
[ANYSIZE_ARRAY
];
2624 } TOKEN_PRIVILEGES
, *PTOKEN_PRIVILEGES
;
2630 typedef struct _TOKEN_OWNER
{
2635 * TOKEN_PRIMARY_GROUP
2638 typedef struct _TOKEN_PRIMARY_GROUP
{
2640 } TOKEN_PRIMARY_GROUP
;
2644 * TOKEN_DEFAULT_DACL
2647 typedef struct _TOKEN_DEFAULT_DACL
{
2649 } TOKEN_DEFAULT_DACL
;
2655 typedef struct _TOKEN_SOURCE
{
2657 LUID SourceIdentifier
;
2664 typedef enum tagTOKEN_TYPE
{
2670 * SECURITY_IMPERSONATION_LEVEL
2673 typedef enum _SECURITY_IMPERSONATION_LEVEL
{
2675 SecurityIdentification
,
2676 SecurityImpersonation
,
2678 } SECURITY_IMPERSONATION_LEVEL
, *PSECURITY_IMPERSONATION_LEVEL
;
2681 typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE
,
2682 * PSECURITY_CONTEXT_TRACKING_MODE
;
2684 * Quality of Service
2687 typedef struct _SECURITY_QUALITY_OF_SERVICE
{
2689 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
;
2690 SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode
;
2692 } SECURITY_QUALITY_OF_SERVICE
, *PSECURITY_QUALITY_OF_SERVICE
;
2698 typedef struct _TOKEN_STATISTICS
{
2700 LUID AuthenticationId
;
2701 LARGE_INTEGER ExpirationTime
;
2702 TOKEN_TYPE TokenType
;
2703 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
;
2704 DWORD DynamicCharged
;
2705 DWORD DynamicAvailable
;
2707 DWORD PrivilegeCount
;
2715 #define ACL_REVISION 2
2717 #define ACL_REVISION1 1
2718 #define ACL_REVISION2 2
2720 /* ACEs, directly starting after an ACL */
2721 typedef struct _ACE_HEADER
{
2725 } ACE_HEADER
,*PACE_HEADER
;
2728 #define ACCESS_ALLOWED_ACE_TYPE 0
2729 #define ACCESS_DENIED_ACE_TYPE 1
2730 #define SYSTEM_AUDIT_ACE_TYPE 2
2731 #define SYSTEM_ALARM_ACE_TYPE 3
2733 /* inherit AceFlags */
2734 #define OBJECT_INHERIT_ACE 0x01
2735 #define CONTAINER_INHERIT_ACE 0x02
2736 #define NO_PROPAGATE_INHERIT_ACE 0x04
2737 #define INHERIT_ONLY_ACE 0x08
2738 #define VALID_INHERIT_FLAGS 0x0F
2740 /* AceFlags mask for what events we (should) audit */
2741 #define SUCCESSFUL_ACCESS_ACE_FLAG 0x40
2742 #define FAILED_ACCESS_ACE_FLAG 0x80
2744 /* different ACEs depending on AceType
2745 * SidStart marks the begin of a SID
2746 * so the thing finally looks like this:
2751 typedef struct _ACCESS_ALLOWED_ACE
{
2755 } ACCESS_ALLOWED_ACE
,*PACCESS_ALLOWED_ACE
;
2757 typedef struct _ACCESS_DENIED_ACE
{
2761 } ACCESS_DENIED_ACE
,*PACCESS_DENIED_ACE
;
2763 typedef struct _SYSTEM_AUDIT_ACE
{
2767 } SYSTEM_AUDIT_ACE
,*PSYSTEM_AUDIT_ACE
;
2769 typedef struct _SYSTEM_ALARM_ACE
{
2773 } SYSTEM_ALARM_ACE
,*PSYSTEM_ALARM_ACE
;
2775 typedef enum tagSID_NAME_USE
{
2780 SidTypeWellKnownGroup
,
2781 SidTypeDeletedAccount
,
2784 } SID_NAME_USE
,*PSID_NAME_USE
;
2788 /* DELETE may be already defined via /usr/include/arpa/nameser_compat.h */
2790 #define DELETE 0x00010000
2791 #define READ_CONTROL 0x00020000
2792 #define WRITE_DAC 0x00040000
2793 #define WRITE_OWNER 0x00080000
2794 #define SYNCHRONIZE 0x00100000
2795 #define STANDARD_RIGHTS_REQUIRED 0x000f0000
2797 #define STANDARD_RIGHTS_READ READ_CONTROL
2798 #define STANDARD_RIGHTS_WRITE READ_CONTROL
2799 #define STANDARD_RIGHTS_EXECUTE READ_CONTROL
2801 #define STANDARD_RIGHTS_ALL 0x001f0000
2803 #define SPECIFIC_RIGHTS_ALL 0x0000ffff
2805 #define GENERIC_READ 0x80000000
2806 #define GENERIC_WRITE 0x40000000
2807 #define GENERIC_EXECUTE 0x20000000
2808 #define GENERIC_ALL 0x10000000
2810 #define MAXIMUM_ALLOWED 0x02000000
2811 #define ACCESS_SYSTEM_SECURITY 0x01000000
2813 #define EVENT_MODIFY_STATE 0x0002
2814 #define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
2816 #define SEMAPHORE_MODIFY_STATE 0x0002
2817 #define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
2819 #define MUTEX_MODIFY_STATE 0x0001
2820 #define MUTEX_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1)
2822 #define TIMER_QUERY_STATE 0x0001
2823 #define TIMER_MODIFY_STATE 0x0002
2824 #define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
2826 #define PROCESS_TERMINATE 0x0001
2827 #define PROCESS_CREATE_THREAD 0x0002
2828 #define PROCESS_VM_OPERATION 0x0008
2829 #define PROCESS_VM_READ 0x0010
2830 #define PROCESS_VM_WRITE 0x0020
2831 #define PROCESS_DUP_HANDLE 0x0040
2832 #define PROCESS_CREATE_PROCESS 0x0080
2833 #define PROCESS_SET_QUOTA 0x0100
2834 #define PROCESS_SET_INFORMATION 0x0200
2835 #define PROCESS_QUERY_INFORMATION 0x0400
2836 #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xfff)
2838 #define THREAD_TERMINATE 0x0001
2839 #define THREAD_SUSPEND_RESUME 0x0002
2840 #define THREAD_GET_CONTEXT 0x0008
2841 #define THREAD_SET_CONTEXT 0x0010
2842 #define THREAD_SET_INFORMATION 0x0020
2843 #define THREAD_QUERY_INFORMATION 0x0040
2844 #define THREAD_SET_THREAD_TOKEN 0x0080
2845 #define THREAD_IMPERSONATE 0x0100
2846 #define THREAD_DIRECT_IMPERSONATION 0x0200
2847 #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3ff)
2849 #define THREAD_BASE_PRIORITY_LOWRT 15
2850 #define THREAD_BASE_PRIORITY_MAX 2
2851 #define THREAD_BASE_PRIORITY_MIN -2
2852 #define THREAD_BASE_PRIORITY_IDLE -15
2854 #define FILE_READ_DATA 0x0001 /* file & pipe */
2855 #define FILE_LIST_DIRECTORY 0x0001 /* directory */
2856 #define FILE_WRITE_DATA 0x0002 /* file & pipe */
2857 #define FILE_ADD_FILE 0x0002 /* directory */
2858 #define FILE_APPEND_DATA 0x0004 /* file */
2859 #define FILE_ADD_SUBDIRECTORY 0x0004 /* directory */
2860 #define FILE_CREATE_PIPE_INSTANCE 0x0004 /* named pipe */
2861 #define FILE_READ_EA 0x0008 /* file & directory */
2862 #define FILE_READ_PROPERTIES FILE_READ_EA
2863 #define FILE_WRITE_EA 0x0010 /* file & directory */
2864 #define FILE_WRITE_PROPERTIES FILE_WRITE_EA
2865 #define FILE_EXECUTE 0x0020 /* file */
2866 #define FILE_TRAVERSE 0x0020 /* directory */
2867 #define FILE_DELETE_CHILD 0x0040 /* directory */
2868 #define FILE_READ_ATTRIBUTES 0x0080 /* all */
2869 #define FILE_WRITE_ATTRIBUTES 0x0100 /* all */
2870 #define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1ff)
2872 #define FILE_GENERIC_READ (STANDARD_RIGHTS_READ | FILE_READ_DATA | \
2873 FILE_READ_ATTRIBUTES | FILE_READ_EA | \
2875 #define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | \
2876 FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | \
2877 FILE_APPEND_DATA | SYNCHRONIZE)
2878 #define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE | FILE_EXECUTE | \
2879 FILE_READ_ATTRIBUTES | SYNCHRONIZE)
2882 /* File attribute flags */
2883 #define FILE_SHARE_READ 0x00000001L
2884 #define FILE_SHARE_WRITE 0x00000002L
2885 #define FILE_SHARE_DELETE 0x00000004L
2886 #define FILE_ATTRIBUTE_READONLY 0x00000001L
2887 #define FILE_ATTRIBUTE_HIDDEN 0x00000002L
2888 #define FILE_ATTRIBUTE_SYSTEM 0x00000004L
2889 #define FILE_ATTRIBUTE_LABEL 0x00000008L /* Not in Windows API */
2890 #define FILE_ATTRIBUTE_DIRECTORY 0x00000010L
2891 #define FILE_ATTRIBUTE_ARCHIVE 0x00000020L
2892 #define FILE_ATTRIBUTE_NORMAL 0x00000080L
2893 #define FILE_ATTRIBUTE_TEMPORARY 0x00000100L
2894 #define FILE_ATTRIBUTE_ATOMIC_WRITE 0x00000200L
2895 #define FILE_ATTRIBUTE_XACTION_WRITE 0x00000400L
2896 #define FILE_ATTRIBUTE_COMPRESSED 0x00000800L
2897 #define FILE_ATTRIBUTE_OFFLINE 0x00001000L
2898 #define FILE_ATTRIBUTE_SYMLINK 0x80000000L /* Not in Windows API */
2900 /* File notification flags */
2901 #define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
2902 #define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
2903 #define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
2904 #define FILE_NOTIFY_CHANGE_SIZE 0x00000008
2905 #define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
2906 #define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
2907 #define FILE_NOTIFY_CHANGE_CREATION 0x00000040
2908 #define FILE_NOTIFY_CHANGE_SECURITY 0x00000100
2910 #define FILE_ACTION_ADDED 0x00000001
2911 #define FILE_ACTION_REMOVED 0x00000002
2912 #define FILE_ACTION_MODIFIED 0x00000003
2913 #define FILE_ACTION_RENAMED_OLD_NAME 0x00000004
2914 #define FILE_ACTION_RENAMED_NEW_NAME 0x00000005
2917 #define FILE_CASE_SENSITIVE_SEARCH 0x00000001
2918 #define FILE_CASE_PRESERVED_NAMES 0x00000002
2919 #define FILE_UNICODE_ON_DISK 0x00000004
2920 #define FILE_PERSISTENT_ACLS 0x00000008
2921 #define FILE_FILE_COMPRESSION 0x00000010
2922 #define FILE_VOLUME_IS_COMPRESSED 0x00008000
2924 /* File alignments (NT) */
2925 #define FILE_BYTE_ALIGNMENT 0x00000000
2926 #define FILE_WORD_ALIGNMENT 0x00000001
2927 #define FILE_LONG_ALIGNMENT 0x00000003
2928 #define FILE_QUAD_ALIGNMENT 0x00000007
2929 #define FILE_OCTA_ALIGNMENT 0x0000000f
2930 #define FILE_32_BYTE_ALIGNMENT 0x0000001f
2931 #define FILE_64_BYTE_ALIGNMENT 0x0000003f
2932 #define FILE_128_BYTE_ALIGNMENT 0x0000007f
2933 #define FILE_256_BYTE_ALIGNMENT 0x000000ff
2934 #define FILE_512_BYTE_ALIGNMENT 0x000001ff
2936 #define REG_NONE 0 /* no type */
2937 #define REG_SZ 1 /* string type (ASCII) */
2938 #define REG_EXPAND_SZ 2 /* string, includes %ENVVAR% (expanded by caller) (ASCII) */
2939 #define REG_BINARY 3 /* binary format, callerspecific */
2940 /* YES, REG_DWORD == REG_DWORD_LITTLE_ENDIAN */
2941 #define REG_DWORD 4 /* DWORD in little endian format */
2942 #define REG_DWORD_LITTLE_ENDIAN 4 /* DWORD in little endian format */
2943 #define REG_DWORD_BIG_ENDIAN 5 /* DWORD in big endian format */
2944 #define REG_LINK 6 /* symbolic link (UNICODE) */
2945 #define REG_MULTI_SZ 7 /* multiple strings, delimited by \0, terminated by \0\0 (ASCII) */
2946 #define REG_RESOURCE_LIST 8 /* resource list? huh? */
2947 #define REG_FULL_RESOURCE_DESCRIPTOR 9 /* full resource descriptor? huh? */
2948 #define REG_RESOURCE_REQUIREMENTS_LIST 10
2950 /* ----------------------------- begin registry ----------------------------- */
2952 /* Registry security values */
2953 #define OWNER_SECURITY_INFORMATION 0x00000001
2954 #define GROUP_SECURITY_INFORMATION 0x00000002
2955 #define DACL_SECURITY_INFORMATION 0x00000004
2956 #define SACL_SECURITY_INFORMATION 0x00000008
2958 #define REG_OPTION_RESERVED 0x00000000
2959 #define REG_OPTION_NON_VOLATILE 0x00000000
2960 #define REG_OPTION_VOLATILE 0x00000001
2961 #define REG_OPTION_CREATE_LINK 0x00000002
2962 #define REG_OPTION_BACKUP_RESTORE 0x00000004 /* FIXME */
2963 #define REG_OPTION_OPEN_LINK 0x00000008
2964 #define REG_LEGAL_OPTION (REG_OPTION_RESERVED| \
2965 REG_OPTION_NON_VOLATILE| \
2966 REG_OPTION_VOLATILE| \
2967 REG_OPTION_CREATE_LINK| \
2968 REG_OPTION_BACKUP_RESTORE| \
2969 REG_OPTION_OPEN_LINK)
2972 #define REG_CREATED_NEW_KEY 0x00000001
2973 #define REG_OPENED_EXISTING_KEY 0x00000002
2975 /* For RegNotifyChangeKeyValue */
2976 #define REG_NOTIFY_CHANGE_NAME 0x1
2978 #define KEY_QUERY_VALUE 0x00000001
2979 #define KEY_SET_VALUE 0x00000002
2980 #define KEY_CREATE_SUB_KEY 0x00000004
2981 #define KEY_ENUMERATE_SUB_KEYS 0x00000008
2982 #define KEY_NOTIFY 0x00000010
2983 #define KEY_CREATE_LINK 0x00000020
2985 #define KEY_READ ((STANDARD_RIGHTS_READ| \
2987 KEY_ENUMERATE_SUB_KEYS| \
2991 #define KEY_WRITE ((STANDARD_RIGHTS_WRITE| \
2993 KEY_CREATE_SUB_KEY) \
2996 #define KEY_EXECUTE ((KEY_READ) \
2999 #define KEY_ALL_ACCESS ((STANDARD_RIGHTS_ALL| \
3002 KEY_CREATE_SUB_KEY| \
3003 KEY_ENUMERATE_SUB_KEYS| \
3008 /* ------------------------------ end registry ------------------------------ */
3011 typedef struct _RTL_CRITICAL_SECTION_DEBUG
3014 WORD CreatorBackTraceIndex
;
3015 struct _RTL_CRITICAL_SECTION
*CriticalSection
;
3016 LIST_ENTRY ProcessLocksList
;
3018 DWORD ContentionCount
;
3020 } RTL_CRITICAL_SECTION_DEBUG
, *PRTL_CRITICAL_SECTION_DEBUG
, RTL_RESOURCE_DEBUG
, *PRTL_RESOURCE_DEBUG
;
3022 typedef struct _RTL_CRITICAL_SECTION
{
3023 PRTL_CRITICAL_SECTION_DEBUG DebugInfo
;
3025 LONG RecursionCount
;
3026 HANDLE OwningThread
;
3027 HANDLE LockSemaphore
;
3028 ULONG_PTR SpinCount
;
3029 } RTL_CRITICAL_SECTION
, *PRTL_CRITICAL_SECTION
;
3032 #define EVENTLOG_SUCCESS 0x0000
3033 #define EVENTLOG_ERROR_TYPE 0x0001
3034 #define EVENTLOG_WARNING_TYPE 0x0002
3035 #define EVENTLOG_INFORMATION_TYPE 0x0004
3036 #define EVENTLOG_AUDIT_SUCCESS 0x0008
3037 #define EVENTLOG_AUDIT_FAILURE 0x0010
3039 #define SERVICE_BOOT_START 0x00000000
3040 #define SERVICE_SYSTEM_START 0x00000001
3041 #define SERVICE_AUTO_START 0x00000002
3042 #define SERVICE_DEMAND_START 0x00000003
3043 #define SERVICE_DISABLED 0x00000004
3045 #define SERVICE_ERROR_IGNORE 0x00000000
3046 #define SERVICE_ERROR_NORMAL 0x00000001
3047 #define SERVICE_ERROR_SEVERE 0x00000002
3048 #define SERVICE_ERROR_CRITICAL 0x00000003
3051 #define SERVICE_KERNEL_DRIVER 0x00000001
3052 #define SERVICE_FILE_SYSTEM_DRIVER 0x00000002
3053 #define SERVICE_ADAPTER 0x00000004
3054 #define SERVICE_RECOGNIZER_DRIVER 0x00000008
3056 #define SERVICE_DRIVER ( SERVICE_KERNEL_DRIVER | SERVICE_FILE_SYSTEM_DRIVER | \
3057 SERVICE_RECOGNIZER_DRIVER )
3059 #define SERVICE_WIN32_OWN_PROCESS 0x00000010
3060 #define SERVICE_WIN32_SHARE_PROCESS 0x00000020
3061 #define SERVICE_WIN32 (SERVICE_WIN32_OWN_PROCESS | SERVICE_WIN32_SHARE_PROCESS)
3063 #define SERVICE_INTERACTIVE_PROCESS 0x00000100
3065 #define SERVICE_TYPE_ALL ( SERVICE_WIN32 | SERVICE_ADAPTER | \
3066 SERVICE_DRIVER | SERVICE_INTERACTIVE_PROCESS )
3069 typedef enum _CM_SERVICE_NODE_TYPE
3071 DriverType
= SERVICE_KERNEL_DRIVER
,
3072 FileSystemType
= SERVICE_FILE_SYSTEM_DRIVER
,
3073 Win32ServiceOwnProcess
= SERVICE_WIN32_OWN_PROCESS
,
3074 Win32ServiceShareProcess
= SERVICE_WIN32_SHARE_PROCESS
,
3075 AdapterType
= SERVICE_ADAPTER
,
3076 RecognizerType
= SERVICE_RECOGNIZER_DRIVER
3077 } SERVICE_NODE_TYPE
;
3079 typedef enum _CM_SERVICE_LOAD_TYPE
3081 BootLoad
= SERVICE_BOOT_START
,
3082 SystemLoad
= SERVICE_SYSTEM_START
,
3083 AutoLoad
= SERVICE_AUTO_START
,
3084 DemandLoad
= SERVICE_DEMAND_START
,
3085 DisableLoad
= SERVICE_DISABLED
3086 } SERVICE_LOAD_TYPE
;
3088 typedef enum _CM_ERROR_CONTROL_TYPE
3090 IgnoreError
= SERVICE_ERROR_IGNORE
,
3091 NormalError
= SERVICE_ERROR_NORMAL
,
3092 SevereError
= SERVICE_ERROR_SEVERE
,
3093 CriticalError
= SERVICE_ERROR_CRITICAL
3094 } SERVICE_ERROR_TYPE
;
3098 #define RtlEqualMemory(Destination, Source, Length) (!memcmp((Destination),(Source),(Length)))
3099 #define RtlMoveMemory(Destination, Source, Length) memmove((Destination),(Source),(Length))
3100 #define RtlCopyMemory(Destination, Source, Length) memcpy((Destination),(Source),(Length))
3101 #define RtlFillMemory(Destination, Length, Fill) memset((Destination),(Fill),(Length))
3102 #define RtlZeroMemory(Destination, Length) memset((Destination),0,(Length))
3104 #include "guiddef.h"
3106 #include "poppack.h"
3108 #endif /* __WINE_WINNT_H */