annotate loader/wine/winnt.h @ 13792:d603c33bb3d3

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