annotate loader/wine/winnt.h @ 2346:7d702c3ef0ad

updated - by zsteva@ptt.yu
author arpi
date Sun, 21 Oct 2001 17:34:40 +0000
parents 421999eb6b9c
children e96d8e8f0c8f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2 * Win32 definitions for Windows NT
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
3 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
4 * Copyright 1996 Alexandre Julliard
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
7 #ifndef __WINE_WINNT_H
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
8 #define __WINE_WINNT_H
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10 #include "windef.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
11
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
12 #ifndef RC_INVOKED
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
13 #include <string.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
14 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
16 #include "pshpack1.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17 /* Defines */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 /* Argument 1 passed to the DllEntryProc. */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20 #define DLL_PROCESS_DETACH 0 /* detach process (unload library) */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 #define DLL_PROCESS_ATTACH 1 /* attach process (load library) */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22 #define DLL_THREAD_ATTACH 2 /* attach new thread */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23 #define DLL_THREAD_DETACH 3 /* detach thread */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
24
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26 /* u.x.wProcessorArchitecture (NT) */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
27 #define PROCESSOR_ARCHITECTURE_INTEL 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
28 #define PROCESSOR_ARCHITECTURE_MIPS 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
29 #define PROCESSOR_ARCHITECTURE_ALPHA 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
30 #define PROCESSOR_ARCHITECTURE_PPC 3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
31 #define PROCESSOR_ARCHITECTURE_SHX 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
32 #define PROCESSOR_ARCHITECTURE_ARM 5
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
33 #define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35 /* dwProcessorType */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36 #define PROCESSOR_INTEL_386 386
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37 #define PROCESSOR_INTEL_486 486
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38 #define PROCESSOR_INTEL_PENTIUM 586
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39 #define PROCESSOR_INTEL_860 860
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40 #define PROCESSOR_MIPS_R2000 2000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41 #define PROCESSOR_MIPS_R3000 3000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42 #define PROCESSOR_MIPS_R4000 4000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
43 #define PROCESSOR_ALPHA_21064 21064
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44 #define PROCESSOR_PPC_601 601
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45 #define PROCESSOR_PPC_603 603
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46 #define PROCESSOR_PPC_604 604
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47 #define PROCESSOR_PPC_620 620
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
48 #define PROCESSOR_HITACHI_SH3 10003
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
49 #define PROCESSOR_HITACHI_SH3E 10004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
50 #define PROCESSOR_HITACHI_SH4 10005
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
51 #define PROCESSOR_MOTOROLA_821 821
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52 #define PROCESSOR_SHx_SH3 103
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53 #define PROCESSOR_SHx_SH4 104
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54 #define PROCESSOR_STRONGARM 2577
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
55 #define PROCESSOR_ARM720 1824 /* 0x720 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56 #define PROCESSOR_ARM820 2080 /* 0x820 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
57 #define PROCESSOR_ARM920 2336 /* 0x920 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
58 #define PROCESSOR_ARM_7TDMI 70001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
60 #define ANYSIZE_ARRAY 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62 #define MINCHAR 0x80
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63 #define MAXCHAR 0x7f
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64 #define MINSHORT 0x8000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65 #define MAXSHORT 0x7fff
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
66 #define MINLONG 0x80000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
67 #define MAXLONG 0x7fffffff
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
68 #define MAXBYTE 0xff
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69 #define MAXWORD 0xffff
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
70 #define MAXDWORD 0xffffffff
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72 #define FIELD_OFFSET(type, field) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
73 ((LONG)(INT)&(((type *)0)->field))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
74
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
75 #define CONTAINING_RECORD(address, type, field) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76 ((type *)((PCHAR)(address) - (PCHAR)(&((type *)0)->field)))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
77
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
78 /* Types */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80 /* TCHAR data types definitions for Winelib. */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81 /* These types are _not_ defined for the emulator, because they */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82 /* depend on the UNICODE macro that only exists in user's code. */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84 #ifndef __WINE__
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
85 # ifdef UNICODE
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
86 typedef WCHAR TCHAR, *PTCHAR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
87 typedef LPWSTR PTSTR, LPTSTR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
88 typedef LPCWSTR PCTSTR, LPCTSTR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
89 #define __TEXT(string) L##string /*probably wrong */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
90 # else /* UNICODE */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
91 typedef char TCHAR, *PTCHAR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
92 typedef LPSTR PTSTR, LPTSTR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
93 typedef LPCSTR PCTSTR, LPCTSTR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
94 #define __TEXT(string) string
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
95 # endif /* UNICODE */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
96 #endif /* __WINE__ */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
97 #define TEXT(quote) __TEXT(quote)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
98
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
99 typedef BYTE BOOLEAN;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
100 typedef BOOLEAN *PBOOLEAN;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
101
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
102 typedef struct _LIST_ENTRY {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
103 struct _LIST_ENTRY *Flink;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
104 struct _LIST_ENTRY *Blink;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
105 } LIST_ENTRY, *PLIST_ENTRY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
106
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
107 typedef struct _SINGLE_LIST_ENTRY {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
108 struct _SINGLE_LIST_ENTRY *Next;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
109 } SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
110
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
111 /* Heap flags */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
112
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
113 #define HEAP_NO_SERIALIZE 0x00000001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
114 #define HEAP_GROWABLE 0x00000002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
115 #define HEAP_GENERATE_EXCEPTIONS 0x00000004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
116 #define HEAP_ZERO_MEMORY 0x00000008
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
117 #define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
118 #define HEAP_TAIL_CHECKING_ENABLED 0x00000020
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
119 #define HEAP_FREE_CHECKING_ENABLED 0x00000040
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
120 #define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
121 #define HEAP_CREATE_ALIGN_16 0x00010000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
122 #define HEAP_CREATE_ENABLE_TRACING 0x00020000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
123 #define HEAP_WINE_SEGPTR 0x01000000 /* Not a Win32 flag */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
124 #define HEAP_WINE_CODESEG 0x02000000 /* Not a Win32 flag */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
125 #define HEAP_WINE_CODE16SEG 0x04000000 /* Not a Win32 flag */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
126 #define HEAP_WINE_SHARED 0x08000000 /* Not a Win32 flag */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
127
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
128 /* Processor feature flags. */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
129 #define PF_FLOATING_POINT_PRECISION_ERRATA 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
130 #define PF_FLOATING_POINT_EMULATED 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
131 #define PF_COMPARE_EXCHANGE_DOUBLE 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
132 #define PF_MMX_INSTRUCTIONS_AVAILABLE 3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
133 #define PF_PPC_MOVEMEM_64BIT_OK 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
134 #define PF_ALPHA_BYTE_INSTRUCTIONS 5
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
135
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
136
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
137 /* The Win32 register context */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
138
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
139 /* CONTEXT is the CPU-dependent context; it should be used */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
140 /* wherever a platform-specific context is needed (e.g. exception */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
141 /* handling, Win32 register functions). */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
142
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
143 /* CONTEXT86 is the i386-specific context; it should be used */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
144 /* wherever only a 386 context makes sense (e.g. DOS interrupts, */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
145 /* Win16 register functions), so that this code can be compiled */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
146 /* on all platforms. */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
147
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
148 #define SIZE_OF_80387_REGISTERS 80
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
149
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
150 typedef struct _FLOATING_SAVE_AREA
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
151 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
152 DWORD ControlWord;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
153 DWORD StatusWord;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
154 DWORD TagWord;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
155 DWORD ErrorOffset;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
156 DWORD ErrorSelector;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
157 DWORD DataOffset;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
158 DWORD DataSelector;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
159 BYTE RegisterArea[SIZE_OF_80387_REGISTERS];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
160 DWORD Cr0NpxState;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
161 } FLOATING_SAVE_AREA, *PFLOATING_SAVE_AREA;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
162
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
163 typedef struct _CONTEXT86
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
164 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
165 DWORD ContextFlags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
166
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
167 /* These are selected by CONTEXT_DEBUG_REGISTERS */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
168 DWORD Dr0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
169 DWORD Dr1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
170 DWORD Dr2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
171 DWORD Dr3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
172 DWORD Dr6;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
173 DWORD Dr7;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
174
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
175 /* These are selected by CONTEXT_FLOATING_POINT */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
176 FLOATING_SAVE_AREA FloatSave;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
177
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
178 /* These are selected by CONTEXT_SEGMENTS */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
179 DWORD SegGs;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
180 DWORD SegFs;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
181 DWORD SegEs;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
182 DWORD SegDs;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
183
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
184 /* These are selected by CONTEXT_INTEGER */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
185 DWORD Edi;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
186 DWORD Esi;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
187 DWORD Ebx;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
188 DWORD Edx;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
189 DWORD Ecx;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
190 DWORD Eax;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
191
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
192 /* These are selected by CONTEXT_CONTROL */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
193 DWORD Ebp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
194 DWORD Eip;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
195 DWORD SegCs;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
196 DWORD EFlags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
197 DWORD Esp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
198 DWORD SegSs;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
199 } CONTEXT86;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
200
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
201 #define CONTEXT_X86 0x00010000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
202 #define CONTEXT_i386 CONTEXT_X86
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
203 #define CONTEXT_i486 CONTEXT_X86
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
204
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
205 #define CONTEXT86_CONTROL (CONTEXT_i386 | 0x0001) /* SS:SP, CS:IP, FLAGS, BP */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
206 #define CONTEXT86_INTEGER (CONTEXT_i386 | 0x0002) /* AX, BX, CX, DX, SI, DI */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
207 #define CONTEXT86_SEGMENTS (CONTEXT_i386 | 0x0004) /* DS, ES, FS, GS */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
208 #define CONTEXT86_FLOATING_POINT (CONTEXT_i386 | 0x0008L) /* 387 state */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
209 #define CONTEXT86_DEBUG_REGISTERS (CONTEXT_i386 | 0x0010L) /* DB 0-3,6,7 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
210 #define CONTEXT86_FULL (CONTEXT86_CONTROL | CONTEXT86_INTEGER | CONTEXT86_SEGMENTS)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
211
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
212 /* i386 context definitions */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
213 #ifdef __i386__
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
214
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
215 #define CONTEXT_CONTROL CONTEXT86_CONTROL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
216 #define CONTEXT_INTEGER CONTEXT86_INTEGER
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
217 #define CONTEXT_SEGMENTS CONTEXT86_SEGMENTS
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
218 #define CONTEXT_FLOATING_POINT CONTEXT86_FLOATING_POINT
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
219 #define CONTEXT_DEBUG_REGISTERS CONTEXT86_DEBUG_REGISTERS
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
220 #define CONTEXT_FULL CONTEXT86_FULL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
221
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
222 typedef CONTEXT86 CONTEXT;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
223
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
224 #endif /* __i386__ */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
225
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
226 /* Alpha context definitions */
1337
421999eb6b9c MPlayer doesn't compile on linux/alpha
jkeil
parents: 1
diff changeset
227 #if defined(_ALPHA_) || defined(__alpha__)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
228
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
229 #define CONTEXT_ALPHA 0x00020000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
230
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
231 #define CONTEXT_CONTROL (CONTEXT_ALPHA | 0x00000001L)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
232 #define CONTEXT_FLOATING_POINT (CONTEXT_ALPHA | 0x00000002L)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
233 #define CONTEXT_INTEGER (CONTEXT_ALPHA | 0x00000004L)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
234 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
235
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
236 typedef struct _CONTEXT
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
237 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
238 /* selected by CONTEXT_FLOATING_POINT */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
239 ULONGLONG FltF0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
240 ULONGLONG FltF1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
241 ULONGLONG FltF2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
242 ULONGLONG FltF3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
243 ULONGLONG FltF4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
244 ULONGLONG FltF5;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
245 ULONGLONG FltF6;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
246 ULONGLONG FltF7;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
247 ULONGLONG FltF8;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
248 ULONGLONG FltF9;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
249 ULONGLONG FltF10;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
250 ULONGLONG FltF11;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
251 ULONGLONG FltF12;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
252 ULONGLONG FltF13;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
253 ULONGLONG FltF14;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
254 ULONGLONG FltF15;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
255 ULONGLONG FltF16;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
256 ULONGLONG FltF17;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
257 ULONGLONG FltF18;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
258 ULONGLONG FltF19;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
259 ULONGLONG FltF20;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
260 ULONGLONG FltF21;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
261 ULONGLONG FltF22;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
262 ULONGLONG FltF23;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
263 ULONGLONG FltF24;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
264 ULONGLONG FltF25;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
265 ULONGLONG FltF26;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
266 ULONGLONG FltF27;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
267 ULONGLONG FltF28;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
268 ULONGLONG FltF29;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
269 ULONGLONG FltF30;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
270 ULONGLONG FltF31;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
271
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
272 /* selected by CONTEXT_INTEGER */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
273 ULONGLONG IntV0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
274 ULONGLONG IntT0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
275 ULONGLONG IntT1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
276 ULONGLONG IntT2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
277 ULONGLONG IntT3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
278 ULONGLONG IntT4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
279 ULONGLONG IntT5;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
280 ULONGLONG IntT6;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
281 ULONGLONG IntT7;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
282 ULONGLONG IntS0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
283 ULONGLONG IntS1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
284 ULONGLONG IntS2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
285 ULONGLONG IntS3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
286 ULONGLONG IntS4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
287 ULONGLONG IntS5;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
288 ULONGLONG IntFp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
289 ULONGLONG IntA0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
290 ULONGLONG IntA1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
291 ULONGLONG IntA2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
292 ULONGLONG IntA3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
293 ULONGLONG IntA4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
294 ULONGLONG IntA5;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
295 ULONGLONG IntT8;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
296 ULONGLONG IntT9;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
297 ULONGLONG IntT10;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
298 ULONGLONG IntT11;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
299 ULONGLONG IntRa;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
300 ULONGLONG IntT12;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
301 ULONGLONG IntAt;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
302 ULONGLONG IntGp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
303 ULONGLONG IntSp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
304 ULONGLONG IntZero;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
305
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
306 /* selected by CONTEXT_FLOATING_POINT */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
307 ULONGLONG Fpcr;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
308 ULONGLONG SoftFpcr;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
309
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
310 /* selected by CONTEXT_CONTROL */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
311 ULONGLONG Fir;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
312 DWORD Psr;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
313 DWORD ContextFlags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
314 DWORD Fill[4];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
315 } CONTEXT;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
316
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
317 #define _QUAD_PSR_OFFSET HighSoftFpcr
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
318 #define _QUAD_FLAGS_OFFSET HighFir
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
319
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
320 #endif /* _ALPHA_ */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
321
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
322 /* Mips context definitions */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
323 #ifdef _MIPS_
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
324
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
325 #define CONTEXT_R4000 0x00010000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
326
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
327 #define CONTEXT_CONTROL (CONTEXT_R4000 | 0x00000001)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
328 #define CONTEXT_FLOATING_POINT (CONTEXT_R4000 | 0x00000002)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
329 #define CONTEXT_INTEGER (CONTEXT_R4000 | 0x00000004)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
330
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
331 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
332
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
333 typedef struct _CONTEXT
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
334 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
335 DWORD Argument[4];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
336 /* These are selected by CONTEXT_FLOATING_POINT */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
337 DWORD FltF0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
338 DWORD FltF1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
339 DWORD FltF2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
340 DWORD FltF3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
341 DWORD FltF4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
342 DWORD FltF5;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
343 DWORD FltF6;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
344 DWORD FltF7;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
345 DWORD FltF8;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
346 DWORD FltF9;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
347 DWORD FltF10;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
348 DWORD FltF11;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
349 DWORD FltF12;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
350 DWORD FltF13;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
351 DWORD FltF14;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
352 DWORD FltF15;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
353 DWORD FltF16;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
354 DWORD FltF17;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
355 DWORD FltF18;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
356 DWORD FltF19;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
357 DWORD FltF20;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
358 DWORD FltF21;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
359 DWORD FltF22;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
360 DWORD FltF23;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
361 DWORD FltF24;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
362 DWORD FltF25;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
363 DWORD FltF26;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
364 DWORD FltF27;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
365 DWORD FltF28;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
366 DWORD FltF29;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
367 DWORD FltF30;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
368 DWORD FltF31;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
369
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
370 /* These are selected by CONTEXT_INTEGER */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
371 DWORD IntZero;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
372 DWORD IntAt;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
373 DWORD IntV0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
374 DWORD IntV1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
375 DWORD IntA0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
376 DWORD IntA1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
377 DWORD IntA2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
378 DWORD IntA3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
379 DWORD IntT0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
380 DWORD IntT1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
381 DWORD IntT2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
382 DWORD IntT3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
383 DWORD IntT4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
384 DWORD IntT5;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
385 DWORD IntT6;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
386 DWORD IntT7;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
387 DWORD IntS0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
388 DWORD IntS1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
389 DWORD IntS2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
390 DWORD IntS3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
391 DWORD IntS4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
392 DWORD IntS5;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
393 DWORD IntS6;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
394 DWORD IntS7;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
395 DWORD IntT8;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
396 DWORD IntT9;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
397 DWORD IntK0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
398 DWORD IntK1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
399 DWORD IntGp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
400 DWORD IntSp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
401 DWORD IntS8;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
402 DWORD IntRa;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
403 DWORD IntLo;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
404 DWORD IntHi;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
405
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
406 /* These are selected by CONTEXT_FLOATING_POINT */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
407 DWORD Fsr;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
408
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
409 /* These are selected by CONTEXT_CONTROL */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
410 DWORD Fir;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
411 DWORD Psr;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
412
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
413 DWORD ContextFlags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
414 DWORD Fill[2];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
415 } CONTEXT;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
416
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
417 #endif /* _MIPS_ */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
418
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
419 /* PowerPC context definitions */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
420 #ifdef __PPC__
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
421
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
422 #define CONTEXT_CONTROL 0x0001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
423 #define CONTEXT_FLOATING_POINT 0x0002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
424 #define CONTEXT_INTEGER 0x0004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
425 #define CONTEXT_DEBUG_REGISTERS 0x0008
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
426 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
427
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
428 typedef struct
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
429 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
430 /* These are selected by CONTEXT_FLOATING_POINT */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
431 double Fpr0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
432 double Fpr1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
433 double Fpr2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
434 double Fpr3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
435 double Fpr4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
436 double Fpr5;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
437 double Fpr6;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
438 double Fpr7;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
439 double Fpr8;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
440 double Fpr9;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
441 double Fpr10;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
442 double Fpr11;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
443 double Fpr12;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
444 double Fpr13;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
445 double Fpr14;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
446 double Fpr15;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
447 double Fpr16;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
448 double Fpr17;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
449 double Fpr18;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
450 double Fpr19;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
451 double Fpr20;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
452 double Fpr21;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
453 double Fpr22;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
454 double Fpr23;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
455 double Fpr24;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
456 double Fpr25;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
457 double Fpr26;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
458 double Fpr27;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
459 double Fpr28;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
460 double Fpr29;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
461 double Fpr30;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
462 double Fpr31;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
463 double Fpscr;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
464
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
465 /* These are selected by CONTEXT_INTEGER */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
466 DWORD Gpr0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
467 DWORD Gpr1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
468 DWORD Gpr2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
469 DWORD Gpr3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
470 DWORD Gpr4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
471 DWORD Gpr5;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
472 DWORD Gpr6;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
473 DWORD Gpr7;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
474 DWORD Gpr8;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
475 DWORD Gpr9;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
476 DWORD Gpr10;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
477 DWORD Gpr11;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
478 DWORD Gpr12;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
479 DWORD Gpr13;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
480 DWORD Gpr14;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
481 DWORD Gpr15;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
482 DWORD Gpr16;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
483 DWORD Gpr17;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
484 DWORD Gpr18;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
485 DWORD Gpr19;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
486 DWORD Gpr20;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
487 DWORD Gpr21;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
488 DWORD Gpr22;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
489 DWORD Gpr23;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
490 DWORD Gpr24;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
491 DWORD Gpr25;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
492 DWORD Gpr26;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
493 DWORD Gpr27;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
494 DWORD Gpr28;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
495 DWORD Gpr29;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
496 DWORD Gpr30;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
497 DWORD Gpr31;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
498
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
499 DWORD Cr;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
500 DWORD Xer;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
501
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
502 /* These are selected by CONTEXT_CONTROL */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
503 DWORD Msr;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
504 DWORD Iar;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
505 DWORD Lr;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
506 DWORD Ctr;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
507
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
508 DWORD ContextFlags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
509 DWORD Fill[3];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
510
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
511 /* These are selected by CONTEXT_DEBUG_REGISTERS */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
512 DWORD Dr0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
513 DWORD Dr1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
514 DWORD Dr2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
515 DWORD Dr3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
516 DWORD Dr4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
517 DWORD Dr5;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
518 DWORD Dr6;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
519 DWORD Dr7;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
520 } CONTEXT;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
521
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
522 typedef struct _STACK_FRAME_HEADER
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
523 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
524 DWORD BackChain;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
525 DWORD GlueSaved1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
526 DWORD GlueSaved2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
527 DWORD Reserved1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
528 DWORD Spare1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
529 DWORD Spare2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
530
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
531 DWORD Parameter0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
532 DWORD Parameter1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
533 DWORD Parameter2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
534 DWORD Parameter3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
535 DWORD Parameter4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
536 DWORD Parameter5;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
537 DWORD Parameter6;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
538 DWORD Parameter7;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
539 } STACK_FRAME_HEADER,*PSTACK_FRAME_HEADER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
540
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
541 #endif /* __PPC__ */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
542
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
543 #ifdef __sparc__
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
544
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
545 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
546 * FIXME:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
547 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
548 * There is no official CONTEXT structure defined for the SPARC
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
549 * architecture, so I just made one up.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
550 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
551 * This structure is valid only for 32-bit SPARC architectures,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
552 * not for 64-bit SPARC.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
553 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
554 * Note that this structure contains only the 'top-level' registers;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
555 * the rest of the register window chain is not visible.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
556 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
557 * The layout follows the Solaris 'prgregset_t' structure.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
558 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
559 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
560
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
561 #define CONTEXT_SPARC 0x10000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
562
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
563 #define CONTEXT_CONTROL (CONTEXT_SPARC | 0x00000001)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
564 #define CONTEXT_FLOATING_POINT (CONTEXT_SPARC | 0x00000002)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
565 #define CONTEXT_INTEGER (CONTEXT_SPARC | 0x00000004)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
566
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
567 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
568
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
569 typedef struct _CONTEXT
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
570 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
571 DWORD ContextFlags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
572
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
573 /* These are selected by CONTEXT_INTEGER */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
574 DWORD g0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
575 DWORD g1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
576 DWORD g2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
577 DWORD g3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
578 DWORD g4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
579 DWORD g5;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
580 DWORD g6;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
581 DWORD g7;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
582 DWORD o0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
583 DWORD o1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
584 DWORD o2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
585 DWORD o3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
586 DWORD o4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
587 DWORD o5;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
588 DWORD o6;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
589 DWORD o7;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
590 DWORD l0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
591 DWORD l1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
592 DWORD l2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
593 DWORD l3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
594 DWORD l4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
595 DWORD l5;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
596 DWORD l6;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
597 DWORD l7;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
598 DWORD i0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
599 DWORD i1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
600 DWORD i2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
601 DWORD i3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
602 DWORD i4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
603 DWORD i5;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
604 DWORD i6;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
605 DWORD i7;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
606
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
607 /* These are selected by CONTEXT_CONTROL */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
608 DWORD psr;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
609 DWORD pc;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
610 DWORD npc;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
611 DWORD y;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
612 DWORD wim;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
613 DWORD tbr;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
614
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
615 /* FIXME: floating point registers missing */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
616
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
617 } CONTEXT;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
618
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
619 #endif /* __sparc__ */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
620
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
621 #if !defined(CONTEXT_FULL) && !defined(RC_INVOKED)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
622 #error You need to define a CONTEXT for your CPU
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
623 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
624
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
625 typedef CONTEXT *PCONTEXT;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
626 typedef HANDLE *PHANDLE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
627
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
628 #ifdef __WINE__
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
629
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
630 /* Macros for easier access to i386 context registers */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
631
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
632 #define EAX_reg(context) ((context)->Eax)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
633 #define EBX_reg(context) ((context)->Ebx)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
634 #define ECX_reg(context) ((context)->Ecx)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
635 #define EDX_reg(context) ((context)->Edx)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
636 #define ESI_reg(context) ((context)->Esi)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
637 #define EDI_reg(context) ((context)->Edi)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
638 #define EBP_reg(context) ((context)->Ebp)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
639
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
640 #define CS_reg(context) ((context)->SegCs)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
641 #define DS_reg(context) ((context)->SegDs)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
642 #define ES_reg(context) ((context)->SegEs)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
643 #define FS_reg(context) ((context)->SegFs)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
644 #define GS_reg(context) ((context)->SegGs)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
645 #define SS_reg(context) ((context)->SegSs)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
646
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
647 #define EFL_reg(context) ((context)->EFlags)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
648 #define EIP_reg(context) ((context)->Eip)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
649 #define ESP_reg(context) ((context)->Esp)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
650
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
651 #define AX_reg(context) (*(WORD*)&EAX_reg(context))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
652 #define BX_reg(context) (*(WORD*)&EBX_reg(context))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
653 #define CX_reg(context) (*(WORD*)&ECX_reg(context))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
654 #define DX_reg(context) (*(WORD*)&EDX_reg(context))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
655 #define SI_reg(context) (*(WORD*)&ESI_reg(context))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
656 #define DI_reg(context) (*(WORD*)&EDI_reg(context))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
657 #define BP_reg(context) (*(WORD*)&EBP_reg(context))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
658
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
659 #define AL_reg(context) (*(BYTE*)&EAX_reg(context))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
660 #define AH_reg(context) (*((BYTE*)&EAX_reg(context)+1))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
661 #define BL_reg(context) (*(BYTE*)&EBX_reg(context))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
662 #define BH_reg(context) (*((BYTE*)&EBX_reg(context)+1))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
663 #define CL_reg(context) (*(BYTE*)&ECX_reg(context))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
664 #define CH_reg(context) (*((BYTE*)&ECX_reg(context)+1))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
665 #define DL_reg(context) (*(BYTE*)&EDX_reg(context))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
666 #define DH_reg(context) (*((BYTE*)&EDX_reg(context)+1))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
667
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
668 #define SET_CFLAG(context) (EFL_reg(context) |= 0x0001)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
669 #define RESET_CFLAG(context) (EFL_reg(context) &= ~0x0001)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
670 #define SET_ZFLAG(context) (EFL_reg(context) |= 0x0040)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
671 #define RESET_ZFLAG(context) (EFL_reg(context) &= ~0x0040)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
672
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
673 #define ISV86(context) (EFL_reg(context) & 0x00020000)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
674 #define V86BASE(context) ((context)->Dr7) /* ugly */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
675
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
676
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
677 /* Macros to retrieve the current context */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
678
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
679 #ifdef __i386__
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
680
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
681 #ifdef NEED_UNDERSCORE_PREFIX
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
682 # define __ASM_NAME(name) "_" name
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
683 #else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
684 # define __ASM_NAME(name) name
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
685 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
686
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
687 #ifdef __GNUC__
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
688 # define __ASM_GLOBAL_FUNC(name,code) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
689 __asm__( ".align 4\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
690 ".globl " __ASM_NAME(#name) "\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
691 ".type " __ASM_NAME(#name) ",@function\n" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
692 __ASM_NAME(#name) ":\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
693 code );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
694 #else /* __GNUC__ */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
695 # define __ASM_GLOBAL_FUNC(name,code) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
696 void __asm_dummy_##name(void) { \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
697 asm( ".align 4\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
698 ".globl " __ASM_NAME(#name) "\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
699 ".type " __ASM_NAME(#name) ",@function\n" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
700 __ASM_NAME(#name) ":\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
701 code ); \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
702 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
703 #endif /* __GNUC__ */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
704
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
705 #define _DEFINE_REGS_ENTRYPOINT( name, fn, args ) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
706 __ASM_GLOBAL_FUNC( name, \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
707 "call " __ASM_NAME("CALL32_Regs") "\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
708 ".long " __ASM_NAME(#fn) "\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
709 ".byte " #args ", " #args )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
710 #define DEFINE_REGS_ENTRYPOINT_0( name, fn ) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
711 _DEFINE_REGS_ENTRYPOINT( name, fn, 0 )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
712 #define DEFINE_REGS_ENTRYPOINT_1( name, fn, t1 ) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
713 _DEFINE_REGS_ENTRYPOINT( name, fn, 4 )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
714 #define DEFINE_REGS_ENTRYPOINT_2( name, fn, t1, t2 ) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
715 _DEFINE_REGS_ENTRYPOINT( name, fn, 8 )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
716 #define DEFINE_REGS_ENTRYPOINT_3( name, fn, t1, t2, t3 ) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
717 _DEFINE_REGS_ENTRYPOINT( name, fn, 12 )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
718 #define DEFINE_REGS_ENTRYPOINT_4( name, fn, t1, t2, t3, t4 ) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
719 _DEFINE_REGS_ENTRYPOINT( name, fn, 16 )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
720
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
721 #endif /* __i386__ */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
722
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
723 #ifdef __sparc__
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
724 /* FIXME: use getcontext() to retrieve full context */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
725 #define _GET_CONTEXT \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
726 CONTEXT context; \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
727 do { memset(&context, 0, sizeof(CONTEXT)); \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
728 context.ContextFlags = CONTEXT_CONTROL; \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
729 context.pc = (DWORD)__builtin_return_address(0); \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
730 } while (0)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
731
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
732 #define DEFINE_REGS_ENTRYPOINT_0( name, fn ) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
733 void WINAPI name ( void ) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
734 { _GET_CONTEXT; fn( &context ); }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
735 #define DEFINE_REGS_ENTRYPOINT_1( name, fn, t1 ) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
736 void WINAPI name ( t1 a1 ) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
737 { _GET_CONTEXT; fn( a1, &context ); }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
738 #define DEFINE_REGS_ENTRYPOINT_2( name, fn, t1, t2 ) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
739 void WINAPI name ( t1 a1, t2 a2 ) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
740 { _GET_CONTEXT; fn( a1, a2, &context ); }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
741 #define DEFINE_REGS_ENTRYPOINT_3( name, fn, t1, t2, t3 ) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
742 void WINAPI name ( t1 a1, t2 a2, t3 a3 ) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
743 { _GET_CONTEXT; fn( a1, a2, a3, &context ); }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
744 #define DEFINE_REGS_ENTRYPOINT_4( name, fn, t1, t2, t3, t4 ) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
745 void WINAPI name ( t1 a1, t2 a2, t3 a3, t4 a4 ) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
746 { _GET_CONTEXT; fn( a1, a2, a3, a4, &context ); }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
747
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
748 #endif /* __sparc__ */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
749
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
750 #ifndef DEFINE_REGS_ENTRYPOINT_0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
751 #error You need to define DEFINE_REGS_ENTRYPOINT macros for your CPU
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
752 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
753
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
754 #ifdef __i386__
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
755 # define GET_IP(context) ((LPVOID)(context)->Eip)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
756 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
757 #ifdef __sparc__
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
758 # define GET_IP(context) ((LPVOID)(context)->pc)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
759 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
760
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
761 #if !defined(GET_IP) && !defined(RC_INVOKED)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
762 # error You must define GET_IP for this CPU
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
763 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
764
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
765 #endif /* __WINE__ */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
766
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
767 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
768 * Exception codes
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
769 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
770
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
771 #define STATUS_SUCCESS 0x00000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
772 #define STATUS_WAIT_0 0x00000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
773 #define STATUS_ABANDONED_WAIT_0 0x00000080
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
774 #define STATUS_USER_APC 0x000000C0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
775 #define STATUS_TIMEOUT 0x00000102
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
776 #define STATUS_PENDING 0x00000103
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
777
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
778 #define STATUS_GUARD_PAGE_VIOLATION 0x80000001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
779 #define STATUS_DATATYPE_MISALIGNMENT 0x80000002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
780 #define STATUS_BREAKPOINT 0x80000003
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
781 #define STATUS_SINGLE_STEP 0x80000004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
782 #define STATUS_BUFFER_OVERFLOW 0x80000005
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
783 #define STATUS_NO_MORE_FILES 0x80000006
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
784 #define STATUS_WAKE_SYSTEM_DEBUGGER 0x80000007
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
785
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
786 #define STATUS_HANDLES_CLOSED 0x8000000A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
787 #define STATUS_NO_INHERITANCE 0x8000000B
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
788 #define STATUS_GUID_SUBSTITUTION_MADE 0x8000000C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
789 #define STATUS_PARTIAL_COPY 0x8000000D
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
790 #define STATUS_DEVICE_PAPER_EMPTY 0x8000000E
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
791 #define STATUS_DEVICE_POWERED_OFF 0x8000000F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
792 #define STATUS_DEVICE_OFF_LINE 0x80000010
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
793 #define STATUS_DEVICE_BUSY 0x80000011
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
794 #define STATUS_NO_MORE_EAS 0x80000012
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
795 #define STATUS_INVALID_EA_NAME 0x80000013
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
796 #define STATUS_EA_LIST_INCONSISTENT 0x80000014
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
797 #define STATUS_INVALID_EA_FLAG 0x80000015
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
798 #define STATUS_VERIFY_REQUIRED 0x80000016
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
799 #define STATUS_EXTRANEOUS_INFORMATION 0x80000017
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
800 #define STATUS_RXACT_COMMIT_NECESSARY 0x80000018
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
801 #define STATUS_NO_MORE_ENTRIES 0x8000001A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
802 #define STATUS_FILEMARK_DETECTED 0x8000001B
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
803 #define STATUS_MEDIA_CHANGED 0x8000001C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
804 #define STATUS_BUS_RESET 0x8000001D
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
805 #define STATUS_END_OF_MEDIA 0x8000001E
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
806 #define STATUS_BEGINNING_OF_MEDIA 0x8000001F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
807 #define STATUS_MEDIA_CHECK 0x80000020
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
808 #define STATUS_SETMARK_DETECTED 0x80000021
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
809 #define STATUS_NO_DATA_DETECTED 0x80000022
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
810 #define STATUS_REDIRECTOR_HAS_OPEN_HANDLES 0x80000023
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
811 #define STATUS_SERVER_HAS_OPEN_HANDLES 0x80000024
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
812 #define STATUS_ALREADY_DISCONNECTED 0x80000025
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
813 #define STATUS_LONGJUMP 0x80000026
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
814
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
815 #define STATUS_UNSUCCESSFUL 0xC0000001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
816 #define STATUS_NOT_IMPLEMENTED 0xC0000002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
817 #define STATUS_INVALID_INFO_CLASS 0xC0000003
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
818 #define STATUS_INFO_LENGTH_MISMATCH 0xC0000004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
819 #define STATUS_ACCESS_VIOLATION 0xC0000005
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
820 #define STATUS_IN_PAGE_ERROR 0xC0000006
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
821 #define STATUS_PAGEFILE_QUOTA 0xC0000007
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
822 #define STATUS_INVALID_HANDLE 0xC0000008
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
823 #define STATUS_BAD_INITIAL_STACK 0xC0000009
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
824 #define STATUS_BAD_INITIAL_PC 0xC000000A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
825 #define STATUS_INVALID_CID 0xC000000B
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
826 #define STATUS_TIMER_NOT_CANCELED 0xC000000C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
827 #define STATUS_INVALID_PARAMETER 0xC000000D
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
828 #define STATUS_NO_SUCH_DEVICE 0xC000000E
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
829 #define STATUS_NO_SUCH_FILE 0xC000000F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
830 #define STATUS_INVALID_DEVICE_REQUEST 0xC0000010
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
831 #define STATUS_END_OF_FILE 0xC0000011
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
832 #define STATUS_WRONG_VOLUME 0xC0000012
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
833 #define STATUS_NO_MEDIA_IN_DEVICE 0xC0000013
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
834 #define STATUS_UNRECOGNIZED_MEDIA 0xC0000014
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
835 #define STATUS_NONEXISTENT_SECTOR 0xC0000015
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
836 #define STATUS_MORE_PROCESSING_REQUIRED 0xC0000016
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
837 #define STATUS_NO_MEMORY 0xC0000017
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
838 #define STATUS_CONFLICTING_ADDRESSES 0xC0000018
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
839 #define STATUS_NOT_MAPPED_VIEW 0xC0000019
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
840 #define STATUS_UNABLE_TO_FREE_VM 0xC000001A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
841 #define STATUS_UNABLE_TO_DELETE_SECTION 0xC000001B
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
842 #define STATUS_INVALID_SYSTEM_SERVICE 0xC000001C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
843 #define STATUS_ILLEGAL_INSTRUCTION 0xC000001D
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
844 #define STATUS_INVALID_LOCK_SEQUENCE 0xC000001E
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
845 #define STATUS_INVALID_VIEW_SIZE 0xC000001F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
846 #define STATUS_INVALID_FILE_FOR_SECTION 0xC0000020
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
847 #define STATUS_ALREADY_COMMITTED 0xC0000021
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
848 #define STATUS_ACCESS_DENIED 0xC0000022
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
849 #define STATUS_BUFFER_TOO_SMALL 0xC0000023
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
850 #define STATUS_OBJECT_TYPE_MISMATCH 0xC0000024
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
851 #define STATUS_NONCONTINUABLE_EXCEPTION 0xC0000025
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
852 #define STATUS_INVALID_DISPOSITION 0xC0000026
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
853 #define STATUS_UNWIND 0xC0000027
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
854 #define STATUS_BAD_STACK 0xC0000028
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
855 #define STATUS_INVALID_UNWIND_TARGET 0xC0000029
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
856 #define STATUS_NOT_LOCKED 0xC000002A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
857 #define STATUS_PARITY_ERROR 0xC000002B
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
858 #define STATUS_UNABLE_TO_DECOMMIT_VM 0xC000002C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
859 #define STATUS_NOT_COMMITTED 0xC000002D
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
860 #define STATUS_INVALID_PORT_ATTRIBUTES 0xC000002E
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
861 #define STATUS_PORT_MESSAGE_TOO_LONG 0xC000002F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
862 #define STATUS_INVALID_PARAMETER_MIX 0xC0000030
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
863 #define STATUS_INVALID_QUOTA_LOWER 0xC0000031
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
864 #define STATUS_DISK_CORRUPT_ERROR 0xC0000032
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
865 #define STATUS_OBJECT_NAME_INVALID 0xC0000033
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
866 #define STATUS_OBJECT_NAME_NOT_FOUND 0xC0000034
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
867 #define STATUS_OBJECT_NAME_COLLISION 0xC0000035
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
868 #define STATUS_PORT_DISCONNECTED 0xC0000037
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
869 #define STATUS_DEVICE_ALREADY_ATTACHED 0xC0000038
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
870 #define STATUS_OBJECT_PATH_INVALID 0xC0000039
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
871 #define STATUS_OBJECT_PATH_NOT_FOUND 0xC000003A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
872 #define STATUS_PATH_SYNTAX_BAD 0xC000003B
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
873 #define STATUS_DATA_OVERRUN 0xC000003C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
874 #define STATUS_DATA_LATE_ERROR 0xC000003D
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
875 #define STATUS_DATA_ERROR 0xC000003E
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
876 #define STATUS_CRC_ERROR 0xC000003F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
877 #define STATUS_SECTION_TOO_BIG 0xC0000040
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
878 #define STATUS_PORT_CONNECTION_REFUSED 0xC0000041
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
879 #define STATUS_INVALID_PORT_HANDLE 0xC0000042
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
880 #define STATUS_SHARING_VIOLATION 0xC0000043
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
881 #define STATUS_QUOTA_EXCEEDED 0xC0000044
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
882 #define STATUS_INVALID_PAGE_PROTECTION 0xC0000045
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
883 #define STATUS_MUTANT_NOT_OWNED 0xC0000046
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
884 #define STATUS_SEMAPHORE_LIMIT_EXCEEDED 0xC0000047
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
885 #define STATUS_PORT_ALREADY_SET 0xC0000048
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
886 #define STATUS_SUSPEND_COUNT_EXCEEDED 0xC000004A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
887 #define STATUS_LOCK_NOT_GRANTED 0xC0000054 /* FIXME: not sure */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
888 #define STATUS_FILE_LOCK_CONFLICT 0xC0000055 /* FIXME: not sure */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
889 #define STATUS_UNKNOWN_REVISION 0xC0000058
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
890 #define STATUS_INVALID_SECURITY_DESCR 0xC0000079
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
891 #define STATUS_DISK_FULL 0xC000007F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
892 #define STATUS_SECTION_NOT_EXTENDED 0xC0000087
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
893 #define STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
894 #define STATUS_FLOAT_DENORMAL_OPERAND 0xC000008D
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
895 #define STATUS_FLOAT_DIVIDE_BY_ZERO 0xC000008E
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
896 #define STATUS_FLOAT_INEXACT_RESULT 0xC000008F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
897 #define STATUS_FLOAT_INVALID_OPERATION 0xC0000090
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
898 #define STATUS_FLOAT_OVERFLOW 0xC0000091
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
899 #define STATUS_FLOAT_STACK_CHECK 0xC0000092
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
900 #define STATUS_FLOAT_UNDERFLOW 0xC0000093
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
901 #define STATUS_INTEGER_DIVIDE_BY_ZERO 0xC0000094
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
902 #define STATUS_INTEGER_OVERFLOW 0xC0000095
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
903 #define STATUS_PRIVILEGED_INSTRUCTION 0xC0000096
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
904 #define STATUS_MEDIA_WRITE_PROTECTED 0XC00000A2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
905 #define STATUS_INVALID_PARAMETER_2 0xC00000F0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
906 #define STATUS_STACK_OVERFLOW 0xC00000FD
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
907 #define STATUS_DIRECTORY_NOT_EMPTY 0xC0000101
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
908 #define STATUS_TOO_MANY_OPENED_FILES 0xC000011F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
909 #define STATUS_CONTROL_C_EXIT 0xC000013A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
910 #define STATUS_PIPE_BROKEN 0xC000014B
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
911 #define STATUS_NOT_REGISTRY_FILE 0xC000015C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
912 #define STATUS_PARTITION_FAILURE 0xC0000172
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
913 #define STATUS_INVALID_BLOCK_LENGTH 0xC0000173
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
914 #define STATUS_DEVICE_NOT_PARTITIONED 0xC0000174
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
915 #define STATUS_UNABLE_TO_LOCK_MEDIA 0xC0000175
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
916 #define STATUS_UNABLE_TO_UNLOAD_MEDIA 0xC0000176
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
917 #define STATUS_EOM_OVERFLOW 0xC0000177
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
918 #define STATUS_NO_MEDIA 0xC0000178
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
919 #define STATUS_NO_SUCH_MEMBER 0xC000017A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
920 #define STATUS_INVALID_MEMBER 0xC000017B
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
921 #define STATUS_KEY_DELETED 0xC000017C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
922 #define STATUS_NO_LOG_SPACE 0xC000017D
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
923 #define STATUS_TOO_MANY_SIDS 0xC000017E
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
924 #define STATUS_LM_CROSS_ENCRYPTION_REQUIRED 0xC000017F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
925 #define STATUS_KEY_HAS_CHILDREN 0xC0000180
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
926 #define STATUS_CHILD_MUST_BE_VOLATILE 0xC0000181
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
927 #define STATUS_DEVICE_CONFIGURATION_ERROR0xC0000182
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
928 #define STATUS_DRIVER_INTERNAL_ERROR 0xC0000183
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
929 #define STATUS_INVALID_DEVICE_STATE 0xC0000184
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
930 #define STATUS_IO_DEVICE_ERROR 0xC0000185
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
931 #define STATUS_DEVICE_PROTOCOL_ERROR 0xC0000186
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
932 #define STATUS_BACKUP_CONTROLLER 0xC0000187
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
933 #define STATUS_LOG_FILE_FULL 0xC0000188
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
934 #define STATUS_TOO_LATE 0xC0000189
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
935 #define STATUS_NO_TRUST_LSA_SECRET 0xC000018A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
936 #define STATUS_NO_TRUST_SAM_ACCOUNT 0xC000018B
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
937 #define STATUS_TRUSTED_DOMAIN_FAILURE 0xC000018C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
938 #define STATUS_TRUSTED_RELATIONSHIP_FAILURE 0xC000018D
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
939 #define STATUS_EVENTLOG_FILE_CORRUPT 0xC000018E
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
940 #define STATUS_EVENTLOG_CANT_START 0xC000018F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
941 #define STATUS_TRUST_FAILURE 0xC0000190
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
942 #define STATUS_MUTANT_LIMIT_EXCEEDED 0xC0000191
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
943 #define STATUS_NETLOGON_NOT_STARTED 0xC0000192
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
944 #define STATUS_ACCOUNT_EXPIRED 0xC0000193
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
945 #define STATUS_POSSIBLE_DEADLOCK 0xC0000194
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
946 #define STATUS_NETWORK_CREDENTIAL_CONFLICT 0xC0000195
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
947 #define STATUS_REMOTE_SESSION_LIMIT 0xC0000196
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
948 #define STATUS_EVENTLOG_FILE_CHANGED 0xC0000197
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
949 #define STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT 0xC0000198
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
950 #define STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT 0xC0000199
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
951 #define STATUS_NOLOGON_SERVER_TRUST_ACCOUNT 0xC000019A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
952 #define STATUS_DOMAIN_TRUST_INCONSISTENT 0xC000019B
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
953 #define STATUS_FS_DRIVER_REQUIRED 0xC000019C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
954
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
955 #define STATUS_RESOURCE_LANG_NOT_FOUND 0xC0000204
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
956
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
957 #define MAXIMUM_WAIT_OBJECTS 64
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
958 #define MAXIMUM_SUSPEND_COUNT 127
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
959
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
960
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
961 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
962 * Return values from the actual exception handlers
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
963 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
964
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
965 #define ExceptionContinueExecution 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
966 #define ExceptionContinueSearch 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
967 #define ExceptionNestedException 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
968 #define ExceptionCollidedUnwind 3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
969
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
970 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
971 * Return values from filters in except() and from UnhandledExceptionFilter
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
972 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
973
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
974 #define EXCEPTION_EXECUTE_HANDLER 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
975 #define EXCEPTION_CONTINUE_SEARCH 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
976 #define EXCEPTION_CONTINUE_EXECUTION -1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
977
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
978 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
979 * From OS/2 2.0 exception handling
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
980 * Win32 seems to use the same flags as ExceptionFlags in an EXCEPTION_RECORD
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
981 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
982
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
983 #define EH_NONCONTINUABLE 0x01
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
984 #define EH_UNWINDING 0x02
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
985 #define EH_EXIT_UNWIND 0x04
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
986 #define EH_STACK_INVALID 0x08
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
987 #define EH_NESTED_CALL 0x10
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
988
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
989 #define EXCEPTION_CONTINUABLE 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
990 #define EXCEPTION_NONCONTINUABLE EH_NONCONTINUABLE
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
991
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
992 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
993 * The exception record used by Win32 to give additional information
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
994 * about exception to exception handlers.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
995 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
996
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
997 #define EXCEPTION_MAXIMUM_PARAMETERS 15
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
998
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
999 typedef struct __EXCEPTION_RECORD
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1000 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1001 DWORD ExceptionCode;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1002 DWORD ExceptionFlags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1003 struct __EXCEPTION_RECORD *ExceptionRecord;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1005 LPVOID ExceptionAddress;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1006 DWORD NumberParameters;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1007 DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1008 } EXCEPTION_RECORD, *PEXCEPTION_RECORD;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1009
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1010 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1011 * The exception pointers structure passed to exception filters
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1012 * in except() and the UnhandledExceptionFilter().
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1013 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1014
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1015 typedef struct _EXCEPTION_POINTERS
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1016 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1017 PEXCEPTION_RECORD ExceptionRecord;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1018 PCONTEXT ContextRecord;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1019 } EXCEPTION_POINTERS, *PEXCEPTION_POINTERS;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1020
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1021
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1022 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1023 * The exception frame, used for registering exception handlers
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1024 * Win32 cares only about this, but compilers generally emit
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1025 * larger exception frames for their own use.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1026 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1027
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1028 struct __EXCEPTION_FRAME;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1029
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1030 typedef DWORD (*PEXCEPTION_HANDLER)(PEXCEPTION_RECORD,struct __EXCEPTION_FRAME*,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1031 PCONTEXT,struct __EXCEPTION_FRAME **);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1032
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1033 typedef struct __EXCEPTION_FRAME
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1034 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1035 struct __EXCEPTION_FRAME *Prev;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1036 PEXCEPTION_HANDLER Handler;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1037 } EXCEPTION_FRAME, *PEXCEPTION_FRAME;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1038
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1039 #include "poppack.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1040
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1041 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1042 * function pointer to a exception filter
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1043 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1044
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1045 typedef LONG CALLBACK (*PTOP_LEVEL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS ExceptionInfo);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1046 typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1047
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1048 DWORD WINAPI UnhandledExceptionFilter( PEXCEPTION_POINTERS epointers );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1049 LPTOP_LEVEL_EXCEPTION_FILTER
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1050 WINAPI SetUnhandledExceptionFilter( LPTOP_LEVEL_EXCEPTION_FILTER filter );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1051
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1052 /* status values for ContinueDebugEvent */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1053 #define DBG_CONTINUE 0x00010002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1054 #define DBG_TERMINATE_THREAD 0x40010003
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1055 #define DBG_TERMINATE_PROCESS 0x40010004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1056 #define DBG_CONTROL_C 0x40010005
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1057 #define DBG_CONTROL_BREAK 0x40010008
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1058 #define DBG_EXCEPTION_NOT_HANDLED 0x80010001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1059
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1060 typedef struct _NT_TIB
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1061 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1062 struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1063 PVOID StackBase;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1064 PVOID StackLimit;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1065 PVOID SubSystemTib;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1066 union {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1067 PVOID FiberData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1068 DWORD Version;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1069 } DUMMYUNIONNAME;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1070 PVOID ArbitraryUserPointer;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1071 struct _NT_TIB *Self;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1072 } NT_TIB, *PNT_TIB;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1073
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1074 struct _TEB;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1075 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1076 #if defined(__i386__) && defined(__GNUC__)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1077 extern inline struct _TEB * WINAPI NtCurrentTeb(void);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1078 extern inline struct _TEB * WINAPI NtCurrentTeb(void)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1079 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1080 struct _TEB *teb;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1081 __asm__(".byte 0x64\n\tmovl (0x18),%0" : "=r" (teb));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1082 return teb;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1083 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1084 #else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1085 extern struct _TEB * WINAPI NtCurrentTeb(void);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1086 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1087 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1088
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1089 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1090 * File formats definitions
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1091 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1092
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1093 typedef struct _IMAGE_DOS_HEADER {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1094 WORD e_magic; /* 00: MZ Header signature */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1095 WORD e_cblp; /* 02: Bytes on last page of file */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1096 WORD e_cp; /* 04: Pages in file */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1097 WORD e_crlc; /* 06: Relocations */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1098 WORD e_cparhdr; /* 08: Size of header in paragraphs */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1099 WORD e_minalloc; /* 0a: Minimum extra paragraphs needed */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1100 WORD e_maxalloc; /* 0c: Maximum extra paragraphs needed */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1101 WORD e_ss; /* 0e: Initial (relative) SS value */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1102 WORD e_sp; /* 10: Initial SP value */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1103 WORD e_csum; /* 12: Checksum */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1104 WORD e_ip; /* 14: Initial IP value */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1105 WORD e_cs; /* 16: Initial (relative) CS value */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1106 WORD e_lfarlc; /* 18: File address of relocation table */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1107 WORD e_ovno; /* 1a: Overlay number */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1108 WORD e_res[4]; /* 1c: Reserved words */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1109 WORD e_oemid; /* 24: OEM identifier (for e_oeminfo) */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1110 WORD e_oeminfo; /* 26: OEM information; e_oemid specific */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1111 WORD e_res2[10]; /* 28: Reserved words */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1112 DWORD e_lfanew; /* 3c: Offset to extended header */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1113 } IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1114
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1115 #define IMAGE_DOS_SIGNATURE 0x5A4D /* MZ */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1116 #define IMAGE_OS2_SIGNATURE 0x454E /* NE */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1117 #define IMAGE_OS2_SIGNATURE_LE 0x454C /* LE */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1118 #define IMAGE_OS2_SIGNATURE_LX 0x584C /* LX */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1119 #define IMAGE_VXD_SIGNATURE 0x454C /* LE */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1120 #define IMAGE_NT_SIGNATURE 0x00004550 /* PE00 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1121
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1122 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1123 * This is the Windows executable (NE) header.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1124 * the name IMAGE_OS2_HEADER is misleading, but in the SDK this way.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1125 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1126 typedef struct
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1127 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1128 WORD ne_magic; /* 00 NE signature 'NE' */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1129 BYTE ne_ver; /* 02 Linker version number */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1130 BYTE ne_rev; /* 03 Linker revision number */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1131 WORD ne_enttab; /* 04 Offset to entry table relative to NE */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1132 WORD ne_cbenttab; /* 06 Length of entry table in bytes */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1133 LONG ne_crc; /* 08 Checksum */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1134 WORD ne_flags; /* 0c Flags about segments in this file */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1135 WORD ne_autodata; /* 0e Automatic data segment number */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1136 WORD ne_heap; /* 10 Initial size of local heap */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1137 WORD ne_stack; /* 12 Initial size of stack */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1138 DWORD ne_csip; /* 14 Initial CS:IP */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1139 DWORD ne_sssp; /* 18 Initial SS:SP */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1140 WORD ne_cseg; /* 1c # of entries in segment table */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1141 WORD ne_cmod; /* 1e # of entries in module reference tab. */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1142 WORD ne_cbnrestab; /* 20 Length of nonresident-name table */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1143 WORD ne_segtab; /* 22 Offset to segment table */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1144 WORD ne_rsrctab; /* 24 Offset to resource table */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1145 WORD ne_restab; /* 26 Offset to resident-name table */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1146 WORD ne_modtab; /* 28 Offset to module reference table */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1147 WORD ne_imptab; /* 2a Offset to imported name table */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1148 DWORD ne_nrestab; /* 2c Offset to nonresident-name table */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1149 WORD ne_cmovent; /* 30 # of movable entry points */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1150 WORD ne_align; /* 32 Logical sector alignment shift count */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1151 WORD ne_cres; /* 34 # of resource segments */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1152 BYTE ne_exetyp; /* 36 Flags indicating target OS */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1153 BYTE ne_flagsothers; /* 37 Additional information flags */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1154 WORD fastload_offset; /* 38 Offset to fast load area (should be ne_pretthunks)*/
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1155 WORD fastload_length; /* 3a Length of fast load area (should be ne_psegrefbytes) */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1156 WORD ne_swaparea; /* 3c Reserved by Microsoft */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1157 WORD ne_expver; /* 3e Expected Windows version number */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1158 } IMAGE_OS2_HEADER,*PIMAGE_OS2_HEADER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1159
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1160 typedef struct _IMAGE_VXD_HEADER {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1161 WORD e32_magic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1162 BYTE e32_border;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1163 BYTE e32_worder;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1164 DWORD e32_level;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1165 WORD e32_cpu;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1166 WORD e32_os;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1167 DWORD e32_ver;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1168 DWORD e32_mflags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1169 DWORD e32_mpages;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1170 DWORD e32_startobj;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1171 DWORD e32_eip;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1172 DWORD e32_stackobj;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1173 DWORD e32_esp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1174 DWORD e32_pagesize;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1175 DWORD e32_lastpagesize;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1176 DWORD e32_fixupsize;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1177 DWORD e32_fixupsum;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1178 DWORD e32_ldrsize;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1179 DWORD e32_ldrsum;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1180 DWORD e32_objtab;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1181 DWORD e32_objcnt;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1182 DWORD e32_objmap;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1183 DWORD e32_itermap;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1184 DWORD e32_rsrctab;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1185 DWORD e32_rsrccnt;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1186 DWORD e32_restab;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1187 DWORD e32_enttab;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1188 DWORD e32_dirtab;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1189 DWORD e32_dircnt;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1190 DWORD e32_fpagetab;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1191 DWORD e32_frectab;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1192 DWORD e32_impmod;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1193 DWORD e32_impmodcnt;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1194 DWORD e32_impproc;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1195 DWORD e32_pagesum;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1196 DWORD e32_datapage;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1197 DWORD e32_preload;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1198 DWORD e32_nrestab;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1199 DWORD e32_cbnrestab;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1200 DWORD e32_nressum;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1201 DWORD e32_autodata;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1202 DWORD e32_debuginfo;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1203 DWORD e32_debuglen;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1204 DWORD e32_instpreload;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1205 DWORD e32_instdemand;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1206 DWORD e32_heapsize;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1207 BYTE e32_res3[12];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1208 DWORD e32_winresoff;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1209 DWORD e32_winreslen;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1210 WORD e32_devid;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1211 WORD e32_ddkver;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1212 } IMAGE_VXD_HEADER, *PIMAGE_VXD_HEADER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1213
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1214
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1215 /* These defines describe the meanings of the bits in the Characteristics
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1216 field */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1217
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1218 #define IMAGE_FILE_RELOCS_STRIPPED 0x0001 /* No relocation info */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1219 #define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1220 #define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1221 #define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1222 #define IMAGE_FILE_16BIT_MACHINE 0x0040
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1223 #define IMAGE_FILE_BYTES_REVERSED_LO 0x0080
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1224 #define IMAGE_FILE_32BIT_MACHINE 0x0100
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1225 #define IMAGE_FILE_DEBUG_STRIPPED 0x0200
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1226 #define IMAGE_FILE_SYSTEM 0x1000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1227 #define IMAGE_FILE_DLL 0x2000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1228 #define IMAGE_FILE_BYTES_REVERSED_HI 0x8000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1229
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1230 /* These are the settings of the Machine field. */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1231 #define IMAGE_FILE_MACHINE_UNKNOWN 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1232 #define IMAGE_FILE_MACHINE_I860 0x14d
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1233 #define IMAGE_FILE_MACHINE_I386 0x14c
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1234 #define IMAGE_FILE_MACHINE_R3000 0x162
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1235 #define IMAGE_FILE_MACHINE_R4000 0x166
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1236 #define IMAGE_FILE_MACHINE_R10000 0x168
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1237 #define IMAGE_FILE_MACHINE_ALPHA 0x184
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1238 #define IMAGE_FILE_MACHINE_POWERPC 0x1F0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1239
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1240 #define IMAGE_SIZEOF_FILE_HEADER 20
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1241
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1242 /* Possible Magic values */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1243 #define IMAGE_NT_OPTIONAL_HDR_MAGIC 0x10b
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1244 #define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1245
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1246 /* These are indexes into the DataDirectory array */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1247 #define IMAGE_FILE_EXPORT_DIRECTORY 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1248 #define IMAGE_FILE_IMPORT_DIRECTORY 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1249 #define IMAGE_FILE_RESOURCE_DIRECTORY 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1250 #define IMAGE_FILE_EXCEPTION_DIRECTORY 3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1251 #define IMAGE_FILE_SECURITY_DIRECTORY 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1252 #define IMAGE_FILE_BASE_RELOCATION_TABLE 5
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1253 #define IMAGE_FILE_DEBUG_DIRECTORY 6
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1254 #define IMAGE_FILE_DESCRIPTION_STRING 7
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1255 #define IMAGE_FILE_MACHINE_VALUE 8 /* Mips */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1256 #define IMAGE_FILE_THREAD_LOCAL_STORAGE 9
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1257 #define IMAGE_FILE_CALLBACK_DIRECTORY 10
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1258
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1259 /* Directory Entries, indices into the DataDirectory array */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1260
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1261 #define IMAGE_DIRECTORY_ENTRY_EXPORT 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1262 #define IMAGE_DIRECTORY_ENTRY_IMPORT 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1263 #define IMAGE_DIRECTORY_ENTRY_RESOURCE 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1264 #define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1265 #define IMAGE_DIRECTORY_ENTRY_SECURITY 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1266 #define IMAGE_DIRECTORY_ENTRY_BASERELOC 5
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1267 #define IMAGE_DIRECTORY_ENTRY_DEBUG 6
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1268 #define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1269 #define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 /* (MIPS GP) */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1270 #define IMAGE_DIRECTORY_ENTRY_TLS 9
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1271 #define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1272 #define IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT 11
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1273 #define IMAGE_DIRECTORY_ENTRY_IAT 12 /* Import Address Table */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1274 #define IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT 13
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1275 #define IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR 14
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1276
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1277 /* Subsystem Values */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1278
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1279 #define IMAGE_SUBSYSTEM_UNKNOWN 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1280 #define IMAGE_SUBSYSTEM_NATIVE 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1281 #define IMAGE_SUBSYSTEM_WINDOWS_GUI 2 /* Windows GUI subsystem */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1282 #define IMAGE_SUBSYSTEM_WINDOWS_CUI 3 /* Windows character subsystem*/
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1283 #define IMAGE_SUBSYSTEM_OS2_CUI 5
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1284 #define IMAGE_SUBSYSTEM_POSIX_CUI 7
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1285
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1286 typedef struct _IMAGE_FILE_HEADER {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1287 WORD Machine;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1288 WORD NumberOfSections;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1289 DWORD TimeDateStamp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1290 DWORD PointerToSymbolTable;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1291 DWORD NumberOfSymbols;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1292 WORD SizeOfOptionalHeader;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1293 WORD Characteristics;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1294 } IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1295
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1296 typedef struct _IMAGE_DATA_DIRECTORY {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1297 DWORD VirtualAddress;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1298 DWORD Size;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1299 } IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1300
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1301 #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1302
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1303 typedef struct _IMAGE_OPTIONAL_HEADER {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1304
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1305 /* Standard fields */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1306
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1307 WORD Magic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1308 BYTE MajorLinkerVersion;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1309 BYTE MinorLinkerVersion;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1310 DWORD SizeOfCode;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1311 DWORD SizeOfInitializedData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1312 DWORD SizeOfUninitializedData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1313 DWORD AddressOfEntryPoint;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1314 DWORD BaseOfCode;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1315 DWORD BaseOfData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1316
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1317 /* NT additional fields */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1318
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1319 DWORD ImageBase;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1320 DWORD SectionAlignment;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1321 DWORD FileAlignment;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1322 WORD MajorOperatingSystemVersion;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1323 WORD MinorOperatingSystemVersion;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1324 WORD MajorImageVersion;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1325 WORD MinorImageVersion;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1326 WORD MajorSubsystemVersion;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1327 WORD MinorSubsystemVersion;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1328 DWORD Win32VersionValue;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1329 DWORD SizeOfImage;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1330 DWORD SizeOfHeaders;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1331 DWORD CheckSum;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1332 WORD Subsystem;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1333 WORD DllCharacteristics;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1334 DWORD SizeOfStackReserve;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1335 DWORD SizeOfStackCommit;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1336 DWORD SizeOfHeapReserve;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1337 DWORD SizeOfHeapCommit;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1338 DWORD LoaderFlags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1339 DWORD NumberOfRvaAndSizes;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1340 IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1341 } IMAGE_OPTIONAL_HEADER, *PIMAGE_OPTIONAL_HEADER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1342
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1343 typedef struct _IMAGE_NT_HEADERS {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1344 DWORD Signature;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1345 IMAGE_FILE_HEADER FileHeader;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1346 IMAGE_OPTIONAL_HEADER OptionalHeader;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1347 } IMAGE_NT_HEADERS, *PIMAGE_NT_HEADERS;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1348
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1349 #define IMAGE_SIZEOF_SHORT_NAME 8
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1350
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1351 typedef struct _IMAGE_SECTION_HEADER {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1352 BYTE Name[IMAGE_SIZEOF_SHORT_NAME];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1353 union {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1354 DWORD PhysicalAddress;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1355 DWORD VirtualSize;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1356 } Misc;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1357 DWORD VirtualAddress;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1358 DWORD SizeOfRawData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1359 DWORD PointerToRawData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1360 DWORD PointerToRelocations;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1361 DWORD PointerToLinenumbers;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1362 WORD NumberOfRelocations;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1363 WORD NumberOfLinenumbers;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1364 DWORD Characteristics;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1365 } IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1366
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1367 #define IMAGE_SIZEOF_SECTION_HEADER 40
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1368
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1369 #define IMAGE_FIRST_SECTION(ntheader) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1370 ((PIMAGE_SECTION_HEADER)((LPBYTE)&((PIMAGE_NT_HEADERS)(ntheader))->OptionalHeader + \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1371 ((PIMAGE_NT_HEADERS)(ntheader))->FileHeader.SizeOfOptionalHeader))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1372
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1373 /* These defines are for the Characteristics bitfield. */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1374 /* #define IMAGE_SCN_TYPE_REG 0x00000000 - Reserved */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1375 /* #define IMAGE_SCN_TYPE_DSECT 0x00000001 - Reserved */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1376 /* #define IMAGE_SCN_TYPE_NOLOAD 0x00000002 - Reserved */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1377 /* #define IMAGE_SCN_TYPE_GROUP 0x00000004 - Reserved */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1378 /* #define IMAGE_SCN_TYPE_NO_PAD 0x00000008 - Reserved */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1379 /* #define IMAGE_SCN_TYPE_COPY 0x00000010 - Reserved */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1380
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1381 #define IMAGE_SCN_CNT_CODE 0x00000020
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1382 #define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1383 #define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1384
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1385 #define IMAGE_SCN_LNK_OTHER 0x00000100
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1386 #define IMAGE_SCN_LNK_INFO 0x00000200
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1387 /* #define IMAGE_SCN_TYPE_OVER 0x00000400 - Reserved */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1388 #define IMAGE_SCN_LNK_REMOVE 0x00000800
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1389 #define IMAGE_SCN_LNK_COMDAT 0x00001000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1390
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1391 /* 0x00002000 - Reserved */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1392 /* #define IMAGE_SCN_MEM_PROTECTED 0x00004000 - Obsolete */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1393 #define IMAGE_SCN_MEM_FARDATA 0x00008000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1394
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1395 /* #define IMAGE_SCN_MEM_SYSHEAP 0x00010000 - Obsolete */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1396 #define IMAGE_SCN_MEM_PURGEABLE 0x00020000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1397 #define IMAGE_SCN_MEM_16BIT 0x00020000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1398 #define IMAGE_SCN_MEM_LOCKED 0x00040000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1399 #define IMAGE_SCN_MEM_PRELOAD 0x00080000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1400
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1401 #define IMAGE_SCN_ALIGN_1BYTES 0x00100000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1402 #define IMAGE_SCN_ALIGN_2BYTES 0x00200000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1403 #define IMAGE_SCN_ALIGN_4BYTES 0x00300000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1404 #define IMAGE_SCN_ALIGN_8BYTES 0x00400000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1405 #define IMAGE_SCN_ALIGN_16BYTES 0x00500000 /* Default */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1406 #define IMAGE_SCN_ALIGN_32BYTES 0x00600000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1407 #define IMAGE_SCN_ALIGN_64BYTES 0x00700000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1408 /* 0x00800000 - Unused */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1409
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1410 #define IMAGE_SCN_LNK_NRELOC_OVFL 0x01000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1411
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1412
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1413 #define IMAGE_SCN_MEM_DISCARDABLE 0x02000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1414 #define IMAGE_SCN_MEM_NOT_CACHED 0x04000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1415 #define IMAGE_SCN_MEM_NOT_PAGED 0x08000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1416 #define IMAGE_SCN_MEM_SHARED 0x10000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1417 #define IMAGE_SCN_MEM_EXECUTE 0x20000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1418 #define IMAGE_SCN_MEM_READ 0x40000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1419 #define IMAGE_SCN_MEM_WRITE 0x80000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1420
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1421 #include "pshpack2.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1422
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1423 typedef struct _IMAGE_SYMBOL {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1424 union {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1425 BYTE ShortName[8];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1426 struct {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1427 DWORD Short;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1428 DWORD Long;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1429 } Name;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1430 DWORD LongName[2];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1431 } N;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1432 DWORD Value;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1433 SHORT SectionNumber;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1434 WORD Type;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1435 BYTE StorageClass;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1436 BYTE NumberOfAuxSymbols;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1437 } IMAGE_SYMBOL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1438 typedef IMAGE_SYMBOL *PIMAGE_SYMBOL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1439
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1440 #define IMAGE_SIZEOF_SYMBOL 18
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1441
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1442 typedef struct _IMAGE_LINENUMBER {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1443 union {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1444 DWORD SymbolTableIndex;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1445 DWORD VirtualAddress;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1446 } Type;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1447 WORD Linenumber;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1448 } IMAGE_LINENUMBER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1449 typedef IMAGE_LINENUMBER *PIMAGE_LINENUMBER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1450
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1451 #define IMAGE_SIZEOF_LINENUMBER 6
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1452
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1453 typedef union _IMAGE_AUX_SYMBOL {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1454 struct {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1455 DWORD TagIndex;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1456 union {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1457 struct {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1458 WORD Linenumber;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1459 WORD Size;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1460 } LnSz;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1461 DWORD TotalSize;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1462 } Misc;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1463 union {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1464 struct {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1465 DWORD PointerToLinenumber;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1466 DWORD PointerToNextFunction;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1467 } Function;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1468 struct {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1469 WORD Dimension[4];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1470 } Array;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1471 } FcnAry;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1472 WORD TvIndex;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1473 } Sym;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1474 struct {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1475 BYTE Name[IMAGE_SIZEOF_SYMBOL];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1476 } File;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1477 struct {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1478 DWORD Length;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1479 WORD NumberOfRelocations;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1480 WORD NumberOfLinenumbers;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1481 DWORD CheckSum;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1482 SHORT Number;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1483 BYTE Selection;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1484 } Section;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1485 } IMAGE_AUX_SYMBOL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1486 typedef IMAGE_AUX_SYMBOL *PIMAGE_AUX_SYMBOL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1487
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1488 #define IMAGE_SIZEOF_AUX_SYMBOL 18
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1489
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1490 #include "poppack.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1491
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1492 #define IMAGE_SYM_UNDEFINED (SHORT)0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1493 #define IMAGE_SYM_ABSOLUTE (SHORT)-1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1494 #define IMAGE_SYM_DEBUG (SHORT)-2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1495
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1496 #define IMAGE_SYM_TYPE_NULL 0x0000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1497 #define IMAGE_SYM_TYPE_VOID 0x0001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1498 #define IMAGE_SYM_TYPE_CHAR 0x0002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1499 #define IMAGE_SYM_TYPE_SHORT 0x0003
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1500 #define IMAGE_SYM_TYPE_INT 0x0004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1501 #define IMAGE_SYM_TYPE_LONG 0x0005
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1502 #define IMAGE_SYM_TYPE_FLOAT 0x0006
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1503 #define IMAGE_SYM_TYPE_DOUBLE 0x0007
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1504 #define IMAGE_SYM_TYPE_STRUCT 0x0008
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1505 #define IMAGE_SYM_TYPE_UNION 0x0009
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1506 #define IMAGE_SYM_TYPE_ENUM 0x000A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1507 #define IMAGE_SYM_TYPE_MOE 0x000B
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1508 #define IMAGE_SYM_TYPE_BYTE 0x000C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1509 #define IMAGE_SYM_TYPE_WORD 0x000D
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1510 #define IMAGE_SYM_TYPE_UINT 0x000E
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1511 #define IMAGE_SYM_TYPE_DWORD 0x000F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1512 #define IMAGE_SYM_TYPE_PCODE 0x8000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1513
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1514 #define IMAGE_SYM_DTYPE_NULL 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1515 #define IMAGE_SYM_DTYPE_POINTER 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1516 #define IMAGE_SYM_DTYPE_FUNCTION 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1517 #define IMAGE_SYM_DTYPE_ARRAY 3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1518
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1519 #define IMAGE_SYM_CLASS_END_OF_FUNCTION (BYTE )-1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1520 #define IMAGE_SYM_CLASS_NULL 0x0000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1521 #define IMAGE_SYM_CLASS_AUTOMATIC 0x0001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1522 #define IMAGE_SYM_CLASS_EXTERNAL 0x0002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1523 #define IMAGE_SYM_CLASS_STATIC 0x0003
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1524 #define IMAGE_SYM_CLASS_REGISTER 0x0004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1525 #define IMAGE_SYM_CLASS_EXTERNAL_DEF 0x0005
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1526 #define IMAGE_SYM_CLASS_LABEL 0x0006
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1527 #define IMAGE_SYM_CLASS_UNDEFINED_LABEL 0x0007
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1528 #define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 0x0008
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1529 #define IMAGE_SYM_CLASS_ARGUMENT 0x0009
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1530 #define IMAGE_SYM_CLASS_STRUCT_TAG 0x000A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1531 #define IMAGE_SYM_CLASS_MEMBER_OF_UNION 0x000B
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1532 #define IMAGE_SYM_CLASS_UNION_TAG 0x000C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1533 #define IMAGE_SYM_CLASS_TYPE_DEFINITION 0x000D
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1534 #define IMAGE_SYM_CLASS_UNDEFINED_STATIC 0x000E
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1535 #define IMAGE_SYM_CLASS_ENUM_TAG 0x000F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1536 #define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 0x0010
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1537 #define IMAGE_SYM_CLASS_REGISTER_PARAM 0x0011
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1538 #define IMAGE_SYM_CLASS_BIT_FIELD 0x0012
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1539
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1540 #define IMAGE_SYM_CLASS_FAR_EXTERNAL 0x0044
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1541 #define IMAGE_SYM_CLASS_BLOCK 0x0064
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1542 #define IMAGE_SYM_CLASS_FUNCTION 0x0065
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1543 #define IMAGE_SYM_CLASS_END_OF_STRUCT 0x0066
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1544 #define IMAGE_SYM_CLASS_FILE 0x0067
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1545 #define IMAGE_SYM_CLASS_SECTION 0x0068
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1546 #define IMAGE_SYM_CLASS_WEAK_EXTERNAL 0x0069
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1547
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1548 #define N_BTMASK 0x000F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1549 #define N_TMASK 0x0030
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1550 #define N_TMASK1 0x00C0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1551 #define N_TMASK2 0x00F0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1552 #define N_BTSHFT 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1553 #define N_TSHIFT 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1554
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1555 #define BTYPE(x) ((x) & N_BTMASK)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1556
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1557 #ifndef ISPTR
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1558 #define ISPTR(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1559 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1560
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1561 #ifndef ISFCN
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1562 #define ISFCN(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_FUNCTION << N_BTSHFT))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1563 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1564
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1565 #ifndef ISARY
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1566 #define ISARY(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_ARRAY << N_BTSHFT))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1567 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1568
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1569 #ifndef ISTAG
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1570 #define ISTAG(x) ((x)==IMAGE_SYM_CLASS_STRUCT_TAG || (x)==IMAGE_SYM_CLASS_UNION_TAG || (x)==IMAGE_SYM_CLASS_ENUM_TAG)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1571 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1572
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1573 #ifndef INCREF
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1574 #define INCREF(x) ((((x)&~N_BTMASK)<<N_TSHIFT)|(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT)|((x)&N_BTMASK))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1575 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1576 #ifndef DECREF
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1577 #define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1578 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1579
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1580 #define IMAGE_COMDAT_SELECT_NODUPLICATES 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1581 #define IMAGE_COMDAT_SELECT_ANY 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1582 #define IMAGE_COMDAT_SELECT_SAME_SIZE 3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1583 #define IMAGE_COMDAT_SELECT_EXACT_MATCH 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1584 #define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1585 #define IMAGE_COMDAT_SELECT_LARGEST 6
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1586 #define IMAGE_COMDAT_SELECT_NEWEST 7
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1587
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1588 #define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1589 #define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1590 #define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1591
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1592 /* Export module directory */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1593
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1594 typedef struct _IMAGE_EXPORT_DIRECTORY {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1595 DWORD Characteristics;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1596 DWORD TimeDateStamp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1597 WORD MajorVersion;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1598 WORD MinorVersion;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1599 DWORD Name;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1600 DWORD Base;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1601 DWORD NumberOfFunctions;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1602 DWORD NumberOfNames;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1603 LPDWORD *AddressOfFunctions;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1604 LPDWORD *AddressOfNames;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1605 LPWORD *AddressOfNameOrdinals;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1606 } IMAGE_EXPORT_DIRECTORY,*PIMAGE_EXPORT_DIRECTORY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1607
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1608 /* Import name entry */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1609 typedef struct _IMAGE_IMPORT_BY_NAME {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1610 WORD Hint;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1611 BYTE Name[1];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1612 } IMAGE_IMPORT_BY_NAME,*PIMAGE_IMPORT_BY_NAME;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1613
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1614 /* Import thunk */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1615 typedef struct _IMAGE_THUNK_DATA {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1616 union {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1617 LPBYTE ForwarderString;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1618 FARPROC Function;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1619 DWORD Ordinal;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1620 PIMAGE_IMPORT_BY_NAME AddressOfData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1621 } u1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1622 } IMAGE_THUNK_DATA,*PIMAGE_THUNK_DATA;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1623
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1624 /* Import module directory */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1625
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1626 typedef struct _IMAGE_IMPORT_DESCRIPTOR {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1627 union {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1628 DWORD Characteristics; /* 0 for terminating null import descriptor */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1629 PIMAGE_THUNK_DATA OriginalFirstThunk; /* RVA to original unbound IAT */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1630 } u;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1631 DWORD TimeDateStamp; /* 0 if not bound,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1632 * -1 if bound, and real date\time stamp
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1633 * in IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1634 * (new BIND)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1635 * otherwise date/time stamp of DLL bound to
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1636 * (Old BIND)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1637 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1638 DWORD ForwarderChain; /* -1 if no forwarders */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1639 DWORD Name;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1640 /* RVA to IAT (if bound this IAT has actual addresses) */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1641 PIMAGE_THUNK_DATA FirstThunk;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1642 } IMAGE_IMPORT_DESCRIPTOR,*PIMAGE_IMPORT_DESCRIPTOR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1643
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1644 #define IMAGE_ORDINAL_FLAG 0x80000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1645 #define IMAGE_SNAP_BY_ORDINAL(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG) != 0)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1646 #define IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1647
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1648 typedef struct _IMAGE_BOUND_IMPORT_DESCRIPTOR
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1649 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1650 DWORD TimeDateStamp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1651 WORD OffsetModuleName;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1652 WORD NumberOfModuleForwarderRefs;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1653 /* Array of zero or more IMAGE_BOUND_FORWARDER_REF follows */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1654 } IMAGE_BOUND_IMPORT_DESCRIPTOR, *PIMAGE_BOUND_IMPORT_DESCRIPTOR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1655
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1656 typedef struct _IMAGE_BOUND_FORWARDER_REF
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1657 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1658 DWORD TimeDateStamp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1659 WORD OffsetModuleName;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1660 WORD Reserved;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1661 } IMAGE_BOUND_FORWARDER_REF, *PIMAGE_BOUND_FORWARDER_REF;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1662
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1663 typedef struct _IMAGE_BASE_RELOCATION
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1664 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1665 DWORD VirtualAddress;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1666 DWORD SizeOfBlock;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1667 WORD TypeOffset[1];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1668 } IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1669
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1670 typedef struct _IMAGE_RELOCATION
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1671 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1672 union {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1673 DWORD VirtualAddress;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1674 DWORD RelocCount;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1675 } u;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1676 DWORD SymbolTableIndex;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1677 WORD Type;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1678 } IMAGE_RELOCATION;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1679 typedef IMAGE_RELOCATION *PIMAGE_RELOCATION;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1680
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1681 #define IMAGE_SIZEOF_RELOCATION 10
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1682
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1683 /* generic relocation types */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1684 #define IMAGE_REL_BASED_ABSOLUTE 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1685 #define IMAGE_REL_BASED_HIGH 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1686 #define IMAGE_REL_BASED_LOW 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1687 #define IMAGE_REL_BASED_HIGHLOW 3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1688 #define IMAGE_REL_BASED_HIGHADJ 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1689 #define IMAGE_REL_BASED_MIPS_JMPADDR 5
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1690 #define IMAGE_REL_BASED_SECTION 6
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1691 #define IMAGE_REL_BASED_REL 7
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1692 #define IMAGE_REL_BASED_MIPS_JMPADDR16 9
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1693 #define IMAGE_REL_BASED_IA64_IMM64 9 /* yes, 9 too */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1694 #define IMAGE_REL_BASED_DIR64 10
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1695 #define IMAGE_REL_BASED_HIGH3ADJ 11
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1696
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1697 /* I386 relocation types */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1698 #define IMAGE_REL_I386_ABSOLUTE 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1699 #define IMAGE_REL_I386_DIR16 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1700 #define IMAGE_REL_I386_REL16 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1701 #define IMAGE_REL_I386_DIR32 6
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1702 #define IMAGE_REL_I386_DIR32NB 7
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1703 #define IMAGE_REL_I386_SEG12 9
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1704 #define IMAGE_REL_I386_SECTION 10
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1705 #define IMAGE_REL_I386_SECREL 11
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1706 #define IMAGE_REL_I386_REL32 20
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1707
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1708 /* MIPS relocation types */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1709 #define IMAGE_REL_MIPS_ABSOLUTE 0x0000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1710 #define IMAGE_REL_MIPS_REFHALF 0x0001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1711 #define IMAGE_REL_MIPS_REFWORD 0x0002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1712 #define IMAGE_REL_MIPS_JMPADDR 0x0003
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1713 #define IMAGE_REL_MIPS_REFHI 0x0004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1714 #define IMAGE_REL_MIPS_REFLO 0x0005
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1715 #define IMAGE_REL_MIPS_GPREL 0x0006
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1716 #define IMAGE_REL_MIPS_LITERAL 0x0007
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1717 #define IMAGE_REL_MIPS_SECTION 0x000A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1718 #define IMAGE_REL_MIPS_SECREL 0x000B
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1719 #define IMAGE_REL_MIPS_SECRELLO 0x000C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1720 #define IMAGE_REL_MIPS_SECRELHI 0x000D
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1721 #define IMAGE_REL_MIPS_JMPADDR16 0x0010
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1722 #define IMAGE_REL_MIPS_REFWORDNB 0x0022
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1723 #define IMAGE_REL_MIPS_PAIR 0x0025
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1724
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1725 /* ALPHA relocation types */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1726 #define IMAGE_REL_ALPHA_ABSOLUTE 0x0000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1727 #define IMAGE_REL_ALPHA_REFLONG 0x0001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1728 #define IMAGE_REL_ALPHA_REFQUAD 0x0002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1729 #define IMAGE_REL_ALPHA_GPREL 0x0003
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1730 #define IMAGE_REL_ALPHA_LITERAL 0x0004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1731 #define IMAGE_REL_ALPHA_LITUSE 0x0005
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1732 #define IMAGE_REL_ALPHA_GPDISP 0x0006
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1733 #define IMAGE_REL_ALPHA_BRADDR 0x0007
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1734 #define IMAGE_REL_ALPHA_HINT 0x0008
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1735 #define IMAGE_REL_ALPHA_INLINE_REFLONG 0x0009
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1736 #define IMAGE_REL_ALPHA_REFHI 0x000A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1737 #define IMAGE_REL_ALPHA_REFLO 0x000B
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1738 #define IMAGE_REL_ALPHA_PAIR 0x000C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1739 #define IMAGE_REL_ALPHA_MATCH 0x000D
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1740 #define IMAGE_REL_ALPHA_SECTION 0x000E
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1741 #define IMAGE_REL_ALPHA_SECREL 0x000F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1742 #define IMAGE_REL_ALPHA_REFLONGNB 0x0010
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1743 #define IMAGE_REL_ALPHA_SECRELLO 0x0011
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1744 #define IMAGE_REL_ALPHA_SECRELHI 0x0012
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1745 #define IMAGE_REL_ALPHA_REFQ3 0x0013
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1746 #define IMAGE_REL_ALPHA_REFQ2 0x0014
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1747 #define IMAGE_REL_ALPHA_REFQ1 0x0015
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1748 #define IMAGE_REL_ALPHA_GPRELLO 0x0016
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1749 #define IMAGE_REL_ALPHA_GPRELHI 0x0017
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1750
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1751 /* PowerPC relocation types */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1752 #define IMAGE_REL_PPC_ABSOLUTE 0x0000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1753 #define IMAGE_REL_PPC_ADDR64 0x0001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1754 #define IMAGE_REL_PPC_ADDR 0x0002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1755 #define IMAGE_REL_PPC_ADDR24 0x0003
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1756 #define IMAGE_REL_PPC_ADDR16 0x0004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1757 #define IMAGE_REL_PPC_ADDR14 0x0005
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1758 #define IMAGE_REL_PPC_REL24 0x0006
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1759 #define IMAGE_REL_PPC_REL14 0x0007
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1760 #define IMAGE_REL_PPC_TOCREL16 0x0008
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1761 #define IMAGE_REL_PPC_TOCREL14 0x0009
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1762 #define IMAGE_REL_PPC_ADDR32NB 0x000A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1763 #define IMAGE_REL_PPC_SECREL 0x000B
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1764 #define IMAGE_REL_PPC_SECTION 0x000C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1765 #define IMAGE_REL_PPC_IFGLUE 0x000D
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1766 #define IMAGE_REL_PPC_IMGLUE 0x000E
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1767 #define IMAGE_REL_PPC_SECREL16 0x000F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1768 #define IMAGE_REL_PPC_REFHI 0x0010
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1769 #define IMAGE_REL_PPC_REFLO 0x0011
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1770 #define IMAGE_REL_PPC_PAIR 0x0012
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1771 #define IMAGE_REL_PPC_SECRELLO 0x0013
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1772 #define IMAGE_REL_PPC_SECRELHI 0x0014
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1773 #define IMAGE_REL_PPC_GPREL 0x0015
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1774 #define IMAGE_REL_PPC_TYPEMASK 0x00FF
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1775 /* modifier bits */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1776 #define IMAGE_REL_PPC_NEG 0x0100
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1777 #define IMAGE_REL_PPC_BRTAKEN 0x0200
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1778 #define IMAGE_REL_PPC_BRNTAKEN 0x0400
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1779 #define IMAGE_REL_PPC_TOCDEFN 0x0800
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1780
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1781 /* SH3 ? relocation type */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1782 #define IMAGE_REL_SH3_ABSOLUTE 0x0000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1783 #define IMAGE_REL_SH3_DIRECT16 0x0001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1784 #define IMAGE_REL_SH3_DIRECT 0x0002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1785 #define IMAGE_REL_SH3_DIRECT8 0x0003
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1786 #define IMAGE_REL_SH3_DIRECT8_WORD 0x0004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1787 #define IMAGE_REL_SH3_DIRECT8_LONG 0x0005
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1788 #define IMAGE_REL_SH3_DIRECT4 0x0006
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1789 #define IMAGE_REL_SH3_DIRECT4_WORD 0x0007
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1790 #define IMAGE_REL_SH3_DIRECT4_LONG 0x0008
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1791 #define IMAGE_REL_SH3_PCREL8_WORD 0x0009
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1792 #define IMAGE_REL_SH3_PCREL8_LONG 0x000A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1793 #define IMAGE_REL_SH3_PCREL12_WORD 0x000B
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1794 #define IMAGE_REL_SH3_STARTOF_SECTION 0x000C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1795 #define IMAGE_REL_SH3_SIZEOF_SECTION 0x000D
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1796 #define IMAGE_REL_SH3_SECTION 0x000E
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1797 #define IMAGE_REL_SH3_SECREL 0x000F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1798 #define IMAGE_REL_SH3_DIRECT32_NB 0x0010
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1799
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1800 /* ARM (Archimedes?) relocation types */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1801 #define IMAGE_REL_ARM_ABSOLUTE 0x0000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1802 #define IMAGE_REL_ARM_ADDR 0x0001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1803 #define IMAGE_REL_ARM_ADDR32NB 0x0002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1804 #define IMAGE_REL_ARM_BRANCH24 0x0003
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1805 #define IMAGE_REL_ARM_BRANCH11 0x0004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1806 #define IMAGE_REL_ARM_SECTION 0x000E
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1807 #define IMAGE_REL_ARM_SECREL 0x000F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1808
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1809 /* IA64 relocation types */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1810 #define IMAGE_REL_IA64_ABSOLUTE 0x0000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1811 #define IMAGE_REL_IA64_IMM14 0x0001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1812 #define IMAGE_REL_IA64_IMM22 0x0002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1813 #define IMAGE_REL_IA64_IMM64 0x0003
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1814 #define IMAGE_REL_IA64_DIR 0x0004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1815 #define IMAGE_REL_IA64_DIR64 0x0005
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1816 #define IMAGE_REL_IA64_PCREL21B 0x0006
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1817 #define IMAGE_REL_IA64_PCREL21M 0x0007
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1818 #define IMAGE_REL_IA64_PCREL21F 0x0008
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1819 #define IMAGE_REL_IA64_GPREL22 0x0009
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1820 #define IMAGE_REL_IA64_LTOFF22 0x000A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1821 #define IMAGE_REL_IA64_SECTION 0x000B
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1822 #define IMAGE_REL_IA64_SECREL22 0x000C
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1823 #define IMAGE_REL_IA64_SECREL64I 0x000D
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1824 #define IMAGE_REL_IA64_SECREL 0x000E
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1825 #define IMAGE_REL_IA64_LTOFF64 0x000F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1826 #define IMAGE_REL_IA64_DIR32NB 0x0010
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1827 #define IMAGE_REL_IA64_RESERVED_11 0x0011
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1828 #define IMAGE_REL_IA64_RESERVED_12 0x0012
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1829 #define IMAGE_REL_IA64_RESERVED_13 0x0013
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1830 #define IMAGE_REL_IA64_RESERVED_14 0x0014
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1831 #define IMAGE_REL_IA64_RESERVED_15 0x0015
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1832 #define IMAGE_REL_IA64_RESERVED_16 0x0016
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1833 #define IMAGE_REL_IA64_ADDEND 0x001F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1834
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1835 /* archive format */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1836
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1837 #define IMAGE_ARCHIVE_START_SIZE 8
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1838 #define IMAGE_ARCHIVE_START "!<arch>\n"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1839 #define IMAGE_ARCHIVE_END "`\n"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1840 #define IMAGE_ARCHIVE_PAD "\n"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1841 #define IMAGE_ARCHIVE_LINKER_MEMBER "/ "
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1842 #define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1843
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1844 typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1845 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1846 BYTE Name[16];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1847 BYTE Date[12];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1848 BYTE UserID[6];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1849 BYTE GroupID[6];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1850 BYTE Mode[8];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1851 BYTE Size[10];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1852 BYTE EndHeader[2];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1853 } IMAGE_ARCHIVE_MEMBER_HEADER, *PIMAGE_ARCHIVE_MEMBER_HEADER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1854
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1855 #define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1856
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1857 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1858 * Resource directory stuff
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1859 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1860 typedef struct _IMAGE_RESOURCE_DIRECTORY {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1861 DWORD Characteristics;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1862 DWORD TimeDateStamp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1863 WORD MajorVersion;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1864 WORD MinorVersion;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1865 WORD NumberOfNamedEntries;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1866 WORD NumberOfIdEntries;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1867 /* IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[]; */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1868 } IMAGE_RESOURCE_DIRECTORY,*PIMAGE_RESOURCE_DIRECTORY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1869
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1870 #define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1871 #define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1872
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1873 typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1874 union {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1875 struct {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1876 unsigned NameOffset:31;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1877 unsigned NameIsString:1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1878 } s;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1879 DWORD Name;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1880 WORD Id;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1881 } u1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1882 union {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1883 DWORD OffsetToData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1884 struct {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1885 unsigned OffsetToDirectory:31;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1886 unsigned DataIsDirectory:1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1887 } s;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1888 } u2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1889 } IMAGE_RESOURCE_DIRECTORY_ENTRY,*PIMAGE_RESOURCE_DIRECTORY_ENTRY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1890
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1891
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1892 typedef struct _IMAGE_RESOURCE_DIRECTORY_STRING {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1893 WORD Length;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1894 CHAR NameString[ 1 ];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1895 } IMAGE_RESOURCE_DIRECTORY_STRING,*PIMAGE_RESOURCE_DIRECTORY_STRING;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1896
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1897 typedef struct _IMAGE_RESOURCE_DIR_STRING_U {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1898 WORD Length;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1899 WCHAR NameString[ 1 ];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1900 } IMAGE_RESOURCE_DIR_STRING_U,*PIMAGE_RESOURCE_DIR_STRING_U;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1901
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1902 typedef struct _IMAGE_RESOURCE_DATA_ENTRY {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1903 DWORD OffsetToData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1904 DWORD Size;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1905 DWORD CodePage;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1906 DWORD ResourceHandle;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1907 } IMAGE_RESOURCE_DATA_ENTRY,*PIMAGE_RESOURCE_DATA_ENTRY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1908
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1909
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1910 typedef VOID CALLBACK (*PIMAGE_TLS_CALLBACK)(
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1911 LPVOID DllHandle,DWORD Reason,LPVOID Reserved
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1912 );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1913
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1914 typedef struct _IMAGE_TLS_DIRECTORY {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1915 DWORD StartAddressOfRawData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1916 DWORD EndAddressOfRawData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1917 LPDWORD AddressOfIndex;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1918 PIMAGE_TLS_CALLBACK *AddressOfCallBacks;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1919 DWORD SizeOfZeroFill;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1920 DWORD Characteristics;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1921 } IMAGE_TLS_DIRECTORY,*PIMAGE_TLS_DIRECTORY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1922
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1923 typedef struct _IMAGE_DEBUG_DIRECTORY {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1924 DWORD Characteristics;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1925 DWORD TimeDateStamp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1926 WORD MajorVersion;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1927 WORD MinorVersion;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1928 DWORD Type;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1929 DWORD SizeOfData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1930 DWORD AddressOfRawData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1931 DWORD PointerToRawData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1932 } IMAGE_DEBUG_DIRECTORY, *PIMAGE_DEBUG_DIRECTORY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1933
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1934 #define IMAGE_DEBUG_TYPE_UNKNOWN 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1935 #define IMAGE_DEBUG_TYPE_COFF 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1936 #define IMAGE_DEBUG_TYPE_CODEVIEW 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1937 #define IMAGE_DEBUG_TYPE_FPO 3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1938 #define IMAGE_DEBUG_TYPE_MISC 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1939 #define IMAGE_DEBUG_TYPE_EXCEPTION 5
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1940 #define IMAGE_DEBUG_TYPE_FIXUP 6
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1941 #define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1942 #define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1943 #define IMAGE_DEBUG_TYPE_BORLAND 9
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1944 #define IMAGE_DEBUG_TYPE_RESERVED10 10
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1945
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1946 typedef struct _IMAGE_COFF_SYMBOLS_HEADER {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1947 DWORD NumberOfSymbols;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1948 DWORD LvaToFirstSymbol;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1949 DWORD NumberOfLinenumbers;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1950 DWORD LvaToFirstLinenumber;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1951 DWORD RvaToFirstByteOfCode;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1952 DWORD RvaToLastByteOfCode;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1953 DWORD RvaToFirstByteOfData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1954 DWORD RvaToLastByteOfData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1955 } IMAGE_COFF_SYMBOLS_HEADER, *PIMAGE_COFF_SYMBOLS_HEADER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1956
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1957 #define FRAME_FPO 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1958 #define FRAME_TRAP 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1959 #define FRAME_TSS 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1960 #define FRAME_NONFPO 3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1961
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1962 typedef struct _FPO_DATA {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1963 DWORD ulOffStart;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1964 DWORD cbProcSize;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1965 DWORD cdwLocals;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1966 WORD cdwParams;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1967 unsigned cbProlog : 8;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1968 unsigned cbRegs : 3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1969 unsigned fHasSEH : 1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1970 unsigned fUseBP : 1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1971 unsigned reserved : 1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1972 unsigned cbFrame : 2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1973 } FPO_DATA, *PFPO_DATA;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1974
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1975 typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1976 DWORD Characteristics;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1977 DWORD TimeDateStamp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1978 WORD MajorVersion;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1979 WORD MinorVersion;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1980 DWORD GlobalFlagsClear;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1981 DWORD GlobalFlagsSet;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1982 DWORD CriticalSectionDefaultTimeout;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1983 DWORD DeCommitFreeBlockThreshold;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1984 DWORD DeCommitTotalFreeThreshold;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1985 PVOID LockPrefixTable;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1986 DWORD MaximumAllocationSize;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1987 DWORD VirtualMemoryThreshold;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1988 DWORD ProcessHeapFlags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1989 DWORD ProcessAffinityMask;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1990 WORD CSDVersion;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1991 WORD Reserved1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1992 PVOID EditList;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1993 DWORD Reserved[1];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1994 } IMAGE_LOAD_CONFIG_DIRECTORY, *PIMAGE_LOAD_CONFIG_DIRECTORY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1995
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1996 typedef struct _IMAGE_FUNCTION_ENTRY {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1997 DWORD StartingAddress;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1998 DWORD EndingAddress;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1999 DWORD EndOfPrologue;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2000 } IMAGE_FUNCTION_ENTRY, *PIMAGE_FUNCTION_ENTRY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2002 /* This is the structure that appears at the very start of a .DBG file. */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2003
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2004 typedef struct _IMAGE_SEPARATE_DEBUG_HEADER {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2005 WORD Signature;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2006 WORD Flags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2007 WORD Machine;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2008 WORD Characteristics;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2009 DWORD TimeDateStamp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2010 DWORD CheckSum;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2011 DWORD ImageBase;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2012 DWORD SizeOfImage;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2013 DWORD NumberOfSections;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2014 DWORD ExportedNamesSize;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2015 DWORD DebugDirectorySize;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2016 DWORD SectionAlignment;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2017 DWORD Reserved[ 2 ];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2018 } IMAGE_SEPARATE_DEBUG_HEADER,*PIMAGE_SEPARATE_DEBUG_HEADER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2019
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2020 #define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2021
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2022
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2023 typedef struct tagMESSAGE_RESOURCE_ENTRY {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2024 WORD Length;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2025 WORD Flags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2026 BYTE Text[1];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2027 } MESSAGE_RESOURCE_ENTRY,*PMESSAGE_RESOURCE_ENTRY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2028 #define MESSAGE_RESOURCE_UNICODE 0x0001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2029
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2030 typedef struct tagMESSAGE_RESOURCE_BLOCK {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2031 DWORD LowId;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2032 DWORD HighId;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2033 DWORD OffsetToEntries;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2034 } MESSAGE_RESOURCE_BLOCK,*PMESSAGE_RESOURCE_BLOCK;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2035
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2036 typedef struct tagMESSAGE_RESOURCE_DATA {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2037 DWORD NumberOfBlocks;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2038 MESSAGE_RESOURCE_BLOCK Blocks[ 1 ];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2039 } MESSAGE_RESOURCE_DATA,*PMESSAGE_RESOURCE_DATA;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2040
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2041 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2042 * Here follows typedefs for security and tokens.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2043 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2044
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2045 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2046 * First a constant for the following typdefs.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2047 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2048
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2049 #define ANYSIZE_ARRAY 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2050
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2051 /* FIXME: Orphan. What does it point to? */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2052 typedef PVOID PACCESS_TOKEN;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2053
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2054 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2055 * TOKEN_INFORMATION_CLASS
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2056 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2057
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2058 typedef enum _TOKEN_INFORMATION_CLASS {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2059 TokenUser = 1,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2060 TokenGroups,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2061 TokenPrivileges,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2062 TokenOwner,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2063 TokenPrimaryGroup,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2064 TokenDefaultDacl,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2065 TokenSource,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2066 TokenType,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2067 TokenImpersonationLevel,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2068 TokenStatistics
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2069 } TOKEN_INFORMATION_CLASS;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2070
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2071 #ifndef _SECURITY_DEFINED
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2072 #define _SECURITY_DEFINED
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2073
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2074 #include "pshpack1.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2075
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2076 typedef DWORD ACCESS_MASK, *PACCESS_MASK;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2077
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2078 typedef struct _GENERIC_MAPPING {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2079 ACCESS_MASK GenericRead;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2080 ACCESS_MASK GenericWrite;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2081 ACCESS_MASK GenericExecute;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2082 ACCESS_MASK GenericAll;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2083 } GENERIC_MAPPING, *PGENERIC_MAPPING;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2084
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2085 #ifndef SID_IDENTIFIER_AUTHORITY_DEFINED
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2086 #define SID_IDENTIFIER_AUTHORITY_DEFINED
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2087 typedef struct {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2088 BYTE Value[6];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2089 } SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2090 #endif /* !defined(SID_IDENTIFIER_AUTHORITY_DEFINED) */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2091
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2092 #ifndef SID_DEFINED
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2093 #define SID_DEFINED
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2094 typedef struct _SID {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2095 BYTE Revision;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2096 BYTE SubAuthorityCount;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2097 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2098 DWORD SubAuthority[1];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2099 } SID,*PSID;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2100 #endif /* !defined(SID_DEFINED) */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2101
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2102 #define SID_REVISION (1) /* Current revision */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2103 #define SID_MAX_SUB_AUTHORITIES (15) /* current max subauths */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2104 #define SID_RECOMMENDED_SUB_AUTHORITIES (1) /* recommended subauths */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2105
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2106
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2107 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2108 * ACL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2109 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2110
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2111 #define ACL_REVISION1 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2112 #define ACL_REVISION2 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2113 #define ACL_REVISION3 3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2114 #define ACL_REVISION4 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2115
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2116 #define MIN_ACL_REVISION ACL_REVISION2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2117 #define MAX_ACL_REVISION ACL_REVISION4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2118
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2119 typedef struct _ACL {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2120 BYTE AclRevision;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2121 BYTE Sbz1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2122 WORD AclSize;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2123 WORD AceCount;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2124 WORD Sbz2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2125 } ACL, *PACL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2126
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2127 /* SECURITY_DESCRIPTOR */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2128 #define SECURITY_DESCRIPTOR_REVISION 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2129 #define SECURITY_DESCRIPTOR_REVISION1 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2130
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2131
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2132 #define SE_OWNER_DEFAULTED 0x0001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2133 #define SE_GROUP_DEFAULTED 0x0002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2134 #define SE_DACL_PRESENT 0x0004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2135 #define SE_DACL_DEFAULTED 0x0008
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2136 #define SE_SACL_PRESENT 0x0010
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2137 #define SE_SACL_DEFAULTED 0x0020
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2138 #define SE_SELF_RELATIVE 0x8000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2139
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2140 typedef DWORD SECURITY_INFORMATION, *PSECURITY_INFORMATION;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2141 typedef WORD SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2142
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2143 /* The security descriptor structure */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2144 typedef struct {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2145 BYTE Revision;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2146 BYTE Sbz1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2147 SECURITY_DESCRIPTOR_CONTROL Control;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2148 DWORD Owner;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2149 DWORD Group;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2150 DWORD Sacl;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2151 DWORD Dacl;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2152 } SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2153
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2154 typedef struct {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2155 BYTE Revision;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2156 BYTE Sbz1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2157 SECURITY_DESCRIPTOR_CONTROL Control;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2158 PSID Owner;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2159 PSID Group;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2160 PACL Sacl;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2161 PACL Dacl;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2162 } SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2163
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2164 #define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2165
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2166 #include "poppack.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2167
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2168 #endif /* _SECURITY_DEFINED */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2169
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2170 #include "pshpack1.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2171
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2172 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2173 * SID_AND_ATTRIBUTES
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2174 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2175
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2176 typedef struct _SID_AND_ATTRIBUTES {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2177 PSID Sid;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2178 DWORD Attributes;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2179 } SID_AND_ATTRIBUTES ;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2180
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2181 /* security entities */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2182 #define SECURITY_NULL_RID (0x00000000L)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2183 #define SECURITY_WORLD_RID (0x00000000L)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2184 #define SECURITY_LOCAL_RID (0X00000000L)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2185
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2186 #define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0}
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2187
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2188 /* S-1-1 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2189 #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2190
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2191 /* S-1-2 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2192 #define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2}
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2193
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2194 /* S-1-3 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2195 #define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3}
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2196 #define SECURITY_CREATOR_OWNER_RID (0x00000000L)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2197 #define SECURITY_CREATOR_GROUP_RID (0x00000001L)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2198 #define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2199 #define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2200
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2201 /* S-1-4 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2202 #define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4}
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2203
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2204 /* S-1-5 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2205 #define SECURITY_NT_AUTHORITY {0,0,0,0,0,5}
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2206 #define SECURITY_DIALUP_RID 0x00000001L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2207 #define SECURITY_NETWORK_RID 0x00000002L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2208 #define SECURITY_BATCH_RID 0x00000003L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2209 #define SECURITY_INTERACTIVE_RID 0x00000004L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2210 #define SECURITY_LOGON_IDS_RID 0x00000005L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2211 #define SECURITY_SERVICE_RID 0x00000006L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2212 #define SECURITY_ANONYMOUS_LOGON_RID 0x00000007L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2213 #define SECURITY_PROXY_RID 0x00000008L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2214 #define SECURITY_ENTERPRISE_CONTROLLERS_RID 0x00000009L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2215 #define SECURITY_PRINCIPAL_SELF_RID 0x0000000AL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2216 #define SECURITY_AUTHENTICATED_USER_RID 0x0000000BL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2217 #define SECURITY_RESTRICTED_CODE_RID 0x0000000CL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2218 #define SECURITY_TERMINAL_SERVER_RID 0x0000000DL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2219 #define SECURITY_LOCAL_SYSTEM_RID 0x00000012L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2220 #define SECURITY_NT_NON_UNIQUE 0x00000015L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2221 #define SECURITY_BUILTIN_DOMAIN_RID 0x00000020L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2222
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2223 #define DOMAIN_GROUP_RID_ADMINS 0x00000200L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2224 #define DOMAIN_GROUP_RID_USERS 0x00000201L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2225 #define DOMAIN_GROUP_RID_GUESTS 0x00000202L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2226
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2227 #define DOMAIN_ALIAS_RID_ADMINS 0x00000220L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2228 #define DOMAIN_ALIAS_RID_USERS 0x00000221L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2229 #define DOMAIN_ALIAS_RID_GUESTS 0x00000222L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2230
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2231 #define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2232
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2233 #define SECURITY_LOGON_IDS_RID_COUNT (3L)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2234
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2235 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2236 * TOKEN_USER
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2237 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2238
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2239 typedef struct _TOKEN_USER {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2240 SID_AND_ATTRIBUTES User;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2241 } TOKEN_USER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2242
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2243 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2244 * TOKEN_GROUPS
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2245 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2246
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2247 typedef struct _TOKEN_GROUPS {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2248 DWORD GroupCount;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2249 SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2250 } TOKEN_GROUPS;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2251
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2252 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2253 * LUID_AND_ATTRIBUTES
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2254 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2255
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2256 typedef union _LARGE_INTEGER {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2257 struct {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2258 DWORD LowPart;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2259 LONG HighPart;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2260 } DUMMYSTRUCTNAME;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2261 LONGLONG QuadPart;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2262 } LARGE_INTEGER, *LPLARGE_INTEGER, *PLARGE_INTEGER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2263
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2264 typedef union _ULARGE_INTEGER {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2265 struct {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2266 DWORD LowPart;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2267 LONG HighPart;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2268 } DUMMYSTRUCTNAME;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2269 LONGLONG QuadPart;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2270 } ULARGE_INTEGER, *LPULARGE_INTEGER, *PULARGE_INTEGER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2271
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2272 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2273 * Locally Unique Identifier
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2274 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2275
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2276 typedef LARGE_INTEGER LUID,*PLUID;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2277
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2278 typedef struct _LUID_AND_ATTRIBUTES {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2279 LUID Luid;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2280 DWORD Attributes;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2281 } LUID_AND_ATTRIBUTES;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2282
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2283 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2284 * PRIVILEGE_SET
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2285 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2286
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2287 typedef struct _PRIVILEGE_SET {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2288 DWORD PrivilegeCount;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2289 DWORD Control;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2290 LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2291 } PRIVILEGE_SET, *PPRIVILEGE_SET;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2292
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2293 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2294 * TOKEN_PRIVILEGES
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2295 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2296
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2297 typedef struct _TOKEN_PRIVILEGES {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2298 DWORD PrivilegeCount;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2299 LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2300 } TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2301
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2302 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2303 * TOKEN_OWNER
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2304 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2305
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2306 typedef struct _TOKEN_OWNER {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2307 PSID Owner;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2308 } TOKEN_OWNER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2309
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2310 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2311 * TOKEN_PRIMARY_GROUP
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2312 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2313
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2314 typedef struct _TOKEN_PRIMARY_GROUP {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2315 PSID PrimaryGroup;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2316 } TOKEN_PRIMARY_GROUP;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2317
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2318
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2319 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2320 * TOKEN_DEFAULT_DACL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2321 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2322
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2323 typedef struct _TOKEN_DEFAULT_DACL {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2324 PACL DefaultDacl;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2325 } TOKEN_DEFAULT_DACL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2326
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2327 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2328 * TOKEN_SOURCEL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2329 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2330
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2331 typedef struct _TOKEN_SOURCE {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2332 char Sourcename[8];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2333 LUID SourceIdentifier;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2334 } TOKEN_SOURCE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2335
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2336 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2337 * TOKEN_TYPE
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2338 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2339
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2340 typedef enum tagTOKEN_TYPE {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2341 TokenPrimary = 1,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2342 TokenImpersonation
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2343 } TOKEN_TYPE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2344
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2345 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2346 * SECURITY_IMPERSONATION_LEVEL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2347 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2348
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2349 typedef enum _SECURITY_IMPERSONATION_LEVEL {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2350 SecurityAnonymous,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2351 SecurityIdentification,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2352 SecurityImpersonation,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2353 SecurityDelegation
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2354 } SECURITY_IMPERSONATION_LEVEL, *PSECURITY_IMPERSONATION_LEVEL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2355
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2356
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2357 typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2358 * PSECURITY_CONTEXT_TRACKING_MODE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2359 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2360 * Quality of Service
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2361 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2362
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2363 typedef struct _SECURITY_QUALITY_OF_SERVICE {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2364 DWORD Length;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2365 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2366 SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2367 WIN_BOOL EffectiveOnly;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2368 } SECURITY_QUALITY_OF_SERVICE, *PSECURITY_QUALITY_OF_SERVICE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2369
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2370 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2371 * TOKEN_STATISTICS
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2372 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2373
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2374 typedef struct _TOKEN_STATISTICS {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2375 LUID TokenId;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2376 LUID AuthenticationId;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2377 LARGE_INTEGER ExpirationTime;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2378 TOKEN_TYPE TokenType;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2379 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2380 DWORD DynamicCharged;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2381 DWORD DynamicAvailable;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2382 DWORD GroupCount;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2383 DWORD PrivilegeCount;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2384 LUID ModifiedId;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2385 } TOKEN_STATISTICS;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2386
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2387 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2388 * ACLs of NT
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2389 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2390
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2391 #define ACL_REVISION 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2392
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2393 #define ACL_REVISION1 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2394 #define ACL_REVISION2 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2395
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2396 /* ACEs, directly starting after an ACL */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2397 typedef struct _ACE_HEADER {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2398 BYTE AceType;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2399 BYTE AceFlags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2400 WORD AceSize;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2401 } ACE_HEADER,*PACE_HEADER;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2402
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2403 /* AceType */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2404 #define ACCESS_ALLOWED_ACE_TYPE 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2405 #define ACCESS_DENIED_ACE_TYPE 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2406 #define SYSTEM_AUDIT_ACE_TYPE 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2407 #define SYSTEM_ALARM_ACE_TYPE 3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2408
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2409 /* inherit AceFlags */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2410 #define OBJECT_INHERIT_ACE 0x01
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2411 #define CONTAINER_INHERIT_ACE 0x02
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2412 #define NO_PROPAGATE_INHERIT_ACE 0x04
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2413 #define INHERIT_ONLY_ACE 0x08
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2414 #define VALID_INHERIT_FLAGS 0x0F
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2415
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2416 /* AceFlags mask for what events we (should) audit */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2417 #define SUCCESSFUL_ACCESS_ACE_FLAG 0x40
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2418 #define FAILED_ACCESS_ACE_FLAG 0x80
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2419
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2420 /* different ACEs depending on AceType
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2421 * SidStart marks the begin of a SID
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2422 * so the thing finally looks like this:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2423 * 0: ACE_HEADER
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2424 * 4: ACCESS_MASK
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2425 * 8... : SID
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2426 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2427 typedef struct _ACCESS_ALLOWED_ACE {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2428 ACE_HEADER Header;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2429 DWORD Mask;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2430 DWORD SidStart;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2431 } ACCESS_ALLOWED_ACE,*PACCESS_ALLOWED_ACE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2432
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2433 typedef struct _ACCESS_DENIED_ACE {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2434 ACE_HEADER Header;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2435 DWORD Mask;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2436 DWORD SidStart;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2437 } ACCESS_DENIED_ACE,*PACCESS_DENIED_ACE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2438
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2439 typedef struct _SYSTEM_AUDIT_ACE {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2440 ACE_HEADER Header;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2441 DWORD Mask;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2442 DWORD SidStart;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2443 } SYSTEM_AUDIT_ACE,*PSYSTEM_AUDIT_ACE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2444
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2445 typedef struct _SYSTEM_ALARM_ACE {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2446 ACE_HEADER Header;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2447 DWORD Mask;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2448 DWORD SidStart;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2449 } SYSTEM_ALARM_ACE,*PSYSTEM_ALARM_ACE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2450
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2451 typedef enum tagSID_NAME_USE {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2452 SidTypeUser = 1,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2453 SidTypeGroup,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2454 SidTypeDomain,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2455 SidTypeAlias,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2456 SidTypeWellKnownGroup,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2457 SidTypeDeletedAccount,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2458 SidTypeInvalid,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2459 SidTypeUnknown
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2460 } SID_NAME_USE,*PSID_NAME_USE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2461
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2462 /* Access rights */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2463
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2464 #define DELETE 0x00010000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2465 #define READ_CONTROL 0x00020000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2466 #define WRITE_DAC 0x00040000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2467 #define WRITE_OWNER 0x00080000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2468 #define SYNCHRONIZE 0x00100000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2469 #define STANDARD_RIGHTS_REQUIRED 0x000f0000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2470
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2471 #define STANDARD_RIGHTS_READ READ_CONTROL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2472 #define STANDARD_RIGHTS_WRITE READ_CONTROL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2473 #define STANDARD_RIGHTS_EXECUTE READ_CONTROL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2474
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2475 #define STANDARD_RIGHTS_ALL 0x001f0000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2476
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2477 #define SPECIFIC_RIGHTS_ALL 0x0000ffff
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2478
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2479 #define GENERIC_READ 0x80000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2480 #define GENERIC_WRITE 0x40000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2481 #define GENERIC_EXECUTE 0x20000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2482 #define GENERIC_ALL 0x10000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2483
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2484 #define MAXIMUM_ALLOWED 0x02000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2485 #define ACCESS_SYSTEM_SECURITY 0x01000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2486
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2487 #define EVENT_MODIFY_STATE 0x0002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2488 #define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2489
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2490 #define SEMAPHORE_MODIFY_STATE 0x0002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2491 #define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2492
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2493 #define MUTEX_MODIFY_STATE 0x0001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2494 #define MUTEX_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2495
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2496 #define PROCESS_TERMINATE 0x0001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2497 #define PROCESS_CREATE_THREAD 0x0002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2498 #define PROCESS_VM_OPERATION 0x0008
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2499 #define PROCESS_VM_READ 0x0010
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2500 #define PROCESS_VM_WRITE 0x0020
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2501 #define PROCESS_DUP_HANDLE 0x0040
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2502 #define PROCESS_CREATE_PROCESS 0x0080
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2503 #define PROCESS_SET_QUOTA 0x0100
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2504 #define PROCESS_SET_INFORMATION 0x0200
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2505 #define PROCESS_QUERY_INFORMATION 0x0400
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2506 #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xfff)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2507
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2508 #define THREAD_TERMINATE 0x0001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2509 #define THREAD_SUSPEND_RESUME 0x0002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2510 #define THREAD_GET_CONTEXT 0x0008
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2511 #define THREAD_SET_CONTEXT 0x0010
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2512 #define THREAD_SET_INFORMATION 0x0020
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2513 #define THREAD_QUERY_INFORMATION 0x0040
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2514 #define THREAD_SET_THREAD_TOKEN 0x0080
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2515 #define THREAD_IMPERSONATE 0x0100
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2516 #define THREAD_DIRECT_IMPERSONATION 0x0200
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2517 #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3ff)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2518
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2519 #define THREAD_BASE_PRIORITY_LOWRT 15
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2520 #define THREAD_BASE_PRIORITY_MAX 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2521 #define THREAD_BASE_PRIORITY_MIN -2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2522 #define THREAD_BASE_PRIORITY_IDLE -15
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2523
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2524 #define FILE_READ_DATA 0x0001 /* file & pipe */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2525 #define FILE_LIST_DIRECTORY 0x0001 /* directory */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2526 #define FILE_WRITE_DATA 0x0002 /* file & pipe */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2527 #define FILE_ADD_FILE 0x0002 /* directory */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2528 #define FILE_APPEND_DATA 0x0004 /* file */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2529 #define FILE_ADD_SUBDIRECTORY 0x0004 /* directory */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2530 #define FILE_CREATE_PIPE_INSTANCE 0x0004 /* named pipe */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2531 #define FILE_READ_EA 0x0008 /* file & directory */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2532 #define FILE_READ_PROPERTIES FILE_READ_EA
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2533 #define FILE_WRITE_EA 0x0010 /* file & directory */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2534 #define FILE_WRITE_PROPERTIES FILE_WRITE_EA
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2535 #define FILE_EXECUTE 0x0020 /* file */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2536 #define FILE_TRAVERSE 0x0020 /* directory */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2537 #define FILE_DELETE_CHILD 0x0040 /* directory */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2538 #define FILE_READ_ATTRIBUTES 0x0080 /* all */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2539 #define FILE_WRITE_ATTRIBUTES 0x0100 /* all */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2540 #define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1ff)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2541
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2542 #define FILE_GENERIC_READ (STANDARD_RIGHTS_READ | FILE_READ_DATA | \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2543 FILE_READ_ATTRIBUTES | FILE_READ_EA | \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2544 SYNCHRONIZE)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2545 #define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2546 FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2547 FILE_APPEND_DATA | SYNCHRONIZE)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2548 #define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE | FILE_EXECUTE | \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2549 FILE_READ_ATTRIBUTES | SYNCHRONIZE)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2550
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2551
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2552 /* File attribute flags
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2553 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2554 #define FILE_SHARE_READ 0x00000001L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2555 #define FILE_SHARE_WRITE 0x00000002L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2556 #define FILE_SHARE_DELETE 0x00000004L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2557 #define FILE_ATTRIBUTE_READONLY 0x00000001L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2558 #define FILE_ATTRIBUTE_HIDDEN 0x00000002L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2559 #define FILE_ATTRIBUTE_SYSTEM 0x00000004L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2560 #define FILE_ATTRIBUTE_LABEL 0x00000008L /* Not in Windows API */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2561 #define FILE_ATTRIBUTE_DIRECTORY 0x00000010L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2562 #define FILE_ATTRIBUTE_ARCHIVE 0x00000020L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2563 #define FILE_ATTRIBUTE_NORMAL 0x00000080L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2564 #define FILE_ATTRIBUTE_TEMPORARY 0x00000100L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2565 #define FILE_ATTRIBUTE_ATOMIC_WRITE 0x00000200L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2566 #define FILE_ATTRIBUTE_XACTION_WRITE 0x00000400L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2567 #define FILE_ATTRIBUTE_COMPRESSED 0x00000800L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2568 #define FILE_ATTRIBUTE_OFFLINE 0x00001000L
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2569
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2570 /* File alignments (NT) */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2571 #define FILE_BYTE_ALIGNMENT 0x00000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2572 #define FILE_WORD_ALIGNMENT 0x00000001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2573 #define FILE_LONG_ALIGNMENT 0x00000003
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2574 #define FILE_QUAD_ALIGNMENT 0x00000007
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2575 #define FILE_OCTA_ALIGNMENT 0x0000000f
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2576 #define FILE_32_BYTE_ALIGNMENT 0x0000001f
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2577 #define FILE_64_BYTE_ALIGNMENT 0x0000003f
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2578 #define FILE_128_BYTE_ALIGNMENT 0x0000007f
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2579 #define FILE_256_BYTE_ALIGNMENT 0x000000ff
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2580 #define FILE_512_BYTE_ALIGNMENT 0x000001ff
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2581
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2582 #define REG_NONE 0 /* no type */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2583 #define REG_SZ 1 /* string type (ASCII) */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2584 #define REG_EXPAND_SZ 2 /* string, includes %ENVVAR% (expanded by caller) (ASCII) */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2585 #define REG_BINARY 3 /* binary format, callerspecific */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2586 /* YES, REG_DWORD == REG_DWORD_LITTLE_ENDIAN */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2587 #define REG_DWORD 4 /* DWORD in little endian format */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2588 #define REG_DWORD_LITTLE_ENDIAN 4 /* DWORD in little endian format */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2589 #define REG_DWORD_BIG_ENDIAN 5 /* DWORD in big endian format */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2590 #define REG_LINK 6 /* symbolic link (UNICODE) */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2591 #define REG_MULTI_SZ 7 /* multiple strings, delimited by \0, terminated by \0\0 (ASCII) */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2592 #define REG_RESOURCE_LIST 8 /* resource list? huh? */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2593 #define REG_FULL_RESOURCE_DESCRIPTOR 9 /* full resource descriptor? huh? */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2594 #define REG_RESOURCE_REQUIREMENTS_LIST 10
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2595
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2596 /* ----------------------------- begin registry ----------------------------- */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2597
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2598 /* Registry security values */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2599 #define OWNER_SECURITY_INFORMATION 0x00000001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2600 #define GROUP_SECURITY_INFORMATION 0x00000002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2601 #define DACL_SECURITY_INFORMATION 0x00000004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2602 #define SACL_SECURITY_INFORMATION 0x00000008
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2603
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2604 #define REG_OPTION_RESERVED 0x00000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2605 #define REG_OPTION_NON_VOLATILE 0x00000000
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2606 #define REG_OPTION_VOLATILE 0x00000001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2607 #define REG_OPTION_CREATE_LINK 0x00000002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2608 #define REG_OPTION_BACKUP_RESTORE 0x00000004 /* FIXME */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2609 #define REG_OPTION_OPEN_LINK 0x00000008
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2610 #define REG_LEGAL_OPTION (REG_OPTION_RESERVED| \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2611 REG_OPTION_NON_VOLATILE| \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2612 REG_OPTION_VOLATILE| \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2613 REG_OPTION_CREATE_LINK| \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2614 REG_OPTION_BACKUP_RESTORE| \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2615 REG_OPTION_OPEN_LINK)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2616
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2617
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2618 #define REG_CREATED_NEW_KEY 0x00000001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2619 #define REG_OPENED_EXISTING_KEY 0x00000002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2620
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2621 /* For RegNotifyChangeKeyValue */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2622 #define REG_NOTIFY_CHANGE_NAME 0x1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2623
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2624 #define KEY_QUERY_VALUE 0x00000001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2625 #define KEY_SET_VALUE 0x00000002
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2626 #define KEY_CREATE_SUB_KEY 0x00000004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2627 #define KEY_ENUMERATE_SUB_KEYS 0x00000008
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2628 #define KEY_NOTIFY 0x00000010
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2629 #define KEY_CREATE_LINK 0x00000020
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2630
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2631 #define KEY_READ ((STANDARD_RIGHTS_READ| \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2632 KEY_QUERY_VALUE| \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2633 KEY_ENUMERATE_SUB_KEYS| \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2634 KEY_NOTIFY) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2635 & (~SYNCHRONIZE) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2636 )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2637 #define KEY_WRITE ((STANDARD_RIGHTS_WRITE| \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2638 KEY_SET_VALUE| \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2639 KEY_CREATE_SUB_KEY) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2640 & (~SYNCHRONIZE) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2641 )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2642 #define KEY_EXECUTE ((KEY_READ) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2643 & (~SYNCHRONIZE)) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2644 )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2645 #define KEY_ALL_ACCESS ((STANDARD_RIGHTS_ALL| \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2646 KEY_QUERY_VALUE| \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2647 KEY_SET_VALUE| \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2648 KEY_CREATE_SUB_KEY| \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2649 KEY_ENUMERATE_SUB_KEYS| \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2650 KEY_NOTIFY| \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2651 KEY_CREATE_LINK) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2652 & (~SYNCHRONIZE) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2653 )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2654 /* ------------------------------ end registry ------------------------------ */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2655
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2656
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2657 #define RtlEqualMemory(Destination, Source, Length) (!memcmp((Destination),(Source),(Length)))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2658 #define RtlMoveMemory(Destination, Source, Length) memmove((Destination),(Source),(Length))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2659 #define RtlCopyMemory(Destination, Source, Length) memcpy((Destination),(Source),(Length))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2660 #define RtlFillMemory(Destination, Length, Fill) memset((Destination),(Fill),(Length))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2661 #define RtlZeroMemory(Destination, Length) memset((Destination),0,(Length))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2662
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2663 #include "poppack.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2664
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2665 #endif /* __WINE_WINNT_H */