Alexandre Julliard | 329f068 | 1996-04-14 13:21:20 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Win32 definitions for Windows NT |
| 3 | * |
| 4 | * Copyright 1996 Alexandre Julliard |
| 5 | */ |
| 6 | |
| 7 | #ifndef __WINE_WINNT_H |
| 8 | #define __WINE_WINNT_H |
| 9 | |
Jim Aston | 2e1cafa | 1999-03-14 16:35:05 +0000 | [diff] [blame] | 10 | #include "windef.h" |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 11 | |
Patrik Stridvall | c7a8dde | 1999-04-25 12:36:53 +0000 | [diff] [blame] | 12 | #include "pshpack1.h" |
Patrik Stridvall | 56d52aa | 1998-11-14 18:24:37 +0000 | [diff] [blame] | 13 | /* Defines */ |
| 14 | |
Michael Veksler | 17822f4 | 1999-02-09 15:46:25 +0000 | [diff] [blame] | 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 */ |
| 20 | |
| 21 | |
| 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_UNKNOWN 0xFFFF |
| 28 | |
| 29 | /* dwProcessorType */ |
| 30 | #define PROCESSOR_INTEL_386 386 |
| 31 | #define PROCESSOR_INTEL_486 486 |
| 32 | #define PROCESSOR_INTEL_PENTIUM 586 |
| 33 | #define PROCESSOR_MIPS_R4000 4000 |
| 34 | #define PROCESSOR_ALPHA_21064 21064 |
| 35 | |
| 36 | |
Patrik Stridvall | 56d52aa | 1998-11-14 18:24:37 +0000 | [diff] [blame] | 37 | #define ANYSIZE_ARRAY 1 |
| 38 | |
Paul Quinn | ea1640f | 1999-03-10 18:03:53 +0000 | [diff] [blame] | 39 | #define MINCHAR 0x80 |
| 40 | #define MAXCHAR 0x7f |
| 41 | #define MINSHORT 0x8000 |
| 42 | #define MAXSHORT 0x7fff |
| 43 | #define MINLONG 0x80000000 |
| 44 | #define MAXLONG 0x7fffffff |
| 45 | #define MAXBYTE 0xff |
| 46 | #define MAXWORD 0xffff |
| 47 | #define MAXDWORD 0xffffffff |
| 48 | |
Patrik Stridvall | 56d52aa | 1998-11-14 18:24:37 +0000 | [diff] [blame] | 49 | #define FIELD_OFFSET(type, field) \ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 50 | ((LONG)(INT)&(((type *)0)->field)) |
Patrik Stridvall | 56d52aa | 1998-11-14 18:24:37 +0000 | [diff] [blame] | 51 | |
| 52 | #define CONTAINING_RECORD(address, type, field) \ |
| 53 | ((type *)((PCHAR)(address) - (PCHAR)(&((type *)0)->field))) |
| 54 | |
| 55 | /* Types */ |
| 56 | |
Patrik Stridvall | 857eb39 | 1999-06-12 18:36:54 +0000 | [diff] [blame] | 57 | /* TCHAR data types definitions for Winelib. */ |
| 58 | /* These types are _not_ defined for the emulator, because they */ |
| 59 | /* depend on the UNICODE macro that only exists in user's code. */ |
| 60 | |
| 61 | #ifndef __WINE__ |
| 62 | # ifdef UNICODE |
| 63 | typedef LPWSTR LPTSTR; |
| 64 | typedef LPCWSTR LPCTSTR; |
| 65 | #define __TEXT(string) L##string /*probably wrong */ |
| 66 | # else /* UNICODE */ |
| 67 | typedef LPSTR LPTSTR; |
| 68 | typedef LPCSTR LPCTSTR; |
| 69 | #define __TEXT(string) string |
| 70 | # endif /* UNICODE */ |
| 71 | #endif /* __WINE__ */ |
| 72 | #define TEXT(quote) __TEXT(quote) |
| 73 | |
Patrik Stridvall | 56d52aa | 1998-11-14 18:24:37 +0000 | [diff] [blame] | 74 | typedef BYTE BOOLEAN; |
| 75 | typedef BOOLEAN *PBOOLEAN; |
| 76 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 77 | typedef struct _LIST_ENTRY { |
| 78 | struct _LIST_ENTRY *Flink; |
| 79 | struct _LIST_ENTRY *Blink; |
| 80 | } LIST_ENTRY, *PLIST_ENTRY; |
Patrik Stridvall | 56d52aa | 1998-11-14 18:24:37 +0000 | [diff] [blame] | 81 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 82 | typedef struct _SINGLE_LIST_ENTRY { |
| 83 | struct _SINGLE_LIST_ENTRY *Next; |
| 84 | } SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY; |
Patrik Stridvall | 56d52aa | 1998-11-14 18:24:37 +0000 | [diff] [blame] | 85 | |
Alexandre Julliard | 329f068 | 1996-04-14 13:21:20 +0000 | [diff] [blame] | 86 | /* Heap flags */ |
Alexandre Julliard | c6c0944 | 1997-01-12 18:32:19 +0000 | [diff] [blame] | 87 | |
Alexandre Julliard | 329f068 | 1996-04-14 13:21:20 +0000 | [diff] [blame] | 88 | #define HEAP_NO_SERIALIZE 0x00000001 |
| 89 | #define HEAP_GROWABLE 0x00000002 |
| 90 | #define HEAP_GENERATE_EXCEPTIONS 0x00000004 |
| 91 | #define HEAP_ZERO_MEMORY 0x00000008 |
| 92 | #define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010 |
| 93 | #define HEAP_TAIL_CHECKING_ENABLED 0x00000020 |
| 94 | #define HEAP_FREE_CHECKING_ENABLED 0x00000040 |
| 95 | #define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080 |
| 96 | #define HEAP_CREATE_ALIGN_16 0x00010000 |
| 97 | #define HEAP_CREATE_ENABLE_TRACING 0x00020000 |
Alexandre Julliard | e2bfa4c | 1996-05-16 18:21:06 +0000 | [diff] [blame] | 98 | #define HEAP_WINE_SEGPTR 0x01000000 /* Not a Win32 flag */ |
| 99 | #define HEAP_WINE_CODESEG 0x02000000 /* Not a Win32 flag */ |
Ulrich Weigand | bf5f693 | 1998-10-11 19:12:16 +0000 | [diff] [blame] | 100 | #define HEAP_WINE_CODE16SEG 0x04000000 /* Not a Win32 flag */ |
Alexandre Julliard | 329f068 | 1996-04-14 13:21:20 +0000 | [diff] [blame] | 101 | |
Alexandre Julliard | 44ed71f | 1997-12-21 19:17:50 +0000 | [diff] [blame] | 102 | /* Processor feature flags. */ |
Alexandre Julliard | 60ce85c | 1998-02-01 18:33:27 +0000 | [diff] [blame] | 103 | #define PF_FLOATING_POINT_PRECISION_ERRATA 0 |
| 104 | #define PF_FLOATING_POINT_EMULATED 1 |
| 105 | #define PF_COMPARE_EXCHANGE_DOUBLE 2 |
| 106 | #define PF_MMX_INSTRUCTIONS_AVAILABLE 3 |
| 107 | #define PF_PPC_MOVEMEM_64BIT_OK 4 |
| 108 | #define PF_ALPHA_BYTE_INSTRUCTIONS 5 |
| 109 | |
Alexandre Julliard | 44ed71f | 1997-12-21 19:17:50 +0000 | [diff] [blame] | 110 | |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 111 | /* The Win32 register context */ |
| 112 | |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame^] | 113 | /* CONTEXT is the CPU-dependent context; it should be used */ |
| 114 | /* wherever a platform-specific context is needed (e.g. exception */ |
| 115 | /* handling, Win32 register functions). */ |
| 116 | |
| 117 | /* CONTEXT86 is the i386-specific context; it should be used */ |
| 118 | /* wherever only a 386 context makes sense (e.g. DOS interrupts, */ |
| 119 | /* Win16 register functions), so that this code can be compiled */ |
| 120 | /* on all platforms. */ |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 121 | |
| 122 | #define SIZE_OF_80387_REGISTERS 80 |
| 123 | |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame^] | 124 | typedef struct _FLOATING_SAVE_AREA |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 125 | { |
| 126 | DWORD ControlWord; |
| 127 | DWORD StatusWord; |
| 128 | DWORD TagWord; |
| 129 | DWORD ErrorOffset; |
| 130 | DWORD ErrorSelector; |
| 131 | DWORD DataOffset; |
| 132 | DWORD DataSelector; |
| 133 | BYTE RegisterArea[SIZE_OF_80387_REGISTERS]; |
| 134 | DWORD Cr0NpxState; |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame^] | 135 | } FLOATING_SAVE_AREA, *PFLOATING_SAVE_AREA; |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 136 | |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame^] | 137 | typedef struct _CONTEXT86 |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 138 | { |
| 139 | DWORD ContextFlags; |
| 140 | |
| 141 | /* These are selected by CONTEXT_DEBUG_REGISTERS */ |
| 142 | DWORD Dr0; |
| 143 | DWORD Dr1; |
| 144 | DWORD Dr2; |
| 145 | DWORD Dr3; |
| 146 | DWORD Dr6; |
| 147 | DWORD Dr7; |
| 148 | |
| 149 | /* These are selected by CONTEXT_FLOATING_POINT */ |
| 150 | FLOATING_SAVE_AREA FloatSave; |
| 151 | |
| 152 | /* These are selected by CONTEXT_SEGMENTS */ |
| 153 | DWORD SegGs; |
| 154 | DWORD SegFs; |
| 155 | DWORD SegEs; |
| 156 | DWORD SegDs; |
| 157 | |
| 158 | /* These are selected by CONTEXT_INTEGER */ |
| 159 | DWORD Edi; |
| 160 | DWORD Esi; |
| 161 | DWORD Ebx; |
| 162 | DWORD Edx; |
| 163 | DWORD Ecx; |
| 164 | DWORD Eax; |
| 165 | |
| 166 | /* These are selected by CONTEXT_CONTROL */ |
| 167 | DWORD Ebp; |
| 168 | DWORD Eip; |
| 169 | DWORD SegCs; |
| 170 | DWORD EFlags; |
| 171 | DWORD Esp; |
| 172 | DWORD SegSs; |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame^] | 173 | } CONTEXT86; |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 174 | |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame^] | 175 | #define CONTEXT86_CONTROL (CONTEXT_i386 | 0x0001) /* SS:SP, CS:IP, FLAGS, BP */ |
| 176 | #define CONTEXT86_INTEGER (CONTEXT_i386 | 0x0002) /* AX, BX, CX, DX, SI, DI */ |
| 177 | #define CONTEXT86_SEGMENTS (CONTEXT_i386 | 0x0004) /* DS, ES, FS, GS */ |
| 178 | #define CONTEXT86_FLOATING_POINT (CONTEXT_i386 | 0x0008L) /* 387 state */ |
| 179 | #define CONTEXT86_DEBUG_REGISTERS (CONTEXT_i386 | 0x0010L) /* DB 0-3,6,7 */ |
| 180 | #define CONTEXT86_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS) |
| 181 | |
| 182 | /* i386 context definitions */ |
| 183 | #ifdef __i386__ |
| 184 | |
| 185 | #define CONTEXT_X86 0x00010000 |
| 186 | #define CONTEXT_i386 CONTEXT_X86 |
| 187 | #define CONTEXT_i486 CONTEXT_X86 |
| 188 | |
| 189 | #define CONTEXT_CONTROL CONTEXT86_CONTROL |
| 190 | #define CONTEXT_INTEGER CONTEXT86_INTEGER |
| 191 | #define CONTEXT_SEGMENTS CONTEXT86_SEGMENTS |
| 192 | #define CONTEXT_FLOATING_POINT CONTEXT86_FLOATING_POINT |
| 193 | #define CONTEXT_DEBUG_REGISTERS CONTEXT86_DEBUG_REGISTERS |
| 194 | #define CONTEXT_FULL CONTEXT86_FULL |
| 195 | |
| 196 | typedef CONTEXT86 CONTEXT; |
| 197 | |
| 198 | #endif /* __i386__ */ |
| 199 | |
| 200 | /* PowerPC context definitions (untested) */ |
| 201 | #ifdef __ppc__ |
| 202 | |
| 203 | #define CONTEXT_CONTROL 0x0001 |
| 204 | #define CONTEXT_FLOATING_POINT 0x0002 |
| 205 | #define CONTEXT_INTEGER 0x0004 |
| 206 | #define CONTEXT_DEBUG_REGISTERS 0x0008 |
| 207 | #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER) |
| 208 | |
| 209 | typedef struct |
| 210 | { |
| 211 | /* These are selected by CONTEXT_FLOATING_POINT */ |
| 212 | double Fpr0; |
| 213 | double Fpr1; |
| 214 | double Fpr2; |
| 215 | double Fpr3; |
| 216 | double Fpr4; |
| 217 | double Fpr5; |
| 218 | double Fpr6; |
| 219 | double Fpr7; |
| 220 | double Fpr8; |
| 221 | double Fpr9; |
| 222 | double Fpr10; |
| 223 | double Fpr11; |
| 224 | double Fpr12; |
| 225 | double Fpr13; |
| 226 | double Fpr14; |
| 227 | double Fpr15; |
| 228 | double Fpr16; |
| 229 | double Fpr17; |
| 230 | double Fpr18; |
| 231 | double Fpr19; |
| 232 | double Fpr20; |
| 233 | double Fpr21; |
| 234 | double Fpr22; |
| 235 | double Fpr23; |
| 236 | double Fpr24; |
| 237 | double Fpr25; |
| 238 | double Fpr26; |
| 239 | double Fpr27; |
| 240 | double Fpr28; |
| 241 | double Fpr29; |
| 242 | double Fpr30; |
| 243 | double Fpr31; |
| 244 | double Fpscr; |
| 245 | |
| 246 | /* These are selected by CONTEXT_INTEGER */ |
| 247 | DWORD Gpr0; |
| 248 | DWORD Gpr1; |
| 249 | DWORD Gpr2; |
| 250 | DWORD Gpr3; |
| 251 | DWORD Gpr4; |
| 252 | DWORD Gpr5; |
| 253 | DWORD Gpr6; |
| 254 | DWORD Gpr7; |
| 255 | DWORD Gpr8; |
| 256 | DWORD Gpr9; |
| 257 | DWORD Gpr10; |
| 258 | DWORD Gpr11; |
| 259 | DWORD Gpr12; |
| 260 | DWORD Gpr13; |
| 261 | DWORD Gpr14; |
| 262 | DWORD Gpr15; |
| 263 | DWORD Gpr16; |
| 264 | DWORD Gpr17; |
| 265 | DWORD Gpr18; |
| 266 | DWORD Gpr19; |
| 267 | DWORD Gpr20; |
| 268 | DWORD Gpr21; |
| 269 | DWORD Gpr22; |
| 270 | DWORD Gpr23; |
| 271 | DWORD Gpr24; |
| 272 | DWORD Gpr25; |
| 273 | DWORD Gpr26; |
| 274 | DWORD Gpr27; |
| 275 | DWORD Gpr28; |
| 276 | DWORD Gpr29; |
| 277 | DWORD Gpr30; |
| 278 | DWORD Gpr31; |
| 279 | |
| 280 | DWORD Cr; |
| 281 | DWORD Xer; |
| 282 | |
| 283 | /* These are selected by CONTEXT_CONTROL */ |
| 284 | DWORD Msr; |
| 285 | DWORD Iar; |
| 286 | DWORD Lr; |
| 287 | DWORD Ctr; |
| 288 | |
| 289 | DWORD ContextFlags; |
| 290 | DWORD Fill[3]; |
| 291 | |
| 292 | /* These are selected by CONTEXT_DEBUG_REGISTERS */ |
| 293 | DWORD Dr0; |
| 294 | DWORD Dr1; |
| 295 | DWORD Dr2; |
| 296 | DWORD Dr3; |
| 297 | DWORD Dr4; |
| 298 | DWORD Dr5; |
| 299 | DWORD Dr6; |
| 300 | DWORD Dr7; |
| 301 | } CONTEXT; |
| 302 | |
| 303 | #endif /* __ppc__ */ |
| 304 | |
| 305 | #if !defined(CONTEXT_FULL) && !defined(RC_INVOKED) |
| 306 | #error You need to define a CONTEXT for your CPU |
| 307 | #endif |
| 308 | |
| 309 | typedef CONTEXT *PCONTEXT; |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 310 | typedef HANDLE *PHANDLE; |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 311 | |
| 312 | #ifdef __WINE__ |
| 313 | |
Alexandre Julliard | f6b08dd | 1999-06-26 18:35:34 +0000 | [diff] [blame^] | 314 | /* Macros for easier access to i386 context registers */ |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 315 | |
| 316 | #define EAX_reg(context) ((context)->Eax) |
| 317 | #define EBX_reg(context) ((context)->Ebx) |
| 318 | #define ECX_reg(context) ((context)->Ecx) |
| 319 | #define EDX_reg(context) ((context)->Edx) |
| 320 | #define ESI_reg(context) ((context)->Esi) |
| 321 | #define EDI_reg(context) ((context)->Edi) |
| 322 | #define EBP_reg(context) ((context)->Ebp) |
| 323 | |
| 324 | #define CS_reg(context) ((context)->SegCs) |
| 325 | #define DS_reg(context) ((context)->SegDs) |
| 326 | #define ES_reg(context) ((context)->SegEs) |
| 327 | #define FS_reg(context) ((context)->SegFs) |
| 328 | #define GS_reg(context) ((context)->SegGs) |
| 329 | #define SS_reg(context) ((context)->SegSs) |
| 330 | |
| 331 | #define EFL_reg(context) ((context)->EFlags) |
| 332 | #define EIP_reg(context) ((context)->Eip) |
| 333 | #define ESP_reg(context) ((context)->Esp) |
| 334 | |
| 335 | #define AX_reg(context) (*(WORD*)&EAX_reg(context)) |
| 336 | #define BX_reg(context) (*(WORD*)&EBX_reg(context)) |
| 337 | #define CX_reg(context) (*(WORD*)&ECX_reg(context)) |
| 338 | #define DX_reg(context) (*(WORD*)&EDX_reg(context)) |
| 339 | #define SI_reg(context) (*(WORD*)&ESI_reg(context)) |
| 340 | #define DI_reg(context) (*(WORD*)&EDI_reg(context)) |
| 341 | #define BP_reg(context) (*(WORD*)&EBP_reg(context)) |
| 342 | |
| 343 | #define AL_reg(context) (*(BYTE*)&EAX_reg(context)) |
| 344 | #define AH_reg(context) (*((BYTE*)&EAX_reg(context)+1)) |
| 345 | #define BL_reg(context) (*(BYTE*)&EBX_reg(context)) |
| 346 | #define BH_reg(context) (*((BYTE*)&EBX_reg(context)+1)) |
| 347 | #define CL_reg(context) (*(BYTE*)&ECX_reg(context)) |
| 348 | #define CH_reg(context) (*((BYTE*)&ECX_reg(context)+1)) |
| 349 | #define DL_reg(context) (*(BYTE*)&EDX_reg(context)) |
| 350 | #define DH_reg(context) (*((BYTE*)&EDX_reg(context)+1)) |
| 351 | |
| 352 | #define IP_reg(context) (*(WORD*)&EIP_reg(context)) |
| 353 | #define SP_reg(context) (*(WORD*)&ESP_reg(context)) |
| 354 | |
| 355 | #define FL_reg(context) (*(WORD*)&EFL_reg(context)) |
| 356 | |
| 357 | #define SET_CFLAG(context) (EFL_reg(context) |= 0x0001) |
Joseph Pranevich | 791cd6a | 1998-12-02 19:58:08 +0000 | [diff] [blame] | 358 | #define RESET_CFLAG(context) (EFL_reg(context) &= ~0x0001) |
| 359 | #define SET_ZFLAG(context) (EFL_reg(context) |= 0x0040) |
| 360 | #define RESET_ZFLAG(context) (EFL_reg(context) &= ~0x0040) |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 361 | |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 362 | #define ISV86(context) (EFL_reg(context) & 0x00020000) |
| 363 | #define V86BASE(context) ((context)->Dr7) /* ugly */ |
| 364 | |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 365 | #endif /* __WINE__ */ |
| 366 | |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 367 | /* |
| 368 | * Exception codes |
| 369 | */ |
| 370 | |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 371 | #define STATUS_SUCCESS 0x00000000 |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 372 | #define STATUS_WAIT_0 0x00000000 |
| 373 | #define STATUS_ABANDONED_WAIT_0 0x00000080 |
| 374 | #define STATUS_USER_APC 0x000000C0 |
| 375 | #define STATUS_TIMEOUT 0x00000102 |
| 376 | #define STATUS_PENDING 0x00000103 |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 377 | #define STATUS_GUARD_PAGE_VIOLATION 0x80000001 |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 378 | #define STATUS_DATATYPE_MISALIGNMENT 0x80000002 |
| 379 | #define STATUS_BREAKPOINT 0x80000003 |
| 380 | #define STATUS_SINGLE_STEP 0x80000004 |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 381 | #define STATUS_BUFFER_OVERFLOW 0x80000005 |
| 382 | #define STATUS_UNSUCCESSFUL 0xC0000001 |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 383 | #define STATUS_ACCESS_VIOLATION 0xC0000005 |
| 384 | #define STATUS_IN_PAGE_ERROR 0xC0000006 |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 385 | #define STATUS_INVALID_PARAMETER 0xC000000D |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 386 | #define STATUS_NO_MEMORY 0xC0000017 |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 387 | #define STATUS_CONFLICTING_ADDRESSES 0xC0000018 |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 388 | #define STATUS_ILLEGAL_INSTRUCTION 0xC000001D |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 389 | #define STATUS_BUFFER_TOO_SMALL 0xC0000023 |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 390 | #define STATUS_NONCONTINUABLE_EXCEPTION 0xC0000025 |
| 391 | #define STATUS_INVALID_DISPOSITION 0xC0000026 |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 392 | #define STATUS_UNWIND 0xC0000027 |
| 393 | #define STATUS_BAD_STACK 0xC0000028 |
| 394 | #define STATUS_INVALID_UNWIND_TARGET 0xC0000029 |
| 395 | #define STATUS_UNKNOWN_REVISION 0xC0000058 |
| 396 | #define STATUS_INVALID_SECURITY_DESCR 0xC0000079 |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 397 | #define STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008C |
| 398 | #define STATUS_FLOAT_DENORMAL_OPERAND 0xC000008D |
| 399 | #define STATUS_FLOAT_DIVIDE_BY_ZERO 0xC000008E |
| 400 | #define STATUS_FLOAT_INEXACT_RESULT 0xC000008F |
| 401 | #define STATUS_FLOAT_INVALID_OPERATION 0xC0000090 |
| 402 | #define STATUS_FLOAT_OVERFLOW 0xC0000091 |
| 403 | #define STATUS_FLOAT_STACK_CHECK 0xC0000092 |
| 404 | #define STATUS_FLOAT_UNDERFLOW 0xC0000093 |
| 405 | #define STATUS_INTEGER_DIVIDE_BY_ZERO 0xC0000094 |
| 406 | #define STATUS_INTEGER_OVERFLOW 0xC0000095 |
| 407 | #define STATUS_PRIVILEGED_INSTRUCTION 0xC0000096 |
Alexandre Julliard | dd93d25 | 1999-05-09 16:12:19 +0000 | [diff] [blame] | 408 | #define STATUS_INVALID_PARAMETER_2 0xC00000F0 |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 409 | #define STATUS_STACK_OVERFLOW 0xC00000FD |
| 410 | #define STATUS_CONTROL_C_EXIT 0xC000013A |
| 411 | |
Alexandre Julliard | 02e9008 | 1998-01-04 17:49:09 +0000 | [diff] [blame] | 412 | #define MAXIMUM_WAIT_OBJECTS 64 |
| 413 | #define MAXIMUM_SUSPEND_COUNT 127 |
| 414 | |
| 415 | |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 416 | /* |
| 417 | * Return values from the actual exception handlers |
| 418 | */ |
| 419 | |
| 420 | #define ExceptionContinueExecution 0 |
| 421 | #define ExceptionContinueSearch 1 |
| 422 | #define ExceptionNestedException 2 |
| 423 | #define ExceptionCollidedUnwind 3 |
| 424 | |
| 425 | /* |
| 426 | * Return values from filters in except() and from UnhandledExceptionFilter |
| 427 | */ |
| 428 | |
| 429 | #define EXCEPTION_EXECUTE_HANDLER 1 |
| 430 | #define EXCEPTION_CONTINUE_SEARCH 0 |
| 431 | #define EXCEPTION_CONTINUE_EXECUTION -1 |
| 432 | |
| 433 | /* |
| 434 | * From OS/2 2.0 exception handling |
| 435 | * Win32 seems to use the same flags as ExceptionFlags in an EXCEPTION_RECORD |
| 436 | */ |
| 437 | |
| 438 | #define EH_NONCONTINUABLE 0x01 |
| 439 | #define EH_UNWINDING 0x02 |
| 440 | #define EH_EXIT_UNWIND 0x04 |
| 441 | #define EH_STACK_INVALID 0x08 |
| 442 | #define EH_NESTED_CALL 0x10 |
| 443 | |
| 444 | #define EXCEPTION_CONTINUABLE 0 |
| 445 | #define EXCEPTION_NONCONTINUABLE EH_NONCONTINUABLE |
| 446 | |
| 447 | /* |
| 448 | * The exception record used by Win32 to give additional information |
| 449 | * about exception to exception handlers. |
| 450 | */ |
| 451 | |
| 452 | #define EXCEPTION_MAXIMUM_PARAMETERS 15 |
| 453 | |
| 454 | typedef struct __EXCEPTION_RECORD |
| 455 | { |
| 456 | DWORD ExceptionCode; |
| 457 | DWORD ExceptionFlags; |
| 458 | struct __EXCEPTION_RECORD *ExceptionRecord; |
| 459 | |
| 460 | LPVOID ExceptionAddress; |
| 461 | DWORD NumberParameters; |
| 462 | DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; |
| 463 | } EXCEPTION_RECORD, *PEXCEPTION_RECORD; |
| 464 | |
| 465 | /* |
| 466 | * The exception pointers structure passed to exception filters |
| 467 | * in except() and the UnhandledExceptionFilter(). |
| 468 | */ |
| 469 | |
| 470 | typedef struct _EXCEPTION_POINTERS |
| 471 | { |
| 472 | PEXCEPTION_RECORD ExceptionRecord; |
| 473 | PCONTEXT ContextRecord; |
| 474 | } EXCEPTION_POINTERS, *PEXCEPTION_POINTERS; |
| 475 | |
Alexandre Julliard | 89fae7e | 1999-05-12 12:47:01 +0000 | [diff] [blame] | 476 | |
| 477 | /* |
| 478 | * The exception frame, used for registering exception handlers |
| 479 | * Win32 cares only about this, but compilers generally emit |
| 480 | * larger exception frames for their own use. |
| 481 | */ |
| 482 | |
| 483 | struct __EXCEPTION_FRAME; |
| 484 | |
| 485 | typedef DWORD (CALLBACK *PEXCEPTION_HANDLER)(PEXCEPTION_RECORD,struct __EXCEPTION_FRAME*, |
| 486 | PCONTEXT,struct __EXCEPTION_FRAME **); |
| 487 | |
| 488 | typedef struct __EXCEPTION_FRAME |
| 489 | { |
| 490 | struct __EXCEPTION_FRAME *Prev; |
| 491 | PEXCEPTION_HANDLER Handler; |
| 492 | } EXCEPTION_FRAME, *PEXCEPTION_FRAME; |
| 493 | |
Patrik Stridvall | c7a8dde | 1999-04-25 12:36:53 +0000 | [diff] [blame] | 494 | #include "poppack.h" |
Michael Veksler | 17822f4 | 1999-02-09 15:46:25 +0000 | [diff] [blame] | 495 | |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 496 | /* |
| 497 | * function pointer to a exception filter |
| 498 | */ |
| 499 | |
Alexandre Julliard | 77b9918 | 1997-09-14 17:17:23 +0000 | [diff] [blame] | 500 | typedef LONG (CALLBACK *PTOP_LEVEL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS ExceptionInfo); |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 501 | typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER; |
| 502 | |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 503 | DWORD WINAPI UnhandledExceptionFilter( PEXCEPTION_POINTERS epointers ); |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 504 | LPTOP_LEVEL_EXCEPTION_FILTER |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 505 | WINAPI SetUnhandledExceptionFilter( LPTOP_LEVEL_EXCEPTION_FILTER filter ); |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 506 | |
Alexandre Julliard | 1ab8c68 | 1999-05-16 17:11:58 +0000 | [diff] [blame] | 507 | /* status values for ContinueDebugEvent */ |
| 508 | #define DBG_CONTINUE 0x00010002 |
| 509 | #define DBG_TERMINATE_THREAD 0x40010003 |
| 510 | #define DBG_TERMINATE_PROCESS 0x40010004 |
| 511 | #define DBG_CONTROL_C 0x40010005 |
| 512 | #define DBG_CONTROL_BREAK 0x40010008 |
| 513 | #define DBG_EXCEPTION_NOT_HANDLED 0x80010001 |
| 514 | |
Alexandre Julliard | 0a860a0 | 1999-06-22 11:43:42 +0000 | [diff] [blame] | 515 | struct _TEB; |
| 516 | #if defined(__i386__) && defined(__WINE__) |
| 517 | static inline struct _TEB *__get_teb(void) |
| 518 | { |
| 519 | struct _TEB *teb; |
| 520 | __asm__(".byte 0x64\n\tmovl (0x18),%0" : "=r" (teb)); |
| 521 | return teb; |
| 522 | } |
| 523 | #define NtCurrentTeb() __get_teb() |
| 524 | #else |
| 525 | extern struct _TEB * WINAPI NtCurrentTeb(void); |
| 526 | #endif |
| 527 | |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 528 | /* |
| 529 | * Here follows typedefs for security and tokens. |
| 530 | */ |
| 531 | |
| 532 | /* |
| 533 | * First a constant for the following typdefs. |
| 534 | */ |
| 535 | |
| 536 | #define ANYSIZE_ARRAY 1 |
| 537 | |
Paul Quinn | ea1640f | 1999-03-10 18:03:53 +0000 | [diff] [blame] | 538 | /* FIXME: Orphan. What does it point to? */ |
| 539 | typedef PVOID PACCESS_TOKEN; |
| 540 | |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 541 | /* |
| 542 | * TOKEN_INFORMATION_CLASS |
| 543 | */ |
| 544 | |
| 545 | typedef enum _TOKEN_INFORMATION_CLASS { |
| 546 | TokenUser = 1, |
| 547 | TokenGroups, |
| 548 | TokenPrivileges, |
| 549 | TokenOwner, |
| 550 | TokenPrimaryGroup, |
| 551 | TokenDefaultDacl, |
| 552 | TokenSource, |
| 553 | TokenType, |
| 554 | TokenImpersonationLevel, |
| 555 | TokenStatistics |
| 556 | } TOKEN_INFORMATION_CLASS; |
| 557 | |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 558 | #ifndef _SECURITY_DEFINED |
| 559 | #define _SECURITY_DEFINED |
| 560 | |
Patrik Stridvall | c7a8dde | 1999-04-25 12:36:53 +0000 | [diff] [blame] | 561 | #include "pshpack1.h" |
Juergen Schmied | 3426d85 | 1999-02-19 16:29:05 +0000 | [diff] [blame] | 562 | |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 563 | typedef struct { |
| 564 | BYTE Value[6]; |
Paul Quinn | ea1640f | 1999-03-10 18:03:53 +0000 | [diff] [blame] | 565 | } SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY; |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 566 | |
| 567 | typedef struct _SID { |
| 568 | BYTE Revision; |
| 569 | BYTE SubAuthorityCount; |
| 570 | SID_IDENTIFIER_AUTHORITY IdentifierAuthority; |
| 571 | DWORD SubAuthority[1]; |
| 572 | } SID,*PSID; |
| 573 | |
Juergen Schmied | 7f0c5f3 | 1999-03-09 17:46:10 +0000 | [diff] [blame] | 574 | #define SID_REVISION (1) /* Current revision */ |
| 575 | #define SID_MAX_SUB_AUTHORITIES (15) /* current max subauths */ |
| 576 | #define SID_RECOMMENDED_SUB_AUTHORITIES (1) /* recommended subauths */ |
| 577 | |
| 578 | |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 579 | /* |
| 580 | * ACL |
| 581 | */ |
| 582 | |
| 583 | typedef struct _ACL { |
| 584 | BYTE AclRevision; |
| 585 | BYTE Sbz1; |
| 586 | WORD AclSize; |
| 587 | WORD AceCount; |
| 588 | WORD Sbz2; |
| 589 | } ACL, *PACL; |
| 590 | |
Juergen Schmied | 3426d85 | 1999-02-19 16:29:05 +0000 | [diff] [blame] | 591 | /* SECURITY_DESCRIPTOR */ |
| 592 | #define SECURITY_DESCRIPTOR_REVISION 1 |
| 593 | #define SECURITY_DESCRIPTOR_REVISION1 1 |
| 594 | |
| 595 | |
| 596 | #define SE_OWNER_DEFAULTED 0x0001 |
| 597 | #define SE_GROUP_DEFAULTED 0x0002 |
| 598 | #define SE_DACL_PRESENT 0x0004 |
| 599 | #define SE_DACL_DEFAULTED 0x0008 |
| 600 | #define SE_SACL_PRESENT 0x0010 |
| 601 | #define SE_SACL_DEFAULTED 0x0020 |
| 602 | #define SE_SELF_RELATIVE 0x8000 |
| 603 | |
| 604 | typedef DWORD SECURITY_INFORMATION; |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 605 | typedef WORD SECURITY_DESCRIPTOR_CONTROL; |
| 606 | |
| 607 | /* The security descriptor structure */ |
| 608 | typedef struct { |
| 609 | BYTE Revision; |
| 610 | BYTE Sbz1; |
| 611 | SECURITY_DESCRIPTOR_CONTROL Control; |
| 612 | PSID Owner; |
| 613 | PSID Group; |
| 614 | PACL Sacl; |
| 615 | PACL Dacl; |
| 616 | } SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR; |
| 617 | |
Juergen Schmied | 3426d85 | 1999-02-19 16:29:05 +0000 | [diff] [blame] | 618 | #define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR)) |
| 619 | |
Patrik Stridvall | c7a8dde | 1999-04-25 12:36:53 +0000 | [diff] [blame] | 620 | #include "poppack.h" |
| 621 | |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 622 | #endif /* _SECURITY_DEFINED */ |
| 623 | |
Patrik Stridvall | c7a8dde | 1999-04-25 12:36:53 +0000 | [diff] [blame] | 624 | #include "pshpack1.h" |
| 625 | |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 626 | /* |
| 627 | * SID_AND_ATTRIBUTES |
| 628 | */ |
| 629 | |
| 630 | typedef struct _SID_AND_ATTRIBUTES { |
| 631 | PSID Sid; |
| 632 | DWORD Attributes; |
| 633 | } SID_AND_ATTRIBUTES ; |
| 634 | |
| 635 | /* |
| 636 | * TOKEN_USER |
| 637 | */ |
| 638 | |
| 639 | typedef struct _TOKEN_USER { |
| 640 | SID_AND_ATTRIBUTES User; |
| 641 | } TOKEN_USER; |
| 642 | |
| 643 | /* |
| 644 | * TOKEN_GROUPS |
| 645 | */ |
| 646 | |
| 647 | typedef struct _TOKEN_GROUPS { |
| 648 | DWORD GroupCount; |
| 649 | SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY]; |
| 650 | } TOKEN_GROUPS; |
| 651 | |
| 652 | /* |
| 653 | * LUID_AND_ATTRIBUTES |
| 654 | */ |
| 655 | |
Michael Veksler | 17822f4 | 1999-02-09 15:46:25 +0000 | [diff] [blame] | 656 | typedef struct _LARGE_INTEGER |
| 657 | { |
| 658 | DWORD LowPart; |
| 659 | LONG HighPart; |
Paul Quinn | ea1640f | 1999-03-10 18:03:53 +0000 | [diff] [blame] | 660 | } LARGE_INTEGER, *LPLARGE_INTEGER, *PLARGE_INTEGER; |
Michael Veksler | 17822f4 | 1999-02-09 15:46:25 +0000 | [diff] [blame] | 661 | |
| 662 | typedef struct _ULARGE_INTEGER |
| 663 | { |
| 664 | DWORD LowPart; |
| 665 | DWORD HighPart; |
Paul Quinn | ea1640f | 1999-03-10 18:03:53 +0000 | [diff] [blame] | 666 | } ULARGE_INTEGER, *LPULARGE_INTEGER, *PULARGE_INTEGER; |
Michael Veksler | 17822f4 | 1999-02-09 15:46:25 +0000 | [diff] [blame] | 667 | |
Paul Quinn | ea1640f | 1999-03-10 18:03:53 +0000 | [diff] [blame] | 668 | /* |
| 669 | * Locally Unique Identifier |
| 670 | */ |
| 671 | |
| 672 | typedef LARGE_INTEGER LUID,*PLUID; |
Michael Veksler | 17822f4 | 1999-02-09 15:46:25 +0000 | [diff] [blame] | 673 | |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 674 | typedef struct _LUID_AND_ATTRIBUTES { |
| 675 | LUID Luid; |
| 676 | DWORD Attributes; |
| 677 | } LUID_AND_ATTRIBUTES; |
| 678 | |
| 679 | /* |
| 680 | * TOKEN_PRIVILEGES |
| 681 | */ |
| 682 | |
| 683 | typedef struct _TOKEN_PRIVILEGES { |
| 684 | DWORD PrivilegeCount; |
| 685 | LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]; |
Juergen Schmied | cdbdab7 | 1999-02-12 13:44:38 +0000 | [diff] [blame] | 686 | } TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES; |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 687 | |
| 688 | /* |
| 689 | * TOKEN_OWNER |
| 690 | */ |
| 691 | |
| 692 | typedef struct _TOKEN_OWNER { |
| 693 | PSID Owner; |
| 694 | } TOKEN_OWNER; |
| 695 | |
| 696 | /* |
| 697 | * TOKEN_PRIMARY_GROUP |
| 698 | */ |
| 699 | |
| 700 | typedef struct _TOKEN_PRIMARY_GROUP { |
| 701 | PSID PrimaryGroup; |
| 702 | } TOKEN_PRIMARY_GROUP; |
| 703 | |
Paul Quinn | ea1640f | 1999-03-10 18:03:53 +0000 | [diff] [blame] | 704 | |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 705 | /* |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 706 | * TOKEN_DEFAULT_DACL |
| 707 | */ |
| 708 | |
| 709 | typedef struct _TOKEN_DEFAULT_DACL { |
Juergen Schmied | cdbdab7 | 1999-02-12 13:44:38 +0000 | [diff] [blame] | 710 | PACL DefaultDacl; |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 711 | } TOKEN_DEFAULT_DACL; |
| 712 | |
| 713 | /* |
| 714 | * TOKEN_SOURCEL |
| 715 | */ |
| 716 | |
| 717 | typedef struct _TOKEN_SOURCE { |
| 718 | char Sourcename[8]; |
| 719 | LUID SourceIdentifier; |
| 720 | } TOKEN_SOURCE; |
| 721 | |
| 722 | /* |
| 723 | * TOKEN_TYPE |
| 724 | */ |
| 725 | |
| 726 | typedef enum tagTOKEN_TYPE { |
| 727 | TokenPrimary = 1, |
| 728 | TokenImpersonation |
| 729 | } TOKEN_TYPE; |
| 730 | |
| 731 | /* |
| 732 | * SECURITY_IMPERSONATION_LEVEL |
| 733 | */ |
| 734 | |
| 735 | typedef enum _SECURITY_IMPERSONATION_LEVEL { |
| 736 | SecurityAnonymous, |
| 737 | SecurityIdentification, |
| 738 | SecurityImpersonation, |
| 739 | SecurityDelegation |
| 740 | } SECURITY_IMPERSONATION_LEVEL; |
| 741 | |
| 742 | |
Keith Matthews | 3979647 | 1999-03-13 12:53:39 +0000 | [diff] [blame] | 743 | typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE, |
| 744 | * PSECURITY_CONTEXT_TRACKING_MODE; |
Patrik Stridvall | 0f8bc5b | 1999-04-22 16:27:50 +0000 | [diff] [blame] | 745 | /* |
| 746 | * Quality of Service |
| 747 | */ |
Keith Matthews | 3979647 | 1999-03-13 12:53:39 +0000 | [diff] [blame] | 748 | |
| 749 | typedef struct _SECURITY_QUALITY_OF_SERVICE { |
| 750 | DWORD Length; |
| 751 | SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; |
| 752 | SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode; |
| 753 | BOOL EffectiveOnly; |
| 754 | } SECURITY_QUALITY_OF_SERVICE, *PSECURITY_QUALITY_OF_SERVICE; |
Francois Gouget | 87e385f | 1999-02-17 17:45:54 +0000 | [diff] [blame] | 755 | |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 756 | /* |
| 757 | * TOKEN_STATISTICS |
| 758 | */ |
| 759 | |
| 760 | typedef struct _TOKEN_STATISTICS { |
| 761 | LUID TokenId; |
| 762 | LUID AuthenticationId; |
| 763 | LARGE_INTEGER ExpirationTime; |
| 764 | TOKEN_TYPE TokenType; |
| 765 | SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; |
| 766 | DWORD DynamicCharged; |
| 767 | DWORD DynamicAvailable; |
| 768 | DWORD GroupCount; |
| 769 | DWORD PrivilegeCount; |
| 770 | LUID ModifiedId; |
| 771 | } TOKEN_STATISTICS; |
| 772 | |
Juergen Schmied | 7f0c5f3 | 1999-03-09 17:46:10 +0000 | [diff] [blame] | 773 | /* |
| 774 | * ACLs of NT |
| 775 | */ |
| 776 | |
| 777 | #define ACL_REVISION 2 |
| 778 | |
| 779 | #define ACL_REVISION1 1 |
| 780 | #define ACL_REVISION2 2 |
| 781 | |
| 782 | /* ACEs, directly starting after an ACL */ |
| 783 | typedef struct _ACE_HEADER { |
| 784 | BYTE AceType; |
| 785 | BYTE AceFlags; |
| 786 | WORD AceSize; |
| 787 | } ACE_HEADER,*PACE_HEADER; |
| 788 | |
| 789 | /* AceType */ |
| 790 | #define ACCESS_ALLOWED_ACE_TYPE 0 |
| 791 | #define ACCESS_DENIED_ACE_TYPE 1 |
| 792 | #define SYSTEM_AUDIT_ACE_TYPE 2 |
| 793 | #define SYSTEM_ALARM_ACE_TYPE 3 |
| 794 | |
| 795 | /* inherit AceFlags */ |
| 796 | #define OBJECT_INHERIT_ACE 0x01 |
| 797 | #define CONTAINER_INHERIT_ACE 0x02 |
| 798 | #define NO_PROPAGATE_INHERIT_ACE 0x04 |
| 799 | #define INHERIT_ONLY_ACE 0x08 |
| 800 | #define VALID_INHERIT_FLAGS 0x0F |
| 801 | |
| 802 | /* AceFlags mask for what events we (should) audit */ |
| 803 | #define SUCCESSFUL_ACCESS_ACE_FLAG 0x40 |
| 804 | #define FAILED_ACCESS_ACE_FLAG 0x80 |
| 805 | |
| 806 | /* different ACEs depending on AceType |
| 807 | * SidStart marks the begin of a SID |
| 808 | * so the thing finally looks like this: |
| 809 | * 0: ACE_HEADER |
| 810 | * 4: ACCESS_MASK |
| 811 | * 8... : SID |
| 812 | */ |
| 813 | typedef struct _ACCESS_ALLOWED_ACE { |
| 814 | ACE_HEADER Header; |
| 815 | DWORD Mask; |
| 816 | DWORD SidStart; |
| 817 | } ACCESS_ALLOWED_ACE,*PACCESS_ALLOWED_ACE; |
| 818 | |
| 819 | typedef struct _ACCESS_DENIED_ACE { |
| 820 | ACE_HEADER Header; |
| 821 | DWORD Mask; |
| 822 | DWORD SidStart; |
| 823 | } ACCESS_DENIED_ACE,*PACCESS_DENIED_ACE; |
| 824 | |
| 825 | typedef struct _SYSTEM_AUDIT_ACE { |
| 826 | ACE_HEADER Header; |
| 827 | DWORD Mask; |
| 828 | DWORD SidStart; |
| 829 | } SYSTEM_AUDIT_ACE,*PSYSTEM_AUDIT_ACE; |
| 830 | |
| 831 | typedef struct _SYSTEM_ALARM_ACE { |
| 832 | ACE_HEADER Header; |
| 833 | DWORD Mask; |
| 834 | DWORD SidStart; |
| 835 | } SYSTEM_ALARM_ACE,*PSYSTEM_ALARM_ACE; |
| 836 | |
| 837 | typedef enum tagSID_NAME_USE { |
| 838 | SidTypeUser = 1, |
| 839 | SidTypeGroup, |
| 840 | SidTypeDomain, |
| 841 | SidTypeAlias, |
| 842 | SidTypeWellKnownGroup, |
| 843 | SidTypeDeletedAccount, |
| 844 | SidTypeInvalid, |
| 845 | SidTypeUnknown |
| 846 | } SID_NAME_USE,*PSID_NAME_USE; |
| 847 | |
Alexandre Julliard | 03468f7 | 1998-02-15 19:40:49 +0000 | [diff] [blame] | 848 | /* Access rights */ |
| 849 | |
| 850 | #define DELETE 0x00010000 |
| 851 | #define READ_CONTROL 0x00020000 |
| 852 | #define WRITE_DAC 0x00040000 |
| 853 | #define WRITE_OWNER 0x00080000 |
| 854 | #define SYNCHRONIZE 0x00100000 |
| 855 | #define STANDARD_RIGHTS_REQUIRED 0x000f0000 |
| 856 | |
| 857 | #define STANDARD_RIGHTS_READ READ_CONTROL |
| 858 | #define STANDARD_RIGHTS_WRITE READ_CONTROL |
| 859 | #define STANDARD_RIGHTS_EXECUTE READ_CONTROL |
| 860 | |
| 861 | #define STANDARD_RIGHTS_ALL 0x001f0000 |
| 862 | |
| 863 | #define SPECIFIC_RIGHTS_ALL 0x0000ffff |
| 864 | |
| 865 | #define GENERIC_READ 0x80000000 |
| 866 | #define GENERIC_WRITE 0x40000000 |
| 867 | #define GENERIC_EXECUTE 0x20000000 |
| 868 | #define GENERIC_ALL 0x10000000 |
| 869 | |
| 870 | #define EVENT_MODIFY_STATE 0x0002 |
| 871 | #define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3) |
| 872 | |
| 873 | #define SEMAPHORE_MODIFY_STATE 0x0002 |
| 874 | #define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3) |
| 875 | |
| 876 | #define MUTEX_MODIFY_STATE 0x0001 |
| 877 | #define MUTEX_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1) |
| 878 | |
| 879 | #define PROCESS_TERMINATE 0x0001 |
| 880 | #define PROCESS_CREATE_THREAD 0x0002 |
| 881 | #define PROCESS_VM_OPERATION 0x0008 |
| 882 | #define PROCESS_VM_READ 0x0010 |
| 883 | #define PROCESS_VM_WRITE 0x0020 |
| 884 | #define PROCESS_DUP_HANDLE 0x0040 |
| 885 | #define PROCESS_CREATE_PROCESS 0x0080 |
| 886 | #define PROCESS_SET_QUOTA 0x0100 |
| 887 | #define PROCESS_SET_INFORMATION 0x0200 |
| 888 | #define PROCESS_QUERY_INFORMATION 0x0400 |
| 889 | #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xfff) |
| 890 | |
| 891 | #define THREAD_TERMINATE 0x0001 |
| 892 | #define THREAD_SUSPEND_RESUME 0x0002 |
| 893 | #define THREAD_GET_CONTEXT 0x0008 |
| 894 | #define THREAD_SET_CONTEXT 0x0010 |
| 895 | #define THREAD_SET_INFORMATION 0x0020 |
| 896 | #define THREAD_QUERY_INFORMATION 0x0040 |
| 897 | #define THREAD_SET_THREAD_TOKEN 0x0080 |
| 898 | #define THREAD_IMPERSONATE 0x0100 |
| 899 | #define THREAD_DIRECT_IMPERSONATION 0x0200 |
| 900 | #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3ff) |
| 901 | |
Paul Quinn | ea1640f | 1999-03-10 18:03:53 +0000 | [diff] [blame] | 902 | #define THREAD_BASE_PRIORITY_LOWRT 15 |
| 903 | #define THREAD_BASE_PRIORITY_MAX 2 |
| 904 | #define THREAD_BASE_PRIORITY_MIN -2 |
| 905 | #define THREAD_BASE_PRIORITY_IDLE -15 |
| 906 | |
Alexandre Julliard | 03468f7 | 1998-02-15 19:40:49 +0000 | [diff] [blame] | 907 | #define FILE_READ_DATA 0x0001 /* file & pipe */ |
| 908 | #define FILE_LIST_DIRECTORY 0x0001 /* directory */ |
| 909 | #define FILE_WRITE_DATA 0x0002 /* file & pipe */ |
| 910 | #define FILE_ADD_FILE 0x0002 /* directory */ |
| 911 | #define FILE_APPEND_DATA 0x0004 /* file */ |
| 912 | #define FILE_ADD_SUBDIRECTORY 0x0004 /* directory */ |
| 913 | #define FILE_CREATE_PIPE_INSTANCE 0x0004 /* named pipe */ |
| 914 | #define FILE_READ_EA 0x0008 /* file & directory */ |
| 915 | #define FILE_READ_PROPERTIES FILE_READ_EA |
| 916 | #define FILE_WRITE_EA 0x0010 /* file & directory */ |
| 917 | #define FILE_WRITE_PROPERTIES FILE_WRITE_EA |
| 918 | #define FILE_EXECUTE 0x0020 /* file */ |
| 919 | #define FILE_TRAVERSE 0x0020 /* directory */ |
| 920 | #define FILE_DELETE_CHILD 0x0040 /* directory */ |
| 921 | #define FILE_READ_ATTRIBUTES 0x0080 /* all */ |
| 922 | #define FILE_WRITE_ATTRIBUTES 0x0100 /* all */ |
| 923 | #define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1ff) |
| 924 | |
| 925 | #define FILE_GENERIC_READ (STANDARD_RIGHTS_READ | FILE_READ_DATA | \ |
| 926 | FILE_READ_ATTRIBUTES | FILE_READ_EA | \ |
| 927 | SYNCHRONIZE) |
| 928 | #define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | \ |
| 929 | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | \ |
| 930 | FILE_APPEND_DATA | SYNCHRONIZE) |
| 931 | #define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE | FILE_EXECUTE | \ |
| 932 | FILE_READ_ATTRIBUTES | SYNCHRONIZE) |
| 933 | |
Alexandre Julliard | a845b88 | 1998-06-01 10:44:35 +0000 | [diff] [blame] | 934 | |
Michael Veksler | 17822f4 | 1999-02-09 15:46:25 +0000 | [diff] [blame] | 935 | /* File attribute flags |
| 936 | */ |
| 937 | #define FILE_SHARE_READ 0x00000001L |
| 938 | #define FILE_SHARE_WRITE 0x00000002L |
| 939 | #define FILE_SHARE_DELETE 0x00000004L |
| 940 | #define FILE_ATTRIBUTE_READONLY 0x00000001L |
| 941 | #define FILE_ATTRIBUTE_HIDDEN 0x00000002L |
| 942 | #define FILE_ATTRIBUTE_SYSTEM 0x00000004L |
| 943 | #define FILE_ATTRIBUTE_LABEL 0x00000008L /* Not in Windows API */ |
| 944 | #define FILE_ATTRIBUTE_DIRECTORY 0x00000010L |
| 945 | #define FILE_ATTRIBUTE_ARCHIVE 0x00000020L |
| 946 | #define FILE_ATTRIBUTE_NORMAL 0x00000080L |
| 947 | #define FILE_ATTRIBUTE_TEMPORARY 0x00000100L |
| 948 | #define FILE_ATTRIBUTE_ATOMIC_WRITE 0x00000200L |
| 949 | #define FILE_ATTRIBUTE_XACTION_WRITE 0x00000400L |
| 950 | #define FILE_ATTRIBUTE_COMPRESSED 0x00000800L |
| 951 | #define FILE_ATTRIBUTE_OFFLINE 0x00001000L |
| 952 | |
| 953 | /* File alignments (NT) */ |
| 954 | #define FILE_BYTE_ALIGNMENT 0x00000000 |
| 955 | #define FILE_WORD_ALIGNMENT 0x00000001 |
| 956 | #define FILE_LONG_ALIGNMENT 0x00000003 |
| 957 | #define FILE_QUAD_ALIGNMENT 0x00000007 |
| 958 | #define FILE_OCTA_ALIGNMENT 0x0000000f |
| 959 | #define FILE_32_BYTE_ALIGNMENT 0x0000001f |
| 960 | #define FILE_64_BYTE_ALIGNMENT 0x0000003f |
| 961 | #define FILE_128_BYTE_ALIGNMENT 0x0000007f |
| 962 | #define FILE_256_BYTE_ALIGNMENT 0x000000ff |
| 963 | #define FILE_512_BYTE_ALIGNMENT 0x000001ff |
| 964 | |
Alexandre Julliard | a845b88 | 1998-06-01 10:44:35 +0000 | [diff] [blame] | 965 | /* Registry security values */ |
| 966 | #define OWNER_SECURITY_INFORMATION 0x00000001 |
| 967 | #define GROUP_SECURITY_INFORMATION 0x00000002 |
| 968 | #define DACL_SECURITY_INFORMATION 0x00000004 |
| 969 | #define SACL_SECURITY_INFORMATION 0x00000008 |
| 970 | |
Patrik Stridvall | c7a8dde | 1999-04-25 12:36:53 +0000 | [diff] [blame] | 971 | #include "poppack.h" |
Joerg Mayer | 8de3ba8 | 1999-04-03 16:26:36 +0000 | [diff] [blame] | 972 | |
Alexandre Julliard | 329f068 | 1996-04-14 13:21:20 +0000 | [diff] [blame] | 973 | #endif /* __WINE_WINNT_H */ |