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 WCHAR TCHAR
, *PTCHAR
;
83 typedef LPWSTR PTSTR
, LPTSTR
;
84 typedef LPCWSTR PCTSTR
, LPCTSTR
;
85 #define __TEXT(string) L##string /*probably wrong */
87 typedef char TCHAR
, *PTCHAR
;
88 typedef LPSTR PTSTR
, LPTSTR
;
89 typedef LPCSTR PCTSTR
, LPCTSTR
;
90 #define __TEXT(string) string
93 #define TEXT(quote) __TEXT(quote)
96 typedef BOOLEAN
*PBOOLEAN
;
98 typedef struct _LIST_ENTRY
{
99 struct _LIST_ENTRY
*Flink
;
100 struct _LIST_ENTRY
*Blink
;
101 } LIST_ENTRY
, *PLIST_ENTRY
;
103 typedef struct _SINGLE_LIST_ENTRY
{
104 struct _SINGLE_LIST_ENTRY
*Next
;
105 } SINGLE_LIST_ENTRY
, *PSINGLE_LIST_ENTRY
;
109 #define HEAP_NO_SERIALIZE 0x00000001
110 #define HEAP_GROWABLE 0x00000002
111 #define HEAP_GENERATE_EXCEPTIONS 0x00000004
112 #define HEAP_ZERO_MEMORY 0x00000008
113 #define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010
114 #define HEAP_TAIL_CHECKING_ENABLED 0x00000020
115 #define HEAP_FREE_CHECKING_ENABLED 0x00000040
116 #define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080
117 #define HEAP_CREATE_ALIGN_16 0x00010000
118 #define HEAP_CREATE_ENABLE_TRACING 0x00020000
119 #define HEAP_WINE_SEGPTR 0x01000000 /* Not a Win32 flag */
120 #define HEAP_WINE_CODESEG 0x02000000 /* Not a Win32 flag */
121 #define HEAP_WINE_CODE16SEG 0x04000000 /* Not a Win32 flag */
122 #define HEAP_WINE_SHARED 0x08000000 /* Not a Win32 flag */
124 /* Processor feature flags. */
125 #define PF_FLOATING_POINT_PRECISION_ERRATA 0
126 #define PF_FLOATING_POINT_EMULATED 1
127 #define PF_COMPARE_EXCHANGE_DOUBLE 2
128 #define PF_MMX_INSTRUCTIONS_AVAILABLE 3
129 #define PF_PPC_MOVEMEM_64BIT_OK 4
130 #define PF_ALPHA_BYTE_INSTRUCTIONS 5
133 /* The Win32 register context */
135 /* CONTEXT is the CPU-dependent context; it should be used */
136 /* wherever a platform-specific context is needed (e.g. exception */
137 /* handling, Win32 register functions). */
139 /* CONTEXT86 is the i386-specific context; it should be used */
140 /* wherever only a 386 context makes sense (e.g. DOS interrupts, */
141 /* Win16 register functions), so that this code can be compiled */
142 /* on all platforms. */
144 #define SIZE_OF_80387_REGISTERS 80
146 typedef struct _FLOATING_SAVE_AREA
155 BYTE RegisterArea
[SIZE_OF_80387_REGISTERS
];
157 } FLOATING_SAVE_AREA
, *PFLOATING_SAVE_AREA
;
159 typedef struct _CONTEXT86
163 /* These are selected by CONTEXT_DEBUG_REGISTERS */
171 /* These are selected by CONTEXT_FLOATING_POINT */
172 FLOATING_SAVE_AREA FloatSave
;
174 /* These are selected by CONTEXT_SEGMENTS */
180 /* These are selected by CONTEXT_INTEGER */
188 /* These are selected by CONTEXT_CONTROL */
197 #define CONTEXT_X86 0x00010000
198 #define CONTEXT_i386 CONTEXT_X86
199 #define CONTEXT_i486 CONTEXT_X86
201 #define CONTEXT86_CONTROL (CONTEXT_i386 | 0x0001) /* SS:SP, CS:IP, FLAGS, BP */
202 #define CONTEXT86_INTEGER (CONTEXT_i386 | 0x0002) /* AX, BX, CX, DX, SI, DI */
203 #define CONTEXT86_SEGMENTS (CONTEXT_i386 | 0x0004) /* DS, ES, FS, GS */
204 #define CONTEXT86_FLOATING_POINT (CONTEXT_i386 | 0x0008L) /* 387 state */
205 #define CONTEXT86_DEBUG_REGISTERS (CONTEXT_i386 | 0x0010L) /* DB 0-3,6,7 */
206 #define CONTEXT86_FULL (CONTEXT86_CONTROL | CONTEXT86_INTEGER | CONTEXT86_SEGMENTS)
208 /* i386 context definitions */
211 #define CONTEXT_CONTROL CONTEXT86_CONTROL
212 #define CONTEXT_INTEGER CONTEXT86_INTEGER
213 #define CONTEXT_SEGMENTS CONTEXT86_SEGMENTS
214 #define CONTEXT_FLOATING_POINT CONTEXT86_FLOATING_POINT
215 #define CONTEXT_DEBUG_REGISTERS CONTEXT86_DEBUG_REGISTERS
216 #define CONTEXT_FULL CONTEXT86_FULL
218 typedef CONTEXT86 CONTEXT
;
220 #endif /* __i386__ */
222 /* Alpha context definitions */
225 #define CONTEXT_ALPHA 0x00020000
227 #define CONTEXT_CONTROL (CONTEXT_ALPHA | 0x00000001L)
228 #define CONTEXT_FLOATING_POINT (CONTEXT_ALPHA | 0x00000002L)
229 #define CONTEXT_INTEGER (CONTEXT_ALPHA | 0x00000004L)
230 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
232 typedef struct _CONTEXT
234 /* selected by CONTEXT_FLOATING_POINT */
268 /* selected by CONTEXT_INTEGER */
302 /* selected by CONTEXT_FLOATING_POINT */
306 /* selected by CONTEXT_CONTROL */
313 #define _QUAD_PSR_OFFSET HighSoftFpcr
314 #define _QUAD_FLAGS_OFFSET HighFir
318 /* Mips context definitions */
321 #define CONTEXT_R4000 0x00010000
323 #define CONTEXT_CONTROL (CONTEXT_R4000 | 0x00000001)
324 #define CONTEXT_FLOATING_POINT (CONTEXT_R4000 | 0x00000002)
325 #define CONTEXT_INTEGER (CONTEXT_R4000 | 0x00000004)
327 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
329 typedef struct _CONTEXT
332 /* These are selected by CONTEXT_FLOATING_POINT */
366 /* These are selected by CONTEXT_INTEGER */
402 /* These are selected by CONTEXT_FLOATING_POINT */
405 /* These are selected by CONTEXT_CONTROL */
415 /* PowerPC context definitions */
418 #define CONTEXT_CONTROL 0x0001
419 #define CONTEXT_FLOATING_POINT 0x0002
420 #define CONTEXT_INTEGER 0x0004
421 #define CONTEXT_DEBUG_REGISTERS 0x0008
422 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
426 /* These are selected by CONTEXT_FLOATING_POINT */
461 /* These are selected by CONTEXT_INTEGER */
498 /* These are selected by CONTEXT_CONTROL */
507 /* These are selected by CONTEXT_DEBUG_REGISTERS */
518 typedef struct _STACK_FRAME_HEADER
535 } STACK_FRAME_HEADER
,*PSTACK_FRAME_HEADER
;
544 * There is no official CONTEXT structure defined for the SPARC
545 * architecture, so I just made one up.
547 * This structure is valid only for 32-bit SPARC architectures,
548 * not for 64-bit SPARC.
550 * Note that this structure contains only the 'top-level' registers;
551 * the rest of the register window chain is not visible.
553 * The layout follows the Solaris 'prgregset_t' structure.
557 #define CONTEXT_SPARC 0x10000000
559 #define CONTEXT_CONTROL (CONTEXT_SPARC | 0x00000001)
560 #define CONTEXT_FLOATING_POINT (CONTEXT_SPARC | 0x00000002)
561 #define CONTEXT_INTEGER (CONTEXT_SPARC | 0x00000004)
563 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
565 typedef struct _CONTEXT
569 /* These are selected by CONTEXT_INTEGER */
603 /* These are selected by CONTEXT_CONTROL */
611 /* FIXME: floating point registers missing */
615 #endif /* __sparc__ */
617 #if !defined(CONTEXT_FULL) && !defined(RC_INVOKED)
618 #error You need to define a CONTEXT for your CPU
621 typedef CONTEXT
*PCONTEXT
;
622 typedef HANDLE
*PHANDLE
;
626 /* Macros for easier access to i386 context registers */
628 #define EAX_reg(context) ((context)->Eax)
629 #define EBX_reg(context) ((context)->Ebx)
630 #define ECX_reg(context) ((context)->Ecx)
631 #define EDX_reg(context) ((context)->Edx)
632 #define ESI_reg(context) ((context)->Esi)
633 #define EDI_reg(context) ((context)->Edi)
634 #define EBP_reg(context) ((context)->Ebp)
636 #define CS_reg(context) ((context)->SegCs)
637 #define DS_reg(context) ((context)->SegDs)
638 #define ES_reg(context) ((context)->SegEs)
639 #define FS_reg(context) ((context)->SegFs)
640 #define GS_reg(context) ((context)->SegGs)
641 #define SS_reg(context) ((context)->SegSs)
643 #define EFL_reg(context) ((context)->EFlags)
644 #define EIP_reg(context) ((context)->Eip)
645 #define ESP_reg(context) ((context)->Esp)
647 #define AX_reg(context) (*(WORD*)&EAX_reg(context))
648 #define BX_reg(context) (*(WORD*)&EBX_reg(context))
649 #define CX_reg(context) (*(WORD*)&ECX_reg(context))
650 #define DX_reg(context) (*(WORD*)&EDX_reg(context))
651 #define SI_reg(context) (*(WORD*)&ESI_reg(context))
652 #define DI_reg(context) (*(WORD*)&EDI_reg(context))
653 #define BP_reg(context) (*(WORD*)&EBP_reg(context))
655 #define AL_reg(context) (*(BYTE*)&EAX_reg(context))
656 #define AH_reg(context) (*((BYTE*)&EAX_reg(context)+1))
657 #define BL_reg(context) (*(BYTE*)&EBX_reg(context))
658 #define BH_reg(context) (*((BYTE*)&EBX_reg(context)+1))
659 #define CL_reg(context) (*(BYTE*)&ECX_reg(context))
660 #define CH_reg(context) (*((BYTE*)&ECX_reg(context)+1))
661 #define DL_reg(context) (*(BYTE*)&EDX_reg(context))
662 #define DH_reg(context) (*((BYTE*)&EDX_reg(context)+1))
664 #define SET_CFLAG(context) (EFL_reg(context) |= 0x0001)
665 #define RESET_CFLAG(context) (EFL_reg(context) &= ~0x0001)
666 #define SET_ZFLAG(context) (EFL_reg(context) |= 0x0040)
667 #define RESET_ZFLAG(context) (EFL_reg(context) &= ~0x0040)
669 #define ISV86(context) (EFL_reg(context) & 0x00020000)
670 #define V86BASE(context) ((context)->Dr7) /* ugly */
673 /* Macros to retrieve the current context */
677 #ifdef NEED_UNDERSCORE_PREFIX
678 # define __ASM_NAME(name) "_" name
680 # define __ASM_NAME(name) name
684 # define __ASM_GLOBAL_FUNC(name,code) \
685 __asm__( ".align 4\n\t" \
686 ".globl " __ASM_NAME(#name) "\n\t" \
687 ".type " __ASM_NAME(#name) ",@function\n" \
688 __ASM_NAME(#name) ":\n\t" \
691 # define __ASM_GLOBAL_FUNC(name,code) \
692 void __asm_dummy_##name(void) { \
693 asm( ".align 4\n\t" \
694 ".globl " __ASM_NAME(#name) "\n\t" \
695 ".type " __ASM_NAME(#name) ",@function\n" \
696 __ASM_NAME(#name) ":\n\t" \
699 #endif /* __GNUC__ */
701 #define _DEFINE_REGS_ENTRYPOINT( name, fn, args ) \
702 __ASM_GLOBAL_FUNC( name, \
703 "call " __ASM_NAME("CALL32_Regs") "\n\t" \
704 ".long " __ASM_NAME(#fn) "\n\t" \
705 ".byte " #args ", " #args )
706 #define DEFINE_REGS_ENTRYPOINT_0( name, fn ) \
707 _DEFINE_REGS_ENTRYPOINT( name, fn, 0 )
708 #define DEFINE_REGS_ENTRYPOINT_1( name, fn, t1 ) \
709 _DEFINE_REGS_ENTRYPOINT( name, fn, 4 )
710 #define DEFINE_REGS_ENTRYPOINT_2( name, fn, t1, t2 ) \
711 _DEFINE_REGS_ENTRYPOINT( name, fn, 8 )
712 #define DEFINE_REGS_ENTRYPOINT_3( name, fn, t1, t2, t3 ) \
713 _DEFINE_REGS_ENTRYPOINT( name, fn, 12 )
714 #define DEFINE_REGS_ENTRYPOINT_4( name, fn, t1, t2, t3, t4 ) \
715 _DEFINE_REGS_ENTRYPOINT( name, fn, 16 )
717 #endif /* __i386__ */
720 /* FIXME: use getcontext() to retrieve full context */
721 #define _GET_CONTEXT \
723 do { memset(&context, 0, sizeof(CONTEXT)); \
724 context.ContextFlags = CONTEXT_CONTROL; \
725 context.pc = (DWORD)__builtin_return_address(0); \
728 #define DEFINE_REGS_ENTRYPOINT_0( name, fn ) \
729 void WINAPI name ( void ) \
730 { _GET_CONTEXT; fn( &context ); }
731 #define DEFINE_REGS_ENTRYPOINT_1( name, fn, t1 ) \
732 void WINAPI name ( t1 a1 ) \
733 { _GET_CONTEXT; fn( a1, &context ); }
734 #define DEFINE_REGS_ENTRYPOINT_2( name, fn, t1, t2 ) \
735 void WINAPI name ( t1 a1, t2 a2 ) \
736 { _GET_CONTEXT; fn( a1, a2, &context ); }
737 #define DEFINE_REGS_ENTRYPOINT_3( name, fn, t1, t2, t3 ) \
738 void WINAPI name ( t1 a1, t2 a2, t3 a3 ) \
739 { _GET_CONTEXT; fn( a1, a2, a3, &context ); }
740 #define DEFINE_REGS_ENTRYPOINT_4( name, fn, t1, t2, t3, t4 ) \
741 void WINAPI name ( t1 a1, t2 a2, t3 a3, t4 a4 ) \
742 { _GET_CONTEXT; fn( a1, a2, a3, a4, &context ); }
744 #endif /* __sparc__ */
746 #ifndef DEFINE_REGS_ENTRYPOINT_0
747 #error You need to define DEFINE_REGS_ENTRYPOINT macros for your CPU
751 # define GET_IP(context) ((LPVOID)(context)->Eip)
754 # define GET_IP(context) ((LPVOID)(context)->pc)
757 #if !defined(GET_IP) && !defined(RC_INVOKED)
758 # error You must define GET_IP for this CPU
761 #endif /* __WINE__ */
767 #define STATUS_SUCCESS 0x00000000
768 #define STATUS_WAIT_0 0x00000000
769 #define STATUS_ABANDONED_WAIT_0 0x00000080
770 #define STATUS_USER_APC 0x000000C0
771 #define STATUS_TIMEOUT 0x00000102
772 #define STATUS_PENDING 0x00000103
774 #define STATUS_GUARD_PAGE_VIOLATION 0x80000001
775 #define STATUS_DATATYPE_MISALIGNMENT 0x80000002
776 #define STATUS_BREAKPOINT 0x80000003
777 #define STATUS_SINGLE_STEP 0x80000004
778 #define STATUS_BUFFER_OVERFLOW 0x80000005
779 #define STATUS_NO_MORE_FILES 0x80000006
780 #define STATUS_WAKE_SYSTEM_DEBUGGER 0x80000007
782 #define STATUS_HANDLES_CLOSED 0x8000000A
783 #define STATUS_NO_INHERITANCE 0x8000000B
784 #define STATUS_GUID_SUBSTITUTION_MADE 0x8000000C
785 #define STATUS_PARTIAL_COPY 0x8000000D
786 #define STATUS_DEVICE_PAPER_EMPTY 0x8000000E
787 #define STATUS_DEVICE_POWERED_OFF 0x8000000F
788 #define STATUS_DEVICE_OFF_LINE 0x80000010
789 #define STATUS_DEVICE_BUSY 0x80000011
790 #define STATUS_NO_MORE_EAS 0x80000012
791 #define STATUS_INVALID_EA_NAME 0x80000013
792 #define STATUS_EA_LIST_INCONSISTENT 0x80000014
793 #define STATUS_INVALID_EA_FLAG 0x80000015
794 #define STATUS_VERIFY_REQUIRED 0x80000016
795 #define STATUS_EXTRANEOUS_INFORMATION 0x80000017
796 #define STATUS_RXACT_COMMIT_NECESSARY 0x80000018
797 #define STATUS_NO_MORE_ENTRIES 0x8000001A
798 #define STATUS_FILEMARK_DETECTED 0x8000001B
799 #define STATUS_MEDIA_CHANGED 0x8000001C
800 #define STATUS_BUS_RESET 0x8000001D
801 #define STATUS_END_OF_MEDIA 0x8000001E
802 #define STATUS_BEGINNING_OF_MEDIA 0x8000001F
803 #define STATUS_MEDIA_CHECK 0x80000020
804 #define STATUS_SETMARK_DETECTED 0x80000021
805 #define STATUS_NO_DATA_DETECTED 0x80000022
806 #define STATUS_REDIRECTOR_HAS_OPEN_HANDLES 0x80000023
807 #define STATUS_SERVER_HAS_OPEN_HANDLES 0x80000024
808 #define STATUS_ALREADY_DISCONNECTED 0x80000025
809 #define STATUS_LONGJUMP 0x80000026
811 #define STATUS_UNSUCCESSFUL 0xC0000001
812 #define STATUS_NOT_IMPLEMENTED 0xC0000002
813 #define STATUS_INVALID_INFO_CLASS 0xC0000003
814 #define STATUS_INFO_LENGTH_MISMATCH 0xC0000004
815 #define STATUS_ACCESS_VIOLATION 0xC0000005
816 #define STATUS_IN_PAGE_ERROR 0xC0000006
817 #define STATUS_PAGEFILE_QUOTA 0xC0000007
818 #define STATUS_INVALID_HANDLE 0xC0000008
819 #define STATUS_BAD_INITIAL_STACK 0xC0000009
820 #define STATUS_BAD_INITIAL_PC 0xC000000A
821 #define STATUS_INVALID_CID 0xC000000B
822 #define STATUS_TIMER_NOT_CANCELED 0xC000000C
823 #define STATUS_INVALID_PARAMETER 0xC000000D
824 #define STATUS_NO_SUCH_DEVICE 0xC000000E
825 #define STATUS_NO_SUCH_FILE 0xC000000F
826 #define STATUS_INVALID_DEVICE_REQUEST 0xC0000010
827 #define STATUS_END_OF_FILE 0xC0000011
828 #define STATUS_WRONG_VOLUME 0xC0000012
829 #define STATUS_NO_MEDIA_IN_DEVICE 0xC0000013
830 #define STATUS_UNRECOGNIZED_MEDIA 0xC0000014
831 #define STATUS_NONEXISTENT_SECTOR 0xC0000015
832 #define STATUS_MORE_PROCESSING_REQUIRED 0xC0000016
833 #define STATUS_NO_MEMORY 0xC0000017
834 #define STATUS_CONFLICTING_ADDRESSES 0xC0000018
835 #define STATUS_NOT_MAPPED_VIEW 0xC0000019
836 #define STATUS_UNABLE_TO_FREE_VM 0xC000001A
837 #define STATUS_UNABLE_TO_DELETE_SECTION 0xC000001B
838 #define STATUS_INVALID_SYSTEM_SERVICE 0xC000001C
839 #define STATUS_ILLEGAL_INSTRUCTION 0xC000001D
840 #define STATUS_INVALID_LOCK_SEQUENCE 0xC000001E
841 #define STATUS_INVALID_VIEW_SIZE 0xC000001F
842 #define STATUS_INVALID_FILE_FOR_SECTION 0xC0000020
843 #define STATUS_ALREADY_COMMITTED 0xC0000021
844 #define STATUS_ACCESS_DENIED 0xC0000022
845 #define STATUS_BUFFER_TOO_SMALL 0xC0000023
846 #define STATUS_OBJECT_TYPE_MISMATCH 0xC0000024
847 #define STATUS_NONCONTINUABLE_EXCEPTION 0xC0000025
848 #define STATUS_INVALID_DISPOSITION 0xC0000026
849 #define STATUS_UNWIND 0xC0000027
850 #define STATUS_BAD_STACK 0xC0000028
851 #define STATUS_INVALID_UNWIND_TARGET 0xC0000029
852 #define STATUS_NOT_LOCKED 0xC000002A
853 #define STATUS_PARITY_ERROR 0xC000002B
854 #define STATUS_UNABLE_TO_DECOMMIT_VM 0xC000002C
855 #define STATUS_NOT_COMMITTED 0xC000002D
856 #define STATUS_INVALID_PORT_ATTRIBUTES 0xC000002E
857 #define STATUS_PORT_MESSAGE_TOO_LONG 0xC000002F
858 #define STATUS_INVALID_PARAMETER_MIX 0xC0000030
859 #define STATUS_INVALID_QUOTA_LOWER 0xC0000031
860 #define STATUS_DISK_CORRUPT_ERROR 0xC0000032
861 #define STATUS_OBJECT_NAME_INVALID 0xC0000033
862 #define STATUS_OBJECT_NAME_NOT_FOUND 0xC0000034
863 #define STATUS_OBJECT_NAME_COLLISION 0xC0000035
864 #define STATUS_PORT_DISCONNECTED 0xC0000037
865 #define STATUS_DEVICE_ALREADY_ATTACHED 0xC0000038
866 #define STATUS_OBJECT_PATH_INVALID 0xC0000039
867 #define STATUS_OBJECT_PATH_NOT_FOUND 0xC000003A
868 #define STATUS_PATH_SYNTAX_BAD 0xC000003B
869 #define STATUS_DATA_OVERRUN 0xC000003C
870 #define STATUS_DATA_LATE_ERROR 0xC000003D
871 #define STATUS_DATA_ERROR 0xC000003E
872 #define STATUS_CRC_ERROR 0xC000003F
873 #define STATUS_SECTION_TOO_BIG 0xC0000040
874 #define STATUS_PORT_CONNECTION_REFUSED 0xC0000041
875 #define STATUS_INVALID_PORT_HANDLE 0xC0000042
876 #define STATUS_SHARING_VIOLATION 0xC0000043
877 #define STATUS_QUOTA_EXCEEDED 0xC0000044
878 #define STATUS_INVALID_PAGE_PROTECTION 0xC0000045
879 #define STATUS_MUTANT_NOT_OWNED 0xC0000046
880 #define STATUS_SEMAPHORE_LIMIT_EXCEEDED 0xC0000047
881 #define STATUS_PORT_ALREADY_SET 0xC0000048
882 #define STATUS_SUSPEND_COUNT_EXCEEDED 0xC000004A
883 #define STATUS_LOCK_NOT_GRANTED 0xC0000054 /* FIXME: not sure */
884 #define STATUS_FILE_LOCK_CONFLICT 0xC0000055 /* FIXME: not sure */
885 #define STATUS_UNKNOWN_REVISION 0xC0000058
886 #define STATUS_INVALID_SECURITY_DESCR 0xC0000079
887 #define STATUS_DISK_FULL 0xC000007F
888 #define STATUS_SECTION_NOT_EXTENDED 0xC0000087
889 #define STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008C
890 #define STATUS_FLOAT_DENORMAL_OPERAND 0xC000008D
891 #define STATUS_FLOAT_DIVIDE_BY_ZERO 0xC000008E
892 #define STATUS_FLOAT_INEXACT_RESULT 0xC000008F
893 #define STATUS_FLOAT_INVALID_OPERATION 0xC0000090
894 #define STATUS_FLOAT_OVERFLOW 0xC0000091
895 #define STATUS_FLOAT_STACK_CHECK 0xC0000092
896 #define STATUS_FLOAT_UNDERFLOW 0xC0000093
897 #define STATUS_INTEGER_DIVIDE_BY_ZERO 0xC0000094
898 #define STATUS_INTEGER_OVERFLOW 0xC0000095
899 #define STATUS_PRIVILEGED_INSTRUCTION 0xC0000096
900 #define STATUS_MEDIA_WRITE_PROTECTED 0XC00000A2
901 #define STATUS_INVALID_PARAMETER_2 0xC00000F0
902 #define STATUS_STACK_OVERFLOW 0xC00000FD
903 #define STATUS_DIRECTORY_NOT_EMPTY 0xC0000101
904 #define STATUS_TOO_MANY_OPENED_FILES 0xC000011F
905 #define STATUS_CONTROL_C_EXIT 0xC000013A
906 #define STATUS_PIPE_BROKEN 0xC000014B
907 #define STATUS_NOT_REGISTRY_FILE 0xC000015C
908 #define STATUS_PARTITION_FAILURE 0xC0000172
909 #define STATUS_INVALID_BLOCK_LENGTH 0xC0000173
910 #define STATUS_DEVICE_NOT_PARTITIONED 0xC0000174
911 #define STATUS_UNABLE_TO_LOCK_MEDIA 0xC0000175
912 #define STATUS_UNABLE_TO_UNLOAD_MEDIA 0xC0000176
913 #define STATUS_EOM_OVERFLOW 0xC0000177
914 #define STATUS_NO_MEDIA 0xC0000178
915 #define STATUS_NO_SUCH_MEMBER 0xC000017A
916 #define STATUS_INVALID_MEMBER 0xC000017B
917 #define STATUS_KEY_DELETED 0xC000017C
918 #define STATUS_NO_LOG_SPACE 0xC000017D
919 #define STATUS_TOO_MANY_SIDS 0xC000017E
920 #define STATUS_LM_CROSS_ENCRYPTION_REQUIRED 0xC000017F
921 #define STATUS_KEY_HAS_CHILDREN 0xC0000180
922 #define STATUS_CHILD_MUST_BE_VOLATILE 0xC0000181
923 #define STATUS_DEVICE_CONFIGURATION_ERROR0xC0000182
924 #define STATUS_DRIVER_INTERNAL_ERROR 0xC0000183
925 #define STATUS_INVALID_DEVICE_STATE 0xC0000184
926 #define STATUS_IO_DEVICE_ERROR 0xC0000185
927 #define STATUS_DEVICE_PROTOCOL_ERROR 0xC0000186
928 #define STATUS_BACKUP_CONTROLLER 0xC0000187
929 #define STATUS_LOG_FILE_FULL 0xC0000188
930 #define STATUS_TOO_LATE 0xC0000189
931 #define STATUS_NO_TRUST_LSA_SECRET 0xC000018A
932 #define STATUS_NO_TRUST_SAM_ACCOUNT 0xC000018B
933 #define STATUS_TRUSTED_DOMAIN_FAILURE 0xC000018C
934 #define STATUS_TRUSTED_RELATIONSHIP_FAILURE 0xC000018D
935 #define STATUS_EVENTLOG_FILE_CORRUPT 0xC000018E
936 #define STATUS_EVENTLOG_CANT_START 0xC000018F
937 #define STATUS_TRUST_FAILURE 0xC0000190
938 #define STATUS_MUTANT_LIMIT_EXCEEDED 0xC0000191
939 #define STATUS_NETLOGON_NOT_STARTED 0xC0000192
940 #define STATUS_ACCOUNT_EXPIRED 0xC0000193
941 #define STATUS_POSSIBLE_DEADLOCK 0xC0000194
942 #define STATUS_NETWORK_CREDENTIAL_CONFLICT 0xC0000195
943 #define STATUS_REMOTE_SESSION_LIMIT 0xC0000196
944 #define STATUS_EVENTLOG_FILE_CHANGED 0xC0000197
945 #define STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT 0xC0000198
946 #define STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT 0xC0000199
947 #define STATUS_NOLOGON_SERVER_TRUST_ACCOUNT 0xC000019A
948 #define STATUS_DOMAIN_TRUST_INCONSISTENT 0xC000019B
949 #define STATUS_FS_DRIVER_REQUIRED 0xC000019C
951 #define STATUS_RESOURCE_LANG_NOT_FOUND 0xC0000204
953 #define MAXIMUM_WAIT_OBJECTS 64
954 #define MAXIMUM_SUSPEND_COUNT 127
958 * Return values from the actual exception handlers
961 #define ExceptionContinueExecution 0
962 #define ExceptionContinueSearch 1
963 #define ExceptionNestedException 2
964 #define ExceptionCollidedUnwind 3
967 * Return values from filters in except() and from UnhandledExceptionFilter
970 #define EXCEPTION_EXECUTE_HANDLER 1
971 #define EXCEPTION_CONTINUE_SEARCH 0
972 #define EXCEPTION_CONTINUE_EXECUTION -1
975 * From OS/2 2.0 exception handling
976 * Win32 seems to use the same flags as ExceptionFlags in an EXCEPTION_RECORD
979 #define EH_NONCONTINUABLE 0x01
980 #define EH_UNWINDING 0x02
981 #define EH_EXIT_UNWIND 0x04
982 #define EH_STACK_INVALID 0x08
983 #define EH_NESTED_CALL 0x10
985 #define EXCEPTION_CONTINUABLE 0
986 #define EXCEPTION_NONCONTINUABLE EH_NONCONTINUABLE
989 * The exception record used by Win32 to give additional information
990 * about exception to exception handlers.
993 #define EXCEPTION_MAXIMUM_PARAMETERS 15
995 typedef struct __EXCEPTION_RECORD
998 DWORD ExceptionFlags
;
999 struct __EXCEPTION_RECORD
*ExceptionRecord
;
1001 LPVOID ExceptionAddress
;
1002 DWORD NumberParameters
;
1003 DWORD ExceptionInformation
[EXCEPTION_MAXIMUM_PARAMETERS
];
1004 } EXCEPTION_RECORD
, *PEXCEPTION_RECORD
;
1007 * The exception pointers structure passed to exception filters
1008 * in except() and the UnhandledExceptionFilter().
1011 typedef struct _EXCEPTION_POINTERS
1013 PEXCEPTION_RECORD ExceptionRecord
;
1014 PCONTEXT ContextRecord
;
1015 } EXCEPTION_POINTERS
, *PEXCEPTION_POINTERS
;
1019 * The exception frame, used for registering exception handlers
1020 * Win32 cares only about this, but compilers generally emit
1021 * larger exception frames for their own use.
1024 struct __EXCEPTION_FRAME
;
1026 typedef DWORD (*PEXCEPTION_HANDLER
)(PEXCEPTION_RECORD
,struct __EXCEPTION_FRAME
*,
1027 PCONTEXT
,struct __EXCEPTION_FRAME
**);
1029 typedef struct __EXCEPTION_FRAME
1031 struct __EXCEPTION_FRAME
*Prev
;
1032 PEXCEPTION_HANDLER Handler
;
1033 } EXCEPTION_FRAME
, *PEXCEPTION_FRAME
;
1035 #include "poppack.h"
1038 * function pointer to a exception filter
1041 typedef LONG (CALLBACK
*PTOP_LEVEL_EXCEPTION_FILTER
)(PEXCEPTION_POINTERS ExceptionInfo
);
1042 typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER
;
1044 DWORD WINAPI
UnhandledExceptionFilter( PEXCEPTION_POINTERS epointers
);
1045 LPTOP_LEVEL_EXCEPTION_FILTER
1046 WINAPI
SetUnhandledExceptionFilter( LPTOP_LEVEL_EXCEPTION_FILTER filter
);
1048 /* status values for ContinueDebugEvent */
1049 #define DBG_CONTINUE 0x00010002
1050 #define DBG_TERMINATE_THREAD 0x40010003
1051 #define DBG_TERMINATE_PROCESS 0x40010004
1052 #define DBG_CONTROL_C 0x40010005
1053 #define DBG_CONTROL_BREAK 0x40010008
1054 #define DBG_EXCEPTION_NOT_HANDLED 0x80010001
1056 typedef struct _NT_TIB
1058 struct _EXCEPTION_REGISTRATION_RECORD
*ExceptionList
;
1066 PVOID ArbitraryUserPointer
;
1067 struct _NT_TIB
*Self
;
1072 #if defined(__i386__) && defined(__GNUC__)
1073 extern inline struct _TEB
* WINAPI
NtCurrentTeb(void);
1074 extern inline struct _TEB
* WINAPI
NtCurrentTeb(void)
1077 __asm__(".byte 0x64\n\tmovl (0x18),%0" : "=r" (teb
));
1081 extern struct _TEB
* WINAPI
NtCurrentTeb(void);
1085 * Here follows typedefs for security and tokens.
1089 * First a constant for the following typdefs.
1092 #define ANYSIZE_ARRAY 1
1094 /* FIXME: Orphan. What does it point to? */
1095 typedef PVOID PACCESS_TOKEN
;
1098 * TOKEN_INFORMATION_CLASS
1101 typedef enum _TOKEN_INFORMATION_CLASS
{
1110 TokenImpersonationLevel
,
1112 } TOKEN_INFORMATION_CLASS
;
1114 #ifndef _SECURITY_DEFINED
1115 #define _SECURITY_DEFINED
1117 #include "pshpack1.h"
1119 typedef DWORD ACCESS_MASK
, *PACCESS_MASK
;
1121 typedef struct _GENERIC_MAPPING
{
1122 ACCESS_MASK GenericRead
;
1123 ACCESS_MASK GenericWrite
;
1124 ACCESS_MASK GenericExecute
;
1125 ACCESS_MASK GenericAll
;
1126 } GENERIC_MAPPING
, *PGENERIC_MAPPING
;
1128 #ifndef SID_IDENTIFIER_AUTHORITY_DEFINED
1129 #define SID_IDENTIFIER_AUTHORITY_DEFINED
1132 } SID_IDENTIFIER_AUTHORITY
,*PSID_IDENTIFIER_AUTHORITY
,*LPSID_IDENTIFIER_AUTHORITY
;
1133 #endif /* !defined(SID_IDENTIFIER_AUTHORITY_DEFINED) */
1137 typedef struct _SID
{
1139 BYTE SubAuthorityCount
;
1140 SID_IDENTIFIER_AUTHORITY IdentifierAuthority
;
1141 DWORD SubAuthority
[1];
1143 #endif /* !defined(SID_DEFINED) */
1145 #define SID_REVISION (1) /* Current revision */
1146 #define SID_MAX_SUB_AUTHORITIES (15) /* current max subauths */
1147 #define SID_RECOMMENDED_SUB_AUTHORITIES (1) /* recommended subauths */
1154 #define ACL_REVISION1 1
1155 #define ACL_REVISION2 2
1156 #define ACL_REVISION3 3
1157 #define ACL_REVISION4 4
1159 #define MIN_ACL_REVISION ACL_REVISION2
1160 #define MAX_ACL_REVISION ACL_REVISION4
1162 typedef struct _ACL
{
1170 /* SECURITY_DESCRIPTOR */
1171 #define SECURITY_DESCRIPTOR_REVISION 1
1172 #define SECURITY_DESCRIPTOR_REVISION1 1
1175 #define SE_OWNER_DEFAULTED 0x0001
1176 #define SE_GROUP_DEFAULTED 0x0002
1177 #define SE_DACL_PRESENT 0x0004
1178 #define SE_DACL_DEFAULTED 0x0008
1179 #define SE_SACL_PRESENT 0x0010
1180 #define SE_SACL_DEFAULTED 0x0020
1181 #define SE_SELF_RELATIVE 0x8000
1183 typedef DWORD SECURITY_INFORMATION
, *PSECURITY_INFORMATION
;
1184 typedef WORD SECURITY_DESCRIPTOR_CONTROL
, *PSECURITY_DESCRIPTOR_CONTROL
;
1186 /* The security descriptor structure */
1190 SECURITY_DESCRIPTOR_CONTROL Control
;
1195 } SECURITY_DESCRIPTOR_RELATIVE
, *PISECURITY_DESCRIPTOR_RELATIVE
;
1200 SECURITY_DESCRIPTOR_CONTROL Control
;
1205 } SECURITY_DESCRIPTOR
, *PSECURITY_DESCRIPTOR
;
1207 #define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR))
1209 #include "poppack.h"
1211 #endif /* _SECURITY_DEFINED */
1213 #include "pshpack1.h"
1216 * SID_AND_ATTRIBUTES
1219 typedef struct _SID_AND_ATTRIBUTES
{
1222 } SID_AND_ATTRIBUTES
;
1224 /* security entities */
1225 #define SECURITY_NULL_RID (0x00000000L)
1226 #define SECURITY_WORLD_RID (0x00000000L)
1227 #define SECURITY_LOCAL_RID (0X00000000L)
1229 #define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0}
1232 #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
1235 #define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2}
1238 #define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3}
1239 #define SECURITY_CREATOR_OWNER_RID (0x00000000L)
1240 #define SECURITY_CREATOR_GROUP_RID (0x00000001L)
1241 #define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L)
1242 #define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L)
1245 #define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4}
1248 #define SECURITY_NT_AUTHORITY {0,0,0,0,0,5}
1249 #define SECURITY_DIALUP_RID 0x00000001L
1250 #define SECURITY_NETWORK_RID 0x00000002L
1251 #define SECURITY_BATCH_RID 0x00000003L
1252 #define SECURITY_INTERACTIVE_RID 0x00000004L
1253 #define SECURITY_LOGON_IDS_RID 0x00000005L
1254 #define SECURITY_SERVICE_RID 0x00000006L
1255 #define SECURITY_ANONYMOUS_LOGON_RID 0x00000007L
1256 #define SECURITY_PROXY_RID 0x00000008L
1257 #define SECURITY_ENTERPRISE_CONTROLLERS_RID 0x00000009L
1258 #define SECURITY_PRINCIPAL_SELF_RID 0x0000000AL
1259 #define SECURITY_AUTHENTICATED_USER_RID 0x0000000BL
1260 #define SECURITY_RESTRICTED_CODE_RID 0x0000000CL
1261 #define SECURITY_TERMINAL_SERVER_RID 0x0000000DL
1262 #define SECURITY_LOCAL_SYSTEM_RID 0x00000012L
1263 #define SECURITY_NT_NON_UNIQUE 0x00000015L
1264 #define SECURITY_BUILTIN_DOMAIN_RID 0x00000020L
1266 #define DOMAIN_GROUP_RID_ADMINS 0x00000200L
1267 #define DOMAIN_GROUP_RID_USERS 0x00000201L
1268 #define DOMAIN_GROUP_RID_GUESTS 0x00000202L
1270 #define DOMAIN_ALIAS_RID_ADMINS 0x00000220L
1271 #define DOMAIN_ALIAS_RID_USERS 0x00000221L
1272 #define DOMAIN_ALIAS_RID_GUESTS 0x00000222L
1274 #define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID
1276 #define SECURITY_LOGON_IDS_RID_COUNT (3L)
1282 typedef struct _TOKEN_USER
{
1283 SID_AND_ATTRIBUTES User
;
1290 typedef struct _TOKEN_GROUPS
{
1292 SID_AND_ATTRIBUTES Groups
[ANYSIZE_ARRAY
];
1296 * LUID_AND_ATTRIBUTES
1299 typedef union _LARGE_INTEGER
{
1305 } LARGE_INTEGER
, *LPLARGE_INTEGER
, *PLARGE_INTEGER
;
1307 typedef union _ULARGE_INTEGER
{
1313 } ULARGE_INTEGER
, *LPULARGE_INTEGER
, *PULARGE_INTEGER
;
1316 * Locally Unique Identifier
1319 typedef LARGE_INTEGER LUID
,*PLUID
;
1321 typedef struct _LUID_AND_ATTRIBUTES
{
1324 } LUID_AND_ATTRIBUTES
;
1330 typedef struct _PRIVILEGE_SET
{
1331 DWORD PrivilegeCount
;
1333 LUID_AND_ATTRIBUTES Privilege
[ANYSIZE_ARRAY
];
1334 } PRIVILEGE_SET
, *PPRIVILEGE_SET
;
1340 typedef struct _TOKEN_PRIVILEGES
{
1341 DWORD PrivilegeCount
;
1342 LUID_AND_ATTRIBUTES Privileges
[ANYSIZE_ARRAY
];
1343 } TOKEN_PRIVILEGES
, *PTOKEN_PRIVILEGES
;
1349 typedef struct _TOKEN_OWNER
{
1354 * TOKEN_PRIMARY_GROUP
1357 typedef struct _TOKEN_PRIMARY_GROUP
{
1359 } TOKEN_PRIMARY_GROUP
;
1363 * TOKEN_DEFAULT_DACL
1366 typedef struct _TOKEN_DEFAULT_DACL
{
1368 } TOKEN_DEFAULT_DACL
;
1374 typedef struct _TOKEN_SOURCE
{
1376 LUID SourceIdentifier
;
1383 typedef enum tagTOKEN_TYPE
{
1389 * SECURITY_IMPERSONATION_LEVEL
1392 typedef enum _SECURITY_IMPERSONATION_LEVEL
{
1394 SecurityIdentification
,
1395 SecurityImpersonation
,
1397 } SECURITY_IMPERSONATION_LEVEL
, *PSECURITY_IMPERSONATION_LEVEL
;
1400 typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE
,
1401 * PSECURITY_CONTEXT_TRACKING_MODE
;
1403 * Quality of Service
1406 typedef struct _SECURITY_QUALITY_OF_SERVICE
{
1408 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
;
1409 SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode
;
1411 } SECURITY_QUALITY_OF_SERVICE
, *PSECURITY_QUALITY_OF_SERVICE
;
1417 typedef struct _TOKEN_STATISTICS
{
1419 LUID AuthenticationId
;
1420 LARGE_INTEGER ExpirationTime
;
1421 TOKEN_TYPE TokenType
;
1422 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
;
1423 DWORD DynamicCharged
;
1424 DWORD DynamicAvailable
;
1426 DWORD PrivilegeCount
;
1434 #define ACL_REVISION 2
1436 #define ACL_REVISION1 1
1437 #define ACL_REVISION2 2
1439 /* ACEs, directly starting after an ACL */
1440 typedef struct _ACE_HEADER
{
1444 } ACE_HEADER
,*PACE_HEADER
;
1447 #define ACCESS_ALLOWED_ACE_TYPE 0
1448 #define ACCESS_DENIED_ACE_TYPE 1
1449 #define SYSTEM_AUDIT_ACE_TYPE 2
1450 #define SYSTEM_ALARM_ACE_TYPE 3
1452 /* inherit AceFlags */
1453 #define OBJECT_INHERIT_ACE 0x01
1454 #define CONTAINER_INHERIT_ACE 0x02
1455 #define NO_PROPAGATE_INHERIT_ACE 0x04
1456 #define INHERIT_ONLY_ACE 0x08
1457 #define VALID_INHERIT_FLAGS 0x0F
1459 /* AceFlags mask for what events we (should) audit */
1460 #define SUCCESSFUL_ACCESS_ACE_FLAG 0x40
1461 #define FAILED_ACCESS_ACE_FLAG 0x80
1463 /* different ACEs depending on AceType
1464 * SidStart marks the begin of a SID
1465 * so the thing finally looks like this:
1470 typedef struct _ACCESS_ALLOWED_ACE
{
1474 } ACCESS_ALLOWED_ACE
,*PACCESS_ALLOWED_ACE
;
1476 typedef struct _ACCESS_DENIED_ACE
{
1480 } ACCESS_DENIED_ACE
,*PACCESS_DENIED_ACE
;
1482 typedef struct _SYSTEM_AUDIT_ACE
{
1486 } SYSTEM_AUDIT_ACE
,*PSYSTEM_AUDIT_ACE
;
1488 typedef struct _SYSTEM_ALARM_ACE
{
1492 } SYSTEM_ALARM_ACE
,*PSYSTEM_ALARM_ACE
;
1494 typedef enum tagSID_NAME_USE
{
1499 SidTypeWellKnownGroup
,
1500 SidTypeDeletedAccount
,
1503 } SID_NAME_USE
,*PSID_NAME_USE
;
1507 #define DELETE 0x00010000
1508 #define READ_CONTROL 0x00020000
1509 #define WRITE_DAC 0x00040000
1510 #define WRITE_OWNER 0x00080000
1511 #define SYNCHRONIZE 0x00100000
1512 #define STANDARD_RIGHTS_REQUIRED 0x000f0000
1514 #define STANDARD_RIGHTS_READ READ_CONTROL
1515 #define STANDARD_RIGHTS_WRITE READ_CONTROL
1516 #define STANDARD_RIGHTS_EXECUTE READ_CONTROL
1518 #define STANDARD_RIGHTS_ALL 0x001f0000
1520 #define SPECIFIC_RIGHTS_ALL 0x0000ffff
1522 #define GENERIC_READ 0x80000000
1523 #define GENERIC_WRITE 0x40000000
1524 #define GENERIC_EXECUTE 0x20000000
1525 #define GENERIC_ALL 0x10000000
1527 #define MAXIMUM_ALLOWED 0x02000000
1528 #define ACCESS_SYSTEM_SECURITY 0x01000000
1530 #define EVENT_MODIFY_STATE 0x0002
1531 #define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
1533 #define SEMAPHORE_MODIFY_STATE 0x0002
1534 #define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
1536 #define MUTEX_MODIFY_STATE 0x0001
1537 #define MUTEX_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1)
1539 #define PROCESS_TERMINATE 0x0001
1540 #define PROCESS_CREATE_THREAD 0x0002
1541 #define PROCESS_VM_OPERATION 0x0008
1542 #define PROCESS_VM_READ 0x0010
1543 #define PROCESS_VM_WRITE 0x0020
1544 #define PROCESS_DUP_HANDLE 0x0040
1545 #define PROCESS_CREATE_PROCESS 0x0080
1546 #define PROCESS_SET_QUOTA 0x0100
1547 #define PROCESS_SET_INFORMATION 0x0200
1548 #define PROCESS_QUERY_INFORMATION 0x0400
1549 #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xfff)
1551 #define THREAD_TERMINATE 0x0001
1552 #define THREAD_SUSPEND_RESUME 0x0002
1553 #define THREAD_GET_CONTEXT 0x0008
1554 #define THREAD_SET_CONTEXT 0x0010
1555 #define THREAD_SET_INFORMATION 0x0020
1556 #define THREAD_QUERY_INFORMATION 0x0040
1557 #define THREAD_SET_THREAD_TOKEN 0x0080
1558 #define THREAD_IMPERSONATE 0x0100
1559 #define THREAD_DIRECT_IMPERSONATION 0x0200
1560 #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3ff)
1562 #define THREAD_BASE_PRIORITY_LOWRT 15
1563 #define THREAD_BASE_PRIORITY_MAX 2
1564 #define THREAD_BASE_PRIORITY_MIN -2
1565 #define THREAD_BASE_PRIORITY_IDLE -15
1567 #define FILE_READ_DATA 0x0001 /* file & pipe */
1568 #define FILE_LIST_DIRECTORY 0x0001 /* directory */
1569 #define FILE_WRITE_DATA 0x0002 /* file & pipe */
1570 #define FILE_ADD_FILE 0x0002 /* directory */
1571 #define FILE_APPEND_DATA 0x0004 /* file */
1572 #define FILE_ADD_SUBDIRECTORY 0x0004 /* directory */
1573 #define FILE_CREATE_PIPE_INSTANCE 0x0004 /* named pipe */
1574 #define FILE_READ_EA 0x0008 /* file & directory */
1575 #define FILE_READ_PROPERTIES FILE_READ_EA
1576 #define FILE_WRITE_EA 0x0010 /* file & directory */
1577 #define FILE_WRITE_PROPERTIES FILE_WRITE_EA
1578 #define FILE_EXECUTE 0x0020 /* file */
1579 #define FILE_TRAVERSE 0x0020 /* directory */
1580 #define FILE_DELETE_CHILD 0x0040 /* directory */
1581 #define FILE_READ_ATTRIBUTES 0x0080 /* all */
1582 #define FILE_WRITE_ATTRIBUTES 0x0100 /* all */
1583 #define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1ff)
1585 #define FILE_GENERIC_READ (STANDARD_RIGHTS_READ | FILE_READ_DATA | \
1586 FILE_READ_ATTRIBUTES | FILE_READ_EA | \
1588 #define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | \
1589 FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | \
1590 FILE_APPEND_DATA | SYNCHRONIZE)
1591 #define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE | FILE_EXECUTE | \
1592 FILE_READ_ATTRIBUTES | SYNCHRONIZE)
1595 /* File attribute flags
1597 #define FILE_SHARE_READ 0x00000001L
1598 #define FILE_SHARE_WRITE 0x00000002L
1599 #define FILE_SHARE_DELETE 0x00000004L
1600 #define FILE_ATTRIBUTE_READONLY 0x00000001L
1601 #define FILE_ATTRIBUTE_HIDDEN 0x00000002L
1602 #define FILE_ATTRIBUTE_SYSTEM 0x00000004L
1603 #define FILE_ATTRIBUTE_LABEL 0x00000008L /* Not in Windows API */
1604 #define FILE_ATTRIBUTE_DIRECTORY 0x00000010L
1605 #define FILE_ATTRIBUTE_ARCHIVE 0x00000020L
1606 #define FILE_ATTRIBUTE_NORMAL 0x00000080L
1607 #define FILE_ATTRIBUTE_TEMPORARY 0x00000100L
1608 #define FILE_ATTRIBUTE_ATOMIC_WRITE 0x00000200L
1609 #define FILE_ATTRIBUTE_XACTION_WRITE 0x00000400L
1610 #define FILE_ATTRIBUTE_COMPRESSED 0x00000800L
1611 #define FILE_ATTRIBUTE_OFFLINE 0x00001000L
1613 /* File alignments (NT) */
1614 #define FILE_BYTE_ALIGNMENT 0x00000000
1615 #define FILE_WORD_ALIGNMENT 0x00000001
1616 #define FILE_LONG_ALIGNMENT 0x00000003
1617 #define FILE_QUAD_ALIGNMENT 0x00000007
1618 #define FILE_OCTA_ALIGNMENT 0x0000000f
1619 #define FILE_32_BYTE_ALIGNMENT 0x0000001f
1620 #define FILE_64_BYTE_ALIGNMENT 0x0000003f
1621 #define FILE_128_BYTE_ALIGNMENT 0x0000007f
1622 #define FILE_256_BYTE_ALIGNMENT 0x000000ff
1623 #define FILE_512_BYTE_ALIGNMENT 0x000001ff
1625 #define REG_NONE 0 /* no type */
1626 #define REG_SZ 1 /* string type (ASCII) */
1627 #define REG_EXPAND_SZ 2 /* string, includes %ENVVAR% (expanded by caller) (ASCII) */
1628 #define REG_BINARY 3 /* binary format, callerspecific */
1629 /* YES, REG_DWORD == REG_DWORD_LITTLE_ENDIAN */
1630 #define REG_DWORD 4 /* DWORD in little endian format */
1631 #define REG_DWORD_LITTLE_ENDIAN 4 /* DWORD in little endian format */
1632 #define REG_DWORD_BIG_ENDIAN 5 /* DWORD in big endian format */
1633 #define REG_LINK 6 /* symbolic link (UNICODE) */
1634 #define REG_MULTI_SZ 7 /* multiple strings, delimited by \0, terminated by \0\0 (ASCII) */
1635 #define REG_RESOURCE_LIST 8 /* resource list? huh? */
1636 #define REG_FULL_RESOURCE_DESCRIPTOR 9 /* full resource descriptor? huh? */
1637 #define REG_RESOURCE_REQUIREMENTS_LIST 10
1639 /* ----------------------------- begin registry ----------------------------- */
1641 /* Registry security values */
1642 #define OWNER_SECURITY_INFORMATION 0x00000001
1643 #define GROUP_SECURITY_INFORMATION 0x00000002
1644 #define DACL_SECURITY_INFORMATION 0x00000004
1645 #define SACL_SECURITY_INFORMATION 0x00000008
1647 #define REG_OPTION_RESERVED 0x00000000
1648 #define REG_OPTION_NON_VOLATILE 0x00000000
1649 #define REG_OPTION_VOLATILE 0x00000001
1650 #define REG_OPTION_CREATE_LINK 0x00000002
1651 #define REG_OPTION_BACKUP_RESTORE 0x00000004 /* FIXME */
1652 #define REG_OPTION_OPEN_LINK 0x00000008
1653 #define REG_LEGAL_OPTION (REG_OPTION_RESERVED| \
1654 REG_OPTION_NON_VOLATILE| \
1655 REG_OPTION_VOLATILE| \
1656 REG_OPTION_CREATE_LINK| \
1657 REG_OPTION_BACKUP_RESTORE| \
1658 REG_OPTION_OPEN_LINK)
1661 #define REG_CREATED_NEW_KEY 0x00000001
1662 #define REG_OPENED_EXISTING_KEY 0x00000002
1664 /* For RegNotifyChangeKeyValue */
1665 #define REG_NOTIFY_CHANGE_NAME 0x1
1667 #define KEY_QUERY_VALUE 0x00000001
1668 #define KEY_SET_VALUE 0x00000002
1669 #define KEY_CREATE_SUB_KEY 0x00000004
1670 #define KEY_ENUMERATE_SUB_KEYS 0x00000008
1671 #define KEY_NOTIFY 0x00000010
1672 #define KEY_CREATE_LINK 0x00000020
1674 #define KEY_READ ((STANDARD_RIGHTS_READ| \
1676 KEY_ENUMERATE_SUB_KEYS| \
1680 #define KEY_WRITE ((STANDARD_RIGHTS_WRITE| \
1682 KEY_CREATE_SUB_KEY) \
1685 #define KEY_EXECUTE ((KEY_READ) \
1688 #define KEY_ALL_ACCESS ((STANDARD_RIGHTS_ALL| \
1691 KEY_CREATE_SUB_KEY| \
1692 KEY_ENUMERATE_SUB_KEYS| \
1697 /* ------------------------------ end registry ------------------------------ */
1700 #define RtlEqualMemory(Destination, Source, Length) (!memcmp((Destination),(Source),(Length)))
1701 #define RtlMoveMemory(Destination, Source, Length) memmove((Destination),(Source),(Length))
1702 #define RtlCopyMemory(Destination, Source, Length) memcpy((Destination),(Source),(Length))
1703 #define RtlFillMemory(Destination, Length, Fill) memset((Destination),(Fill),(Length))
1704 #define RtlZeroMemory(Destination, Length) memset((Destination),0,(Length))
1706 #include "poppack.h"
1708 #endif /* __WINE_WINNT_H */