2 * Win32 definitions for Windows NT
4 * Copyright 1996 Alexandre Julliard
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
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
60 #define MINSHORT 0x8000
61 #define MAXSHORT 0x7fff
62 #define MINLONG 0x80000000
63 #define MAXLONG 0x7fffffff
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)))
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. */
82 typedef LPWSTR LPTSTR
;
83 typedef LPCWSTR LPCTSTR
;
84 #define __TEXT(string) L##string /*probably wrong */
87 typedef LPCSTR LPCTSTR
;
88 #define __TEXT(string) string
91 #define TEXT(quote) __TEXT(quote)
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
;
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
152 BYTE RegisterArea
[SIZE_OF_80387_REGISTERS
];
154 } FLOATING_SAVE_AREA
, *PFLOATING_SAVE_AREA
;
156 typedef struct _CONTEXT86
160 /* These are selected by CONTEXT_DEBUG_REGISTERS */
168 /* These are selected by CONTEXT_FLOATING_POINT */
169 FLOATING_SAVE_AREA FloatSave
;
171 /* These are selected by CONTEXT_SEGMENTS */
177 /* These are selected by CONTEXT_INTEGER */
185 /* These are selected by CONTEXT_CONTROL */
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 */
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 */
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 */
265 /* selected by CONTEXT_INTEGER */
299 /* selected by CONTEXT_FLOATING_POINT */
303 /* selected by CONTEXT_CONTROL */
310 #define _QUAD_PSR_OFFSET HighSoftFpcr
311 #define _QUAD_FLAGS_OFFSET HighFir
315 /* Mips context definitions */
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
329 /* These are selected by CONTEXT_FLOATING_POINT */
363 /* These are selected by CONTEXT_INTEGER */
399 /* These are selected by CONTEXT_FLOATING_POINT */
402 /* These are selected by CONTEXT_CONTROL */
412 /* PowerPC context definitions */
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)
423 /* These are selected by CONTEXT_FLOATING_POINT */
458 /* These are selected by CONTEXT_INTEGER */
495 /* These are selected by CONTEXT_CONTROL */
504 /* These are selected by CONTEXT_DEBUG_REGISTERS */
515 typedef struct _STACK_FRAME_HEADER
532 } STACK_FRAME_HEADER
,*PSTACK_FRAME_HEADER
;
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
566 /* These are selected by CONTEXT_INTEGER */
600 /* These are selected by CONTEXT_CONTROL */
608 /* FIXME: floating point registers missing */
614 #if !defined(CONTEXT_FULL) && !defined(RC_INVOKED)
615 #error You need to define a CONTEXT for your CPU
618 typedef CONTEXT
*PCONTEXT
;
619 typedef HANDLE
*PHANDLE
;
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 */
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" \
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__ */
696 /* FIXME: use getcontext() to retrieve full context */
697 #define _GET_CONTEXT \
699 do { memset(&context, 0, sizeof(CONTEXT)); \
700 context.ContextFlags = CONTEXT_CONTROL; \
701 context.pc = (DWORD)__builtin_return_address(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
727 # define GET_IP(context) ((LPVOID)(context)->Eip)
730 # define GET_IP(context) ((LPVOID)(context)->pc)
733 #if !defined(GET_IP) && !defined(RC_INVOKED)
734 # error You must define GET_IP for this CPU
737 #endif /* __WINE__ */
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
750 #define STATUS_GUARD_PAGE_VIOLATION 0x80000001
751 #define STATUS_DATATYPE_MISALIGNMENT 0x80000002
752 #define STATUS_BREAKPOINT 0x80000003
753 #define STATUS_SINGLE_STEP 0x80000004
754 #define STATUS_BUFFER_OVERFLOW 0x80000005
755 #define STATUS_NO_MORE_FILES 0x80000006
756 #define STATUS_WAKE_SYSTEM_DEBUGGER 0x80000007
758 #define STATUS_HANDLES_CLOSED 0x8000000A
759 #define STATUS_NO_INHERITANCE 0x8000000B
760 #define STATUS_GUID_SUBSTITUTION_MADE 0x8000000C
761 #define STATUS_PARTIAL_COPY 0x8000000D
762 #define STATUS_DEVICE_PAPER_EMPTY 0x8000000E
763 #define STATUS_DEVICE_POWERED_OFF 0x8000000F
764 #define STATUS_DEVICE_OFF_LINE 0x80000010
765 #define STATUS_DEVICE_BUSY 0x80000011
766 #define STATUS_NO_MORE_EAS 0x80000012
767 #define STATUS_INVALID_EA_NAME 0x80000013
768 #define STATUS_EA_LIST_INCONSISTENT 0x80000014
769 #define STATUS_INVALID_EA_FLAG 0x80000015
770 #define STATUS_VERIFY_REQUIRED 0x80000016
771 #define STATUS_EXTRANEOUS_INFORMATION 0x80000017
772 #define STATUS_RXACT_COMMIT_NECESSARY 0x80000018
773 #define STATUS_NO_MORE_ENTRIES 0x8000001A
774 #define STATUS_FILEMARK_DETECTED 0x8000001B
775 #define STATUS_MEDIA_CHANGED 0x8000001C
776 #define STATUS_BUS_RESET 0x8000001D
777 #define STATUS_END_OF_MEDIA 0x8000001E
778 #define STATUS_BEGINNING_OF_MEDIA 0x8000001F
779 #define STATUS_MEDIA_CHECK 0x80000020
780 #define STATUS_SETMARK_DETECTED 0x80000021
781 #define STATUS_NO_DATA_DETECTED 0x80000022
782 #define STATUS_REDIRECTOR_HAS_OPEN_HANDLES 0x80000023
783 #define STATUS_SERVER_HAS_OPEN_HANDLES 0x80000024
784 #define STATUS_ALREADY_DISCONNECTED 0x80000025
785 #define STATUS_LONGJUMP 0x80000026
787 #define STATUS_UNSUCCESSFUL 0xC0000001
788 #define STATUS_NOT_IMPLEMENTED 0xC0000002
789 #define STATUS_INVALID_INFO_CLASS 0xC0000003
790 #define STATUS_INFO_LENGTH_MISMATCH 0xC0000004
791 #define STATUS_ACCESS_VIOLATION 0xC0000005
792 #define STATUS_IN_PAGE_ERROR 0xC0000006
793 #define STATUS_PAGEFILE_QUOTA 0xC0000007
794 #define STATUS_INVALID_HANDLE 0xC0000008
795 #define STATUS_BAD_INITIAL_STACK 0xC0000009
796 #define STATUS_BAD_INITIAL_PC 0xC000000A
797 #define STATUS_INVALID_CID 0xC000000B
798 #define STATUS_TIMER_NOT_CANCELED 0xC000000C
799 #define STATUS_INVALID_PARAMETER 0xC000000D
800 #define STATUS_NO_SUCH_DEVICE 0xC000000E
801 #define STATUS_NO_SUCH_FILE 0xC000000F
802 #define STATUS_INVALID_DEVICE_REQUEST 0xC0000010
803 #define STATUS_END_OF_FILE 0xC0000011
804 #define STATUS_WRONG_VOLUME 0xC0000012
805 #define STATUS_NO_MEDIA_IN_DEVICE 0xC0000013
806 #define STATUS_UNRECOGNIZED_MEDIA 0xC0000014
807 #define STATUS_NONEXISTENT_SECTOR 0xC0000015
808 #define STATUS_MORE_PROCESSING_REQUIRED 0xC0000016
809 #define STATUS_NO_MEMORY 0xC0000017
810 #define STATUS_CONFLICTING_ADDRESSES 0xC0000018
811 #define STATUS_NOT_MAPPED_VIEW 0xC0000019
812 #define STATUS_UNABLE_TO_FREE_VM 0xC000001A
813 #define STATUS_UNABLE_TO_DELETE_SECTION 0xC000001B
814 #define STATUS_INVALID_SYSTEM_SERVICE 0xC000001C
815 #define STATUS_ILLEGAL_INSTRUCTION 0xC000001D
816 #define STATUS_INVALID_LOCK_SEQUENCE 0xC000001E
817 #define STATUS_INVALID_VIEW_SIZE 0xC000001F
818 #define STATUS_INVALID_FILE_FOR_SECTION 0xC0000020
819 #define STATUS_ALREADY_COMMITTED 0xC0000021
820 #define STATUS_ACCESS_DENIED 0xC0000022
821 #define STATUS_BUFFER_TOO_SMALL 0xC0000023
822 #define STATUS_OBJECT_TYPE_MISMATCH 0xC0000024
823 #define STATUS_NONCONTINUABLE_EXCEPTION 0xC0000025
824 #define STATUS_INVALID_DISPOSITION 0xC0000026
825 #define STATUS_UNWIND 0xC0000027
826 #define STATUS_BAD_STACK 0xC0000028
827 #define STATUS_INVALID_UNWIND_TARGET 0xC0000029
828 #define STATUS_NOT_LOCKED 0xC000002A
829 #define STATUS_PARITY_ERROR 0xC000002B
830 #define STATUS_UNABLE_TO_DECOMMIT_VM 0xC000002C
831 #define STATUS_NOT_COMMITTED 0xC000002D
832 #define STATUS_INVALID_PORT_ATTRIBUTES 0xC000002E
833 #define STATUS_PORT_MESSAGE_TOO_LONG 0xC000002F
834 #define STATUS_INVALID_PARAMETER_MIX 0xC0000030
835 #define STATUS_INVALID_QUOTA_LOWER 0xC0000031
836 #define STATUS_DISK_CORRUPT_ERROR 0xC0000032
837 #define STATUS_OBJECT_NAME_INVALID 0xC0000033
838 #define STATUS_OBJECT_NAME_NOT_FOUND 0xC0000034
839 #define STATUS_OBJECT_NAME_COLLISION 0xC0000035
840 #define STATUS_PORT_DISCONNECTED 0xC0000037
841 #define STATUS_DEVICE_ALREADY_ATTACHED 0xC0000038
842 #define STATUS_OBJECT_PATH_INVALID 0xC0000039
843 #define STATUS_OBJECT_PATH_NOT_FOUND 0xC000003A
844 #define STATUS_PATH_SYNTAX_BAD 0xC000003B
845 #define STATUS_DATA_OVERRUN 0xC000003C
846 #define STATUS_DATA_LATE_ERROR 0xC000003D
847 #define STATUS_DATA_ERROR 0xC000003E
848 #define STATUS_CRC_ERROR 0xC000003F
849 #define STATUS_SECTION_TOO_BIG 0xC0000040
850 #define STATUS_PORT_CONNECTION_REFUSED 0xC0000041
851 #define STATUS_INVALID_PORT_HANDLE 0xC0000042
852 #define STATUS_SHARING_VIOLATION 0xC0000043
853 #define STATUS_QUOTA_EXCEEDED 0xC0000044
854 #define STATUS_INVALID_PAGE_PROTECTION 0xC0000045
855 #define STATUS_MUTANT_NOT_OWNED 0xC0000046
856 #define STATUS_SEMAPHORE_LIMIT_EXCEEDED 0xC0000047
857 #define STATUS_PORT_ALREADY_SET 0xC0000048
858 #define STATUS_SUSPEND_COUNT_EXCEEDED 0xC000004A
859 #define STATUS_LOCK_NOT_GRANTED 0xC0000054 /* FIXME: not sure */
860 #define STATUS_FILE_LOCK_CONFLICT 0xC0000055 /* FIXME: not sure */
861 #define STATUS_UNKNOWN_REVISION 0xC0000058
862 #define STATUS_INVALID_SECURITY_DESCR 0xC0000079
863 #define STATUS_DISK_FULL 0xC000007F
864 #define STATUS_SECTION_NOT_EXTENDED 0xC0000087
865 #define STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008C
866 #define STATUS_FLOAT_DENORMAL_OPERAND 0xC000008D
867 #define STATUS_FLOAT_DIVIDE_BY_ZERO 0xC000008E
868 #define STATUS_FLOAT_INEXACT_RESULT 0xC000008F
869 #define STATUS_FLOAT_INVALID_OPERATION 0xC0000090
870 #define STATUS_FLOAT_OVERFLOW 0xC0000091
871 #define STATUS_FLOAT_STACK_CHECK 0xC0000092
872 #define STATUS_FLOAT_UNDERFLOW 0xC0000093
873 #define STATUS_INTEGER_DIVIDE_BY_ZERO 0xC0000094
874 #define STATUS_INTEGER_OVERFLOW 0xC0000095
875 #define STATUS_PRIVILEGED_INSTRUCTION 0xC0000096
876 #define STATUS_MEDIA_WRITE_PROTECTED 0XC00000A2
877 #define STATUS_INVALID_PARAMETER_2 0xC00000F0
878 #define STATUS_STACK_OVERFLOW 0xC00000FD
879 #define STATUS_DIRECTORY_NOT_EMPTY 0xC0000101
880 #define STATUS_TOO_MANY_OPENED_FILES 0xC000011F
881 #define STATUS_CONTROL_C_EXIT 0xC000013A
882 #define STATUS_PIPE_BROKEN 0xC000014B
883 #define STATUS_NOT_REGISTRY_FILE 0xC000015C
884 #define STATUS_PARTITION_FAILURE 0xC0000172
885 #define STATUS_INVALID_BLOCK_LENGTH 0xC0000173
886 #define STATUS_DEVICE_NOT_PARTITIONED 0xC0000174
887 #define STATUS_UNABLE_TO_LOCK_MEDIA 0xC0000175
888 #define STATUS_UNABLE_TO_UNLOAD_MEDIA 0xC0000176
889 #define STATUS_EOM_OVERFLOW 0xC0000177
890 #define STATUS_NO_MEDIA 0xC0000178
891 #define STATUS_NO_SUCH_MEMBER 0xC000017A
892 #define STATUS_INVALID_MEMBER 0xC000017B
893 #define STATUS_KEY_DELETED 0xC000017C
894 #define STATUS_NO_LOG_SPACE 0xC000017D
895 #define STATUS_TOO_MANY_SIDS 0xC000017E
896 #define STATUS_LM_CROSS_ENCRYPTION_REQUIRED 0xC000017F
897 #define STATUS_KEY_HAS_CHILDREN 0xC0000180
898 #define STATUS_CHILD_MUST_BE_VOLATILE 0xC0000181
899 #define STATUS_DEVICE_CONFIGURATION_ERROR0xC0000182
900 #define STATUS_DRIVER_INTERNAL_ERROR 0xC0000183
901 #define STATUS_INVALID_DEVICE_STATE 0xC0000184
902 #define STATUS_IO_DEVICE_ERROR 0xC0000185
903 #define STATUS_DEVICE_PROTOCOL_ERROR 0xC0000186
904 #define STATUS_BACKUP_CONTROLLER 0xC0000187
905 #define STATUS_LOG_FILE_FULL 0xC0000188
906 #define STATUS_TOO_LATE 0xC0000189
907 #define STATUS_NO_TRUST_LSA_SECRET 0xC000018A
908 #define STATUS_NO_TRUST_SAM_ACCOUNT 0xC000018B
909 #define STATUS_TRUSTED_DOMAIN_FAILURE 0xC000018C
910 #define STATUS_TRUSTED_RELATIONSHIP_FAILURE 0xC000018D
911 #define STATUS_EVENTLOG_FILE_CORRUPT 0xC000018E
912 #define STATUS_EVENTLOG_CANT_START 0xC000018F
913 #define STATUS_TRUST_FAILURE 0xC0000190
914 #define STATUS_MUTANT_LIMIT_EXCEEDED 0xC0000191
915 #define STATUS_NETLOGON_NOT_STARTED 0xC0000192
916 #define STATUS_ACCOUNT_EXPIRED 0xC0000193
917 #define STATUS_POSSIBLE_DEADLOCK 0xC0000194
918 #define STATUS_NETWORK_CREDENTIAL_CONFLICT 0xC0000195
919 #define STATUS_REMOTE_SESSION_LIMIT 0xC0000196
920 #define STATUS_EVENTLOG_FILE_CHANGED 0xC0000197
921 #define STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT 0xC0000198
922 #define STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT 0xC0000199
923 #define STATUS_NOLOGON_SERVER_TRUST_ACCOUNT 0xC000019A
924 #define STATUS_DOMAIN_TRUST_INCONSISTENT 0xC000019B
925 #define STATUS_FS_DRIVER_REQUIRED 0xC000019C
927 #define STATUS_RESOURCE_LANG_NOT_FOUND 0xC0000204
929 #define MAXIMUM_WAIT_OBJECTS 64
930 #define MAXIMUM_SUSPEND_COUNT 127
934 * Return values from the actual exception handlers
937 #define ExceptionContinueExecution 0
938 #define ExceptionContinueSearch 1
939 #define ExceptionNestedException 2
940 #define ExceptionCollidedUnwind 3
943 * Return values from filters in except() and from UnhandledExceptionFilter
946 #define EXCEPTION_EXECUTE_HANDLER 1
947 #define EXCEPTION_CONTINUE_SEARCH 0
948 #define EXCEPTION_CONTINUE_EXECUTION -1
951 * From OS/2 2.0 exception handling
952 * Win32 seems to use the same flags as ExceptionFlags in an EXCEPTION_RECORD
955 #define EH_NONCONTINUABLE 0x01
956 #define EH_UNWINDING 0x02
957 #define EH_EXIT_UNWIND 0x04
958 #define EH_STACK_INVALID 0x08
959 #define EH_NESTED_CALL 0x10
961 #define EXCEPTION_CONTINUABLE 0
962 #define EXCEPTION_NONCONTINUABLE EH_NONCONTINUABLE
965 * The exception record used by Win32 to give additional information
966 * about exception to exception handlers.
969 #define EXCEPTION_MAXIMUM_PARAMETERS 15
971 typedef struct __EXCEPTION_RECORD
974 DWORD ExceptionFlags
;
975 struct __EXCEPTION_RECORD
*ExceptionRecord
;
977 LPVOID ExceptionAddress
;
978 DWORD NumberParameters
;
979 DWORD ExceptionInformation
[EXCEPTION_MAXIMUM_PARAMETERS
];
980 } EXCEPTION_RECORD
, *PEXCEPTION_RECORD
;
983 * The exception pointers structure passed to exception filters
984 * in except() and the UnhandledExceptionFilter().
987 typedef struct _EXCEPTION_POINTERS
989 PEXCEPTION_RECORD ExceptionRecord
;
990 PCONTEXT ContextRecord
;
991 } EXCEPTION_POINTERS
, *PEXCEPTION_POINTERS
;
995 * The exception frame, used for registering exception handlers
996 * Win32 cares only about this, but compilers generally emit
997 * larger exception frames for their own use.
1000 struct __EXCEPTION_FRAME
;
1002 typedef DWORD (*PEXCEPTION_HANDLER
)(PEXCEPTION_RECORD
,struct __EXCEPTION_FRAME
*,
1003 PCONTEXT
,struct __EXCEPTION_FRAME
**);
1005 typedef struct __EXCEPTION_FRAME
1007 struct __EXCEPTION_FRAME
*Prev
;
1008 PEXCEPTION_HANDLER Handler
;
1009 } EXCEPTION_FRAME
, *PEXCEPTION_FRAME
;
1011 #include "poppack.h"
1014 * function pointer to a exception filter
1017 typedef LONG (CALLBACK
*PTOP_LEVEL_EXCEPTION_FILTER
)(PEXCEPTION_POINTERS ExceptionInfo
);
1018 typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER
;
1020 DWORD WINAPI
UnhandledExceptionFilter( PEXCEPTION_POINTERS epointers
);
1021 LPTOP_LEVEL_EXCEPTION_FILTER
1022 WINAPI
SetUnhandledExceptionFilter( LPTOP_LEVEL_EXCEPTION_FILTER filter
);
1024 /* status values for ContinueDebugEvent */
1025 #define DBG_CONTINUE 0x00010002
1026 #define DBG_TERMINATE_THREAD 0x40010003
1027 #define DBG_TERMINATE_PROCESS 0x40010004
1028 #define DBG_CONTROL_C 0x40010005
1029 #define DBG_CONTROL_BREAK 0x40010008
1030 #define DBG_EXCEPTION_NOT_HANDLED 0x80010001
1032 typedef struct _NT_TIB
1034 struct _EXCEPTION_REGISTRATION_RECORD
*ExceptionList
;
1042 PVOID ArbitraryUserPointer
;
1043 struct _NT_TIB
*Self
;
1050 #if defined(__i386__)
1051 static inline struct _TEB
* WINE_UNUSED
__get_teb(void)
1054 __asm__(".byte 0x64\n\tmovl (0x18),%0" : "=r" (teb
));
1057 #elif defined(HAVE__LWP_CREATE)
1058 extern void *_lwp_getprivate(void);
1059 static inline struct _TEB
* WINE_UNUSED
__get_teb(void)
1061 return (struct _TEB
*)_lwp_getprivate();
1064 #error NtCurrentTeb() not defined for this architecture!
1067 #define NtCurrentTeb() __get_teb()
1069 #else /* __WINE__ */
1070 extern struct _TEB
* WINAPI
NtCurrentTeb(void);
1074 * Here follows typedefs for security and tokens.
1078 * First a constant for the following typdefs.
1081 #define ANYSIZE_ARRAY 1
1083 /* FIXME: Orphan. What does it point to? */
1084 typedef PVOID PACCESS_TOKEN
;
1087 * TOKEN_INFORMATION_CLASS
1090 typedef enum _TOKEN_INFORMATION_CLASS
{
1099 TokenImpersonationLevel
,
1101 } TOKEN_INFORMATION_CLASS
;
1103 #ifndef _SECURITY_DEFINED
1104 #define _SECURITY_DEFINED
1106 #include "pshpack1.h"
1108 typedef DWORD ACCESS_MASK
, *PACCESS_MASK
;
1110 typedef struct _GENERIC_MAPPING
{
1111 ACCESS_MASK GenericRead
;
1112 ACCESS_MASK GenericWrite
;
1113 ACCESS_MASK GenericExecute
;
1114 ACCESS_MASK GenericAll
;
1115 } GENERIC_MAPPING
, *PGENERIC_MAPPING
;
1117 #ifndef SID_IDENTIFIER_AUTHORITY_DEFINED
1118 #define SID_IDENTIFIER_AUTHORITY_DEFINED
1121 } SID_IDENTIFIER_AUTHORITY
,*PSID_IDENTIFIER_AUTHORITY
,*LPSID_IDENTIFIER_AUTHORITY
;
1122 #endif /* !defined(SID_IDENTIFIER_AUTHORITY_DEFINED) */
1126 typedef struct _SID
{
1128 BYTE SubAuthorityCount
;
1129 SID_IDENTIFIER_AUTHORITY IdentifierAuthority
;
1130 DWORD SubAuthority
[1];
1132 #endif /* !defined(SID_DEFINED) */
1134 #define SID_REVISION (1) /* Current revision */
1135 #define SID_MAX_SUB_AUTHORITIES (15) /* current max subauths */
1136 #define SID_RECOMMENDED_SUB_AUTHORITIES (1) /* recommended subauths */
1143 #define ACL_REVISION1 1
1144 #define ACL_REVISION2 2
1145 #define ACL_REVISION3 3
1146 #define ACL_REVISION4 4
1148 #define MIN_ACL_REVISION ACL_REVISION2
1149 #define MAX_ACL_REVISION ACL_REVISION4
1151 typedef struct _ACL
{
1159 /* SECURITY_DESCRIPTOR */
1160 #define SECURITY_DESCRIPTOR_REVISION 1
1161 #define SECURITY_DESCRIPTOR_REVISION1 1
1164 #define SE_OWNER_DEFAULTED 0x0001
1165 #define SE_GROUP_DEFAULTED 0x0002
1166 #define SE_DACL_PRESENT 0x0004
1167 #define SE_DACL_DEFAULTED 0x0008
1168 #define SE_SACL_PRESENT 0x0010
1169 #define SE_SACL_DEFAULTED 0x0020
1170 #define SE_SELF_RELATIVE 0x8000
1172 typedef DWORD SECURITY_INFORMATION
, *PSECURITY_INFORMATION
;
1173 typedef WORD SECURITY_DESCRIPTOR_CONTROL
, *PSECURITY_DESCRIPTOR_CONTROL
;
1175 /* The security descriptor structure */
1179 SECURITY_DESCRIPTOR_CONTROL Control
;
1184 } SECURITY_DESCRIPTOR_RELATIVE
, *PISECURITY_DESCRIPTOR_RELATIVE
;
1189 SECURITY_DESCRIPTOR_CONTROL Control
;
1194 } SECURITY_DESCRIPTOR
, *PSECURITY_DESCRIPTOR
;
1196 #define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR))
1198 #include "poppack.h"
1200 #endif /* _SECURITY_DEFINED */
1202 #include "pshpack1.h"
1205 * SID_AND_ATTRIBUTES
1208 typedef struct _SID_AND_ATTRIBUTES
{
1211 } SID_AND_ATTRIBUTES
;
1213 /* security entities */
1214 #define SECURITY_NULL_RID (0x00000000L)
1215 #define SECURITY_WORLD_RID (0x00000000L)
1216 #define SECURITY_LOCAL_RID (0X00000000L)
1218 #define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0}
1221 #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
1224 #define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2}
1227 #define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3}
1228 #define SECURITY_CREATOR_OWNER_RID (0x00000000L)
1229 #define SECURITY_CREATOR_GROUP_RID (0x00000001L)
1230 #define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L)
1231 #define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L)
1234 #define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4}
1237 #define SECURITY_NT_AUTHORITY {0,0,0,0,0,5}
1238 #define SECURITY_DIALUP_RID 0x00000001L
1239 #define SECURITY_NETWORK_RID 0x00000002L
1240 #define SECURITY_BATCH_RID 0x00000003L
1241 #define SECURITY_INTERACTIVE_RID 0x00000004L
1242 #define SECURITY_LOGON_IDS_RID 0x00000005L
1243 #define SECURITY_SERVICE_RID 0x00000006L
1244 #define SECURITY_ANONYMOUS_LOGON_RID 0x00000007L
1245 #define SECURITY_PROXY_RID 0x00000008L
1246 #define SECURITY_ENTERPRISE_CONTROLLERS_RID 0x00000009L
1247 #define SECURITY_PRINCIPAL_SELF_RID 0x0000000AL
1248 #define SECURITY_AUTHENTICATED_USER_RID 0x0000000BL
1249 #define SECURITY_RESTRICTED_CODE_RID 0x0000000CL
1250 #define SECURITY_TERMINAL_SERVER_RID 0x0000000DL
1251 #define SECURITY_LOCAL_SYSTEM_RID 0x00000012L
1252 #define SECURITY_NT_NON_UNIQUE 0x00000015L
1253 #define SECURITY_BUILTIN_DOMAIN_RID 0x00000020L
1255 #define DOMAIN_GROUP_RID_ADMINS 0x00000200L
1256 #define DOMAIN_GROUP_RID_USERS 0x00000201L
1257 #define DOMAIN_GROUP_RID_GUESTS 0x00000202L
1259 #define DOMAIN_ALIAS_RID_ADMINS 0x00000220L
1260 #define DOMAIN_ALIAS_RID_USERS 0x00000221L
1261 #define DOMAIN_ALIAS_RID_GUESTS 0x00000222L
1263 #define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID
1265 #define SECURITY_LOGON_IDS_RID_COUNT (3L)
1271 typedef struct _TOKEN_USER
{
1272 SID_AND_ATTRIBUTES User
;
1279 typedef struct _TOKEN_GROUPS
{
1281 SID_AND_ATTRIBUTES Groups
[ANYSIZE_ARRAY
];
1285 * LUID_AND_ATTRIBUTES
1288 typedef union _LARGE_INTEGER
{
1294 } LARGE_INTEGER
, *LPLARGE_INTEGER
, *PLARGE_INTEGER
;
1296 typedef union _ULARGE_INTEGER
{
1302 } ULARGE_INTEGER
, *LPULARGE_INTEGER
, *PULARGE_INTEGER
;
1305 * Locally Unique Identifier
1308 typedef LARGE_INTEGER LUID
,*PLUID
;
1310 typedef struct _LUID_AND_ATTRIBUTES
{
1313 } LUID_AND_ATTRIBUTES
;
1319 typedef struct _PRIVILEGE_SET
{
1320 DWORD PrivilegeCount
;
1322 LUID_AND_ATTRIBUTES Privilege
[ANYSIZE_ARRAY
];
1323 } PRIVILEGE_SET
, *PPRIVILEGE_SET
;
1329 typedef struct _TOKEN_PRIVILEGES
{
1330 DWORD PrivilegeCount
;
1331 LUID_AND_ATTRIBUTES Privileges
[ANYSIZE_ARRAY
];
1332 } TOKEN_PRIVILEGES
, *PTOKEN_PRIVILEGES
;
1338 typedef struct _TOKEN_OWNER
{
1343 * TOKEN_PRIMARY_GROUP
1346 typedef struct _TOKEN_PRIMARY_GROUP
{
1348 } TOKEN_PRIMARY_GROUP
;
1352 * TOKEN_DEFAULT_DACL
1355 typedef struct _TOKEN_DEFAULT_DACL
{
1357 } TOKEN_DEFAULT_DACL
;
1363 typedef struct _TOKEN_SOURCE
{
1365 LUID SourceIdentifier
;
1372 typedef enum tagTOKEN_TYPE
{
1378 * SECURITY_IMPERSONATION_LEVEL
1381 typedef enum _SECURITY_IMPERSONATION_LEVEL
{
1383 SecurityIdentification
,
1384 SecurityImpersonation
,
1386 } SECURITY_IMPERSONATION_LEVEL
, *PSECURITY_IMPERSONATION_LEVEL
;
1389 typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE
,
1390 * PSECURITY_CONTEXT_TRACKING_MODE
;
1392 * Quality of Service
1395 typedef struct _SECURITY_QUALITY_OF_SERVICE
{
1397 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
;
1398 SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode
;
1400 } SECURITY_QUALITY_OF_SERVICE
, *PSECURITY_QUALITY_OF_SERVICE
;
1406 typedef struct _TOKEN_STATISTICS
{
1408 LUID AuthenticationId
;
1409 LARGE_INTEGER ExpirationTime
;
1410 TOKEN_TYPE TokenType
;
1411 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
;
1412 DWORD DynamicCharged
;
1413 DWORD DynamicAvailable
;
1415 DWORD PrivilegeCount
;
1423 #define ACL_REVISION 2
1425 #define ACL_REVISION1 1
1426 #define ACL_REVISION2 2
1428 /* ACEs, directly starting after an ACL */
1429 typedef struct _ACE_HEADER
{
1433 } ACE_HEADER
,*PACE_HEADER
;
1436 #define ACCESS_ALLOWED_ACE_TYPE 0
1437 #define ACCESS_DENIED_ACE_TYPE 1
1438 #define SYSTEM_AUDIT_ACE_TYPE 2
1439 #define SYSTEM_ALARM_ACE_TYPE 3
1441 /* inherit AceFlags */
1442 #define OBJECT_INHERIT_ACE 0x01
1443 #define CONTAINER_INHERIT_ACE 0x02
1444 #define NO_PROPAGATE_INHERIT_ACE 0x04
1445 #define INHERIT_ONLY_ACE 0x08
1446 #define VALID_INHERIT_FLAGS 0x0F
1448 /* AceFlags mask for what events we (should) audit */
1449 #define SUCCESSFUL_ACCESS_ACE_FLAG 0x40
1450 #define FAILED_ACCESS_ACE_FLAG 0x80
1452 /* different ACEs depending on AceType
1453 * SidStart marks the begin of a SID
1454 * so the thing finally looks like this:
1459 typedef struct _ACCESS_ALLOWED_ACE
{
1463 } ACCESS_ALLOWED_ACE
,*PACCESS_ALLOWED_ACE
;
1465 typedef struct _ACCESS_DENIED_ACE
{
1469 } ACCESS_DENIED_ACE
,*PACCESS_DENIED_ACE
;
1471 typedef struct _SYSTEM_AUDIT_ACE
{
1475 } SYSTEM_AUDIT_ACE
,*PSYSTEM_AUDIT_ACE
;
1477 typedef struct _SYSTEM_ALARM_ACE
{
1481 } SYSTEM_ALARM_ACE
,*PSYSTEM_ALARM_ACE
;
1483 typedef enum tagSID_NAME_USE
{
1488 SidTypeWellKnownGroup
,
1489 SidTypeDeletedAccount
,
1492 } SID_NAME_USE
,*PSID_NAME_USE
;
1496 #define DELETE 0x00010000
1497 #define READ_CONTROL 0x00020000
1498 #define WRITE_DAC 0x00040000
1499 #define WRITE_OWNER 0x00080000
1500 #define SYNCHRONIZE 0x00100000
1501 #define STANDARD_RIGHTS_REQUIRED 0x000f0000
1503 #define STANDARD_RIGHTS_READ READ_CONTROL
1504 #define STANDARD_RIGHTS_WRITE READ_CONTROL
1505 #define STANDARD_RIGHTS_EXECUTE READ_CONTROL
1507 #define STANDARD_RIGHTS_ALL 0x001f0000
1509 #define SPECIFIC_RIGHTS_ALL 0x0000ffff
1511 #define GENERIC_READ 0x80000000
1512 #define GENERIC_WRITE 0x40000000
1513 #define GENERIC_EXECUTE 0x20000000
1514 #define GENERIC_ALL 0x10000000
1516 #define MAXIMUM_ALLOWED 0x02000000
1517 #define ACCESS_SYSTEM_SECURITY 0x01000000
1519 #define EVENT_MODIFY_STATE 0x0002
1520 #define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
1522 #define SEMAPHORE_MODIFY_STATE 0x0002
1523 #define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
1525 #define MUTEX_MODIFY_STATE 0x0001
1526 #define MUTEX_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1)
1528 #define PROCESS_TERMINATE 0x0001
1529 #define PROCESS_CREATE_THREAD 0x0002
1530 #define PROCESS_VM_OPERATION 0x0008
1531 #define PROCESS_VM_READ 0x0010
1532 #define PROCESS_VM_WRITE 0x0020
1533 #define PROCESS_DUP_HANDLE 0x0040
1534 #define PROCESS_CREATE_PROCESS 0x0080
1535 #define PROCESS_SET_QUOTA 0x0100
1536 #define PROCESS_SET_INFORMATION 0x0200
1537 #define PROCESS_QUERY_INFORMATION 0x0400
1538 #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xfff)
1540 #define THREAD_TERMINATE 0x0001
1541 #define THREAD_SUSPEND_RESUME 0x0002
1542 #define THREAD_GET_CONTEXT 0x0008
1543 #define THREAD_SET_CONTEXT 0x0010
1544 #define THREAD_SET_INFORMATION 0x0020
1545 #define THREAD_QUERY_INFORMATION 0x0040
1546 #define THREAD_SET_THREAD_TOKEN 0x0080
1547 #define THREAD_IMPERSONATE 0x0100
1548 #define THREAD_DIRECT_IMPERSONATION 0x0200
1549 #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3ff)
1551 #define THREAD_BASE_PRIORITY_LOWRT 15
1552 #define THREAD_BASE_PRIORITY_MAX 2
1553 #define THREAD_BASE_PRIORITY_MIN -2
1554 #define THREAD_BASE_PRIORITY_IDLE -15
1556 #define FILE_READ_DATA 0x0001 /* file & pipe */
1557 #define FILE_LIST_DIRECTORY 0x0001 /* directory */
1558 #define FILE_WRITE_DATA 0x0002 /* file & pipe */
1559 #define FILE_ADD_FILE 0x0002 /* directory */
1560 #define FILE_APPEND_DATA 0x0004 /* file */
1561 #define FILE_ADD_SUBDIRECTORY 0x0004 /* directory */
1562 #define FILE_CREATE_PIPE_INSTANCE 0x0004 /* named pipe */
1563 #define FILE_READ_EA 0x0008 /* file & directory */
1564 #define FILE_READ_PROPERTIES FILE_READ_EA
1565 #define FILE_WRITE_EA 0x0010 /* file & directory */
1566 #define FILE_WRITE_PROPERTIES FILE_WRITE_EA
1567 #define FILE_EXECUTE 0x0020 /* file */
1568 #define FILE_TRAVERSE 0x0020 /* directory */
1569 #define FILE_DELETE_CHILD 0x0040 /* directory */
1570 #define FILE_READ_ATTRIBUTES 0x0080 /* all */
1571 #define FILE_WRITE_ATTRIBUTES 0x0100 /* all */
1572 #define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1ff)
1574 #define FILE_GENERIC_READ (STANDARD_RIGHTS_READ | FILE_READ_DATA | \
1575 FILE_READ_ATTRIBUTES | FILE_READ_EA | \
1577 #define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | \
1578 FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | \
1579 FILE_APPEND_DATA | SYNCHRONIZE)
1580 #define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE | FILE_EXECUTE | \
1581 FILE_READ_ATTRIBUTES | SYNCHRONIZE)
1584 /* File attribute flags
1586 #define FILE_SHARE_READ 0x00000001L
1587 #define FILE_SHARE_WRITE 0x00000002L
1588 #define FILE_SHARE_DELETE 0x00000004L
1589 #define FILE_ATTRIBUTE_READONLY 0x00000001L
1590 #define FILE_ATTRIBUTE_HIDDEN 0x00000002L
1591 #define FILE_ATTRIBUTE_SYSTEM 0x00000004L
1592 #define FILE_ATTRIBUTE_LABEL 0x00000008L /* Not in Windows API */
1593 #define FILE_ATTRIBUTE_DIRECTORY 0x00000010L
1594 #define FILE_ATTRIBUTE_ARCHIVE 0x00000020L
1595 #define FILE_ATTRIBUTE_NORMAL 0x00000080L
1596 #define FILE_ATTRIBUTE_TEMPORARY 0x00000100L
1597 #define FILE_ATTRIBUTE_ATOMIC_WRITE 0x00000200L
1598 #define FILE_ATTRIBUTE_XACTION_WRITE 0x00000400L
1599 #define FILE_ATTRIBUTE_COMPRESSED 0x00000800L
1600 #define FILE_ATTRIBUTE_OFFLINE 0x00001000L
1602 /* File alignments (NT) */
1603 #define FILE_BYTE_ALIGNMENT 0x00000000
1604 #define FILE_WORD_ALIGNMENT 0x00000001
1605 #define FILE_LONG_ALIGNMENT 0x00000003
1606 #define FILE_QUAD_ALIGNMENT 0x00000007
1607 #define FILE_OCTA_ALIGNMENT 0x0000000f
1608 #define FILE_32_BYTE_ALIGNMENT 0x0000001f
1609 #define FILE_64_BYTE_ALIGNMENT 0x0000003f
1610 #define FILE_128_BYTE_ALIGNMENT 0x0000007f
1611 #define FILE_256_BYTE_ALIGNMENT 0x000000ff
1612 #define FILE_512_BYTE_ALIGNMENT 0x000001ff
1614 /* Registry security values */
1615 #define OWNER_SECURITY_INFORMATION 0x00000001
1616 #define GROUP_SECURITY_INFORMATION 0x00000002
1617 #define DACL_SECURITY_INFORMATION 0x00000004
1618 #define SACL_SECURITY_INFORMATION 0x00000008
1620 #include "poppack.h"
1622 #endif /* __WINE_WINNT_H */