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