annotate loader/wine/winnt.h @ 23088:6a40ec31cfa7

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