Changed to use new server-side registry support.
[wine/multimedia.git] / include / winnt.h
blob691bd3d3904da3a4e67f80bf1b2fc19c738efc50
1 /*
2 * Win32 definitions for Windows NT
4 * Copyright 1996 Alexandre Julliard
5 */
7 #ifndef __WINE_WINNT_H
8 #define __WINE_WINNT_H
10 #include "windef.h"
12 #include "pshpack1.h"
13 /* Defines */
15 /* Argument 1 passed to the DllEntryProc. */
16 #define DLL_PROCESS_DETACH 0 /* detach process (unload library) */
17 #define DLL_PROCESS_ATTACH 1 /* attach process (load library) */
18 #define DLL_THREAD_ATTACH 2 /* attach new thread */
19 #define DLL_THREAD_DETACH 3 /* detach thread */
22 /* u.x.wProcessorArchitecture (NT) */
23 #define PROCESSOR_ARCHITECTURE_INTEL 0
24 #define PROCESSOR_ARCHITECTURE_MIPS 1
25 #define PROCESSOR_ARCHITECTURE_ALPHA 2
26 #define PROCESSOR_ARCHITECTURE_PPC 3
27 #define PROCESSOR_ARCHITECTURE_SHX 4
28 #define PROCESSOR_ARCHITECTURE_ARM 5
29 #define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
31 /* dwProcessorType */
32 #define PROCESSOR_INTEL_386 386
33 #define PROCESSOR_INTEL_486 486
34 #define PROCESSOR_INTEL_PENTIUM 586
35 #define PROCESSOR_INTEL_860 860
36 #define PROCESSOR_MIPS_R2000 2000
37 #define PROCESSOR_MIPS_R3000 3000
38 #define PROCESSOR_MIPS_R4000 4000
39 #define PROCESSOR_ALPHA_21064 21064
40 #define PROCESSOR_PPC_601 601
41 #define PROCESSOR_PPC_603 603
42 #define PROCESSOR_PPC_604 604
43 #define PROCESSOR_PPC_620 620
44 #define PROCESSOR_HITACHI_SH3 10003
45 #define PROCESSOR_HITACHI_SH3E 10004
46 #define PROCESSOR_HITACHI_SH4 10005
47 #define PROCESSOR_MOTOROLA_821 821
48 #define PROCESSOR_SHx_SH3 103
49 #define PROCESSOR_SHx_SH4 104
50 #define PROCESSOR_STRONGARM 2577
51 #define PROCESSOR_ARM720 1824 /* 0x720 */
52 #define PROCESSOR_ARM820 2080 /* 0x820 */
53 #define PROCESSOR_ARM920 2336 /* 0x920 */
54 #define PROCESSOR_ARM_7TDMI 70001
56 #define ANYSIZE_ARRAY 1
58 #define MINCHAR 0x80
59 #define MAXCHAR 0x7f
60 #define MINSHORT 0x8000
61 #define MAXSHORT 0x7fff
62 #define MINLONG 0x80000000
63 #define MAXLONG 0x7fffffff
64 #define MAXBYTE 0xff
65 #define MAXWORD 0xffff
66 #define MAXDWORD 0xffffffff
68 #define FIELD_OFFSET(type, field) \
69 ((LONG)(INT)&(((type *)0)->field))
71 #define CONTAINING_RECORD(address, type, field) \
72 ((type *)((PCHAR)(address) - (PCHAR)(&((type *)0)->field)))
74 /* Types */
76 /* TCHAR data types definitions for Winelib. */
77 /* These types are _not_ defined for the emulator, because they */
78 /* depend on the UNICODE macro that only exists in user's code. */
80 #ifndef __WINE__
81 # ifdef UNICODE
82 typedef LPWSTR LPTSTR;
83 typedef LPCWSTR LPCTSTR;
84 #define __TEXT(string) L##string /*probably wrong */
85 # else /* UNICODE */
86 typedef LPSTR LPTSTR;
87 typedef LPCSTR LPCTSTR;
88 #define __TEXT(string) string
89 # endif /* UNICODE */
90 #endif /* __WINE__ */
91 #define TEXT(quote) __TEXT(quote)
93 typedef BYTE BOOLEAN;
94 typedef BOOLEAN *PBOOLEAN;
96 typedef struct _LIST_ENTRY {
97 struct _LIST_ENTRY *Flink;
98 struct _LIST_ENTRY *Blink;
99 } LIST_ENTRY, *PLIST_ENTRY;
101 typedef struct _SINGLE_LIST_ENTRY {
102 struct _SINGLE_LIST_ENTRY *Next;
103 } SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY;
105 /* Heap flags */
107 #define HEAP_NO_SERIALIZE 0x00000001
108 #define HEAP_GROWABLE 0x00000002
109 #define HEAP_GENERATE_EXCEPTIONS 0x00000004
110 #define HEAP_ZERO_MEMORY 0x00000008
111 #define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010
112 #define HEAP_TAIL_CHECKING_ENABLED 0x00000020
113 #define HEAP_FREE_CHECKING_ENABLED 0x00000040
114 #define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080
115 #define HEAP_CREATE_ALIGN_16 0x00010000
116 #define HEAP_CREATE_ENABLE_TRACING 0x00020000
117 #define HEAP_WINE_SEGPTR 0x01000000 /* Not a Win32 flag */
118 #define HEAP_WINE_CODESEG 0x02000000 /* Not a Win32 flag */
119 #define HEAP_WINE_CODE16SEG 0x04000000 /* Not a Win32 flag */
121 /* Processor feature flags. */
122 #define PF_FLOATING_POINT_PRECISION_ERRATA 0
123 #define PF_FLOATING_POINT_EMULATED 1
124 #define PF_COMPARE_EXCHANGE_DOUBLE 2
125 #define PF_MMX_INSTRUCTIONS_AVAILABLE 3
126 #define PF_PPC_MOVEMEM_64BIT_OK 4
127 #define PF_ALPHA_BYTE_INSTRUCTIONS 5
130 /* The Win32 register context */
132 /* CONTEXT is the CPU-dependent context; it should be used */
133 /* wherever a platform-specific context is needed (e.g. exception */
134 /* handling, Win32 register functions). */
136 /* CONTEXT86 is the i386-specific context; it should be used */
137 /* wherever only a 386 context makes sense (e.g. DOS interrupts, */
138 /* Win16 register functions), so that this code can be compiled */
139 /* on all platforms. */
141 #define SIZE_OF_80387_REGISTERS 80
143 typedef struct _FLOATING_SAVE_AREA
145 DWORD ControlWord;
146 DWORD StatusWord;
147 DWORD TagWord;
148 DWORD ErrorOffset;
149 DWORD ErrorSelector;
150 DWORD DataOffset;
151 DWORD DataSelector;
152 BYTE RegisterArea[SIZE_OF_80387_REGISTERS];
153 DWORD Cr0NpxState;
154 } FLOATING_SAVE_AREA, *PFLOATING_SAVE_AREA;
156 typedef struct _CONTEXT86
158 DWORD ContextFlags;
160 /* These are selected by CONTEXT_DEBUG_REGISTERS */
161 DWORD Dr0;
162 DWORD Dr1;
163 DWORD Dr2;
164 DWORD Dr3;
165 DWORD Dr6;
166 DWORD Dr7;
168 /* These are selected by CONTEXT_FLOATING_POINT */
169 FLOATING_SAVE_AREA FloatSave;
171 /* These are selected by CONTEXT_SEGMENTS */
172 DWORD SegGs;
173 DWORD SegFs;
174 DWORD SegEs;
175 DWORD SegDs;
177 /* These are selected by CONTEXT_INTEGER */
178 DWORD Edi;
179 DWORD Esi;
180 DWORD Ebx;
181 DWORD Edx;
182 DWORD Ecx;
183 DWORD Eax;
185 /* These are selected by CONTEXT_CONTROL */
186 DWORD Ebp;
187 DWORD Eip;
188 DWORD SegCs;
189 DWORD EFlags;
190 DWORD Esp;
191 DWORD SegSs;
192 } CONTEXT86;
194 #define CONTEXT_X86 0x00010000
195 #define CONTEXT_i386 CONTEXT_X86
196 #define CONTEXT_i486 CONTEXT_X86
198 #define CONTEXT86_CONTROL (CONTEXT_i386 | 0x0001) /* SS:SP, CS:IP, FLAGS, BP */
199 #define CONTEXT86_INTEGER (CONTEXT_i386 | 0x0002) /* AX, BX, CX, DX, SI, DI */
200 #define CONTEXT86_SEGMENTS (CONTEXT_i386 | 0x0004) /* DS, ES, FS, GS */
201 #define CONTEXT86_FLOATING_POINT (CONTEXT_i386 | 0x0008L) /* 387 state */
202 #define CONTEXT86_DEBUG_REGISTERS (CONTEXT_i386 | 0x0010L) /* DB 0-3,6,7 */
203 #define CONTEXT86_FULL (CONTEXT86_CONTROL | CONTEXT86_INTEGER | CONTEXT86_SEGMENTS)
205 /* i386 context definitions */
206 #ifdef __i386__
208 #define CONTEXT_CONTROL CONTEXT86_CONTROL
209 #define CONTEXT_INTEGER CONTEXT86_INTEGER
210 #define CONTEXT_SEGMENTS CONTEXT86_SEGMENTS
211 #define CONTEXT_FLOATING_POINT CONTEXT86_FLOATING_POINT
212 #define CONTEXT_DEBUG_REGISTERS CONTEXT86_DEBUG_REGISTERS
213 #define CONTEXT_FULL CONTEXT86_FULL
215 typedef CONTEXT86 CONTEXT;
217 #endif /* __i386__ */
219 /* Alpha context definitions */
220 #ifdef _ALPHA_
222 #define CONTEXT_ALPHA 0x00020000
224 #define CONTEXT_CONTROL (CONTEXT_ALPHA | 0x00000001L)
225 #define CONTEXT_FLOATING_POINT (CONTEXT_ALPHA | 0x00000002L)
226 #define CONTEXT_INTEGER (CONTEXT_ALPHA | 0x00000004L)
227 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
229 typedef struct _CONTEXT
231 /* selected by CONTEXT_FLOATING_POINT */
232 ULONGLONG FltF0;
233 ULONGLONG FltF1;
234 ULONGLONG FltF2;
235 ULONGLONG FltF3;
236 ULONGLONG FltF4;
237 ULONGLONG FltF5;
238 ULONGLONG FltF6;
239 ULONGLONG FltF7;
240 ULONGLONG FltF8;
241 ULONGLONG FltF9;
242 ULONGLONG FltF10;
243 ULONGLONG FltF11;
244 ULONGLONG FltF12;
245 ULONGLONG FltF13;
246 ULONGLONG FltF14;
247 ULONGLONG FltF15;
248 ULONGLONG FltF16;
249 ULONGLONG FltF17;
250 ULONGLONG FltF18;
251 ULONGLONG FltF19;
252 ULONGLONG FltF20;
253 ULONGLONG FltF21;
254 ULONGLONG FltF22;
255 ULONGLONG FltF23;
256 ULONGLONG FltF24;
257 ULONGLONG FltF25;
258 ULONGLONG FltF26;
259 ULONGLONG FltF27;
260 ULONGLONG FltF28;
261 ULONGLONG FltF29;
262 ULONGLONG FltF30;
263 ULONGLONG FltF31;
265 /* selected by CONTEXT_INTEGER */
266 ULONGLONG IntV0;
267 ULONGLONG IntT0;
268 ULONGLONG IntT1;
269 ULONGLONG IntT2;
270 ULONGLONG IntT3;
271 ULONGLONG IntT4;
272 ULONGLONG IntT5;
273 ULONGLONG IntT6;
274 ULONGLONG IntT7;
275 ULONGLONG IntS0;
276 ULONGLONG IntS1;
277 ULONGLONG IntS2;
278 ULONGLONG IntS3;
279 ULONGLONG IntS4;
280 ULONGLONG IntS5;
281 ULONGLONG IntFp;
282 ULONGLONG IntA0;
283 ULONGLONG IntA1;
284 ULONGLONG IntA2;
285 ULONGLONG IntA3;
286 ULONGLONG IntA4;
287 ULONGLONG IntA5;
288 ULONGLONG IntT8;
289 ULONGLONG IntT9;
290 ULONGLONG IntT10;
291 ULONGLONG IntT11;
292 ULONGLONG IntRa;
293 ULONGLONG IntT12;
294 ULONGLONG IntAt;
295 ULONGLONG IntGp;
296 ULONGLONG IntSp;
297 ULONGLONG IntZero;
299 /* selected by CONTEXT_FLOATING_POINT */
300 ULONGLONG Fpcr;
301 ULONGLONG SoftFpcr;
303 /* selected by CONTEXT_CONTROL */
304 ULONGLONG Fir;
305 DWORD Psr;
306 DWORD ContextFlags;
307 DWORD Fill[4];
308 } CONTEXT;
310 #define _QUAD_PSR_OFFSET HighSoftFpcr
311 #define _QUAD_FLAGS_OFFSET HighFir
313 #endif /* _ALPHA_ */
315 /* Mips context definitions */
316 #ifdef _MIPS_
318 #define CONTEXT_R4000 0x00010000
320 #define CONTEXT_CONTROL (CONTEXT_R4000 | 0x00000001)
321 #define CONTEXT_FLOATING_POINT (CONTEXT_R4000 | 0x00000002)
322 #define CONTEXT_INTEGER (CONTEXT_R4000 | 0x00000004)
324 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
326 typedef struct _CONTEXT
328 DWORD Argument[4];
329 /* These are selected by CONTEXT_FLOATING_POINT */
330 DWORD FltF0;
331 DWORD FltF1;
332 DWORD FltF2;
333 DWORD FltF3;
334 DWORD FltF4;
335 DWORD FltF5;
336 DWORD FltF6;
337 DWORD FltF7;
338 DWORD FltF8;
339 DWORD FltF9;
340 DWORD FltF10;
341 DWORD FltF11;
342 DWORD FltF12;
343 DWORD FltF13;
344 DWORD FltF14;
345 DWORD FltF15;
346 DWORD FltF16;
347 DWORD FltF17;
348 DWORD FltF18;
349 DWORD FltF19;
350 DWORD FltF20;
351 DWORD FltF21;
352 DWORD FltF22;
353 DWORD FltF23;
354 DWORD FltF24;
355 DWORD FltF25;
356 DWORD FltF26;
357 DWORD FltF27;
358 DWORD FltF28;
359 DWORD FltF29;
360 DWORD FltF30;
361 DWORD FltF31;
363 /* These are selected by CONTEXT_INTEGER */
364 DWORD IntZero;
365 DWORD IntAt;
366 DWORD IntV0;
367 DWORD IntV1;
368 DWORD IntA0;
369 DWORD IntA1;
370 DWORD IntA2;
371 DWORD IntA3;
372 DWORD IntT0;
373 DWORD IntT1;
374 DWORD IntT2;
375 DWORD IntT3;
376 DWORD IntT4;
377 DWORD IntT5;
378 DWORD IntT6;
379 DWORD IntT7;
380 DWORD IntS0;
381 DWORD IntS1;
382 DWORD IntS2;
383 DWORD IntS3;
384 DWORD IntS4;
385 DWORD IntS5;
386 DWORD IntS6;
387 DWORD IntS7;
388 DWORD IntT8;
389 DWORD IntT9;
390 DWORD IntK0;
391 DWORD IntK1;
392 DWORD IntGp;
393 DWORD IntSp;
394 DWORD IntS8;
395 DWORD IntRa;
396 DWORD IntLo;
397 DWORD IntHi;
399 /* These are selected by CONTEXT_FLOATING_POINT */
400 DWORD Fsr;
402 /* These are selected by CONTEXT_CONTROL */
403 DWORD Fir;
404 DWORD Psr;
406 DWORD ContextFlags;
407 DWORD Fill[2];
408 } CONTEXT;
410 #endif /* _MIPS_ */
412 /* PowerPC context definitions */
413 #ifdef __PPC__
415 #define CONTEXT_CONTROL 0x0001
416 #define CONTEXT_FLOATING_POINT 0x0002
417 #define CONTEXT_INTEGER 0x0004
418 #define CONTEXT_DEBUG_REGISTERS 0x0008
419 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
421 typedef struct
423 /* These are selected by CONTEXT_FLOATING_POINT */
424 double Fpr0;
425 double Fpr1;
426 double Fpr2;
427 double Fpr3;
428 double Fpr4;
429 double Fpr5;
430 double Fpr6;
431 double Fpr7;
432 double Fpr8;
433 double Fpr9;
434 double Fpr10;
435 double Fpr11;
436 double Fpr12;
437 double Fpr13;
438 double Fpr14;
439 double Fpr15;
440 double Fpr16;
441 double Fpr17;
442 double Fpr18;
443 double Fpr19;
444 double Fpr20;
445 double Fpr21;
446 double Fpr22;
447 double Fpr23;
448 double Fpr24;
449 double Fpr25;
450 double Fpr26;
451 double Fpr27;
452 double Fpr28;
453 double Fpr29;
454 double Fpr30;
455 double Fpr31;
456 double Fpscr;
458 /* These are selected by CONTEXT_INTEGER */
459 DWORD Gpr0;
460 DWORD Gpr1;
461 DWORD Gpr2;
462 DWORD Gpr3;
463 DWORD Gpr4;
464 DWORD Gpr5;
465 DWORD Gpr6;
466 DWORD Gpr7;
467 DWORD Gpr8;
468 DWORD Gpr9;
469 DWORD Gpr10;
470 DWORD Gpr11;
471 DWORD Gpr12;
472 DWORD Gpr13;
473 DWORD Gpr14;
474 DWORD Gpr15;
475 DWORD Gpr16;
476 DWORD Gpr17;
477 DWORD Gpr18;
478 DWORD Gpr19;
479 DWORD Gpr20;
480 DWORD Gpr21;
481 DWORD Gpr22;
482 DWORD Gpr23;
483 DWORD Gpr24;
484 DWORD Gpr25;
485 DWORD Gpr26;
486 DWORD Gpr27;
487 DWORD Gpr28;
488 DWORD Gpr29;
489 DWORD Gpr30;
490 DWORD Gpr31;
492 DWORD Cr;
493 DWORD Xer;
495 /* These are selected by CONTEXT_CONTROL */
496 DWORD Msr;
497 DWORD Iar;
498 DWORD Lr;
499 DWORD Ctr;
501 DWORD ContextFlags;
502 DWORD Fill[3];
504 /* These are selected by CONTEXT_DEBUG_REGISTERS */
505 DWORD Dr0;
506 DWORD Dr1;
507 DWORD Dr2;
508 DWORD Dr3;
509 DWORD Dr4;
510 DWORD Dr5;
511 DWORD Dr6;
512 DWORD Dr7;
513 } CONTEXT;
515 typedef struct _STACK_FRAME_HEADER
517 DWORD BackChain;
518 DWORD GlueSaved1;
519 DWORD GlueSaved2;
520 DWORD Reserved1;
521 DWORD Spare1;
522 DWORD Spare2;
524 DWORD Parameter0;
525 DWORD Parameter1;
526 DWORD Parameter2;
527 DWORD Parameter3;
528 DWORD Parameter4;
529 DWORD Parameter5;
530 DWORD Parameter6;
531 DWORD Parameter7;
532 } STACK_FRAME_HEADER,*PSTACK_FRAME_HEADER;
534 #endif /* __PPC__ */
536 #ifdef __sparc__
539 * FIXME:
541 * There is no official CONTEXT structure defined for the SPARC
542 * architecture, so I just made one up.
544 * This structure is valid only for 32-bit SPARC architectures,
545 * not for 64-bit SPARC.
547 * Note that this structure contains only the 'top-level' registers;
548 * the rest of the register window chain is not visible.
550 * The layout follows the Solaris 'prgregset_t' structure.
554 #define CONTEXT_SPARC 0x10000000
556 #define CONTEXT_CONTROL (CONTEXT_SPARC | 0x00000001)
557 #define CONTEXT_FLOATING_POINT (CONTEXT_SPARC | 0x00000002)
558 #define CONTEXT_INTEGER (CONTEXT_SPARC | 0x00000004)
560 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
562 typedef struct _CONTEXT
564 DWORD ContextFlags;
566 /* These are selected by CONTEXT_INTEGER */
567 DWORD g0;
568 DWORD g1;
569 DWORD g2;
570 DWORD g3;
571 DWORD g4;
572 DWORD g5;
573 DWORD g6;
574 DWORD g7;
575 DWORD o0;
576 DWORD o1;
577 DWORD o2;
578 DWORD o3;
579 DWORD o4;
580 DWORD o5;
581 DWORD o6;
582 DWORD o7;
583 DWORD l0;
584 DWORD l1;
585 DWORD l2;
586 DWORD l3;
587 DWORD l4;
588 DWORD l5;
589 DWORD l6;
590 DWORD l7;
591 DWORD i0;
592 DWORD i1;
593 DWORD i2;
594 DWORD i3;
595 DWORD i4;
596 DWORD i5;
597 DWORD i6;
598 DWORD i7;
600 /* These are selected by CONTEXT_CONTROL */
601 DWORD psr;
602 DWORD pc;
603 DWORD npc;
604 DWORD y;
605 DWORD wim;
606 DWORD tbr;
608 /* FIXME: floating point registers missing */
610 } CONTEXT;
612 #endif
614 #if !defined(CONTEXT_FULL) && !defined(RC_INVOKED)
615 #error You need to define a CONTEXT for your CPU
616 #endif
618 typedef CONTEXT *PCONTEXT;
619 typedef HANDLE *PHANDLE;
621 #ifdef __WINE__
623 /* Macros for easier access to i386 context registers */
625 #define EAX_reg(context) ((context)->Eax)
626 #define EBX_reg(context) ((context)->Ebx)
627 #define ECX_reg(context) ((context)->Ecx)
628 #define EDX_reg(context) ((context)->Edx)
629 #define ESI_reg(context) ((context)->Esi)
630 #define EDI_reg(context) ((context)->Edi)
631 #define EBP_reg(context) ((context)->Ebp)
633 #define CS_reg(context) ((context)->SegCs)
634 #define DS_reg(context) ((context)->SegDs)
635 #define ES_reg(context) ((context)->SegEs)
636 #define FS_reg(context) ((context)->SegFs)
637 #define GS_reg(context) ((context)->SegGs)
638 #define SS_reg(context) ((context)->SegSs)
640 #define EFL_reg(context) ((context)->EFlags)
641 #define EIP_reg(context) ((context)->Eip)
642 #define ESP_reg(context) ((context)->Esp)
644 #define AX_reg(context) (*(WORD*)&EAX_reg(context))
645 #define BX_reg(context) (*(WORD*)&EBX_reg(context))
646 #define CX_reg(context) (*(WORD*)&ECX_reg(context))
647 #define DX_reg(context) (*(WORD*)&EDX_reg(context))
648 #define SI_reg(context) (*(WORD*)&ESI_reg(context))
649 #define DI_reg(context) (*(WORD*)&EDI_reg(context))
650 #define BP_reg(context) (*(WORD*)&EBP_reg(context))
652 #define AL_reg(context) (*(BYTE*)&EAX_reg(context))
653 #define AH_reg(context) (*((BYTE*)&EAX_reg(context)+1))
654 #define BL_reg(context) (*(BYTE*)&EBX_reg(context))
655 #define BH_reg(context) (*((BYTE*)&EBX_reg(context)+1))
656 #define CL_reg(context) (*(BYTE*)&ECX_reg(context))
657 #define CH_reg(context) (*((BYTE*)&ECX_reg(context)+1))
658 #define DL_reg(context) (*(BYTE*)&EDX_reg(context))
659 #define DH_reg(context) (*((BYTE*)&EDX_reg(context)+1))
661 #define SET_CFLAG(context) (EFL_reg(context) |= 0x0001)
662 #define RESET_CFLAG(context) (EFL_reg(context) &= ~0x0001)
663 #define SET_ZFLAG(context) (EFL_reg(context) |= 0x0040)
664 #define RESET_ZFLAG(context) (EFL_reg(context) &= ~0x0040)
666 #define ISV86(context) (EFL_reg(context) & 0x00020000)
667 #define V86BASE(context) ((context)->Dr7) /* ugly */
670 /* Macros to retrieve the current context */
672 #ifdef __i386__
673 #define _DEFINE_REGS_ENTRYPOINT( name, fn, args ) \
674 __asm__(".align 4\n\t" \
675 ".globl " #name "\n\t" \
676 ".type " #name ",@function\n\t" \
677 #name ":\n\t" \
678 "call CALL32_Regs\n\t" \
679 ".long " #fn "\n\t" \
680 ".byte " #args ", " #args "\n\t");
682 #define DEFINE_REGS_ENTRYPOINT_0( name, fn ) \
683 _DEFINE_REGS_ENTRYPOINT( name, fn, 0 )
684 #define DEFINE_REGS_ENTRYPOINT_1( name, fn, t1 ) \
685 _DEFINE_REGS_ENTRYPOINT( name, fn, 4 )
686 #define DEFINE_REGS_ENTRYPOINT_2( name, fn, t1, t2 ) \
687 _DEFINE_REGS_ENTRYPOINT( name, fn, 8 )
688 #define DEFINE_REGS_ENTRYPOINT_3( name, fn, t1, t2, t3 ) \
689 _DEFINE_REGS_ENTRYPOINT( name, fn, 12 )
690 #define DEFINE_REGS_ENTRYPOINT_4( name, fn, t1, t2, t3, t4 ) \
691 _DEFINE_REGS_ENTRYPOINT( name, fn, 16 )
693 #endif /* __i386__ */
695 #ifdef __sparc__
696 /* FIXME: use getcontext() to retrieve full context */
697 #define _GET_CONTEXT \
698 CONTEXT context; \
699 do { memset(&context, 0, sizeof(CONTEXT)); \
700 context.ContextFlags = CONTEXT_CONTROL; \
701 context.pc = (DWORD)__builtin_return_address(0); \
702 } while (0)
704 #define DEFINE_REGS_ENTRYPOINT_0( name, fn ) \
705 void WINAPI name ( void ) \
706 { _GET_CONTEXT; fn( &context ); }
707 #define DEFINE_REGS_ENTRYPOINT_1( name, fn, t1 ) \
708 void WINAPI name ( t1 a1 ) \
709 { _GET_CONTEXT; fn( a1, &context ); }
710 #define DEFINE_REGS_ENTRYPOINT_2( name, fn, t1, t2 ) \
711 void WINAPI name ( t1 a1, t2 a2 ) \
712 { _GET_CONTEXT; fn( a1, a2, &context ); }
713 #define DEFINE_REGS_ENTRYPOINT_3( name, fn, t1, t2, t3 ) \
714 void WINAPI name ( t1 a1, t2 a2, t3 a3 ) \
715 { _GET_CONTEXT; fn( a1, a2, a3, &context ); }
716 #define DEFINE_REGS_ENTRYPOINT_4( name, fn, t1, t2, t3, t4 ) \
717 void WINAPI name ( t1 a1, t2 a2, t3 a3, t4 a4 ) \
718 { _GET_CONTEXT; fn( a1, a2, a3, a4, &context ); }
720 #endif /* __sparc__ */
722 #ifndef DEFINE_REGS_ENTRYPOINT_0
723 #error You need to define DEFINE_REGS_ENTRYPOINT macros for your CPU
724 #endif
726 #ifdef __i386__
727 # define GET_IP(context) ((LPVOID)(context)->Eip)
728 #endif
729 #ifdef __sparc__
730 # define GET_IP(context) ((LPVOID)(context)->pc)
731 #endif
733 #if !defined(GET_IP) && !defined(RC_INVOKED)
734 # error You must define GET_IP for this CPU
735 #endif
737 #endif /* __WINE__ */
740 * Exception codes
743 #define STATUS_SUCCESS 0x00000000
744 #define STATUS_WAIT_0 0x00000000
745 #define STATUS_ABANDONED_WAIT_0 0x00000080
746 #define STATUS_USER_APC 0x000000C0
747 #define STATUS_TIMEOUT 0x00000102
748 #define STATUS_PENDING 0x00000103
749 #define STATUS_GUARD_PAGE_VIOLATION 0x80000001
750 #define STATUS_DATATYPE_MISALIGNMENT 0x80000002
751 #define STATUS_BREAKPOINT 0x80000003
752 #define STATUS_SINGLE_STEP 0x80000004
753 #define STATUS_BUFFER_OVERFLOW 0x80000005
754 #define STATUS_UNSUCCESSFUL 0xC0000001
755 #define STATUS_ACCESS_VIOLATION 0xC0000005
756 #define STATUS_IN_PAGE_ERROR 0xC0000006
757 #define STATUS_INVALID_PARAMETER 0xC000000D
758 #define STATUS_NO_MEMORY 0xC0000017
759 #define STATUS_CONFLICTING_ADDRESSES 0xC0000018
760 #define STATUS_ILLEGAL_INSTRUCTION 0xC000001D
761 #define STATUS_BUFFER_TOO_SMALL 0xC0000023
762 #define STATUS_NONCONTINUABLE_EXCEPTION 0xC0000025
763 #define STATUS_INVALID_DISPOSITION 0xC0000026
764 #define STATUS_UNWIND 0xC0000027
765 #define STATUS_BAD_STACK 0xC0000028
766 #define STATUS_INVALID_UNWIND_TARGET 0xC0000029
767 #define STATUS_UNKNOWN_REVISION 0xC0000058
768 #define STATUS_INVALID_SECURITY_DESCR 0xC0000079
769 #define STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008C
770 #define STATUS_FLOAT_DENORMAL_OPERAND 0xC000008D
771 #define STATUS_FLOAT_DIVIDE_BY_ZERO 0xC000008E
772 #define STATUS_FLOAT_INEXACT_RESULT 0xC000008F
773 #define STATUS_FLOAT_INVALID_OPERATION 0xC0000090
774 #define STATUS_FLOAT_OVERFLOW 0xC0000091
775 #define STATUS_FLOAT_STACK_CHECK 0xC0000092
776 #define STATUS_FLOAT_UNDERFLOW 0xC0000093
777 #define STATUS_INTEGER_DIVIDE_BY_ZERO 0xC0000094
778 #define STATUS_INTEGER_OVERFLOW 0xC0000095
779 #define STATUS_PRIVILEGED_INSTRUCTION 0xC0000096
780 #define STATUS_INVALID_PARAMETER_2 0xC00000F0
781 #define STATUS_STACK_OVERFLOW 0xC00000FD
782 #define STATUS_CONTROL_C_EXIT 0xC000013A
784 #define MAXIMUM_WAIT_OBJECTS 64
785 #define MAXIMUM_SUSPEND_COUNT 127
789 * Return values from the actual exception handlers
792 #define ExceptionContinueExecution 0
793 #define ExceptionContinueSearch 1
794 #define ExceptionNestedException 2
795 #define ExceptionCollidedUnwind 3
798 * Return values from filters in except() and from UnhandledExceptionFilter
801 #define EXCEPTION_EXECUTE_HANDLER 1
802 #define EXCEPTION_CONTINUE_SEARCH 0
803 #define EXCEPTION_CONTINUE_EXECUTION -1
806 * From OS/2 2.0 exception handling
807 * Win32 seems to use the same flags as ExceptionFlags in an EXCEPTION_RECORD
810 #define EH_NONCONTINUABLE 0x01
811 #define EH_UNWINDING 0x02
812 #define EH_EXIT_UNWIND 0x04
813 #define EH_STACK_INVALID 0x08
814 #define EH_NESTED_CALL 0x10
816 #define EXCEPTION_CONTINUABLE 0
817 #define EXCEPTION_NONCONTINUABLE EH_NONCONTINUABLE
820 * The exception record used by Win32 to give additional information
821 * about exception to exception handlers.
824 #define EXCEPTION_MAXIMUM_PARAMETERS 15
826 typedef struct __EXCEPTION_RECORD
828 DWORD ExceptionCode;
829 DWORD ExceptionFlags;
830 struct __EXCEPTION_RECORD *ExceptionRecord;
832 LPVOID ExceptionAddress;
833 DWORD NumberParameters;
834 DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
835 } EXCEPTION_RECORD, *PEXCEPTION_RECORD;
838 * The exception pointers structure passed to exception filters
839 * in except() and the UnhandledExceptionFilter().
842 typedef struct _EXCEPTION_POINTERS
844 PEXCEPTION_RECORD ExceptionRecord;
845 PCONTEXT ContextRecord;
846 } EXCEPTION_POINTERS, *PEXCEPTION_POINTERS;
850 * The exception frame, used for registering exception handlers
851 * Win32 cares only about this, but compilers generally emit
852 * larger exception frames for their own use.
855 struct __EXCEPTION_FRAME;
857 typedef DWORD (*PEXCEPTION_HANDLER)(PEXCEPTION_RECORD,struct __EXCEPTION_FRAME*,
858 PCONTEXT,struct __EXCEPTION_FRAME **);
860 typedef struct __EXCEPTION_FRAME
862 struct __EXCEPTION_FRAME *Prev;
863 PEXCEPTION_HANDLER Handler;
864 } EXCEPTION_FRAME, *PEXCEPTION_FRAME;
866 #include "poppack.h"
869 * function pointer to a exception filter
872 typedef LONG (CALLBACK *PTOP_LEVEL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS ExceptionInfo);
873 typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;
875 DWORD WINAPI UnhandledExceptionFilter( PEXCEPTION_POINTERS epointers );
876 LPTOP_LEVEL_EXCEPTION_FILTER
877 WINAPI SetUnhandledExceptionFilter( LPTOP_LEVEL_EXCEPTION_FILTER filter );
879 /* status values for ContinueDebugEvent */
880 #define DBG_CONTINUE 0x00010002
881 #define DBG_TERMINATE_THREAD 0x40010003
882 #define DBG_TERMINATE_PROCESS 0x40010004
883 #define DBG_CONTROL_C 0x40010005
884 #define DBG_CONTROL_BREAK 0x40010008
885 #define DBG_EXCEPTION_NOT_HANDLED 0x80010001
887 struct _TEB;
889 #ifdef __WINE__
891 #if defined(__i386__)
892 static inline struct _TEB * WINE_UNUSED __get_teb(void)
894 struct _TEB *teb;
895 __asm__(".byte 0x64\n\tmovl (0x18),%0" : "=r" (teb));
896 return teb;
898 #elif defined(HAVE__LWP_CREATE)
899 extern void *_lwp_getprivate(void);
900 static inline struct _TEB * WINE_UNUSED __get_teb(void)
902 return (struct _TEB *)_lwp_getprivate();
904 #else
905 #error NtCurrentTeb() not defined for this architecture!
906 #endif
908 #define NtCurrentTeb() __get_teb()
910 #else /* __WINE__ */
911 extern struct _TEB * WINAPI NtCurrentTeb(void);
912 #endif
915 * Here follows typedefs for security and tokens.
919 * First a constant for the following typdefs.
922 #define ANYSIZE_ARRAY 1
924 /* FIXME: Orphan. What does it point to? */
925 typedef PVOID PACCESS_TOKEN;
928 * TOKEN_INFORMATION_CLASS
931 typedef enum _TOKEN_INFORMATION_CLASS {
932 TokenUser = 1,
933 TokenGroups,
934 TokenPrivileges,
935 TokenOwner,
936 TokenPrimaryGroup,
937 TokenDefaultDacl,
938 TokenSource,
939 TokenType,
940 TokenImpersonationLevel,
941 TokenStatistics
942 } TOKEN_INFORMATION_CLASS;
944 #ifndef _SECURITY_DEFINED
945 #define _SECURITY_DEFINED
947 #include "pshpack1.h"
949 typedef DWORD ACCESS_MASK, *PACCESS_MASK;
951 typedef struct _GENERIC_MAPPING {
952 ACCESS_MASK GenericRead;
953 ACCESS_MASK GenericWrite;
954 ACCESS_MASK GenericExecute;
955 ACCESS_MASK GenericAll;
956 } GENERIC_MAPPING, *PGENERIC_MAPPING;
958 #ifndef SID_IDENTIFIER_AUTHORITY_DEFINED
959 #define SID_IDENTIFIER_AUTHORITY_DEFINED
960 typedef struct {
961 BYTE Value[6];
962 } SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
963 #endif /* !defined(SID_IDENTIFIER_AUTHORITY_DEFINED) */
965 #ifndef SID_DEFINED
966 #define SID_DEFINED
967 typedef struct _SID {
968 BYTE Revision;
969 BYTE SubAuthorityCount;
970 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
971 DWORD SubAuthority[1];
972 } SID,*PSID;
973 #endif /* !defined(SID_DEFINED) */
975 #define SID_REVISION (1) /* Current revision */
976 #define SID_MAX_SUB_AUTHORITIES (15) /* current max subauths */
977 #define SID_RECOMMENDED_SUB_AUTHORITIES (1) /* recommended subauths */
981 * ACL
984 typedef struct _ACL {
985 BYTE AclRevision;
986 BYTE Sbz1;
987 WORD AclSize;
988 WORD AceCount;
989 WORD Sbz2;
990 } ACL, *PACL;
992 /* SECURITY_DESCRIPTOR */
993 #define SECURITY_DESCRIPTOR_REVISION 1
994 #define SECURITY_DESCRIPTOR_REVISION1 1
997 #define SE_OWNER_DEFAULTED 0x0001
998 #define SE_GROUP_DEFAULTED 0x0002
999 #define SE_DACL_PRESENT 0x0004
1000 #define SE_DACL_DEFAULTED 0x0008
1001 #define SE_SACL_PRESENT 0x0010
1002 #define SE_SACL_DEFAULTED 0x0020
1003 #define SE_SELF_RELATIVE 0x8000
1005 typedef DWORD SECURITY_INFORMATION, *PSECURITY_INFORMATION;
1006 typedef WORD SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;
1008 /* The security descriptor structure */
1009 typedef struct {
1010 BYTE Revision;
1011 BYTE Sbz1;
1012 SECURITY_DESCRIPTOR_CONTROL Control;
1013 PSID Owner;
1014 PSID Group;
1015 PACL Sacl;
1016 PACL Dacl;
1017 } SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR;
1019 #define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR))
1021 #include "poppack.h"
1023 #endif /* _SECURITY_DEFINED */
1025 #include "pshpack1.h"
1028 * SID_AND_ATTRIBUTES
1031 typedef struct _SID_AND_ATTRIBUTES {
1032 PSID Sid;
1033 DWORD Attributes;
1034 } SID_AND_ATTRIBUTES ;
1037 * TOKEN_USER
1040 typedef struct _TOKEN_USER {
1041 SID_AND_ATTRIBUTES User;
1042 } TOKEN_USER;
1045 * TOKEN_GROUPS
1048 typedef struct _TOKEN_GROUPS {
1049 DWORD GroupCount;
1050 SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY];
1051 } TOKEN_GROUPS;
1054 * LUID_AND_ATTRIBUTES
1057 typedef union _LARGE_INTEGER {
1058 struct {
1059 DWORD LowPart;
1060 LONG HighPart;
1061 } DUMMYSTRUCTNAME;
1062 LONGLONG QuadPart;
1063 } LARGE_INTEGER, *LPLARGE_INTEGER, *PLARGE_INTEGER;
1065 typedef union _ULARGE_INTEGER {
1066 struct {
1067 DWORD LowPart;
1068 LONG HighPart;
1069 } DUMMYSTRUCTNAME;
1070 LONGLONG QuadPart;
1071 } ULARGE_INTEGER, *LPULARGE_INTEGER, *PULARGE_INTEGER;
1074 * Locally Unique Identifier
1077 typedef LARGE_INTEGER LUID,*PLUID;
1079 typedef struct _LUID_AND_ATTRIBUTES {
1080 LUID Luid;
1081 DWORD Attributes;
1082 } LUID_AND_ATTRIBUTES;
1085 * PRIVILEGE_SET
1088 typedef struct _PRIVILEGE_SET {
1089 DWORD PrivilegeCount;
1090 DWORD Control;
1091 LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY];
1092 } PRIVILEGE_SET, *PPRIVILEGE_SET;
1095 * TOKEN_PRIVILEGES
1098 typedef struct _TOKEN_PRIVILEGES {
1099 DWORD PrivilegeCount;
1100 LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY];
1101 } TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES;
1104 * TOKEN_OWNER
1107 typedef struct _TOKEN_OWNER {
1108 PSID Owner;
1109 } TOKEN_OWNER;
1112 * TOKEN_PRIMARY_GROUP
1115 typedef struct _TOKEN_PRIMARY_GROUP {
1116 PSID PrimaryGroup;
1117 } TOKEN_PRIMARY_GROUP;
1121 * TOKEN_DEFAULT_DACL
1124 typedef struct _TOKEN_DEFAULT_DACL {
1125 PACL DefaultDacl;
1126 } TOKEN_DEFAULT_DACL;
1129 * TOKEN_SOURCEL
1132 typedef struct _TOKEN_SOURCE {
1133 char Sourcename[8];
1134 LUID SourceIdentifier;
1135 } TOKEN_SOURCE;
1138 * TOKEN_TYPE
1141 typedef enum tagTOKEN_TYPE {
1142 TokenPrimary = 1,
1143 TokenImpersonation
1144 } TOKEN_TYPE;
1147 * SECURITY_IMPERSONATION_LEVEL
1150 typedef enum _SECURITY_IMPERSONATION_LEVEL {
1151 SecurityAnonymous,
1152 SecurityIdentification,
1153 SecurityImpersonation,
1154 SecurityDelegation
1155 } SECURITY_IMPERSONATION_LEVEL, *PSECURITY_IMPERSONATION_LEVEL;
1158 typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE,
1159 * PSECURITY_CONTEXT_TRACKING_MODE;
1161 * Quality of Service
1164 typedef struct _SECURITY_QUALITY_OF_SERVICE {
1165 DWORD Length;
1166 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
1167 SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode;
1168 BOOL EffectiveOnly;
1169 } SECURITY_QUALITY_OF_SERVICE, *PSECURITY_QUALITY_OF_SERVICE;
1172 * TOKEN_STATISTICS
1175 typedef struct _TOKEN_STATISTICS {
1176 LUID TokenId;
1177 LUID AuthenticationId;
1178 LARGE_INTEGER ExpirationTime;
1179 TOKEN_TYPE TokenType;
1180 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
1181 DWORD DynamicCharged;
1182 DWORD DynamicAvailable;
1183 DWORD GroupCount;
1184 DWORD PrivilegeCount;
1185 LUID ModifiedId;
1186 } TOKEN_STATISTICS;
1189 * ACLs of NT
1192 #define ACL_REVISION 2
1194 #define ACL_REVISION1 1
1195 #define ACL_REVISION2 2
1197 /* ACEs, directly starting after an ACL */
1198 typedef struct _ACE_HEADER {
1199 BYTE AceType;
1200 BYTE AceFlags;
1201 WORD AceSize;
1202 } ACE_HEADER,*PACE_HEADER;
1204 /* AceType */
1205 #define ACCESS_ALLOWED_ACE_TYPE 0
1206 #define ACCESS_DENIED_ACE_TYPE 1
1207 #define SYSTEM_AUDIT_ACE_TYPE 2
1208 #define SYSTEM_ALARM_ACE_TYPE 3
1210 /* inherit AceFlags */
1211 #define OBJECT_INHERIT_ACE 0x01
1212 #define CONTAINER_INHERIT_ACE 0x02
1213 #define NO_PROPAGATE_INHERIT_ACE 0x04
1214 #define INHERIT_ONLY_ACE 0x08
1215 #define VALID_INHERIT_FLAGS 0x0F
1217 /* AceFlags mask for what events we (should) audit */
1218 #define SUCCESSFUL_ACCESS_ACE_FLAG 0x40
1219 #define FAILED_ACCESS_ACE_FLAG 0x80
1221 /* different ACEs depending on AceType
1222 * SidStart marks the begin of a SID
1223 * so the thing finally looks like this:
1224 * 0: ACE_HEADER
1225 * 4: ACCESS_MASK
1226 * 8... : SID
1228 typedef struct _ACCESS_ALLOWED_ACE {
1229 ACE_HEADER Header;
1230 DWORD Mask;
1231 DWORD SidStart;
1232 } ACCESS_ALLOWED_ACE,*PACCESS_ALLOWED_ACE;
1234 typedef struct _ACCESS_DENIED_ACE {
1235 ACE_HEADER Header;
1236 DWORD Mask;
1237 DWORD SidStart;
1238 } ACCESS_DENIED_ACE,*PACCESS_DENIED_ACE;
1240 typedef struct _SYSTEM_AUDIT_ACE {
1241 ACE_HEADER Header;
1242 DWORD Mask;
1243 DWORD SidStart;
1244 } SYSTEM_AUDIT_ACE,*PSYSTEM_AUDIT_ACE;
1246 typedef struct _SYSTEM_ALARM_ACE {
1247 ACE_HEADER Header;
1248 DWORD Mask;
1249 DWORD SidStart;
1250 } SYSTEM_ALARM_ACE,*PSYSTEM_ALARM_ACE;
1252 typedef enum tagSID_NAME_USE {
1253 SidTypeUser = 1,
1254 SidTypeGroup,
1255 SidTypeDomain,
1256 SidTypeAlias,
1257 SidTypeWellKnownGroup,
1258 SidTypeDeletedAccount,
1259 SidTypeInvalid,
1260 SidTypeUnknown
1261 } SID_NAME_USE,*PSID_NAME_USE;
1263 /* Access rights */
1265 #define DELETE 0x00010000
1266 #define READ_CONTROL 0x00020000
1267 #define WRITE_DAC 0x00040000
1268 #define WRITE_OWNER 0x00080000
1269 #define SYNCHRONIZE 0x00100000
1270 #define STANDARD_RIGHTS_REQUIRED 0x000f0000
1272 #define STANDARD_RIGHTS_READ READ_CONTROL
1273 #define STANDARD_RIGHTS_WRITE READ_CONTROL
1274 #define STANDARD_RIGHTS_EXECUTE READ_CONTROL
1276 #define STANDARD_RIGHTS_ALL 0x001f0000
1278 #define SPECIFIC_RIGHTS_ALL 0x0000ffff
1280 #define GENERIC_READ 0x80000000
1281 #define GENERIC_WRITE 0x40000000
1282 #define GENERIC_EXECUTE 0x20000000
1283 #define GENERIC_ALL 0x10000000
1285 #define MAXIMUM_ALLOWED 0x02000000
1286 #define ACCESS_SYSTEM_SECURITY 0x01000000
1288 #define EVENT_MODIFY_STATE 0x0002
1289 #define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
1291 #define SEMAPHORE_MODIFY_STATE 0x0002
1292 #define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
1294 #define MUTEX_MODIFY_STATE 0x0001
1295 #define MUTEX_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1)
1297 #define PROCESS_TERMINATE 0x0001
1298 #define PROCESS_CREATE_THREAD 0x0002
1299 #define PROCESS_VM_OPERATION 0x0008
1300 #define PROCESS_VM_READ 0x0010
1301 #define PROCESS_VM_WRITE 0x0020
1302 #define PROCESS_DUP_HANDLE 0x0040
1303 #define PROCESS_CREATE_PROCESS 0x0080
1304 #define PROCESS_SET_QUOTA 0x0100
1305 #define PROCESS_SET_INFORMATION 0x0200
1306 #define PROCESS_QUERY_INFORMATION 0x0400
1307 #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xfff)
1309 #define THREAD_TERMINATE 0x0001
1310 #define THREAD_SUSPEND_RESUME 0x0002
1311 #define THREAD_GET_CONTEXT 0x0008
1312 #define THREAD_SET_CONTEXT 0x0010
1313 #define THREAD_SET_INFORMATION 0x0020
1314 #define THREAD_QUERY_INFORMATION 0x0040
1315 #define THREAD_SET_THREAD_TOKEN 0x0080
1316 #define THREAD_IMPERSONATE 0x0100
1317 #define THREAD_DIRECT_IMPERSONATION 0x0200
1318 #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3ff)
1320 #define THREAD_BASE_PRIORITY_LOWRT 15
1321 #define THREAD_BASE_PRIORITY_MAX 2
1322 #define THREAD_BASE_PRIORITY_MIN -2
1323 #define THREAD_BASE_PRIORITY_IDLE -15
1325 #define FILE_READ_DATA 0x0001 /* file & pipe */
1326 #define FILE_LIST_DIRECTORY 0x0001 /* directory */
1327 #define FILE_WRITE_DATA 0x0002 /* file & pipe */
1328 #define FILE_ADD_FILE 0x0002 /* directory */
1329 #define FILE_APPEND_DATA 0x0004 /* file */
1330 #define FILE_ADD_SUBDIRECTORY 0x0004 /* directory */
1331 #define FILE_CREATE_PIPE_INSTANCE 0x0004 /* named pipe */
1332 #define FILE_READ_EA 0x0008 /* file & directory */
1333 #define FILE_READ_PROPERTIES FILE_READ_EA
1334 #define FILE_WRITE_EA 0x0010 /* file & directory */
1335 #define FILE_WRITE_PROPERTIES FILE_WRITE_EA
1336 #define FILE_EXECUTE 0x0020 /* file */
1337 #define FILE_TRAVERSE 0x0020 /* directory */
1338 #define FILE_DELETE_CHILD 0x0040 /* directory */
1339 #define FILE_READ_ATTRIBUTES 0x0080 /* all */
1340 #define FILE_WRITE_ATTRIBUTES 0x0100 /* all */
1341 #define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1ff)
1343 #define FILE_GENERIC_READ (STANDARD_RIGHTS_READ | FILE_READ_DATA | \
1344 FILE_READ_ATTRIBUTES | FILE_READ_EA | \
1345 SYNCHRONIZE)
1346 #define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | \
1347 FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | \
1348 FILE_APPEND_DATA | SYNCHRONIZE)
1349 #define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE | FILE_EXECUTE | \
1350 FILE_READ_ATTRIBUTES | SYNCHRONIZE)
1353 /* File attribute flags
1355 #define FILE_SHARE_READ 0x00000001L
1356 #define FILE_SHARE_WRITE 0x00000002L
1357 #define FILE_SHARE_DELETE 0x00000004L
1358 #define FILE_ATTRIBUTE_READONLY 0x00000001L
1359 #define FILE_ATTRIBUTE_HIDDEN 0x00000002L
1360 #define FILE_ATTRIBUTE_SYSTEM 0x00000004L
1361 #define FILE_ATTRIBUTE_LABEL 0x00000008L /* Not in Windows API */
1362 #define FILE_ATTRIBUTE_DIRECTORY 0x00000010L
1363 #define FILE_ATTRIBUTE_ARCHIVE 0x00000020L
1364 #define FILE_ATTRIBUTE_NORMAL 0x00000080L
1365 #define FILE_ATTRIBUTE_TEMPORARY 0x00000100L
1366 #define FILE_ATTRIBUTE_ATOMIC_WRITE 0x00000200L
1367 #define FILE_ATTRIBUTE_XACTION_WRITE 0x00000400L
1368 #define FILE_ATTRIBUTE_COMPRESSED 0x00000800L
1369 #define FILE_ATTRIBUTE_OFFLINE 0x00001000L
1371 /* File alignments (NT) */
1372 #define FILE_BYTE_ALIGNMENT 0x00000000
1373 #define FILE_WORD_ALIGNMENT 0x00000001
1374 #define FILE_LONG_ALIGNMENT 0x00000003
1375 #define FILE_QUAD_ALIGNMENT 0x00000007
1376 #define FILE_OCTA_ALIGNMENT 0x0000000f
1377 #define FILE_32_BYTE_ALIGNMENT 0x0000001f
1378 #define FILE_64_BYTE_ALIGNMENT 0x0000003f
1379 #define FILE_128_BYTE_ALIGNMENT 0x0000007f
1380 #define FILE_256_BYTE_ALIGNMENT 0x000000ff
1381 #define FILE_512_BYTE_ALIGNMENT 0x000001ff
1383 /* Registry security values */
1384 #define OWNER_SECURITY_INFORMATION 0x00000001
1385 #define GROUP_SECURITY_INFORMATION 0x00000002
1386 #define DACL_SECURITY_INFORMATION 0x00000004
1387 #define SACL_SECURITY_INFORMATION 0x00000008
1389 #include "poppack.h"
1391 #endif /* __WINE_WINNT_H */