2 * Win32 definitions for Windows NT
4 * Copyright 1996 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
41 #define NTSYSAPI DECLSPEC_IMPORT
44 #define NTAPI __stdcall
47 # if defined(_MSC_VER)
48 # define DECLSPEC_IMPORT __declspec(dllimport)
49 # elif defined(__MINGW32__) || defined(__CYGWIN__)
50 # define DECLSPEC_IMPORT __attribute__((dllimport))
52 # define DECLSPEC_IMPORT DECLSPEC_HIDDEN
55 # define DECLSPEC_IMPORT
58 #ifndef DECLSPEC_NORETURN
59 # if defined(_MSC_VER) && (_MSC_VER >= 1200) && !defined(MIDL_PASS)
60 # define DECLSPEC_NORETURN __declspec(noreturn)
61 # elif defined(__GNUC__)
62 # define DECLSPEC_NORETURN __attribute__((noreturn))
64 # define DECLSPEC_NORETURN
68 #ifndef DECLSPEC_ALIGN
69 # if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
70 # define DECLSPEC_ALIGN(x) __declspec(align(x))
71 # elif defined(__GNUC__)
72 # define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
74 # define DECLSPEC_ALIGN(x)
78 #ifndef DECLSPEC_CACHEALIGN
79 # define DECLSPEC_CACHEALIGN DECLSPEC_ALIGN(128)
83 # if defined(_MSC_VER) && (_MSC_VER >= 1100) && defined (__cplusplus)
84 # define DECLSPEC_UUID(x) __declspec(uuid(x))
86 # define DECLSPEC_UUID(x)
90 #ifndef DECLSPEC_NOVTABLE
91 # if defined(_MSC_VER) && (_MSC_VER >= 1100) && defined(__cplusplus)
92 # define DECLSPEC_NOVTABLE __declspec(novtable)
94 # define DECLSPEC_NOVTABLE
98 #ifndef DECLSPEC_SELECTANY
99 #if defined(_MSC_VER) && (_MSC_VER >= 1100)
100 #define DECLSPEC_SELECTANY __declspec(selectany)
102 #define DECLSPEC_SELECTANY
107 # if defined(_MSC_VER) && (_MSC_VER >= 1210)
108 # define NOP_FUNCTION __noop
110 # define NOP_FUNCTION (void)0
114 #ifndef DECLSPEC_ADDRSAFE
115 # if defined(_MSC_VER) && (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64))
116 # define DECLSPEC_ADDRSAFE __declspec(address_safe)
118 # define DECLSPEC_ADDRSAFE
123 # if defined(_MSC_VER) && (_MSC_VER >= 1200)
124 # define FORCEINLINE __forceinline
125 # elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2)))
126 # define FORCEINLINE inline __attribute__((always_inline))
128 # define FORCEINLINE inline
132 #ifndef DECLSPEC_DEPRECATED
133 # if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
134 # define DECLSPEC_DEPRECATED __declspec(deprecated)
135 # define DEPRECATE_SUPPORTED
136 # elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2)))
137 # define DECLSPEC_DEPRECATED __attribute__((deprecated))
138 # define DEPRECATE_SUPPORTED
140 # define DECLSPEC_DEPRECATED
141 # undef DEPRECATE_SUPPORTED
145 /* a couple of useful Wine extensions */
148 # define DECLSPEC_EXPORT __declspec(dllexport)
149 #elif defined(__MINGW32__)
150 # define DECLSPEC_EXPORT __attribute__((dllexport))
151 #elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) && !defined(__sun)
152 # define DECLSPEC_EXPORT __attribute__((visibility ("default")))
154 # define DECLSPEC_EXPORT
157 #if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__) || defined(__sun)
158 # define DECLSPEC_HIDDEN
159 #elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
160 # define DECLSPEC_HIDDEN __attribute__((visibility ("hidden")))
162 # define DECLSPEC_HIDDEN
165 #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
166 #define __WINE_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
168 #define __WINE_ALLOC_SIZE(x)
171 /* Anonymous union/struct handling */
173 #ifndef NONAMELESSSTRUCT
175 /* Anonymous struct support starts with gcc 2.96 or gcc/g++ 3.x */
176 # if (__GNUC__ < 2) || ((__GNUC__ == 2) && (defined(__cplusplus) || (__GNUC_MINOR__ < 96)))
177 # define NONAMELESSSTRUCT
179 # elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
180 # define NONAMELESSSTRUCT
182 #endif /* NONAMELESSSTRUCT */
184 #ifndef NONAMELESSUNION
186 /* Anonymous unions support starts with gcc 2.96/g++ 2.95 */
187 # if (__GNUC__ < 2) || ((__GNUC__ == 2) && ((__GNUC_MINOR__ < 95) || ((__GNUC_MINOR__ == 95) && !defined(__cplusplus))))
188 # define NONAMELESSUNION
190 # elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
191 # define NONAMELESSUNION
193 #endif /* NONAMELESSUNION */
195 #undef DUMMYSTRUCTNAME
196 #undef DUMMYSTRUCTNAME1
197 #undef DUMMYSTRUCTNAME2
198 #undef DUMMYSTRUCTNAME3
199 #undef DUMMYSTRUCTNAME4
200 #undef DUMMYSTRUCTNAME5
201 #ifndef NONAMELESSSTRUCT
202 #define DUMMYSTRUCTNAME
203 #define DUMMYSTRUCTNAME1
204 #define DUMMYSTRUCTNAME2
205 #define DUMMYSTRUCTNAME3
206 #define DUMMYSTRUCTNAME4
207 #define DUMMYSTRUCTNAME5
208 #else /* !defined(NONAMELESSSTRUCT) */
209 #define DUMMYSTRUCTNAME s
210 #define DUMMYSTRUCTNAME1 s1
211 #define DUMMYSTRUCTNAME2 s2
212 #define DUMMYSTRUCTNAME3 s3
213 #define DUMMYSTRUCTNAME4 s4
214 #define DUMMYSTRUCTNAME5 s5
215 #endif /* !defined(NONAMELESSSTRUCT) */
217 #undef DUMMYUNIONNAME
218 #undef DUMMYUNIONNAME1
219 #undef DUMMYUNIONNAME2
220 #undef DUMMYUNIONNAME3
221 #undef DUMMYUNIONNAME4
222 #undef DUMMYUNIONNAME5
223 #undef DUMMYUNIONNAME6
224 #undef DUMMYUNIONNAME7
225 #undef DUMMYUNIONNAME8
226 #ifndef NONAMELESSUNION
227 #define DUMMYUNIONNAME
228 #define DUMMYUNIONNAME1
229 #define DUMMYUNIONNAME2
230 #define DUMMYUNIONNAME3
231 #define DUMMYUNIONNAME4
232 #define DUMMYUNIONNAME5
233 #define DUMMYUNIONNAME6
234 #define DUMMYUNIONNAME7
235 #define DUMMYUNIONNAME8
236 #else /* !defined(NONAMELESSUNION) */
237 #define DUMMYUNIONNAME u
238 #define DUMMYUNIONNAME1 u1
239 #define DUMMYUNIONNAME2 u2
240 #define DUMMYUNIONNAME3 u3
241 #define DUMMYUNIONNAME4 u4
242 #define DUMMYUNIONNAME5 u5
243 #define DUMMYUNIONNAME6 u6
244 #define DUMMYUNIONNAME7 u7
245 #define DUMMYUNIONNAME8 u8
246 #endif /* !defined(NONAMELESSUNION) */
248 #undef __C89_NAMELESS
249 #undef __C89_NAMELESSSTRUCTNAME
250 #undef __C89_NAMELESSSTRUCTNAME1
251 #undef __C89_NAMELESSSTRUCTNAME2
252 #undef __C89_NAMELESSSTRUCTNAME3
253 #undef __C89_NAMELESSSTRUCTNAME4
254 #undef __C89_NAMELESSSTRUCTNAME5
255 #undef __C89_NAMELESSUNIONNAME
256 #undef __C89_NAMELESSUNIONNAME1
257 #undef __C89_NAMELESSUNIONNAME2
258 #undef __C89_NAMELESSUNIONNAME3
259 #undef __C89_NAMELESSUNIONNAME4
260 #undef __C89_NAMELESSUNIONNAME5
261 #undef __C89_NAMELESSUNIONNAME6
262 #undef __C89_NAMELESSUNIONNAME7
263 #undef __C89_NAMELESSUNIONNAME8
265 #if !defined(__WINESRC__) && !defined(WINE_NO_NAMELESS_EXTENSION)
267 /* Anonymous structs support starts with gcc 2.96/g++ 2.95 */
268 # if (__GNUC__ > 2) || ((__GNUC__ == 2) && ((__GNUC_MINOR__ > 95) || ((__GNUC_MINOR__ == 95) && defined(__cplusplus))))
269 # define __C89_NAMELESS __extension__
271 # elif defined(_MSC_VER)
272 # define __C89_NAMELESS
276 #ifdef __C89_NAMELESS
277 # define __C89_NAMELESSSTRUCTNAME
278 # define __C89_NAMELESSSTRUCTNAME1
279 # define __C89_NAMELESSSTRUCTNAME2
280 # define __C89_NAMELESSSTRUCTNAME3
281 # define __C89_NAMELESSSTRUCTNAME4
282 # define __C89_NAMELESSSTRUCTNAME5
283 # define __C89_NAMELESSUNIONNAME
284 # define __C89_NAMELESSUNIONNAME1
285 # define __C89_NAMELESSUNIONNAME2
286 # define __C89_NAMELESSUNIONNAME3
287 # define __C89_NAMELESSUNIONNAME4
288 # define __C89_NAMELESSUNIONNAME5
289 # define __C89_NAMELESSUNIONNAME6
290 # define __C89_NAMELESSUNIONNAME7
291 # define __C89_NAMELESSUNIONNAME8
293 # define __C89_NAMELESS
294 # define __C89_NAMELESSSTRUCTNAME DUMMYSTRUCTNAME
295 # define __C89_NAMELESSSTRUCTNAME1 DUMMYSTRUCTNAME1
296 # define __C89_NAMELESSSTRUCTNAME2 DUMMYSTRUCTNAME2
297 # define __C89_NAMELESSSTRUCTNAME3 DUMMYSTRUCTNAME3
298 # define __C89_NAMELESSSTRUCTNAME4 DUMMYSTRUCTNAME4
299 # define __C89_NAMELESSSTRUCTNAME5 DUMMYSTRUCTNAME5
300 # define __C89_NAMELESSUNIONNAME DUMMYUNIONNAME
301 # define __C89_NAMELESSUNIONNAME1 DUMMYUNIONNAME1
302 # define __C89_NAMELESSUNIONNAME2 DUMMYUNIONNAME2
303 # define __C89_NAMELESSUNIONNAME3 DUMMYUNIONNAME3
304 # define __C89_NAMELESSUNIONNAME4 DUMMYUNIONNAME4
305 # define __C89_NAMELESSUNIONNAME5 DUMMYUNIONNAME5
306 # define __C89_NAMELESSUNIONNAME6 DUMMYUNIONNAME6
307 # define __C89_NAMELESSUNIONNAME7 DUMMYUNIONNAME7
308 # define __C89_NAMELESSUNIONNAME8 DUMMYUNIONNAME8
311 /* C99 restrict support */
313 #if defined(ENABLE_RESTRICTED) && !defined(MIDL_PASS) && !defined(RC_INVOKED)
314 # if defined(_MSC_VER) && defined(_M_MRX000)
315 # define RESTRICTED_POINTER __restrict
316 # elif defined(__GNUC__) && ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)))
317 # define RESTRICTED_POINTER __restrict
319 # define RESTRICTED_POINTER
322 # define RESTRICTED_POINTER
325 /* C99 unaligned support */
328 #if defined(_MSC_VER) && (defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64))
329 # define UNALIGNED __unaligned
331 # define UNALIGNED64 __unaligned
341 /* Alignment macros */
343 #if defined(_WIN64) || (defined(_MSC_VER) && defined(_M_ALPHA)) || defined(__alpha__)
344 #define MAX_NATURAL_ALIGNMENT sizeof(ULONGLONG)
345 #define MEMORY_ALLOCATION_ALIGNMENT 16
347 #define MAX_NATURAL_ALIGNMENT sizeof(DWORD)
348 #define MEMORY_ALLOCATION_ALIGNMENT 8
351 #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
352 # define TYPE_ALIGNMENT(t) __alignof(t)
353 #elif defined(__GNUC__)
354 # define TYPE_ALIGNMENT(t) __alignof__(t)
356 # define TYPE_ALIGNMENT(t) FIELD_OFFSET(struct { char x; t test; }, test)
360 # define PROBE_ALIGNMENT(_s) \
361 (TYPE_ALIGNMENT(_s) > TYPE_ALIGNMENT(DWORD) ? \
362 TYPE_ALIGNMENT(_s) : TYPE_ALIGNMENT(DWORD))
363 # define PROBE_ALIGNMENT32(_s) TYPE_ALIGNMENT(DWORD)
365 # define PROBE_ALIGNMENT(_s) TYPE_ALIGNMENT(DWORD)
368 /* Compile time assertion */
370 #if defined(_MSC_VER)
371 # define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1]
373 # define C_ASSERT(e) extern void __C_ASSERT__(int [(e)?1:-1])
376 /* Eliminate Microsoft C/C++ compiler warning 4715 */
377 #if defined(_MSC_VER) && (_MSC_VER > 1200)
378 # define DEFAULT_UNREACHABLE default: __assume(0)
379 #elif defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5))))
380 # define DEFAULT_UNREACHABLE default: __builtin_unreachable()
382 # define DEFAULT_UNREACHABLE default:
386 #define APPLICATION_ERROR_MASK 0x20000000
387 #define ERROR_SEVERITY_SUCCESS 0x00000000
388 #define ERROR_SEVERITY_INFORMATIONAL 0x40000000
389 #define ERROR_SEVERITY_WARNING 0x80000000
390 #define ERROR_SEVERITY_ERROR 0xC0000000
393 #define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \
395 inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a)|((int)b)); } \
396 inline ENUMTYPE operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) |= ((int)b)); } \
397 inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a)&((int)b)); } \
398 inline ENUMTYPE operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) &= ((int)b)); } \
399 inline ENUMTYPE operator ~ (ENUMTYPE a) { return (ENUMTYPE)(~((int)a)); } \
400 inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a)^((int)b)); } \
401 inline ENUMTYPE operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) ^= ((int)b)); } \
404 #define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) /* */
407 /* Microsoft's macros for declaring functions */
410 # define EXTERN_C extern "C"
412 # define EXTERN_C extern
415 #define STDMETHODCALLTYPE __stdcall
416 #define STDMETHODVCALLTYPE __cdecl
417 #define STDAPICALLTYPE __stdcall
418 #define STDAPIVCALLTYPE __cdecl
420 #define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
421 #define STDAPI_(type) EXTERN_C type STDAPICALLTYPE
422 #define STDMETHODIMP HRESULT STDMETHODCALLTYPE
423 #define STDMETHODIMP_(type) type STDMETHODCALLTYPE
424 #define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
425 #define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE
426 #define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
427 #define STDMETHODIMPV_(type) type STDMETHODVCALLTYPE
429 /* Define the basic types */
434 typedef VOID
*PVOID64
;
435 typedef BYTE BOOLEAN
, *PBOOLEAN
;
436 typedef char CHAR
, *PCHAR
;
437 typedef short SHORT
, *PSHORT
;
439 typedef long LONG
, *PLONG
;
441 typedef int LONG
, *PLONG
;
444 /* Some systems might have wchar_t, but we really need 16 bit characters */
445 #ifdef WINE_UNICODE_NATIVE
446 typedef wchar_t WCHAR
, *PWCHAR
;
448 typedef unsigned short WCHAR
, *PWCHAR
;
451 typedef ULONG UCSCHAR
;
452 #define MIN_UCSCHAR (0)
453 #define MAX_UCSCHAR (0x0010ffff)
454 #define UCSCHAR_INVALID_CHARACTER (0xffffffff)
456 /* 'Extended/Wide' numerical types */
460 typedef signed __int64 LONGLONG
, *PLONGLONG
;
461 typedef unsigned __int64 ULONGLONG
, *PULONGLONG
;
463 typedef signed __int64
DECLSPEC_ALIGN(8) LONGLONG
, *PLONGLONG
;
464 typedef unsigned __int64
DECLSPEC_ALIGN(8) ULONGLONG
, *PULONGLONG
;
471 typedef ULONGLONG DWORDLONG
, *PDWORDLONG
;
473 typedef ULONGLONG
DECLSPEC_ALIGN(8) DWORDLONG
, *PDWORDLONG
;
477 /* ANSI string types */
478 typedef CHAR
*PCH
, *LPCH
, *PNZCH
;
479 typedef const CHAR
*PCCH
, *LPCCH
, *PCNZCH
;
480 typedef CHAR
*PSTR
, *LPSTR
, *NPSTR
;
481 typedef const CHAR
*PCSTR
, *LPCSTR
;
482 typedef CHAR
*PZZSTR
;
483 typedef const CHAR
*PCZZSTR
;
485 /* Unicode string types */
486 typedef const WCHAR
*PCWCHAR
, *LPCUWCHAR
, *PCUWCHAR
;
487 typedef WCHAR
*PWCH
, *LPWCH
;
488 typedef const WCHAR
*PCWCH
, *LPCWCH
;
489 typedef WCHAR
*PNZWCH
, *PUNZWCH
;
490 typedef const WCHAR
*PCNZWCH
, *PCUNZWCH
;
491 typedef WCHAR
*PWSTR
, *LPWSTR
, *NWPSTR
;
492 typedef const WCHAR
*PCWSTR
, *LPCWSTR
;
493 typedef WCHAR
*PZZWSTR
, *PUZZWSTR
;
494 typedef const WCHAR
*PCZZWSTR
, *PCUZZWSTR
;
495 typedef PWSTR
*PZPWSTR
;
496 typedef PCWSTR
*PZPCWSTR
;
498 /* Neutral character and string types */
499 /* These are only defined for Winelib, i.e. _not_ defined for
500 * the emulator. The reason is they depend on the UNICODE
501 * macro which only exists in the user's code.
503 #ifndef WINE_NO_UNICODE_MACROS
505 # ifndef _TCHAR_DEFINED
506 typedef WCHAR TCHAR
, *PTCHAR
;
507 # define _TCHAR_DEFINED
509 typedef LPWCH PTCH
, LPTCH
;
510 typedef LPCWCH PCTCH
, LPCTCH
;
511 typedef LPWSTR PTSTR
, LPTSTR
;
512 typedef LPCWSTR PCTSTR
, LPCTSTR
;
513 typedef LPWSTR PUTSTR
, LPUTSTR
;
514 typedef LPCWSTR PCUTSTR
, LPCUTSTR
;
515 typedef PNZWCH PNZTCH
;
516 typedef PUNZWCH PUNZTCH
;
517 typedef PCNZWCH PCNZTCH
;
518 typedef PCUNZWCH PCUNZTCH
;
519 typedef PZZWSTR PZZTSTR
;
520 typedef PCZZWSTR PCZZTSTR
;
521 typedef PUZZWSTR PUZZTSTR
;
522 typedef PCUZZWSTR PCUZZTSTR
;
524 # ifndef _TCHAR_DEFINED
525 typedef CHAR TCHAR
, *PTCHAR
;
526 # define _TCHAR_DEFINED
528 typedef LPCH PTCH
, LPTCH
;
529 typedef LPCCH PCTCH
, LPCTCH
;
530 typedef LPSTR PTSTR
, LPTSTR
;
531 typedef LPCSTR PCTSTR
, LPCTSTR
;
532 typedef PNZCH PNZTCH
, PUNZTCH
;
533 typedef PCNZCH PCNZTCH
, PCUNZTCH
;
534 typedef PZZSTR PZZTSTR
, PUZZTSTR
;
535 typedef PCZZSTR PCZZTSTR
, PCUZZTSTR
;
536 # endif /* UNICODE */
537 #endif /* WINE_NO_UNICODE_MACROS */
539 /* UCS string types */
540 typedef UCSCHAR
*PUCSCHAR
, *PUUCSCHAR
;
541 typedef const UCSCHAR
*PCUCSCHAR
, *PCUUCSCHAR
;
542 typedef UCSCHAR
*PUCSSTR
, *PUUCSSTR
;
543 typedef const UCSCHAR
*PCUCSSTR
, *PCUUCSSTR
;
545 /* Misc common WIN32 types */
547 typedef DWORD LCID
, *PLCID
;
549 typedef DWORD EXECUTION_STATE
;
550 #ifndef _HRESULT_DEFINED
551 #define _HRESULT_DEFINED
552 typedef LONG HRESULT
;
557 typedef void *HANDLE
;
558 typedef HANDLE
*PHANDLE
, *LPHANDLE
;
561 #define DECLARE_HANDLE(a) typedef struct a##__ { int unused; } *a
563 #define DECLARE_HANDLE(a) typedef HANDLE a
570 /* Macro to deal with LP64 <=> LLP64 differences in numeric constants with 'l' modifier */
572 # if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__)
573 # define __MSABI_LONG(x) x ## l
575 # define __MSABI_LONG(x) x
581 #ifndef WIN32_NO_STATUS
583 #define STATUS_WAIT_0 ((DWORD) 0x00000000)
584 #define STATUS_ABANDONED_WAIT_0 ((DWORD) 0x00000080)
585 #define STATUS_USER_APC ((DWORD) 0x000000C0)
586 #define STATUS_TIMEOUT ((DWORD) 0x00000102)
587 #define STATUS_PENDING ((DWORD) 0x00000103)
588 #define STATUS_SEGMENT_NOTIFICATION ((DWORD) 0x40000005)
589 #define STATUS_GUARD_PAGE_VIOLATION ((DWORD) 0x80000001)
590 #define STATUS_DATATYPE_MISALIGNMENT ((DWORD) 0x80000002)
591 #define STATUS_BREAKPOINT ((DWORD) 0x80000003)
592 #define STATUS_SINGLE_STEP ((DWORD) 0x80000004)
593 #define STATUS_ACCESS_VIOLATION ((DWORD) 0xC0000005)
594 #define STATUS_IN_PAGE_ERROR ((DWORD) 0xC0000006)
595 #define STATUS_INVALID_HANDLE ((DWORD) 0xC0000008)
596 #define STATUS_NO_MEMORY ((DWORD) 0xC0000017)
597 #define STATUS_ILLEGAL_INSTRUCTION ((DWORD) 0xC000001D)
598 #define STATUS_NONCONTINUABLE_EXCEPTION ((DWORD) 0xC0000025)
599 #define STATUS_INVALID_DISPOSITION ((DWORD) 0xC0000026)
600 #define STATUS_ARRAY_BOUNDS_EXCEEDED ((DWORD) 0xC000008C)
601 #define STATUS_FLOAT_DENORMAL_OPERAND ((DWORD) 0xC000008D)
602 #define STATUS_FLOAT_DIVIDE_BY_ZERO ((DWORD) 0xC000008E)
603 #define STATUS_FLOAT_INEXACT_RESULT ((DWORD) 0xC000008F)
604 #define STATUS_FLOAT_INVALID_OPERATION ((DWORD) 0xC0000090)
605 #define STATUS_FLOAT_OVERFLOW ((DWORD) 0xC0000091)
606 #define STATUS_FLOAT_STACK_CHECK ((DWORD) 0xC0000092)
607 #define STATUS_FLOAT_UNDERFLOW ((DWORD) 0xC0000093)
608 #define STATUS_INTEGER_DIVIDE_BY_ZERO ((DWORD) 0xC0000094)
609 #define STATUS_INTEGER_OVERFLOW ((DWORD) 0xC0000095)
610 #define STATUS_PRIVILEGED_INSTRUCTION ((DWORD) 0xC0000096)
611 #define STATUS_STACK_OVERFLOW ((DWORD) 0xC00000FD)
612 #define STATUS_CONTROL_C_EXIT ((DWORD) 0xC000013A)
613 #define STATUS_FLOAT_MULTIPLE_FAULTS ((DWORD) 0xC00002B4)
614 #define STATUS_FLOAT_MULTIPLE_TRAPS ((DWORD) 0xC00002B5)
615 #define STATUS_REG_NAT_CONSUMPTION ((DWORD) 0xC00002C9)
616 #define STATUS_SXS_EARLY_DEACTIVATION ((DWORD) 0xC015000F)
617 #define STATUS_SXS_INVALID_DEACTIVATION ((DWORD) 0xC0150010)
619 /* status values for ContinueDebugEvent */
620 #define DBG_EXCEPTION_HANDLED ((DWORD) 0x00010001)
621 #define DBG_CONTINUE ((DWORD) 0x00010002)
622 #define DBG_TERMINATE_THREAD ((DWORD) 0x40010003)
623 #define DBG_TERMINATE_PROCESS ((DWORD) 0x40010004)
624 #define DBG_CONTROL_C ((DWORD) 0x40010005)
625 #define DBG_PRINTEXCEPTION_C ((DWORD) 0x40010006)
626 #define DBG_RIPEXCEPTION ((DWORD) 0x40010007)
627 #define DBG_CONTROL_BREAK ((DWORD) 0x40010008)
628 #define DBG_COMMAND_EXCEPTION ((DWORD) 0x40010009)
629 #define DBG_EXCEPTION_NOT_HANDLED ((DWORD) 0x80010001)
631 #endif /* WIN32_NO_STATUS */
633 /* Argument 1 passed to the DllEntryProc. */
634 #define DLL_PROCESS_DETACH 0 /* detach process (unload library) */
635 #define DLL_PROCESS_ATTACH 1 /* attach process (load library) */
636 #define DLL_THREAD_ATTACH 2 /* attach new thread */
637 #define DLL_THREAD_DETACH 3 /* detach thread */
639 #define DLL_WINE_PREATTACH 8 /* called before process attach for Wine builtins */
642 /* u.x.wProcessorArchitecture (NT) */
643 #define PROCESSOR_ARCHITECTURE_INTEL 0
644 #define PROCESSOR_ARCHITECTURE_MIPS 1
645 #define PROCESSOR_ARCHITECTURE_ALPHA 2
646 #define PROCESSOR_ARCHITECTURE_PPC 3
647 #define PROCESSOR_ARCHITECTURE_SHX 4
648 #define PROCESSOR_ARCHITECTURE_ARM 5
649 #define PROCESSOR_ARCHITECTURE_IA64 6
650 #define PROCESSOR_ARCHITECTURE_ALPHA64 7
651 #define PROCESSOR_ARCHITECTURE_MSIL 8
652 #define PROCESSOR_ARCHITECTURE_AMD64 9
653 #define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 10
654 #define PROCESSOR_ARCHITECTURE_NEUTRAL 11
655 #define PROCESSOR_ARCHITECTURE_ARM64 12
656 #define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
658 /* dwProcessorType */
659 #define PROCESSOR_INTEL_386 386
660 #define PROCESSOR_INTEL_486 486
661 #define PROCESSOR_INTEL_PENTIUM 586
662 #define PROCESSOR_INTEL_860 860
663 #define PROCESSOR_INTEL_IA64 2200
664 #define PROCESSOR_AMD_X8664 8664
665 #define PROCESSOR_MIPS_R2000 2000
666 #define PROCESSOR_MIPS_R3000 3000
667 #define PROCESSOR_MIPS_R4000 4000
668 #define PROCESSOR_ALPHA_21064 21064
669 #define PROCESSOR_PPC_601 601
670 #define PROCESSOR_PPC_603 603
671 #define PROCESSOR_PPC_604 604
672 #define PROCESSOR_PPC_620 620
673 #define PROCESSOR_HITACHI_SH3 10003
674 #define PROCESSOR_HITACHI_SH3E 10004
675 #define PROCESSOR_HITACHI_SH4 10005
676 #define PROCESSOR_MOTOROLA_821 821
677 #define PROCESSOR_SHx_SH3 103
678 #define PROCESSOR_SHx_SH4 104
679 #define PROCESSOR_STRONGARM 2577
680 #define PROCESSOR_ARM720 1824 /* 0x720 */
681 #define PROCESSOR_ARM820 2080 /* 0x820 */
682 #define PROCESSOR_ARM920 2336 /* 0x920 */
683 #define PROCESSOR_ARM_7TDMI 70001
684 #define PROCESSOR_OPTIL 18767
687 #define MAXIMUM_PROCESSORS 64
689 #define MAXIMUM_PROCESSORS 32
692 typedef struct _MEMORY_BASIC_INFORMATION
695 LPVOID AllocationBase
;
696 DWORD AllocationProtect
;
701 } MEMORY_BASIC_INFORMATION
, *PMEMORY_BASIC_INFORMATION
;
703 #define PAGE_NOACCESS 0x01
704 #define PAGE_READONLY 0x02
705 #define PAGE_READWRITE 0x04
706 #define PAGE_WRITECOPY 0x08
707 #define PAGE_EXECUTE 0x10
708 #define PAGE_EXECUTE_READ 0x20
709 #define PAGE_EXECUTE_READWRITE 0x40
710 #define PAGE_EXECUTE_WRITECOPY 0x80
711 #define PAGE_GUARD 0x100
712 #define PAGE_NOCACHE 0x200
713 #define PAGE_WRITECOMBINE 0x400
715 #define MEM_COMMIT 0x00001000
716 #define MEM_RESERVE 0x00002000
717 #define MEM_DECOMMIT 0x00004000
718 #define MEM_RELEASE 0x00008000
719 #define MEM_FREE 0x00010000
720 #define MEM_PRIVATE 0x00020000
721 #define MEM_MAPPED 0x00040000
722 #define MEM_RESET 0x00080000
723 #define MEM_TOP_DOWN 0x00100000
724 #define MEM_WRITE_WATCH 0x00200000
725 #define MEM_PHYSICAL 0x00400000
726 #define MEM_LARGE_PAGES 0x20000000
727 #define MEM_4MB_PAGES 0x80000000
729 #define SEC_FILE 0x00800000
730 #define SEC_IMAGE 0x01000000
731 #define SEC_PROTECTED_IMAGE 0x02000000
732 #define SEC_RESERVE 0x04000000
733 #define SEC_COMMIT 0x08000000
734 #define SEC_NOCACHE 0x10000000
735 #define SEC_WRITECOMBINE 0x40000000
736 #define SEC_LARGE_PAGES 0x80000000
737 #define SEC_IMAGE_NO_EXECUTE (SEC_IMAGE | SEC_NOCACHE)
738 #define MEM_IMAGE SEC_IMAGE
740 #define WRITE_WATCH_FLAG_RESET 0x00000001
742 #define AT_ROUND_TO_PAGE 0x40000000
746 #define MINSHORT 0x8000
747 #define MAXSHORT 0x7fff
748 #define MINLONG 0x80000000
749 #define MAXLONG 0x7fffffff
751 #define MAXWORD 0xffff
752 #define MAXDWORD 0xffffffff
753 #define MAXLONGLONG (((LONGLONG)0x7fffffff << 32) | 0xffffffff)
755 #define UNICODE_STRING_MAX_CHARS 32767
757 #define FIELD_OFFSET(type, field) ((LONG)offsetof(type, field))
759 #define CONTAINING_RECORD(address, type, field) \
760 ((type *)((PCHAR)(address) - offsetof(type, field)))
764 typedef struct _LIST_ENTRY
{
765 struct _LIST_ENTRY
*Flink
;
766 struct _LIST_ENTRY
*Blink
;
767 } LIST_ENTRY
, *PLIST_ENTRY
, * RESTRICTED_POINTER PRLIST_ENTRY
;
769 typedef struct _SINGLE_LIST_ENTRY
{
770 struct _SINGLE_LIST_ENTRY
*Next
;
771 } SINGLE_LIST_ENTRY
, *PSINGLE_LIST_ENTRY
;
775 typedef struct DECLSPEC_ALIGN(16) _SLIST_ENTRY
*PSLIST_ENTRY
;
776 typedef struct DECLSPEC_ALIGN(16) _SLIST_ENTRY
{
780 typedef union DECLSPEC_ALIGN(16) _SLIST_HEADER
{
787 ULONGLONG Sequence
:9;
788 ULONGLONG NextEntry
:39;
789 ULONGLONG HeaderType
:1;
791 ULONGLONG Reserved
:59;
796 ULONGLONG Sequence
:48;
797 ULONGLONG HeaderType
:1;
799 ULONGLONG Reserved
:2;
800 ULONGLONG NextEntry
:60;
802 } SLIST_HEADER
, *PSLIST_HEADER
;
806 #undef SLIST_ENTRY /* for Mac OS */
807 #define SLIST_ENTRY SINGLE_LIST_ENTRY
808 #define _SLIST_ENTRY _SINGLE_LIST_ENTRY
809 #define PSLIST_ENTRY PSINGLE_LIST_ENTRY
811 typedef union _SLIST_HEADER
{
818 } SLIST_HEADER
, *PSLIST_HEADER
;
822 NTSYSAPI PSLIST_ENTRY WINAPI
RtlFirstEntrySList(const SLIST_HEADER
*);
823 NTSYSAPI VOID WINAPI
RtlInitializeSListHead(PSLIST_HEADER
);
824 NTSYSAPI PSLIST_ENTRY WINAPI
RtlInterlockedFlushSList(PSLIST_HEADER
);
825 NTSYSAPI PSLIST_ENTRY WINAPI
RtlInterlockedPopEntrySList(PSLIST_HEADER
);
826 NTSYSAPI PSLIST_ENTRY WINAPI
RtlInterlockedPushEntrySList(PSLIST_HEADER
, PSLIST_ENTRY
);
827 NTSYSAPI WORD WINAPI
RtlQueryDepthSList(PSLIST_HEADER
);
832 #define HEAP_NO_SERIALIZE 0x00000001
833 #define HEAP_GROWABLE 0x00000002
834 #define HEAP_GENERATE_EXCEPTIONS 0x00000004
835 #define HEAP_ZERO_MEMORY 0x00000008
836 #define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010
837 #define HEAP_TAIL_CHECKING_ENABLED 0x00000020
838 #define HEAP_FREE_CHECKING_ENABLED 0x00000040
839 #define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080
840 #define HEAP_CREATE_ALIGN_16 0x00010000
841 #define HEAP_CREATE_ENABLE_TRACING 0x00020000
842 #define HEAP_CREATE_ENABLE_EXECUTE 0x00040000
844 /* This flag allows it to create heaps shared by all processes under win95,
845 FIXME: correct name */
846 #define HEAP_SHARED 0x04000000
848 typedef enum _HEAP_INFORMATION_CLASS
{
849 HeapCompatibilityInformation
,
850 } HEAP_INFORMATION_CLASS
;
852 /* Processor feature flags. */
853 #define PF_FLOATING_POINT_PRECISION_ERRATA 0
854 #define PF_FLOATING_POINT_EMULATED 1
855 #define PF_COMPARE_EXCHANGE_DOUBLE 2
856 #define PF_MMX_INSTRUCTIONS_AVAILABLE 3
857 #define PF_PPC_MOVEMEM_64BIT_OK 4
858 #define PF_ALPHA_BYTE_INSTRUCTIONS 5
859 #define PF_XMMI_INSTRUCTIONS_AVAILABLE 6
860 #define PF_3DNOW_INSTRUCTIONS_AVAILABLE 7
861 #define PF_RDTSC_INSTRUCTION_AVAILABLE 8
862 #define PF_PAE_ENABLED 9
863 #define PF_XMMI64_INSTRUCTIONS_AVAILABLE 10
864 #define PF_SSE_DAZ_MODE_AVAILABLE 11
865 #define PF_NX_ENABLED 12
866 #define PF_SSE3_INSTRUCTIONS_AVAILABLE 13
867 #define PF_COMPARE_EXCHANGE128 14
868 #define PF_COMPARE64_EXCHANGE128 15
869 #define PF_CHANNELS_ENABLED 16
870 #define PF_XSAVE_ENABLED 17
871 #define PF_ARM_VFP_32_REGISTERS_AVAILABLE 18
872 #define PF_ARM_NEON_INSTRUCTIONS_AVAILABLE 19
873 #define PF_SECOND_LEVEL_ADDRESS_TRANSLATION 20
874 #define PF_VIRT_FIRMWARE_ENABLED 21
875 #define PF_RDWRFSGSBASE_AVAILABLE 22
876 #define PF_FASTFAIL_AVAILABLE 23
877 #define PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE 24
878 #define PF_ARM_64BIT_LOADSTORE_ATOMIC 25
879 #define PF_ARM_EXTERNAL_CACHE_AVAILABLE 26
880 #define PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE 27
881 #define PF_RDRAND_INSTRUCTION_AVAILABLE 28
882 #define PF_ARM_V8_INSTRUCTIONS_AVAILABLE 29
883 #define PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE 30
884 #define PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE 31
887 /* Execution state flags */
888 #define ES_SYSTEM_REQUIRED 0x00000001
889 #define ES_DISPLAY_REQUIRED 0x00000002
890 #define ES_USER_PRESENT 0x00000004
891 #define ES_CONTINUOUS 0x80000000
893 /* The Win32 register context */
895 /* i386 context definitions */
898 #define SIZE_OF_80387_REGISTERS 80
900 typedef struct _FLOATING_SAVE_AREA
909 BYTE RegisterArea
[SIZE_OF_80387_REGISTERS
];
911 } FLOATING_SAVE_AREA
, *PFLOATING_SAVE_AREA
;
913 #define MAXIMUM_SUPPORTED_EXTENSION 512
915 typedef struct _CONTEXT
919 /* These are selected by CONTEXT_DEBUG_REGISTERS */
927 /* These are selected by CONTEXT_FLOATING_POINT */
928 FLOATING_SAVE_AREA FloatSave
;
930 /* These are selected by CONTEXT_SEGMENTS */
936 /* These are selected by CONTEXT_INTEGER */
944 /* These are selected by CONTEXT_CONTROL */
952 BYTE ExtendedRegisters
[MAXIMUM_SUPPORTED_EXTENSION
];
955 #define CONTEXT_X86 0x00010000
956 #define CONTEXT_i386 CONTEXT_X86
957 #define CONTEXT_i486 CONTEXT_X86
959 #define CONTEXT_CONTROL (CONTEXT_i386 | 0x0001) /* SS:SP, CS:IP, FLAGS, BP */
960 #define CONTEXT_INTEGER (CONTEXT_i386 | 0x0002) /* AX, BX, CX, DX, SI, DI */
961 #define CONTEXT_SEGMENTS (CONTEXT_i386 | 0x0004) /* DS, ES, FS, GS */
962 #define CONTEXT_FLOATING_POINT (CONTEXT_i386 | 0x0008) /* 387 state */
963 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386 | 0x0010) /* DB 0-3,6,7 */
964 #define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386 | 0x0020)
965 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS)
966 #define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | \
967 CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS | CONTEXT_EXTENDED_REGISTERS)
969 #define EXCEPTION_READ_FAULT 0
970 #define EXCEPTION_WRITE_FAULT 1
971 #define EXCEPTION_EXECUTE_FAULT 8
973 #endif /* __i386__ */
975 typedef struct _LDT_ENTRY
{
990 unsigned LimitHi
: 4;
992 unsigned Reserved_0
: 1;
993 unsigned Default_Big
: 1;
994 unsigned Granularity
: 1;
998 } LDT_ENTRY
, *PLDT_ENTRY
;
1000 /* x86-64 context definitions */
1001 #if defined(__x86_64__)
1003 #define CONTEXT_AMD64 0x00100000
1005 #define CONTEXT_CONTROL (CONTEXT_AMD64 | 0x0001)
1006 #define CONTEXT_INTEGER (CONTEXT_AMD64 | 0x0002)
1007 #define CONTEXT_SEGMENTS (CONTEXT_AMD64 | 0x0004)
1008 #define CONTEXT_FLOATING_POINT (CONTEXT_AMD64 | 0x0008)
1009 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_AMD64 | 0x0010)
1010 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)
1011 #define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS)
1013 #define EXCEPTION_READ_FAULT 0
1014 #define EXCEPTION_WRITE_FAULT 1
1015 #define EXCEPTION_EXECUTE_FAULT 8
1017 typedef struct DECLSPEC_ALIGN(16) _M128A
{
1022 typedef struct _XMM_SAVE_AREA32
{
1023 WORD ControlWord
; /* 000 */
1024 WORD StatusWord
; /* 002 */
1025 BYTE TagWord
; /* 004 */
1026 BYTE Reserved1
; /* 005 */
1027 WORD ErrorOpcode
; /* 006 */
1028 DWORD ErrorOffset
; /* 008 */
1029 WORD ErrorSelector
; /* 00c */
1030 WORD Reserved2
; /* 00e */
1031 DWORD DataOffset
; /* 010 */
1032 WORD DataSelector
; /* 014 */
1033 WORD Reserved3
; /* 016 */
1034 DWORD MxCsr
; /* 018 */
1035 DWORD MxCsr_Mask
; /* 01c */
1036 M128A FloatRegisters
[8]; /* 020 */
1037 M128A XmmRegisters
[16]; /* 0a0 */
1038 BYTE Reserved4
[96]; /* 1a0 */
1039 } XMM_SAVE_AREA32
, *PXMM_SAVE_AREA32
;
1041 typedef struct DECLSPEC_ALIGN(16) _CONTEXT
{
1042 DWORD64 P1Home
; /* 000 */
1043 DWORD64 P2Home
; /* 008 */
1044 DWORD64 P3Home
; /* 010 */
1045 DWORD64 P4Home
; /* 018 */
1046 DWORD64 P5Home
; /* 020 */
1047 DWORD64 P6Home
; /* 028 */
1050 DWORD ContextFlags
; /* 030 */
1051 DWORD MxCsr
; /* 034 */
1054 WORD SegCs
; /* 038 */
1055 WORD SegDs
; /* 03a */
1056 WORD SegEs
; /* 03c */
1057 WORD SegFs
; /* 03e */
1058 WORD SegGs
; /* 040 */
1059 WORD SegSs
; /* 042 */
1060 DWORD EFlags
; /* 044 */
1063 DWORD64 Dr0
; /* 048 */
1064 DWORD64 Dr1
; /* 050 */
1065 DWORD64 Dr2
; /* 058 */
1066 DWORD64 Dr3
; /* 060 */
1067 DWORD64 Dr6
; /* 068 */
1068 DWORD64 Dr7
; /* 070 */
1071 DWORD64 Rax
; /* 078 */
1072 DWORD64 Rcx
; /* 080 */
1073 DWORD64 Rdx
; /* 088 */
1074 DWORD64 Rbx
; /* 090 */
1075 DWORD64 Rsp
; /* 098 */
1076 DWORD64 Rbp
; /* 0a0 */
1077 DWORD64 Rsi
; /* 0a8 */
1078 DWORD64 Rdi
; /* 0b0 */
1079 DWORD64 R8
; /* 0b8 */
1080 DWORD64 R9
; /* 0c0 */
1081 DWORD64 R10
; /* 0c8 */
1082 DWORD64 R11
; /* 0d0 */
1083 DWORD64 R12
; /* 0d8 */
1084 DWORD64 R13
; /* 0e0 */
1085 DWORD64 R14
; /* 0e8 */
1086 DWORD64 R15
; /* 0f0 */
1089 DWORD64 Rip
; /* 0f8 */
1091 /* Floating point */
1093 XMM_SAVE_AREA32 FltSave
; /* 100 */
1095 M128A Header
[2]; /* 100 */
1096 M128A Legacy
[8]; /* 120 */
1097 M128A Xmm0
; /* 1a0 */
1098 M128A Xmm1
; /* 1b0 */
1099 M128A Xmm2
; /* 1c0 */
1100 M128A Xmm3
; /* 1d0 */
1101 M128A Xmm4
; /* 1e0 */
1102 M128A Xmm5
; /* 1f0 */
1103 M128A Xmm6
; /* 200 */
1104 M128A Xmm7
; /* 210 */
1105 M128A Xmm8
; /* 220 */
1106 M128A Xmm9
; /* 230 */
1107 M128A Xmm10
; /* 240 */
1108 M128A Xmm11
; /* 250 */
1109 M128A Xmm12
; /* 260 */
1110 M128A Xmm13
; /* 270 */
1111 M128A Xmm14
; /* 280 */
1112 M128A Xmm15
; /* 290 */
1117 M128A VectorRegister
[26]; /* 300 */
1118 DWORD64 VectorControl
; /* 4a0 */
1121 DWORD64 DebugControl
; /* 4a8 */
1122 DWORD64 LastBranchToRip
; /* 4b0 */
1123 DWORD64 LastBranchFromRip
; /* 4b8 */
1124 DWORD64 LastExceptionToRip
; /* 4c0 */
1125 DWORD64 LastExceptionFromRip
; /* 4c8 */
1128 typedef struct _RUNTIME_FUNCTION
1133 } RUNTIME_FUNCTION
, *PRUNTIME_FUNCTION
;
1135 #define UNWIND_HISTORY_TABLE_SIZE 12
1137 typedef struct _UNWIND_HISTORY_TABLE_ENTRY
1140 PRUNTIME_FUNCTION FunctionEntry
;
1141 } UNWIND_HISTORY_TABLE_ENTRY
, *PUNWIND_HISTORY_TABLE_ENTRY
;
1143 #define UNWIND_HISTORY_TABLE_NONE 0
1144 #define UNWIND_HISTORY_TABLE_GLOBAL 1
1145 #define UNWIND_HISTORY_TABLE_LOCAL 2
1147 typedef struct _UNWIND_HISTORY_TABLE
1152 ULONG64 HighAddress
;
1153 UNWIND_HISTORY_TABLE_ENTRY Entry
[UNWIND_HISTORY_TABLE_SIZE
];
1154 } UNWIND_HISTORY_TABLE
, *PUNWIND_HISTORY_TABLE
;
1156 typedef struct _KNONVOLATILE_CONTEXT_POINTERS
1160 PM128A FloatingContext
[16];
1184 PULONG64 IntegerContext
[16];
1205 } KNONVOLATILE_CONTEXT_POINTERS
, *PKNONVOLATILE_CONTEXT_POINTERS
;
1207 typedef PRUNTIME_FUNCTION (CALLBACK
*PGET_RUNTIME_FUNCTION_CALLBACK
)(DWORD64
,PVOID
);
1209 BOOLEAN CDECL
RtlAddFunctionTable(RUNTIME_FUNCTION
*,DWORD
,DWORD64
);
1210 BOOLEAN CDECL
RtlDeleteFunctionTable(RUNTIME_FUNCTION
*);
1211 BOOLEAN CDECL
RtlInstallFunctionTableCallback(DWORD64
,DWORD64
,DWORD
,PGET_RUNTIME_FUNCTION_CALLBACK
,PVOID
,PCWSTR
);
1212 PRUNTIME_FUNCTION WINAPI
RtlLookupFunctionEntry(DWORD64
,DWORD64
*,UNWIND_HISTORY_TABLE
*);
1213 PVOID WINAPI
RtlVirtualUnwind(ULONG
,ULONG64
,ULONG64
,RUNTIME_FUNCTION
*,CONTEXT
*,PVOID
*,ULONG64
*,KNONVOLATILE_CONTEXT_POINTERS
*);
1215 #define UNW_FLAG_NHANDLER 0
1216 #define UNW_FLAG_EHANDLER 1
1217 #define UNW_FLAG_UHANDLER 2
1218 #define UNW_FLAG_CHAININFO 4
1220 #endif /* __x86_64__ */
1222 /* IA64 context definitions */
1225 #define CONTEXT_IA64 0x00080000
1226 #define CONTEXT_CONTROL (CONTEXT_IA64 | 0x00000001)
1227 #define CONTEXT_LOWER_FLOATING_POINT (CONTEXT_IA64 | 0x00000002)
1228 #define CONTEXT_HIGHER_FLOATING_POINT (CONTEXT_IA64 | 0x00000004)
1229 #define CONTEXT_INTEGER (CONTEXT_IA64 | 0x00000008)
1230 #define CONTEXT_DEBUG (CONTEXT_IA64 | 0x00000010)
1231 #define CONTEXT_IA32_CONTROL (CONTEXT_IA64 | 0x00000020)
1232 #define CONTEXT_FLOATING_POINT (CONTEXT_LOWER_FLOATING_POINT | CONTEXT_HIGHER_FLOATING_POINT)
1233 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER | CONTEXT_IA32_CONTROL)
1234 #define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER | CONTEXT_DEBUG | CONTEXT_IA32_CONTROL)
1236 #define CONTEXT_EXCEPTION_ACTIVE 0x8000000
1237 #define CONTEXT_SERVICE_ACTIVE 0x10000000
1238 #define CONTEXT_EXCEPTION_REQUEST 0x40000000
1239 #define CONTEXT_EXCEPTION_REPORTING 0x80000000
1241 typedef struct _CONTEXT
1436 ULONGLONG RsBSPSTORE
;
1450 ULONGLONG UNUSEDPACK
;
1451 } CONTEXT
, *PCONTEXT
;
1453 typedef struct _RUNTIME_FUNCTION
1457 ULONG UnwindInfoAddress
;
1458 } RUNTIME_FUNCTION
, *PRUNTIME_FUNCTION
;
1460 typedef struct _FRAME_POINTERS
{
1461 ULONGLONG MemoryStackFp
;
1462 ULONGLONG BackingStoreFp
;
1463 } FRAME_POINTERS
, *PFRAME_POINTERS
;
1465 #define UNWIND_HISTORY_TABLE_SIZE 12
1467 typedef struct _UNWIND_HISTORY_TABLE_ENTRY
{
1470 PRUNTIME_FUNCTION FunctionEntry
;
1471 } UNWIND_HISTORY_TABLE_ENTRY
, *PUNWIND_HISTORY_TABLE_ENTRY
;
1473 typedef struct _UNWIND_HISTORY_TABLE
{
1477 ULONG64 HighAddress
;
1478 UNWIND_HISTORY_TABLE_ENTRY Entry
[UNWIND_HISTORY_TABLE_SIZE
];
1479 } UNWIND_HISTORY_TABLE
, *PUNWIND_HISTORY_TABLE
;
1481 typedef struct _KNONVOLATILE_CONTEXT_POINTERS
1487 PFLOAT128 HighFloatingContext
[10];
1509 PULONGLONG IntS0Nat
;
1510 PULONGLONG IntS1Nat
;
1511 PULONGLONG IntS2Nat
;
1512 PULONGLONG IntS3Nat
;
1513 PULONGLONG IntSpNat
;
1529 } KNONVOLATILE_CONTEXT_POINTERS
, *PKNONVOLATILE_CONTEXT_POINTERS
;
1531 ULONGLONG WINAPI
RtlVirtualUnwind(ULONGLONG
,ULONGLONG
,RUNTIME_FUNCTION
*,CONTEXT
*,BOOLEAN
*,FRAME_POINTERS
*,KNONVOLATILE_CONTEXT_POINTERS
*);
1533 #endif /* __ia64__ */
1535 /* Alpha context definitions */
1536 #if defined(_ALPHA_) || defined(__ALPHA__) || defined(__alpha__)
1538 #define CONTEXT_ALPHA 0x00020000
1540 #define CONTEXT_CONTROL (CONTEXT_ALPHA | 0x00000001)
1541 #define CONTEXT_FLOATING_POINT (CONTEXT_ALPHA | 0x00000002)
1542 #define CONTEXT_INTEGER (CONTEXT_ALPHA | 0x00000004)
1543 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
1545 #define EXCEPTION_READ_FAULT 0
1546 #define EXCEPTION_WRITE_FAULT 1
1547 #define EXCEPTION_EXECUTE_FAULT 8
1549 typedef struct _CONTEXT
1551 /* selected by CONTEXT_FLOATING_POINT */
1585 /* selected by CONTEXT_INTEGER */
1619 /* selected by CONTEXT_FLOATING_POINT */
1623 /* selected by CONTEXT_CONTROL */
1630 #define _QUAD_PSR_OFFSET HighSoftFpcr
1631 #define _QUAD_FLAGS_OFFSET HighFir
1633 #endif /* _ALPHA_ */
1637 /* The following flags control the contents of the CONTEXT structure. */
1639 #define CONTEXT_ARM 0x0200000
1640 #define CONTEXT_CONTROL (CONTEXT_ARM | 0x00000001)
1641 #define CONTEXT_INTEGER (CONTEXT_ARM | 0x00000002)
1642 #define CONTEXT_FLOATING_POINT (CONTEXT_ARM | 0x00000004)
1643 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_ARM | 0x00000008)
1645 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER)
1647 #define EXCEPTION_READ_FAULT 0
1648 #define EXCEPTION_WRITE_FAULT 1
1649 #define EXCEPTION_EXECUTE_FAULT 8
1651 #define ARM_MAX_BREAKPOINTS 8
1652 #define ARM_MAX_WATCHPOINTS 1
1654 typedef struct _RUNTIME_FUNCTION
1661 DWORD FunctionLength
: 11;
1668 DWORD StackAdjust
: 10;
1671 } RUNTIME_FUNCTION
, *PRUNTIME_FUNCTION
;
1673 #define UNWIND_HISTORY_TABLE_SIZE 12
1675 typedef struct _UNWIND_HISTORY_TABLE_ENTRY
1678 PRUNTIME_FUNCTION FunctionEntry
;
1679 } UNWIND_HISTORY_TABLE_ENTRY
, *PUNWIND_HISTORY_TABLE_ENTRY
;
1681 typedef struct _UNWIND_HISTORY_TABLE
1690 UNWIND_HISTORY_TABLE_ENTRY Entry
[UNWIND_HISTORY_TABLE_SIZE
];
1691 } UNWIND_HISTORY_TABLE
, *PUNWIND_HISTORY_TABLE
;
1693 typedef struct _NEON128
1697 } NEON128
, *PNEON128
;
1699 typedef struct _CONTEXT
1701 ULONG ContextFlags
; /* 000 */
1702 /* CONTEXT_INTEGER */
1713 ULONG R10
; /* 02c */
1714 ULONG R11
; /* 030 */
1715 ULONG R12
; /* 034 */
1716 /* CONTEXT_CONTROL */
1720 ULONG Cpsr
; /* 044 */
1721 /* CONTEXT_FLOATING_POINT */
1722 ULONG Fpscr
; /* 048 */
1723 ULONG Padding
; /* 04c */
1729 } DUMMYUNIONNAME
; /* 050 */
1730 /* CONTEXT_DEBUG_REGISTERS */
1731 ULONG Bvr
[ARM_MAX_BREAKPOINTS
]; /* 150 */
1732 ULONG Bcr
[ARM_MAX_BREAKPOINTS
]; /* 170 */
1733 ULONG Wvr
[ARM_MAX_WATCHPOINTS
]; /* 190 */
1734 ULONG Wcr
[ARM_MAX_WATCHPOINTS
]; /* 194 */
1735 ULONG Padding2
[2]; /* 198 */
1738 BOOLEAN CDECL
RtlAddFunctionTable(RUNTIME_FUNCTION
*,DWORD
,DWORD
);
1739 BOOLEAN CDECL
RtlDeleteFunctionTable(RUNTIME_FUNCTION
*);
1740 PRUNTIME_FUNCTION WINAPI
RtlLookupFunctionEntry(ULONG_PTR
,DWORD
*,UNWIND_HISTORY_TABLE
*);
1742 #endif /* __arm__ */
1748 * There is not yet an official CONTEXT structure defined for the AArch64
1749 * architecture, so I just made one up.
1753 #define CONTEXT_ARM64 0x400000
1754 #define CONTEXT_CONTROL (CONTEXT_ARM64 | 0x00000001)
1755 #define CONTEXT_INTEGER (CONTEXT_ARM64 | 0x00000002)
1756 #define CONTEXT_FLOATING_POINT (CONTEXT_ARM64 | 0x00000004)
1757 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_ARM64 | 0x00000008)
1759 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER)
1761 #define EXCEPTION_READ_FAULT 0
1762 #define EXCEPTION_WRITE_FAULT 1
1763 #define EXCEPTION_EXECUTE_FAULT 8
1765 #define ARM64_MAX_BREAKPOINTS 8
1766 #define ARM64_MAX_WATCHPOINTS 2
1768 typedef struct _RUNTIME_FUNCTION
1777 DWORD FunctionLength
: 11;
1782 DWORD FrameSize
: 9;
1785 } RUNTIME_FUNCTION
, *PRUNTIME_FUNCTION
;
1787 #define UNWIND_HISTORY_TABLE_SIZE 12
1789 typedef struct _UNWIND_HISTORY_TABLE_ENTRY
1792 PRUNTIME_FUNCTION FunctionEntry
;
1793 } UNWIND_HISTORY_TABLE_ENTRY
, *PUNWIND_HISTORY_TABLE_ENTRY
;
1795 typedef struct _UNWIND_HISTORY_TABLE
1803 DWORD64 HighAddress
;
1804 UNWIND_HISTORY_TABLE_ENTRY Entry
[UNWIND_HISTORY_TABLE_SIZE
];
1805 } UNWIND_HISTORY_TABLE
, *PUNWIND_HISTORY_TABLE
;
1807 typedef union _NEON128
1818 } NEON128
, *PNEON128
;
1820 typedef struct _CONTEXT
1822 ULONG ContextFlags
; /* 000 */
1823 /* CONTEXT_INTEGER */
1824 ULONG Cpsr
; /* 004 */
1829 DWORD64 X0
; /* 008 */
1830 DWORD64 X1
; /* 010 */
1831 DWORD64 X2
; /* 018 */
1832 DWORD64 X3
; /* 020 */
1833 DWORD64 X4
; /* 028 */
1834 DWORD64 X5
; /* 030 */
1835 DWORD64 X6
; /* 038 */
1836 DWORD64 X7
; /* 040 */
1837 DWORD64 X8
; /* 048 */
1838 DWORD64 X9
; /* 050 */
1839 DWORD64 X10
; /* 058 */
1840 DWORD64 X11
; /* 060 */
1841 DWORD64 X12
; /* 068 */
1842 DWORD64 X13
; /* 070 */
1843 DWORD64 X14
; /* 078 */
1844 DWORD64 X15
; /* 080 */
1845 DWORD64 X16
; /* 088 */
1846 DWORD64 X17
; /* 090 */
1847 DWORD64 X18
; /* 098 */
1848 DWORD64 X19
; /* 0a0 */
1849 DWORD64 X20
; /* 0a8 */
1850 DWORD64 X21
; /* 0b0 */
1851 DWORD64 X22
; /* 0b8 */
1852 DWORD64 X23
; /* 0c0 */
1853 DWORD64 X24
; /* 0c8 */
1854 DWORD64 X25
; /* 0d0 */
1855 DWORD64 X26
; /* 0d8 */
1856 DWORD64 X27
; /* 0e0 */
1857 DWORD64 X28
; /* 0e8 */
1859 DWORD64 X
[29]; /* 008 */
1861 /* CONTEXT_CONTROL */
1862 DWORD64 Fp
; /* 0f0 */
1863 DWORD64 Lr
; /* 0f8 */
1864 DWORD64 Sp
; /* 100 */
1865 DWORD64 Pc
; /* 108 */
1866 /* CONTEXT_FLOATING_POINT */
1867 NEON128 V
[32]; /* 110 */
1868 DWORD Fpcr
; /* 310 */
1869 DWORD Fpsr
; /* 314 */
1870 /* CONTEXT_DEBUG_REGISTERS */
1871 DWORD Bcr
[ARM64_MAX_BREAKPOINTS
]; /* 318 */
1872 DWORD64 Bvr
[ARM64_MAX_BREAKPOINTS
]; /* 338 */
1873 DWORD Wcr
[ARM64_MAX_WATCHPOINTS
]; /* 378 */
1874 DWORD64 Wvr
[ARM64_MAX_WATCHPOINTS
]; /* 380 */
1877 #endif /* __aarch64__ */
1880 /* Mips context definitions */
1881 #if defined(_MIPS_) || defined(__MIPS__) || defined(__mips__)
1883 #define CONTEXT_R4000 0x00010000
1885 #define CONTEXT_CONTROL (CONTEXT_R4000 | 0x00000001)
1886 #define CONTEXT_FLOATING_POINT (CONTEXT_R4000 | 0x00000002)
1887 #define CONTEXT_INTEGER (CONTEXT_R4000 | 0x00000004)
1889 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
1891 #define EXCEPTION_READ_FAULT 0
1892 #define EXCEPTION_WRITE_FAULT 1
1893 #define EXCEPTION_EXECUTE_FAULT 8
1895 typedef struct _CONTEXT
1898 /* These are selected by CONTEXT_FLOATING_POINT */
1932 /* These are selected by CONTEXT_INTEGER */
1968 /* These are selected by CONTEXT_FLOATING_POINT */
1971 /* These are selected by CONTEXT_CONTROL */
1981 /* PowerPC context definitions */
1984 #define CONTEXT_CONTROL 0x0001
1985 #define CONTEXT_FLOATING_POINT 0x0002
1986 #define CONTEXT_INTEGER 0x0004
1987 #define CONTEXT_DEBUG_REGISTERS 0x0008
1988 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
1990 #define EXCEPTION_READ_FAULT 0
1991 #define EXCEPTION_WRITE_FAULT 1
1992 #define EXCEPTION_EXECUTE_FAULT 8
1996 /* These are selected by CONTEXT_FLOATING_POINT */
2031 /* These are selected by CONTEXT_INTEGER */
2068 /* These are selected by CONTEXT_CONTROL */
2070 DWORD Iar
; /* Instruction Address Register , aka PC ... */
2076 DWORD Dar
; /* Fault registers for coredump */
2078 DWORD Trap
; /* number of powerpc exception taken */
2080 /* These are selected by CONTEXT_DEBUG_REGISTERS */
2091 typedef struct _STACK_FRAME_HEADER
2108 } STACK_FRAME_HEADER
,*PSTACK_FRAME_HEADER
;
2110 #endif /* __powerpc__ */
2112 #if !defined(CONTEXT_FULL) && !defined(RC_INVOKED)
2113 #error You need to define a CONTEXT for your CPU
2116 typedef CONTEXT
*PCONTEXT
;
2118 NTSYSAPI
void WINAPI
RtlCaptureContext(CONTEXT
*);
2123 #define PRODUCT_UNDEFINED 0x00000000
2124 #define PRODUCT_ULTIMATE 0x00000001
2125 #define PRODUCT_HOME_BASIC 0x00000002
2126 #define PRODUCT_HOME_PREMIUM 0x00000003
2127 #define PRODUCT_ENTERPRISE 0x00000004
2128 #define PRODUCT_HOME_BASIC_N 0x00000005
2129 #define PRODUCT_BUSINESS 0x00000006
2130 #define PRODUCT_STANDARD_SERVER 0x00000007
2131 #define PRODUCT_DATACENTER_SERVER 0x00000008
2132 #define PRODUCT_SMALLBUSINESS_SERVER 0x00000009
2133 #define PRODUCT_ENTERPRISE_SERVER 0x0000000A
2134 #define PRODUCT_STARTER 0x0000000B
2135 #define PRODUCT_DATACENTER_SERVER_CORE 0x0000000C
2136 #define PRODUCT_STANDARD_SERVER_CORE 0x0000000D
2137 #define PRODUCT_ENTERPRISE_SERVER_CORE 0x0000000E
2138 #define PRODUCT_ENTERPRISE_SERVER_IA64 0x0000000F
2139 #define PRODUCT_BUSINESS_N 0x00000010
2140 #define PRODUCT_WEB_SERVER 0x00000011
2141 #define PRODUCT_CLUSTER_SERVER 0x00000012
2142 #define PRODUCT_HOME_SERVER 0x00000013
2143 #define PRODUCT_STORAGE_EXPRESS_SERVER 0x00000014
2144 #define PRODUCT_STORAGE_STANDARD_SERVER 0x00000015
2145 #define PRODUCT_STORAGE_WORKGROUP_SERVER 0x00000016
2146 #define PRODUCT_STORAGE_ENTERPRISE_SERVER 0x00000017
2147 #define PRODUCT_SERVER_FOR_SMALLBUSINESS 0x00000018
2148 #define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM 0x00000019
2149 #define PRODUCT_HOME_PREMIUM_N 0x0000001A
2150 #define PRODUCT_ENTERPRISE_N 0x0000001B
2151 #define PRODUCT_ULTIMATE_N 0x0000001C
2152 #define PRODUCT_WEB_SERVER_CORE 0x0000001D
2153 #define PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT 0x0000001E
2154 #define PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY 0x0000001F
2155 #define PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING 0x00000020
2156 #define PRODUCT_SERVER_FOUNDATION 0x00000021
2157 #define PRODUCT_HOME_PREMIUM_SERVER 0x00000022
2158 #define PRODUCT_SERVER_FOR_SMALLBUSINESS_V 0x00000023
2159 #define PRODUCT_STANDARD_SERVER_V 0x00000024
2160 #define PRODUCT_DATACENTER_SERVER_V 0x00000025
2161 #define PRODUCT_SERVER_V 0x00000025
2162 #define PRODUCT_ENTERPRISE_SERVER_V 0x00000026
2163 #define PRODUCT_DATACENTER_SERVER_CORE_V 0x00000027
2164 #define PRODUCT_STANDARD_SERVER_CORE_V 0x00000028
2165 #define PRODUCT_ENTERPRISE_SERVER_CORE_V 0x00000029
2166 #define PRODUCT_HYPERV 0x0000002A
2167 #define PRODUCT_STORAGE_EXPRESS_SERVER_CORE 0x0000002B
2168 #define PRODUCT_STORAGE_STANDARD_SERVER_CORE 0x0000002C
2169 #define PRODUCT_STORAGE_WORKGROUP_SERVER_CORE 0x0000002D
2170 #define PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE 0x0000002E
2171 #define PRODUCT_STARTER_N 0x0000002F
2172 #define PRODUCT_PROFESSIONAL 0x00000030
2173 #define PRODUCT_PROFESSIONAL_N 0x00000031
2174 #define PRODUCT_SB_SOLUTION_SERVER 0x00000032
2175 #define PRODUCT_SERVER_FOR_SB_SOLUTIONS 0x00000033
2176 #define PRODUCT_STANDARD_SERVER_SOLUTIONS 0x00000034
2177 #define PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE 0x00000035
2178 #define PRODUCT_SB_SOLUTION_SERVER_EM 0x00000036
2179 #define PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM 0x00000037
2180 #define PRODUCT_SOLUTION_EMBEDDEDSERVER 0x00000038
2181 #define PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE 0x00000039
2182 #define PRODUCT_PROFESSIONAL_EMBEDDED 0x0000003A
2183 #define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT 0x0000003B
2184 #define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL 0x0000003C
2185 #define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC 0x0000003D
2186 #define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC 0x0000003E
2187 #define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE 0x0000003F
2188 #define PRODUCT_CLUSTER_SERVER_V 0x00000040
2189 #define PRODUCT_EMBEDDED 0x00000041
2190 #define PRODUCT_STARTER_E 0x00000042
2191 #define PRODUCT_HOME_BASIC_E 0x00000043
2192 #define PRODUCT_HOME_PREMIUM_E 0x00000044
2193 #define PRODUCT_PROFESSIONAL_E 0x00000045
2194 #define PRODUCT_ENTERPRISE_E 0x00000046
2195 #define PRODUCT_ULTIMATE_E 0x00000047
2196 #define PRODUCT_ENTERPRISE_EVALUATION 0x00000048
2197 #define PRODUCT_MULTIPOINT_STANDARD_SERVER 0x0000004C
2198 #define PRODUCT_MULTIPOINT_PREMIUM_SERVER 0x0000004D
2199 #define PRODUCT_STANDARD_EVALUATION_SERVER 0x0000004F
2200 #define PRODUCT_DATACENTER_EVALUATION_SERVER 0x00000050
2201 #define PRODUCT_ENTERPRISE_N_EVALUATION 0x00000054
2202 #define PRODUCT_EMBEDDED_AUTOMOTIVE 0x00000055
2203 #define PRODUCT_EMBEDDED_INDUSTRY_A 0x00000056
2204 #define PRODUCT_THINPC 0x00000057
2205 #define PRODUCT_EMBEDDED_A 0x00000058
2206 #define PRODUCT_EMBEDDED_INDUSTRY 0x00000059
2207 #define PRODUCT_EMBEDDED_E 0x0000005A
2208 #define PRODUCT_EMBEDDED_INDUSTRY_E 0x0000005B
2209 #define PRODUCT_EMBEDDED_INDUSTRY_A_E 0x0000005C
2210 #define PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER 0x0000005F
2211 #define PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER 0x00000060
2212 #define PRODUCT_CORE_ARM 0x00000061
2213 #define PRODUCT_CORE_N 0x00000062
2214 #define PRODUCT_CORE_COUNTRYSPECIFIC 0x00000063
2215 #define PRODUCT_CORE_SINGLELANGUAGE 0x00000064
2216 #define PRODUCT_CORE_LANGUAGESPECIFIC 0x00000064
2217 #define PRODUCT_CORE 0x00000065
2218 #define PRODUCT_PROFESSIONAL_WMC 0x00000067
2219 #define PRODUCT_MOBILE_CORE 0x00000068
2220 #define PRODUCT_EMBEDDED_INDUSTRY_EVAL 0x00000069
2221 #define PRODUCT_EMBEDDED_INDUSTRY_E_EVAL 0x0000006A
2222 #define PRODUCT_EMBEDDED_EVAL 0x0000006B
2223 #define PRODUCT_EMBEDDED_E_EVAL 0x0000006C
2224 #define PRODUCT_NANO_SERVER 0x0000006D
2225 #define PRODUCT_CLOUD_STORAGE_SERVER 0x0000006E
2226 #define PRODUCT_CORE_CONNECTED 0x0000006F
2227 #define PRODUCT_PROFESSIONAL_STUDENT 0x00000070
2228 #define PRODUCT_CORE_CONNECTED_N 0x00000071
2229 #define PRODUCT_PROFESSIONAL_STUDENT_N 0x00000072
2230 #define PRODUCT_CORE_CONNECTED_SINGLELANGUAGE 0x00000073
2231 #define PRODUCT_CORE_CONNECTED_COUNTRYSPECIFIC 0x00000074
2232 #define PRODUCT_CONNECTED_CAR 0x00000075
2233 #define PRODUCT_INDUSTRY_HANDHELD 0x00000076
2234 #define PRODUCT_PPI_PRO 0x00000077
2235 #define PRODUCT_ARM64_SERVER 0x00000078
2236 #define PRODUCT_EDUCATION 0x00000079
2237 #define PRODUCT_EDUCATION_N 0x0000007A
2238 #define PRODUCT_IOTUAP 0x0000007B
2239 #define PRODUCT_CLOUD_HOST_INFRASTRUCTURE_SERVER 0x0000007C
2240 #define PRODUCT_ENTERPRISE_S 0x0000007D
2241 #define PRODUCT_ENTERPRISE_S_N 0x0000007E
2242 #define PRODUCT_PROFESSIONAL_S 0x0000007F
2243 #define PRODUCT_PROFESSIONAL_S_N 0x00000080
2244 #define PRODUCT_ENTERPRISE_S_EVALUATION 0x00000081
2245 #define PRODUCT_ENTERPRISE_S_N_EVALUATION 0x00000082
2246 #define PRODUCT_UNLICENSED 0xABCDABCD
2253 #define MAKELCID(l, s) (MAKELONG(l, s))
2255 #define MAKELANGID(p, s) ((((WORD)(s))<<10) | (WORD)(p))
2256 #define PRIMARYLANGID(l) ((WORD)(l) & 0x3ff)
2257 #define SUBLANGID(l) ((WORD)(l) >> 10)
2259 #define LANGIDFROMLCID(lcid) ((WORD)(lcid))
2260 #define SORTIDFROMLCID(lcid) ((WORD)((((DWORD)(lcid)) >> 16) & 0x0f))
2262 #define LANG_SYSTEM_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT))
2263 #define LANG_USER_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT))
2264 #define LOCALE_SYSTEM_DEFAULT (MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT))
2265 #define LOCALE_USER_DEFAULT (MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT))
2266 #define LOCALE_NEUTRAL (MAKELCID(MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL),SORT_DEFAULT))
2267 #define LOCALE_INVARIANT (MAKELCID(MAKELANGID(LANG_INVARIANT,SUBLANG_NEUTRAL),SORT_DEFAULT))
2268 #define LOCALE_CUSTOM_DEFAULT (MAKELCID(MAKELANGID(LANG_NEUTRAL,SUBLANG_CUSTOM_DEFAULT),SORT_DEFAULT))
2269 #define LOCALE_CUSTOM_UNSPECIFIED (MAKELCID(MAKELANGID(LANG_NEUTRAL,SUBLANG_CUSTOM_UNSPECIFIED),SORT_DEFAULT))
2270 #define LOCALE_CUSTOM_UI_DEFAULT (MAKELCID(MAKELANGID(LANG_NEUTRAL,SUBLANG_UI_CUSTOM_DEFAULT),SORT_DEFAULT))
2271 #define LOCALE_NAME_MAX_LENGTH 85
2274 #define UNREFERENCED_PARAMETER(u) (void)(u)
2275 #define DBG_UNREFERENCED_PARAMETER(u) (void)(u)
2276 #define DBG_UNREFERENCED_LOCAL_VARIABLE(u) (void)(u)
2282 * Definitions for IsTextUnicode()
2285 #define IS_TEXT_UNICODE_ASCII16 0x0001
2286 #define IS_TEXT_UNICODE_STATISTICS 0x0002
2287 #define IS_TEXT_UNICODE_CONTROLS 0x0004
2288 #define IS_TEXT_UNICODE_SIGNATURE 0x0008
2289 #define IS_TEXT_UNICODE_UNICODE_MASK 0x000F
2290 #define IS_TEXT_UNICODE_REVERSE_ASCII16 0x0010
2291 #define IS_TEXT_UNICODE_REVERSE_STATISTICS 0x0020
2292 #define IS_TEXT_UNICODE_REVERSE_CONTROLS 0x0040
2293 #define IS_TEXT_UNICODE_REVERSE_SIGNATURE 0x0080
2294 #define IS_TEXT_UNICODE_REVERSE_MASK 0x00F0
2295 #define IS_TEXT_UNICODE_ILLEGAL_CHARS 0x0100
2296 #define IS_TEXT_UNICODE_ODD_LENGTH 0x0200
2297 #define IS_TEXT_UNICODE_DBCS_LEADBYTE 0x0400
2298 #define IS_TEXT_UNICODE_NOT_UNICODE_MASK 0x0F00
2299 #define IS_TEXT_UNICODE_NULL_BYTES 0x1000
2300 #define IS_TEXT_UNICODE_NOT_ASCII_MASK 0xF000
2302 #define MAXIMUM_WAIT_OBJECTS 64
2303 #define MAXIMUM_SUSPEND_COUNT 127
2305 #define WT_EXECUTEDEFAULT 0x00
2306 #define WT_EXECUTEINIOTHREAD 0x01
2307 #define WT_EXECUTEINUITHREAD 0x02
2308 #define WT_EXECUTEINWAITTHREAD 0x04
2309 #define WT_EXECUTEONLYONCE 0x08
2310 #define WT_EXECUTELONGFUNCTION 0x10
2311 #define WT_EXECUTEINTIMERTHREAD 0x20
2312 #define WT_EXECUTEINPERSISTENTIOTHREAD 0x40
2313 #define WT_EXECUTEINPERSISTENTTHREAD 0x80
2314 #define WT_EXECUTEINLONGTHREAD 0x10
2315 #define WT_EXECUTEDELETEWAIT 0x08
2316 #define WT_TRANSFER_IMPERSONATION 0x0100
2319 #define EXCEPTION_CONTINUABLE 0
2320 #define EXCEPTION_NONCONTINUABLE 0x01
2323 * The exception record used by Win32 to give additional information
2324 * about exception to exception handlers.
2327 #define EXCEPTION_MAXIMUM_PARAMETERS 15
2329 typedef struct _EXCEPTION_RECORD
2331 DWORD ExceptionCode
;
2332 DWORD ExceptionFlags
;
2333 struct _EXCEPTION_RECORD
*ExceptionRecord
;
2335 PVOID ExceptionAddress
;
2336 DWORD NumberParameters
;
2337 ULONG_PTR ExceptionInformation
[EXCEPTION_MAXIMUM_PARAMETERS
];
2338 } EXCEPTION_RECORD
, *PEXCEPTION_RECORD
;
2341 * The exception pointers structure passed to exception filters
2342 * in except() and the UnhandledExceptionFilter().
2345 typedef struct _EXCEPTION_POINTERS
2347 PEXCEPTION_RECORD ExceptionRecord
;
2348 PCONTEXT ContextRecord
;
2349 } EXCEPTION_POINTERS
, *PEXCEPTION_POINTERS
;
2353 * The exception frame, used for registering exception handlers
2354 * Win32 cares only about this, but compilers generally emit
2355 * larger exception frames for their own use.
2358 struct _EXCEPTION_REGISTRATION_RECORD
;
2360 typedef DWORD (*PEXCEPTION_HANDLER
)(PEXCEPTION_RECORD
,struct _EXCEPTION_REGISTRATION_RECORD
*,
2361 PCONTEXT
,struct _EXCEPTION_REGISTRATION_RECORD
**);
2363 typedef struct _EXCEPTION_REGISTRATION_RECORD
2365 struct _EXCEPTION_REGISTRATION_RECORD
*Prev
;
2366 PEXCEPTION_HANDLER Handler
;
2367 } EXCEPTION_REGISTRATION_RECORD
;
2370 * function pointer to an exception filter
2373 typedef LONG (CALLBACK
*PVECTORED_EXCEPTION_HANDLER
)(PEXCEPTION_POINTERS ExceptionInfo
);
2375 typedef struct _NT_TIB
2377 struct _EXCEPTION_REGISTRATION_RECORD
*ExceptionList
;
2385 PVOID ArbitraryUserPointer
;
2386 struct _NT_TIB
*Self
;
2391 #if defined(__i386__) && defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2)))
2392 static FORCEINLINE
struct _TEB
* WINAPI
NtCurrentTeb(void)
2395 __asm__(".byte 0x64\n\tmovl (0x18),%0" : "=r" (teb
));
2398 #elif defined(__i386__) && defined(_MSC_VER)
2399 static FORCEINLINE
struct _TEB
* WINAPI
NtCurrentTeb(void)
2402 __asm mov eax
, fs
:[0x18];
2406 #elif defined(__x86_64__) && defined(__GNUC__)
2407 static FORCEINLINE
struct _TEB
* WINAPI
NtCurrentTeb(void)
2410 __asm__(".byte 0x65\n\tmovq (0x30),%0" : "=r" (teb
));
2413 #elif defined(__x86_64__) && defined(_MSC_VER)
2414 #pragma intrinsic(__readgsqword)
2415 static FORCEINLINE
struct _TEB
* WINAPI
NtCurrentTeb(void)
2417 return (struct _TEB
*)__readgsqword(FIELD_OFFSET(NT_TIB
, Self
));
2420 extern struct _TEB
* WINAPI
NtCurrentTeb(void);
2423 #ifdef NONAMELESSUNION
2424 #define GetCurrentFiber() (((NT_TIB *)NtCurrentTeb())->u.FiberData)
2426 #define GetCurrentFiber() (((NT_TIB *)NtCurrentTeb())->FiberData)
2428 #define GetFiberData() (*(void **)GetCurrentFiber())
2430 #define TLS_MINIMUM_AVAILABLE 64
2433 * File formats definitions
2436 #include <pshpack2.h>
2437 typedef struct _IMAGE_DOS_HEADER
{
2438 WORD e_magic
; /* 00: MZ Header signature */
2439 WORD e_cblp
; /* 02: Bytes on last page of file */
2440 WORD e_cp
; /* 04: Pages in file */
2441 WORD e_crlc
; /* 06: Relocations */
2442 WORD e_cparhdr
; /* 08: Size of header in paragraphs */
2443 WORD e_minalloc
; /* 0a: Minimum extra paragraphs needed */
2444 WORD e_maxalloc
; /* 0c: Maximum extra paragraphs needed */
2445 WORD e_ss
; /* 0e: Initial (relative) SS value */
2446 WORD e_sp
; /* 10: Initial SP value */
2447 WORD e_csum
; /* 12: Checksum */
2448 WORD e_ip
; /* 14: Initial IP value */
2449 WORD e_cs
; /* 16: Initial (relative) CS value */
2450 WORD e_lfarlc
; /* 18: File address of relocation table */
2451 WORD e_ovno
; /* 1a: Overlay number */
2452 WORD e_res
[4]; /* 1c: Reserved words */
2453 WORD e_oemid
; /* 24: OEM identifier (for e_oeminfo) */
2454 WORD e_oeminfo
; /* 26: OEM information; e_oemid specific */
2455 WORD e_res2
[10]; /* 28: Reserved words */
2456 DWORD e_lfanew
; /* 3c: Offset to extended header */
2457 } IMAGE_DOS_HEADER
, *PIMAGE_DOS_HEADER
;
2458 #include <poppack.h>
2460 #define IMAGE_DOS_SIGNATURE 0x5A4D /* MZ */
2461 #define IMAGE_OS2_SIGNATURE 0x454E /* NE */
2462 #define IMAGE_OS2_SIGNATURE_LE 0x454C /* LE */
2463 #define IMAGE_OS2_SIGNATURE_LX 0x584C /* LX */
2464 #define IMAGE_VXD_SIGNATURE 0x454C /* LE */
2465 #define IMAGE_NT_SIGNATURE 0x00004550 /* PE00 */
2468 * This is the Windows executable (NE) header.
2469 * the name IMAGE_OS2_HEADER is misleading, but in the SDK this way.
2471 #include <pshpack2.h>
2474 WORD ne_magic
; /* 00 NE signature 'NE' */
2475 BYTE ne_ver
; /* 02 Linker version number */
2476 BYTE ne_rev
; /* 03 Linker revision number */
2477 WORD ne_enttab
; /* 04 Offset to entry table relative to NE */
2478 WORD ne_cbenttab
; /* 06 Length of entry table in bytes */
2479 LONG ne_crc
; /* 08 Checksum */
2480 WORD ne_flags
; /* 0c Flags about segments in this file */
2481 WORD ne_autodata
; /* 0e Automatic data segment number */
2482 WORD ne_heap
; /* 10 Initial size of local heap */
2483 WORD ne_stack
; /* 12 Initial size of stack */
2484 DWORD ne_csip
; /* 14 Initial CS:IP */
2485 DWORD ne_sssp
; /* 18 Initial SS:SP */
2486 WORD ne_cseg
; /* 1c # of entries in segment table */
2487 WORD ne_cmod
; /* 1e # of entries in module reference tab. */
2488 WORD ne_cbnrestab
; /* 20 Length of nonresident-name table */
2489 WORD ne_segtab
; /* 22 Offset to segment table */
2490 WORD ne_rsrctab
; /* 24 Offset to resource table */
2491 WORD ne_restab
; /* 26 Offset to resident-name table */
2492 WORD ne_modtab
; /* 28 Offset to module reference table */
2493 WORD ne_imptab
; /* 2a Offset to imported name table */
2494 DWORD ne_nrestab
; /* 2c Offset to nonresident-name table */
2495 WORD ne_cmovent
; /* 30 # of movable entry points */
2496 WORD ne_align
; /* 32 Logical sector alignment shift count */
2497 WORD ne_cres
; /* 34 # of resource segments */
2498 BYTE ne_exetyp
; /* 36 Flags indicating target OS */
2499 BYTE ne_flagsothers
; /* 37 Additional information flags */
2500 WORD ne_pretthunks
; /* 38 Offset to return thunks */
2501 WORD ne_psegrefbytes
; /* 3a Offset to segment ref. bytes */
2502 WORD ne_swaparea
; /* 3c Reserved by Microsoft */
2503 WORD ne_expver
; /* 3e Expected Windows version number */
2504 } IMAGE_OS2_HEADER
, *PIMAGE_OS2_HEADER
;
2505 #include <poppack.h>
2507 #include <pshpack2.h>
2508 typedef struct _IMAGE_VXD_HEADER
{
2523 DWORD e32_lastpagesize
;
2524 DWORD e32_fixupsize
;
2541 DWORD e32_impmodcnt
;
2547 DWORD e32_cbnrestab
;
2550 DWORD e32_debuginfo
;
2552 DWORD e32_instpreload
;
2553 DWORD e32_instdemand
;
2556 DWORD e32_winresoff
;
2557 DWORD e32_winreslen
;
2560 } IMAGE_VXD_HEADER
, *PIMAGE_VXD_HEADER
;
2561 #include <poppack.h>
2563 /* These defines describe the meanings of the bits in the Characteristics
2566 #define IMAGE_FILE_RELOCS_STRIPPED 0x0001 /* No relocation info */
2567 #define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002
2568 #define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004
2569 #define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008
2570 #define IMAGE_FILE_AGGRESIVE_WS_TRIM 0x0010
2571 #define IMAGE_FILE_LARGE_ADDRESS_AWARE 0x0020
2572 #define IMAGE_FILE_16BIT_MACHINE 0x0040
2573 #define IMAGE_FILE_BYTES_REVERSED_LO 0x0080
2574 #define IMAGE_FILE_32BIT_MACHINE 0x0100
2575 #define IMAGE_FILE_DEBUG_STRIPPED 0x0200
2576 #define IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP 0x0400
2577 #define IMAGE_FILE_NET_RUN_FROM_SWAP 0x0800
2578 #define IMAGE_FILE_SYSTEM 0x1000
2579 #define IMAGE_FILE_DLL 0x2000
2580 #define IMAGE_FILE_UP_SYSTEM_ONLY 0x4000
2581 #define IMAGE_FILE_BYTES_REVERSED_HI 0x8000
2583 /* These are the settings of the Machine field. */
2584 #define IMAGE_FILE_MACHINE_UNKNOWN 0
2585 #define IMAGE_FILE_MACHINE_I860 0x014d
2586 #define IMAGE_FILE_MACHINE_I386 0x014c
2587 #define IMAGE_FILE_MACHINE_R3000 0x0162
2588 #define IMAGE_FILE_MACHINE_R4000 0x0166
2589 #define IMAGE_FILE_MACHINE_R10000 0x0168
2590 #define IMAGE_FILE_MACHINE_WCEMIPSV2 0x0169
2591 #define IMAGE_FILE_MACHINE_ALPHA 0x0184
2592 #define IMAGE_FILE_MACHINE_SH3 0x01a2
2593 #define IMAGE_FILE_MACHINE_SH3DSP 0x01a3
2594 #define IMAGE_FILE_MACHINE_SH3E 0x01a4
2595 #define IMAGE_FILE_MACHINE_SH4 0x01a6
2596 #define IMAGE_FILE_MACHINE_SH5 0x01a8
2597 #define IMAGE_FILE_MACHINE_ARM 0x01c0
2598 #define IMAGE_FILE_MACHINE_THUMB 0x01c2
2599 #define IMAGE_FILE_MACHINE_ARMNT 0x01c4
2600 #define IMAGE_FILE_MACHINE_ARM64 0xaa64
2601 #define IMAGE_FILE_MACHINE_AM33 0x01d3
2602 #define IMAGE_FILE_MACHINE_POWERPC 0x01f0
2603 #define IMAGE_FILE_MACHINE_POWERPCFP 0x01f1
2604 #define IMAGE_FILE_MACHINE_IA64 0x0200
2605 #define IMAGE_FILE_MACHINE_MIPS16 0x0266
2606 #define IMAGE_FILE_MACHINE_ALPHA64 0x0284
2607 #define IMAGE_FILE_MACHINE_MIPSFPU 0x0366
2608 #define IMAGE_FILE_MACHINE_MIPSFPU16 0x0466
2609 #define IMAGE_FILE_MACHINE_AXP64 IMAGE_FILE_MACHINE_ALPHA64
2610 #define IMAGE_FILE_MACHINE_TRICORE 0x0520
2611 #define IMAGE_FILE_MACHINE_CEF 0x0cef
2612 #define IMAGE_FILE_MACHINE_EBC 0x0ebc
2613 #define IMAGE_FILE_MACHINE_AMD64 0x8664
2614 #define IMAGE_FILE_MACHINE_M32R 0x9041
2615 #define IMAGE_FILE_MACHINE_CEE 0xc0ee
2617 #define IMAGE_SIZEOF_FILE_HEADER 20
2618 #define IMAGE_SIZEOF_ROM_OPTIONAL_HEADER 56
2619 #define IMAGE_SIZEOF_STD_OPTIONAL_HEADER 28
2620 #define IMAGE_SIZEOF_NT_OPTIONAL32_HEADER 224
2621 #define IMAGE_SIZEOF_NT_OPTIONAL64_HEADER 240
2622 #define IMAGE_SIZEOF_SHORT_NAME 8
2623 #define IMAGE_SIZEOF_SECTION_HEADER 40
2624 #define IMAGE_SIZEOF_SYMBOL 18
2625 #define IMAGE_SIZEOF_AUX_SYMBOL 18
2626 #define IMAGE_SIZEOF_RELOCATION 10
2627 #define IMAGE_SIZEOF_BASE_RELOCATION 8
2628 #define IMAGE_SIZEOF_LINENUMBER 6
2629 #define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
2631 /* Possible Magic values */
2632 #define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b
2633 #define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
2634 #define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
2637 #define IMAGE_SIZEOF_NT_OPTIONAL_HEADER IMAGE_SIZEOF_NT_OPTIONAL64_HEADER
2638 #define IMAGE_NT_OPTIONAL_HDR_MAGIC IMAGE_NT_OPTIONAL_HDR64_MAGIC
2640 #define IMAGE_SIZEOF_NT_OPTIONAL_HEADER IMAGE_SIZEOF_NT_OPTIONAL32_HEADER
2641 #define IMAGE_NT_OPTIONAL_HDR_MAGIC IMAGE_NT_OPTIONAL_HDR32_MAGIC
2644 /* These are indexes into the DataDirectory array */
2645 #define IMAGE_FILE_EXPORT_DIRECTORY 0
2646 #define IMAGE_FILE_IMPORT_DIRECTORY 1
2647 #define IMAGE_FILE_RESOURCE_DIRECTORY 2
2648 #define IMAGE_FILE_EXCEPTION_DIRECTORY 3
2649 #define IMAGE_FILE_SECURITY_DIRECTORY 4
2650 #define IMAGE_FILE_BASE_RELOCATION_TABLE 5
2651 #define IMAGE_FILE_DEBUG_DIRECTORY 6
2652 #define IMAGE_FILE_DESCRIPTION_STRING 7
2653 #define IMAGE_FILE_MACHINE_VALUE 8 /* Mips */
2654 #define IMAGE_FILE_THREAD_LOCAL_STORAGE 9
2655 #define IMAGE_FILE_CALLBACK_DIRECTORY 10
2657 /* Directory Entries, indices into the DataDirectory array */
2659 #define IMAGE_DIRECTORY_ENTRY_EXPORT 0
2660 #define IMAGE_DIRECTORY_ENTRY_IMPORT 1
2661 #define IMAGE_DIRECTORY_ENTRY_RESOURCE 2
2662 #define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3
2663 #define IMAGE_DIRECTORY_ENTRY_SECURITY 4
2664 #define IMAGE_DIRECTORY_ENTRY_BASERELOC 5
2665 #define IMAGE_DIRECTORY_ENTRY_DEBUG 6
2666 #define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7
2667 #define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 /* (MIPS GP) */
2668 #define IMAGE_DIRECTORY_ENTRY_TLS 9
2669 #define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10
2670 #define IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT 11
2671 #define IMAGE_DIRECTORY_ENTRY_IAT 12 /* Import Address Table */
2672 #define IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT 13
2673 #define IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR 14
2675 /* Subsystem Values */
2677 #define IMAGE_SUBSYSTEM_UNKNOWN 0
2678 #define IMAGE_SUBSYSTEM_NATIVE 1
2679 #define IMAGE_SUBSYSTEM_WINDOWS_GUI 2 /* Windows GUI subsystem */
2680 #define IMAGE_SUBSYSTEM_WINDOWS_CUI 3 /* Windows character subsystem */
2681 #define IMAGE_SUBSYSTEM_OS2_CUI 5
2682 #define IMAGE_SUBSYSTEM_POSIX_CUI 7
2683 #define IMAGE_SUBSYSTEM_NATIVE_WINDOWS 8 /* native Win9x driver */
2684 #define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9 /* Windows CE subsystem */
2685 #define IMAGE_SUBSYSTEM_EFI_APPLICATION 10
2686 #define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
2687 #define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
2688 #define IMAGE_SUBSYSTEM_EFI_ROM 13
2689 #define IMAGE_SUBSYSTEM_XBOX 14
2690 #define IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION 16
2692 /* DLL Characteristics */
2693 #define IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE 0x0040
2694 #define IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY 0x0080
2695 #define IMAGE_DLLCHARACTERISTICS_NX_COMPAT 0x0100
2696 #define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION 0x0200
2697 #define IMAGE_DLLCHARACTERISTICS_NO_SEH 0x0400
2698 #define IMAGE_DLLCHARACTERISTICS_NO_BIND 0x0800
2699 #define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000
2700 #define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000
2702 typedef struct _IMAGE_FILE_HEADER
{
2704 WORD NumberOfSections
;
2705 DWORD TimeDateStamp
;
2706 DWORD PointerToSymbolTable
;
2707 DWORD NumberOfSymbols
;
2708 WORD SizeOfOptionalHeader
;
2709 WORD Characteristics
;
2710 } IMAGE_FILE_HEADER
, *PIMAGE_FILE_HEADER
;
2712 typedef struct _IMAGE_DATA_DIRECTORY
{
2713 DWORD VirtualAddress
;
2715 } IMAGE_DATA_DIRECTORY
, *PIMAGE_DATA_DIRECTORY
;
2717 #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
2719 typedef struct _IMAGE_OPTIONAL_HEADER64
{
2720 WORD Magic
; /* 0x20b */
2721 BYTE MajorLinkerVersion
;
2722 BYTE MinorLinkerVersion
;
2724 DWORD SizeOfInitializedData
;
2725 DWORD SizeOfUninitializedData
;
2726 DWORD AddressOfEntryPoint
;
2728 ULONGLONG ImageBase
;
2729 DWORD SectionAlignment
;
2730 DWORD FileAlignment
;
2731 WORD MajorOperatingSystemVersion
;
2732 WORD MinorOperatingSystemVersion
;
2733 WORD MajorImageVersion
;
2734 WORD MinorImageVersion
;
2735 WORD MajorSubsystemVersion
;
2736 WORD MinorSubsystemVersion
;
2737 DWORD Win32VersionValue
;
2739 DWORD SizeOfHeaders
;
2742 WORD DllCharacteristics
;
2743 ULONGLONG SizeOfStackReserve
;
2744 ULONGLONG SizeOfStackCommit
;
2745 ULONGLONG SizeOfHeapReserve
;
2746 ULONGLONG SizeOfHeapCommit
;
2748 DWORD NumberOfRvaAndSizes
;
2749 IMAGE_DATA_DIRECTORY DataDirectory
[IMAGE_NUMBEROF_DIRECTORY_ENTRIES
];
2750 } IMAGE_OPTIONAL_HEADER64
, *PIMAGE_OPTIONAL_HEADER64
;
2752 typedef struct _IMAGE_NT_HEADERS64
{
2754 IMAGE_FILE_HEADER FileHeader
;
2755 IMAGE_OPTIONAL_HEADER64 OptionalHeader
;
2756 } IMAGE_NT_HEADERS64
, *PIMAGE_NT_HEADERS64
;
2758 typedef struct _IMAGE_OPTIONAL_HEADER
{
2760 /* Standard fields */
2762 WORD Magic
; /* 0x10b or 0x107 */ /* 0x00 */
2763 BYTE MajorLinkerVersion
;
2764 BYTE MinorLinkerVersion
;
2766 DWORD SizeOfInitializedData
;
2767 DWORD SizeOfUninitializedData
;
2768 DWORD AddressOfEntryPoint
; /* 0x10 */
2772 /* NT additional fields */
2775 DWORD SectionAlignment
; /* 0x20 */
2776 DWORD FileAlignment
;
2777 WORD MajorOperatingSystemVersion
;
2778 WORD MinorOperatingSystemVersion
;
2779 WORD MajorImageVersion
;
2780 WORD MinorImageVersion
;
2781 WORD MajorSubsystemVersion
; /* 0x30 */
2782 WORD MinorSubsystemVersion
;
2783 DWORD Win32VersionValue
;
2785 DWORD SizeOfHeaders
;
2786 DWORD CheckSum
; /* 0x40 */
2788 WORD DllCharacteristics
;
2789 DWORD SizeOfStackReserve
;
2790 DWORD SizeOfStackCommit
;
2791 DWORD SizeOfHeapReserve
; /* 0x50 */
2792 DWORD SizeOfHeapCommit
;
2794 DWORD NumberOfRvaAndSizes
;
2795 IMAGE_DATA_DIRECTORY DataDirectory
[IMAGE_NUMBEROF_DIRECTORY_ENTRIES
]; /* 0x60 */
2797 } IMAGE_OPTIONAL_HEADER32
, *PIMAGE_OPTIONAL_HEADER32
;
2799 typedef struct _IMAGE_NT_HEADERS
{
2800 DWORD Signature
; /* "PE"\0\0 */ /* 0x00 */
2801 IMAGE_FILE_HEADER FileHeader
; /* 0x04 */
2802 IMAGE_OPTIONAL_HEADER32 OptionalHeader
; /* 0x18 */
2803 } IMAGE_NT_HEADERS32
, *PIMAGE_NT_HEADERS32
;
2806 typedef IMAGE_NT_HEADERS64 IMAGE_NT_HEADERS
;
2807 typedef PIMAGE_NT_HEADERS64 PIMAGE_NT_HEADERS
;
2808 typedef IMAGE_OPTIONAL_HEADER64 IMAGE_OPTIONAL_HEADER
;
2809 typedef PIMAGE_OPTIONAL_HEADER64 PIMAGE_OPTIONAL_HEADER
;
2811 typedef IMAGE_NT_HEADERS32 IMAGE_NT_HEADERS
;
2812 typedef PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS
;
2813 typedef IMAGE_OPTIONAL_HEADER32 IMAGE_OPTIONAL_HEADER
;
2814 typedef PIMAGE_OPTIONAL_HEADER32 PIMAGE_OPTIONAL_HEADER
;
2817 #define IMAGE_SIZEOF_SHORT_NAME 8
2819 typedef struct _IMAGE_SECTION_HEADER
{
2820 BYTE Name
[IMAGE_SIZEOF_SHORT_NAME
];
2822 DWORD PhysicalAddress
;
2825 DWORD VirtualAddress
;
2826 DWORD SizeOfRawData
;
2827 DWORD PointerToRawData
;
2828 DWORD PointerToRelocations
;
2829 DWORD PointerToLinenumbers
;
2830 WORD NumberOfRelocations
;
2831 WORD NumberOfLinenumbers
;
2832 DWORD Characteristics
;
2833 } IMAGE_SECTION_HEADER
, *PIMAGE_SECTION_HEADER
;
2835 #define IMAGE_SIZEOF_SECTION_HEADER 40
2837 #define IMAGE_FIRST_SECTION(ntheader) \
2838 ((PIMAGE_SECTION_HEADER)(ULONG_PTR)((const BYTE *)&((const IMAGE_NT_HEADERS *)(ntheader))->OptionalHeader + \
2839 ((const IMAGE_NT_HEADERS *)(ntheader))->FileHeader.SizeOfOptionalHeader))
2841 /* These defines are for the Characteristics bitfield. */
2842 /* #define IMAGE_SCN_TYPE_REG 0x00000000 - Reserved */
2843 /* #define IMAGE_SCN_TYPE_DSECT 0x00000001 - Reserved */
2844 /* #define IMAGE_SCN_TYPE_NOLOAD 0x00000002 - Reserved */
2845 /* #define IMAGE_SCN_TYPE_GROUP 0x00000004 - Reserved */
2846 #define IMAGE_SCN_TYPE_NO_PAD 0x00000008 /* Reserved */
2847 /* #define IMAGE_SCN_TYPE_COPY 0x00000010 - Reserved */
2849 #define IMAGE_SCN_CNT_CODE 0x00000020
2850 #define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040
2851 #define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080
2853 #define IMAGE_SCN_LNK_OTHER 0x00000100
2854 #define IMAGE_SCN_LNK_INFO 0x00000200
2855 /* #define IMAGE_SCN_TYPE_OVER 0x00000400 - Reserved */
2856 #define IMAGE_SCN_LNK_REMOVE 0x00000800
2857 #define IMAGE_SCN_LNK_COMDAT 0x00001000
2859 /* 0x00002000 - Reserved */
2860 /* #define IMAGE_SCN_MEM_PROTECTED 0x00004000 - Obsolete */
2861 #define IMAGE_SCN_MEM_FARDATA 0x00008000
2863 /* #define IMAGE_SCN_MEM_SYSHEAP 0x00010000 - Obsolete */
2864 #define IMAGE_SCN_MEM_PURGEABLE 0x00020000
2865 #define IMAGE_SCN_MEM_16BIT 0x00020000
2866 #define IMAGE_SCN_MEM_LOCKED 0x00040000
2867 #define IMAGE_SCN_MEM_PRELOAD 0x00080000
2869 #define IMAGE_SCN_ALIGN_1BYTES 0x00100000
2870 #define IMAGE_SCN_ALIGN_2BYTES 0x00200000
2871 #define IMAGE_SCN_ALIGN_4BYTES 0x00300000
2872 #define IMAGE_SCN_ALIGN_8BYTES 0x00400000
2873 #define IMAGE_SCN_ALIGN_16BYTES 0x00500000 /* Default */
2874 #define IMAGE_SCN_ALIGN_32BYTES 0x00600000
2875 #define IMAGE_SCN_ALIGN_64BYTES 0x00700000
2876 #define IMAGE_SCN_ALIGN_128BYTES 0x00800000
2877 #define IMAGE_SCN_ALIGN_256BYTES 0x00900000
2878 #define IMAGE_SCN_ALIGN_512BYTES 0x00A00000
2879 #define IMAGE_SCN_ALIGN_1024BYTES 0x00B00000
2880 #define IMAGE_SCN_ALIGN_2048BYTES 0x00C00000
2881 #define IMAGE_SCN_ALIGN_4096BYTES 0x00D00000
2882 #define IMAGE_SCN_ALIGN_8192BYTES 0x00E00000
2883 /* 0x00F00000 - Unused */
2884 #define IMAGE_SCN_ALIGN_MASK 0x00F00000
2886 #define IMAGE_SCN_LNK_NRELOC_OVFL 0x01000000
2889 #define IMAGE_SCN_MEM_DISCARDABLE 0x02000000
2890 #define IMAGE_SCN_MEM_NOT_CACHED 0x04000000
2891 #define IMAGE_SCN_MEM_NOT_PAGED 0x08000000
2892 #define IMAGE_SCN_MEM_SHARED 0x10000000
2893 #define IMAGE_SCN_MEM_EXECUTE 0x20000000
2894 #define IMAGE_SCN_MEM_READ 0x40000000
2895 #define IMAGE_SCN_MEM_WRITE 0x80000000
2897 #include <pshpack2.h>
2899 typedef struct _IMAGE_SYMBOL
{
2909 SHORT SectionNumber
;
2912 BYTE NumberOfAuxSymbols
;
2914 typedef IMAGE_SYMBOL
*PIMAGE_SYMBOL
;
2916 #define IMAGE_SIZEOF_SYMBOL 18
2918 typedef struct _IMAGE_LINENUMBER
{
2920 DWORD SymbolTableIndex
;
2921 DWORD VirtualAddress
;
2925 typedef IMAGE_LINENUMBER
*PIMAGE_LINENUMBER
;
2927 #define IMAGE_SIZEOF_LINENUMBER 6
2929 typedef union _IMAGE_AUX_SYMBOL
{
2941 DWORD PointerToLinenumber
;
2942 DWORD PointerToNextFunction
;
2951 BYTE Name
[IMAGE_SIZEOF_SYMBOL
];
2955 WORD NumberOfRelocations
;
2956 WORD NumberOfLinenumbers
;
2962 typedef IMAGE_AUX_SYMBOL
*PIMAGE_AUX_SYMBOL
;
2964 #define IMAGE_SIZEOF_AUX_SYMBOL 18
2966 #include <poppack.h>
2968 #define IMAGE_SYM_UNDEFINED (SHORT)0
2969 #define IMAGE_SYM_ABSOLUTE (SHORT)-1
2970 #define IMAGE_SYM_DEBUG (SHORT)-2
2972 #define IMAGE_SYM_TYPE_NULL 0x0000
2973 #define IMAGE_SYM_TYPE_VOID 0x0001
2974 #define IMAGE_SYM_TYPE_CHAR 0x0002
2975 #define IMAGE_SYM_TYPE_SHORT 0x0003
2976 #define IMAGE_SYM_TYPE_INT 0x0004
2977 #define IMAGE_SYM_TYPE_LONG 0x0005
2978 #define IMAGE_SYM_TYPE_FLOAT 0x0006
2979 #define IMAGE_SYM_TYPE_DOUBLE 0x0007
2980 #define IMAGE_SYM_TYPE_STRUCT 0x0008
2981 #define IMAGE_SYM_TYPE_UNION 0x0009
2982 #define IMAGE_SYM_TYPE_ENUM 0x000A
2983 #define IMAGE_SYM_TYPE_MOE 0x000B
2984 #define IMAGE_SYM_TYPE_BYTE 0x000C
2985 #define IMAGE_SYM_TYPE_WORD 0x000D
2986 #define IMAGE_SYM_TYPE_UINT 0x000E
2987 #define IMAGE_SYM_TYPE_DWORD 0x000F
2988 #define IMAGE_SYM_TYPE_PCODE 0x8000
2990 #define IMAGE_SYM_DTYPE_NULL 0
2991 #define IMAGE_SYM_DTYPE_POINTER 1
2992 #define IMAGE_SYM_DTYPE_FUNCTION 2
2993 #define IMAGE_SYM_DTYPE_ARRAY 3
2995 #define IMAGE_SYM_CLASS_END_OF_FUNCTION (BYTE )-1
2996 #define IMAGE_SYM_CLASS_NULL 0x0000
2997 #define IMAGE_SYM_CLASS_AUTOMATIC 0x0001
2998 #define IMAGE_SYM_CLASS_EXTERNAL 0x0002
2999 #define IMAGE_SYM_CLASS_STATIC 0x0003
3000 #define IMAGE_SYM_CLASS_REGISTER 0x0004
3001 #define IMAGE_SYM_CLASS_EXTERNAL_DEF 0x0005
3002 #define IMAGE_SYM_CLASS_LABEL 0x0006
3003 #define IMAGE_SYM_CLASS_UNDEFINED_LABEL 0x0007
3004 #define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 0x0008
3005 #define IMAGE_SYM_CLASS_ARGUMENT 0x0009
3006 #define IMAGE_SYM_CLASS_STRUCT_TAG 0x000A
3007 #define IMAGE_SYM_CLASS_MEMBER_OF_UNION 0x000B
3008 #define IMAGE_SYM_CLASS_UNION_TAG 0x000C
3009 #define IMAGE_SYM_CLASS_TYPE_DEFINITION 0x000D
3010 #define IMAGE_SYM_CLASS_UNDEFINED_STATIC 0x000E
3011 #define IMAGE_SYM_CLASS_ENUM_TAG 0x000F
3012 #define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 0x0010
3013 #define IMAGE_SYM_CLASS_REGISTER_PARAM 0x0011
3014 #define IMAGE_SYM_CLASS_BIT_FIELD 0x0012
3016 #define IMAGE_SYM_CLASS_FAR_EXTERNAL 0x0044
3017 #define IMAGE_SYM_CLASS_BLOCK 0x0064
3018 #define IMAGE_SYM_CLASS_FUNCTION 0x0065
3019 #define IMAGE_SYM_CLASS_END_OF_STRUCT 0x0066
3020 #define IMAGE_SYM_CLASS_FILE 0x0067
3021 #define IMAGE_SYM_CLASS_SECTION 0x0068
3022 #define IMAGE_SYM_CLASS_WEAK_EXTERNAL 0x0069
3024 #define N_BTMASK 0x000F
3025 #define N_TMASK 0x0030
3026 #define N_TMASK1 0x00C0
3027 #define N_TMASK2 0x00F0
3031 #define BTYPE(x) ((x) & N_BTMASK)
3034 #define ISPTR(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT))
3038 #define ISFCN(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_FUNCTION << N_BTSHFT))
3042 #define ISARY(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_ARRAY << N_BTSHFT))
3046 #define ISTAG(x) ((x)==IMAGE_SYM_CLASS_STRUCT_TAG || (x)==IMAGE_SYM_CLASS_UNION_TAG || (x)==IMAGE_SYM_CLASS_ENUM_TAG)
3050 #define INCREF(x) ((((x)&~N_BTMASK)<<N_TSHIFT)|(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT)|((x)&N_BTMASK))
3053 #define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
3056 #define IMAGE_COMDAT_SELECT_NODUPLICATES 1
3057 #define IMAGE_COMDAT_SELECT_ANY 2
3058 #define IMAGE_COMDAT_SELECT_SAME_SIZE 3
3059 #define IMAGE_COMDAT_SELECT_EXACT_MATCH 4
3060 #define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
3061 #define IMAGE_COMDAT_SELECT_LARGEST 6
3062 #define IMAGE_COMDAT_SELECT_NEWEST 7
3064 #define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
3065 #define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
3066 #define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
3068 /* Export module directory */
3070 typedef struct _IMAGE_EXPORT_DIRECTORY
{
3071 DWORD Characteristics
;
3072 DWORD TimeDateStamp
;
3077 DWORD NumberOfFunctions
;
3078 DWORD NumberOfNames
;
3079 DWORD AddressOfFunctions
;
3080 DWORD AddressOfNames
;
3081 DWORD AddressOfNameOrdinals
;
3082 } IMAGE_EXPORT_DIRECTORY
,*PIMAGE_EXPORT_DIRECTORY
;
3084 /* Import name entry */
3085 typedef struct _IMAGE_IMPORT_BY_NAME
{
3088 } IMAGE_IMPORT_BY_NAME
,*PIMAGE_IMPORT_BY_NAME
;
3090 #include <pshpack8.h>
3092 typedef struct _IMAGE_THUNK_DATA64
{
3094 ULONGLONG ForwarderString
;
3097 ULONGLONG AddressOfData
;
3099 } IMAGE_THUNK_DATA64
,*PIMAGE_THUNK_DATA64
;
3100 #include <poppack.h>
3102 typedef struct _IMAGE_THUNK_DATA32
{
3104 DWORD ForwarderString
;
3107 DWORD AddressOfData
;
3109 } IMAGE_THUNK_DATA32
,*PIMAGE_THUNK_DATA32
;
3111 /* Import module directory */
3113 typedef struct _IMAGE_IMPORT_DESCRIPTOR
{
3115 DWORD Characteristics
; /* 0 for terminating null import descriptor */
3116 DWORD OriginalFirstThunk
; /* RVA to original unbound IAT */
3118 DWORD TimeDateStamp
; /* 0 if not bound,
3119 * -1 if bound, and real date\time stamp
3120 * in IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT
3122 * otherwise date/time stamp of DLL bound to
3125 DWORD ForwarderChain
; /* -1 if no forwarders */
3127 /* RVA to IAT (if bound this IAT has actual addresses) */
3129 } IMAGE_IMPORT_DESCRIPTOR
,*PIMAGE_IMPORT_DESCRIPTOR
;
3131 #define IMAGE_ORDINAL_FLAG64 (((ULONGLONG)0x80000000 << 32) | 0x00000000)
3132 #define IMAGE_ORDINAL_FLAG32 0x80000000
3133 #define IMAGE_SNAP_BY_ORDINAL64(ordinal) (((ordinal) & IMAGE_ORDINAL_FLAG64) != 0)
3134 #define IMAGE_SNAP_BY_ORDINAL32(ordinal) (((ordinal) & IMAGE_ORDINAL_FLAG32) != 0)
3135 #define IMAGE_ORDINAL64(ordinal) ((ordinal) & 0xffff)
3136 #define IMAGE_ORDINAL32(ordinal) ((ordinal) & 0xffff)
3139 #define IMAGE_ORDINAL_FLAG IMAGE_ORDINAL_FLAG64
3140 #define IMAGE_SNAP_BY_ORDINAL(Ordinal) IMAGE_SNAP_BY_ORDINAL64(Ordinal)
3141 #define IMAGE_ORDINAL(Ordinal) IMAGE_ORDINAL64(Ordinal)
3142 typedef IMAGE_THUNK_DATA64 IMAGE_THUNK_DATA
;
3143 typedef PIMAGE_THUNK_DATA64 PIMAGE_THUNK_DATA
;
3145 #define IMAGE_ORDINAL_FLAG IMAGE_ORDINAL_FLAG32
3146 #define IMAGE_SNAP_BY_ORDINAL(Ordinal) IMAGE_SNAP_BY_ORDINAL32(Ordinal)
3147 #define IMAGE_ORDINAL(Ordinal) IMAGE_ORDINAL32(Ordinal)
3148 typedef IMAGE_THUNK_DATA32 IMAGE_THUNK_DATA
;
3149 typedef PIMAGE_THUNK_DATA32 PIMAGE_THUNK_DATA
;
3152 typedef struct _IMAGE_BOUND_IMPORT_DESCRIPTOR
3154 DWORD TimeDateStamp
;
3155 WORD OffsetModuleName
;
3156 WORD NumberOfModuleForwarderRefs
;
3157 /* Array of zero or more IMAGE_BOUND_FORWARDER_REF follows */
3158 } IMAGE_BOUND_IMPORT_DESCRIPTOR
, *PIMAGE_BOUND_IMPORT_DESCRIPTOR
;
3160 typedef struct _IMAGE_BOUND_FORWARDER_REF
3162 DWORD TimeDateStamp
;
3163 WORD OffsetModuleName
;
3165 } IMAGE_BOUND_FORWARDER_REF
, *PIMAGE_BOUND_FORWARDER_REF
;
3167 typedef struct _IMAGE_BASE_RELOCATION
3169 DWORD VirtualAddress
;
3171 /* WORD TypeOffset[1]; */
3172 } IMAGE_BASE_RELOCATION
,*PIMAGE_BASE_RELOCATION
;
3174 #include <pshpack2.h>
3176 typedef struct _IMAGE_RELOCATION
3179 DWORD VirtualAddress
;
3182 DWORD SymbolTableIndex
;
3184 } IMAGE_RELOCATION
, *PIMAGE_RELOCATION
;
3186 #include <poppack.h>
3188 #define IMAGE_SIZEOF_RELOCATION 10
3190 typedef struct _IMAGE_DELAYLOAD_DESCRIPTOR
3194 DWORD AllAttributes
;
3198 DWORD ReservedAttributes
:31;
3203 DWORD ModuleHandleRVA
;
3204 DWORD ImportAddressTableRVA
;
3205 DWORD ImportNameTableRVA
;
3206 DWORD BoundImportAddressTableRVA
;
3207 DWORD UnloadInformationTableRVA
;
3208 DWORD TimeDateStamp
;
3209 } IMAGE_DELAYLOAD_DESCRIPTOR
, *PIMAGE_DELAYLOAD_DESCRIPTOR
;
3210 typedef const IMAGE_DELAYLOAD_DESCRIPTOR
*PCIMAGE_DELAYLOAD_DESCRIPTOR
;
3212 /* generic relocation types */
3213 #define IMAGE_REL_BASED_ABSOLUTE 0
3214 #define IMAGE_REL_BASED_HIGH 1
3215 #define IMAGE_REL_BASED_LOW 2
3216 #define IMAGE_REL_BASED_HIGHLOW 3
3217 #define IMAGE_REL_BASED_HIGHADJ 4
3218 #define IMAGE_REL_BASED_MIPS_JMPADDR 5
3219 #define IMAGE_REL_BASED_ARM_MOV32A 5 /* yes, 5 too */
3220 #define IMAGE_REL_BASED_ARM_MOV32 5 /* yes, 5 too */
3221 #define IMAGE_REL_BASED_SECTION 6
3222 #define IMAGE_REL_BASED_REL 7
3223 #define IMAGE_REL_BASED_ARM_MOV32T 7 /* yes, 7 too */
3224 #define IMAGE_REL_BASED_THUMB_MOV32 7 /* yes, 7 too */
3225 #define IMAGE_REL_BASED_MIPS_JMPADDR16 9
3226 #define IMAGE_REL_BASED_IA64_IMM64 9 /* yes, 9 too */
3227 #define IMAGE_REL_BASED_DIR64 10
3228 #define IMAGE_REL_BASED_HIGH3ADJ 11
3230 /* I386 relocation types */
3231 #define IMAGE_REL_I386_ABSOLUTE 0
3232 #define IMAGE_REL_I386_DIR16 1
3233 #define IMAGE_REL_I386_REL16 2
3234 #define IMAGE_REL_I386_DIR32 6
3235 #define IMAGE_REL_I386_DIR32NB 7
3236 #define IMAGE_REL_I386_SEG12 9
3237 #define IMAGE_REL_I386_SECTION 10
3238 #define IMAGE_REL_I386_SECREL 11
3239 #define IMAGE_REL_I386_TOKEN 12
3240 #define IMAGE_REL_I386_SECREL7 13
3241 #define IMAGE_REL_I386_REL32 20
3243 /* MIPS relocation types */
3244 #define IMAGE_REL_MIPS_ABSOLUTE 0x0000
3245 #define IMAGE_REL_MIPS_REFHALF 0x0001
3246 #define IMAGE_REL_MIPS_REFWORD 0x0002
3247 #define IMAGE_REL_MIPS_JMPADDR 0x0003
3248 #define IMAGE_REL_MIPS_REFHI 0x0004
3249 #define IMAGE_REL_MIPS_REFLO 0x0005
3250 #define IMAGE_REL_MIPS_GPREL 0x0006
3251 #define IMAGE_REL_MIPS_LITERAL 0x0007
3252 #define IMAGE_REL_MIPS_SECTION 0x000A
3253 #define IMAGE_REL_MIPS_SECREL 0x000B
3254 #define IMAGE_REL_MIPS_SECRELLO 0x000C
3255 #define IMAGE_REL_MIPS_SECRELHI 0x000D
3256 #define IMAGE_REL_MIPS_TOKEN 0x000E
3257 #define IMAGE_REL_MIPS_JMPADDR16 0x0010
3258 #define IMAGE_REL_MIPS_REFWORDNB 0x0022
3259 #define IMAGE_REL_MIPS_PAIR 0x0025
3261 /* ALPHA relocation types */
3262 #define IMAGE_REL_ALPHA_ABSOLUTE 0x0000
3263 #define IMAGE_REL_ALPHA_REFLONG 0x0001
3264 #define IMAGE_REL_ALPHA_REFQUAD 0x0002
3265 #define IMAGE_REL_ALPHA_GPREL 0x0003
3266 #define IMAGE_REL_ALPHA_LITERAL 0x0004
3267 #define IMAGE_REL_ALPHA_LITUSE 0x0005
3268 #define IMAGE_REL_ALPHA_GPDISP 0x0006
3269 #define IMAGE_REL_ALPHA_BRADDR 0x0007
3270 #define IMAGE_REL_ALPHA_HINT 0x0008
3271 #define IMAGE_REL_ALPHA_INLINE_REFLONG 0x0009
3272 #define IMAGE_REL_ALPHA_REFHI 0x000A
3273 #define IMAGE_REL_ALPHA_REFLO 0x000B
3274 #define IMAGE_REL_ALPHA_PAIR 0x000C
3275 #define IMAGE_REL_ALPHA_MATCH 0x000D
3276 #define IMAGE_REL_ALPHA_SECTION 0x000E
3277 #define IMAGE_REL_ALPHA_SECREL 0x000F
3278 #define IMAGE_REL_ALPHA_REFLONGNB 0x0010
3279 #define IMAGE_REL_ALPHA_SECRELLO 0x0011
3280 #define IMAGE_REL_ALPHA_SECRELHI 0x0012
3281 #define IMAGE_REL_ALPHA_REFQ3 0x0013
3282 #define IMAGE_REL_ALPHA_REFQ2 0x0014
3283 #define IMAGE_REL_ALPHA_REFQ1 0x0015
3284 #define IMAGE_REL_ALPHA_GPRELLO 0x0016
3285 #define IMAGE_REL_ALPHA_GPRELHI 0x0017
3287 /* PowerPC relocation types */
3288 #define IMAGE_REL_PPC_ABSOLUTE 0x0000
3289 #define IMAGE_REL_PPC_ADDR64 0x0001
3290 #define IMAGE_REL_PPC_ADDR 0x0002
3291 #define IMAGE_REL_PPC_ADDR24 0x0003
3292 #define IMAGE_REL_PPC_ADDR16 0x0004
3293 #define IMAGE_REL_PPC_ADDR14 0x0005
3294 #define IMAGE_REL_PPC_REL24 0x0006
3295 #define IMAGE_REL_PPC_REL14 0x0007
3296 #define IMAGE_REL_PPC_TOCREL16 0x0008
3297 #define IMAGE_REL_PPC_TOCREL14 0x0009
3298 #define IMAGE_REL_PPC_ADDR32NB 0x000A
3299 #define IMAGE_REL_PPC_SECREL 0x000B
3300 #define IMAGE_REL_PPC_SECTION 0x000C
3301 #define IMAGE_REL_PPC_IFGLUE 0x000D
3302 #define IMAGE_REL_PPC_IMGLUE 0x000E
3303 #define IMAGE_REL_PPC_SECREL16 0x000F
3304 #define IMAGE_REL_PPC_REFHI 0x0010
3305 #define IMAGE_REL_PPC_REFLO 0x0011
3306 #define IMAGE_REL_PPC_PAIR 0x0012
3307 #define IMAGE_REL_PPC_SECRELLO 0x0013
3308 #define IMAGE_REL_PPC_SECRELHI 0x0014
3309 #define IMAGE_REL_PPC_GPREL 0x0015
3310 #define IMAGE_REL_PPC_TOKEN 0x0016
3311 #define IMAGE_REL_PPC_TYPEMASK 0x00FF
3313 #define IMAGE_REL_PPC_NEG 0x0100
3314 #define IMAGE_REL_PPC_BRTAKEN 0x0200
3315 #define IMAGE_REL_PPC_BRNTAKEN 0x0400
3316 #define IMAGE_REL_PPC_TOCDEFN 0x0800
3318 /* SH3 relocation types */
3319 #define IMAGE_REL_SH3_ABSOLUTE 0x0000
3320 #define IMAGE_REL_SH3_DIRECT16 0x0001
3321 #define IMAGE_REL_SH3_DIRECT 0x0002
3322 #define IMAGE_REL_SH3_DIRECT8 0x0003
3323 #define IMAGE_REL_SH3_DIRECT8_WORD 0x0004
3324 #define IMAGE_REL_SH3_DIRECT8_LONG 0x0005
3325 #define IMAGE_REL_SH3_DIRECT4 0x0006
3326 #define IMAGE_REL_SH3_DIRECT4_WORD 0x0007
3327 #define IMAGE_REL_SH3_DIRECT4_LONG 0x0008
3328 #define IMAGE_REL_SH3_PCREL8_WORD 0x0009
3329 #define IMAGE_REL_SH3_PCREL8_LONG 0x000A
3330 #define IMAGE_REL_SH3_PCREL12_WORD 0x000B
3331 #define IMAGE_REL_SH3_STARTOF_SECTION 0x000C
3332 #define IMAGE_REL_SH3_SIZEOF_SECTION 0x000D
3333 #define IMAGE_REL_SH3_SECTION 0x000E
3334 #define IMAGE_REL_SH3_SECREL 0x000F
3335 #define IMAGE_REL_SH3_DIRECT32_NB 0x0010
3336 #define IMAGE_REL_SH3_GPREL4_LONG 0x0011
3337 #define IMAGE_REL_SH3_TOKEN 0x0012
3339 /* ARM relocation types */
3340 #define IMAGE_REL_ARM_ABSOLUTE 0x0000
3341 #define IMAGE_REL_ARM_ADDR 0x0001
3342 #define IMAGE_REL_ARM_ADDR32NB 0x0002
3343 #define IMAGE_REL_ARM_BRANCH24 0x0003
3344 #define IMAGE_REL_ARM_BRANCH11 0x0004
3345 #define IMAGE_REL_ARM_TOKEN 0x0005
3346 #define IMAGE_REL_ARM_GPREL12 0x0006
3347 #define IMAGE_REL_ARM_GPREL7 0x0007
3348 #define IMAGE_REL_ARM_BLX24 0x0008
3349 #define IMAGE_REL_ARM_BLX11 0x0009
3350 #define IMAGE_REL_ARM_SECTION 0x000E
3351 #define IMAGE_REL_ARM_SECREL 0x000F
3352 #define IMAGE_REL_ARM_MOV32A 0x0010
3353 #define IMAGE_REL_ARM_MOV32T 0x0011
3354 #define IMAGE_REL_ARM_BRANCH20T 0x0012
3355 #define IMAGE_REL_ARM_BRANCH24T 0x0014
3356 #define IMAGE_REL_ARM_BLX23T 0x0015
3358 /* ARM64 relocation types */
3359 #define IMAGE_REL_ARM64_ABSOLUTE 0x0000
3360 #define IMAGE_REL_ARM64_ADDR32 0x0001
3361 #define IMAGE_REL_ARM64_ADDR32NB 0x0002
3362 #define IMAGE_REL_ARM64_BRANCH26 0x0003
3363 #define IMAGE_REL_ARM64_PAGEBASE_REL21 0x0004
3364 #define IMAGE_REL_ARM64_REL21 0x0005
3365 #define IMAGE_REL_ARM64_PAGEOFFSET_12A 0x0006
3366 #define IMAGE_REL_ARM64_PAGEOFFSET_12L 0x0007
3367 #define IMAGE_REL_ARM64_SECREL 0x0008
3368 #define IMAGE_REL_ARM64_SECREL_LOW12A 0x0009
3369 #define IMAGE_REL_ARM64_SECREL_HIGH12A 0x000A
3370 #define IMAGE_REL_ARM64_SECREL_LOW12L 0x000B
3371 #define IMAGE_REL_ARM64_TOKEN 0x000C
3372 #define IMAGE_REL_ARM64_SECTION 0x000D
3373 #define IMAGE_REL_ARM64_ADDR64 0x000E
3375 /* IA64 relocation types */
3376 #define IMAGE_REL_IA64_ABSOLUTE 0x0000
3377 #define IMAGE_REL_IA64_IMM14 0x0001
3378 #define IMAGE_REL_IA64_IMM22 0x0002
3379 #define IMAGE_REL_IA64_IMM64 0x0003
3380 #define IMAGE_REL_IA64_DIR 0x0004
3381 #define IMAGE_REL_IA64_DIR64 0x0005
3382 #define IMAGE_REL_IA64_PCREL21B 0x0006
3383 #define IMAGE_REL_IA64_PCREL21M 0x0007
3384 #define IMAGE_REL_IA64_PCREL21F 0x0008
3385 #define IMAGE_REL_IA64_GPREL22 0x0009
3386 #define IMAGE_REL_IA64_LTOFF22 0x000A
3387 #define IMAGE_REL_IA64_SECTION 0x000B
3388 #define IMAGE_REL_IA64_SECREL22 0x000C
3389 #define IMAGE_REL_IA64_SECREL64I 0x000D
3390 #define IMAGE_REL_IA64_SECREL 0x000E
3391 #define IMAGE_REL_IA64_LTOFF64 0x000F
3392 #define IMAGE_REL_IA64_DIR32NB 0x0010
3393 #define IMAGE_REL_IA64_SREL14 0x0011
3394 #define IMAGE_REL_IA64_SREL22 0x0012
3395 #define IMAGE_REL_IA64_SREL32 0x0013
3396 #define IMAGE_REL_IA64_UREL32 0x0014
3397 #define IMAGE_REL_IA64_PCREL60X 0x0015
3398 #define IMAGE_REL_IA64_PCREL60B 0x0016
3399 #define IMAGE_REL_IA64_PCREL60F 0x0017
3400 #define IMAGE_REL_IA64_PCREL60I 0x0018
3401 #define IMAGE_REL_IA64_PCREL60M 0x0019
3402 #define IMAGE_REL_IA64_IMMGPREL64 0x001A
3403 #define IMAGE_REL_IA64_TOKEN 0x001B
3404 #define IMAGE_REL_IA64_GPREL32 0x001C
3405 #define IMAGE_REL_IA64_ADDEND 0x001F
3407 /* AMD64 relocation types */
3408 #define IMAGE_REL_AMD64_ABSOLUTE 0x0000
3409 #define IMAGE_REL_AMD64_ADDR64 0x0001
3410 #define IMAGE_REL_AMD64_ADDR32 0x0002
3411 #define IMAGE_REL_AMD64_ADDR32NB 0x0003
3412 #define IMAGE_REL_AMD64_REL32 0x0004
3413 #define IMAGE_REL_AMD64_REL32_1 0x0005
3414 #define IMAGE_REL_AMD64_REL32_2 0x0006
3415 #define IMAGE_REL_AMD64_REL32_3 0x0007
3416 #define IMAGE_REL_AMD64_REL32_4 0x0008
3417 #define IMAGE_REL_AMD64_REL32_5 0x0009
3418 #define IMAGE_REL_AMD64_SECTION 0x000A
3419 #define IMAGE_REL_AMD64_SECREL 0x000B
3420 #define IMAGE_REL_AMD64_SECREL7 0x000C
3421 #define IMAGE_REL_AMD64_TOKEN 0x000D
3422 #define IMAGE_REL_AMD64_SREL32 0x000E
3423 #define IMAGE_REL_AMD64_PAIR 0x000F
3424 #define IMAGE_REL_AMD64_SSPAN32 0x0010
3426 /* archive format */
3428 #define IMAGE_ARCHIVE_START_SIZE 8
3429 #define IMAGE_ARCHIVE_START "!<arch>\n"
3430 #define IMAGE_ARCHIVE_END "`\n"
3431 #define IMAGE_ARCHIVE_PAD "\n"
3432 #define IMAGE_ARCHIVE_LINKER_MEMBER "/ "
3433 #define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
3435 typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER
3444 } IMAGE_ARCHIVE_MEMBER_HEADER
, *PIMAGE_ARCHIVE_MEMBER_HEADER
;
3446 #define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
3448 typedef struct _IMPORT_OBJECT_HEADER
3454 DWORD TimeDateStamp
;
3464 } IMPORT_OBJECT_HEADER
;
3466 #define IMPORT_OBJECT_HDR_SIG2 0xffff
3468 typedef enum IMPORT_OBJECT_TYPE
3470 IMPORT_OBJECT_CODE
= 0,
3471 IMPORT_OBJECT_DATA
= 1,
3472 IMPORT_OBJECT_CONST
= 2
3473 } IMPORT_OBJECT_TYPE
;
3475 typedef enum IMPORT_OBJECT_NAME_TYPE
3477 IMPORT_OBJECT_ORDINAL
= 0,
3478 IMPORT_OBJECT_NAME
= 1,
3479 IMPORT_OBJECT_NAME_NO_PREFIX
= 2,
3480 IMPORT_OBJECT_NAME_UNDECORATE
= 3
3481 } IMPORT_OBJECT_NAME_TYPE
;
3483 typedef struct _ANON_OBJECT_HEADER
3489 DWORD TimeDateStamp
;
3492 } ANON_OBJECT_HEADER
;
3495 * Resource directory stuff
3497 typedef struct _IMAGE_RESOURCE_DIRECTORY
{
3498 DWORD Characteristics
;
3499 DWORD TimeDateStamp
;
3502 WORD NumberOfNamedEntries
;
3503 WORD NumberOfIdEntries
;
3504 /* IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[]; */
3505 } IMAGE_RESOURCE_DIRECTORY
,*PIMAGE_RESOURCE_DIRECTORY
;
3507 #define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000
3508 #define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000
3510 typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY
{
3513 #ifdef BITFIELDS_BIGENDIAN
3514 unsigned NameIsString
:1;
3515 unsigned NameOffset
:31;
3517 unsigned NameOffset
:31;
3518 unsigned NameIsString
:1;
3522 #ifdef WORDS_BIGENDIAN
3533 #ifdef BITFIELDS_BIGENDIAN
3534 unsigned DataIsDirectory
:1;
3535 unsigned OffsetToDirectory
:31;
3537 unsigned OffsetToDirectory
:31;
3538 unsigned DataIsDirectory
:1;
3542 } IMAGE_RESOURCE_DIRECTORY_ENTRY
,*PIMAGE_RESOURCE_DIRECTORY_ENTRY
;
3545 typedef struct _IMAGE_RESOURCE_DIRECTORY_STRING
{
3547 CHAR NameString
[ 1 ];
3548 } IMAGE_RESOURCE_DIRECTORY_STRING
,*PIMAGE_RESOURCE_DIRECTORY_STRING
;
3550 typedef struct _IMAGE_RESOURCE_DIR_STRING_U
{
3552 WCHAR NameString
[ 1 ];
3553 } IMAGE_RESOURCE_DIR_STRING_U
,*PIMAGE_RESOURCE_DIR_STRING_U
;
3555 typedef struct _IMAGE_RESOURCE_DATA_ENTRY
{
3560 } IMAGE_RESOURCE_DATA_ENTRY
,*PIMAGE_RESOURCE_DATA_ENTRY
;
3563 typedef VOID (CALLBACK
*PIMAGE_TLS_CALLBACK
)(
3564 LPVOID DllHandle
,DWORD Reason
,LPVOID Reserved
3567 typedef struct _IMAGE_TLS_DIRECTORY64
{
3568 ULONGLONG StartAddressOfRawData
;
3569 ULONGLONG EndAddressOfRawData
;
3570 ULONGLONG AddressOfIndex
;
3571 ULONGLONG AddressOfCallBacks
;
3572 DWORD SizeOfZeroFill
;
3573 DWORD Characteristics
;
3574 } IMAGE_TLS_DIRECTORY64
, *PIMAGE_TLS_DIRECTORY64
;
3576 typedef struct _IMAGE_TLS_DIRECTORY32
{
3577 DWORD StartAddressOfRawData
;
3578 DWORD EndAddressOfRawData
;
3579 DWORD AddressOfIndex
;
3580 DWORD AddressOfCallBacks
;
3581 DWORD SizeOfZeroFill
;
3582 DWORD Characteristics
;
3583 } IMAGE_TLS_DIRECTORY32
, *PIMAGE_TLS_DIRECTORY32
;
3586 typedef IMAGE_TLS_DIRECTORY64 IMAGE_TLS_DIRECTORY
;
3587 typedef PIMAGE_TLS_DIRECTORY64 PIMAGE_TLS_DIRECTORY
;
3589 typedef IMAGE_TLS_DIRECTORY32 IMAGE_TLS_DIRECTORY
;
3590 typedef PIMAGE_TLS_DIRECTORY32 PIMAGE_TLS_DIRECTORY
;
3593 typedef struct _IMAGE_DEBUG_DIRECTORY
{
3594 DWORD Characteristics
;
3595 DWORD TimeDateStamp
;
3600 DWORD AddressOfRawData
;
3601 DWORD PointerToRawData
;
3602 } IMAGE_DEBUG_DIRECTORY
, *PIMAGE_DEBUG_DIRECTORY
;
3604 #define IMAGE_DEBUG_TYPE_UNKNOWN 0
3605 #define IMAGE_DEBUG_TYPE_COFF 1
3606 #define IMAGE_DEBUG_TYPE_CODEVIEW 2
3607 #define IMAGE_DEBUG_TYPE_FPO 3
3608 #define IMAGE_DEBUG_TYPE_MISC 4
3609 #define IMAGE_DEBUG_TYPE_EXCEPTION 5
3610 #define IMAGE_DEBUG_TYPE_FIXUP 6
3611 #define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7
3612 #define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8
3613 #define IMAGE_DEBUG_TYPE_BORLAND 9
3614 #define IMAGE_DEBUG_TYPE_RESERVED10 10
3615 #define IMAGE_DEBUG_TYPE_CLSID 11
3616 #define IMAGE_DEBUG_TYPE_VC_FEATURE 12
3617 #define IMAGE_DEBUG_TYPE_POGO 13
3618 #define IMAGE_DEBUG_TYPE_ILTCG 14
3619 #define IMAGE_DEBUG_TYPE_MPX 15
3621 typedef enum ReplacesCorHdrNumericDefines
3623 COMIMAGE_FLAGS_ILONLY
= 0x00000001,
3624 COMIMAGE_FLAGS_32BITREQUIRED
= 0x00000002,
3625 COMIMAGE_FLAGS_IL_LIBRARY
= 0x00000004,
3626 COMIMAGE_FLAGS_STRONGNAMESIGNED
= 0x00000008,
3627 COMIMAGE_FLAGS_NATIVE_ENTRYPOINT
= 0x00000010,
3628 COMIMAGE_FLAGS_TRACKDEBUGDATA
= 0x00010000,
3630 COR_VERSION_MAJOR_V2
= 2,
3631 COR_VERSION_MAJOR
= COR_VERSION_MAJOR_V2
,
3632 COR_VERSION_MINOR
= 0,
3633 COR_DELETED_NAME_LENGTH
= 8,
3634 COR_VTABLEGAP_NAME_LENGTH
= 8,
3636 NATIVE_TYPE_MAX_CB
= 1,
3637 COR_ILMETHOD_SECT_SMALL_MAX_DATASIZE
= 0xff,
3639 IMAGE_COR_MIH_METHODRVA
= 0x01,
3640 IMAGE_COR_MIH_EHRVA
= 0x02,
3641 IMAGE_COR_MIH_BASICBLOCK
= 0x08,
3643 COR_VTABLE_32BIT
= 0x01,
3644 COR_VTABLE_64BIT
= 0x02,
3645 COR_VTABLE_FROM_UNMANAGED
= 0x04,
3646 COR_VTABLE_CALL_MOST_DERIVED
= 0x10,
3648 IMAGE_COR_EATJ_THUNK_SIZE
= 32,
3650 MAX_CLASS_NAME
= 1024,
3651 MAX_PACKAGE_NAME
= 1024,
3652 } ReplacesCorHdrNumericDefines
;
3654 typedef struct IMAGE_COR20_HEADER
3657 WORD MajorRuntimeVersion
;
3658 WORD MinorRuntimeVersion
;
3660 IMAGE_DATA_DIRECTORY MetaData
;
3663 DWORD EntryPointToken
;
3664 DWORD EntryPointRVA
;
3667 IMAGE_DATA_DIRECTORY Resources
;
3668 IMAGE_DATA_DIRECTORY StrongNameSignature
;
3669 IMAGE_DATA_DIRECTORY CodeManagerTable
;
3670 IMAGE_DATA_DIRECTORY VTableFixups
;
3671 IMAGE_DATA_DIRECTORY ExportAddressTableJumps
;
3672 IMAGE_DATA_DIRECTORY ManagedNativeHeader
;
3674 } IMAGE_COR20_HEADER
, *PIMAGE_COR20_HEADER
;
3676 typedef struct _IMAGE_COFF_SYMBOLS_HEADER
{
3677 DWORD NumberOfSymbols
;
3678 DWORD LvaToFirstSymbol
;
3679 DWORD NumberOfLinenumbers
;
3680 DWORD LvaToFirstLinenumber
;
3681 DWORD RvaToFirstByteOfCode
;
3682 DWORD RvaToLastByteOfCode
;
3683 DWORD RvaToFirstByteOfData
;
3684 DWORD RvaToLastByteOfData
;
3685 } IMAGE_COFF_SYMBOLS_HEADER
, *PIMAGE_COFF_SYMBOLS_HEADER
;
3688 #define FRAME_TRAP 1
3690 #define FRAME_NONFPO 3
3692 typedef struct _FPO_DATA
{
3703 } FPO_DATA
, *PFPO_DATA
;
3705 typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY64
{
3707 DWORD TimeDateStamp
;
3710 DWORD GlobalFlagsClear
;
3711 DWORD GlobalFlagsSet
;
3712 DWORD CriticalSectionDefaultTimeout
;
3713 ULONGLONG DeCommitFreeBlockThreshold
;
3714 ULONGLONG DeCommitTotalFreeThreshold
;
3715 ULONGLONG LockPrefixTable
;
3716 ULONGLONG MaximumAllocationSize
;
3717 ULONGLONG VirtualMemoryThreshold
;
3718 ULONGLONG ProcessAffinityMask
;
3719 DWORD ProcessHeapFlags
;
3723 ULONGLONG SecurityCookie
;
3724 ULONGLONG SEHandlerTable
;
3725 ULONGLONG SEHandlerCount
;
3726 } IMAGE_LOAD_CONFIG_DIRECTORY64
, *PIMAGE_LOAD_CONFIG_DIRECTORY64
;
3728 typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY32
{
3730 DWORD TimeDateStamp
;
3733 DWORD GlobalFlagsClear
;
3734 DWORD GlobalFlagsSet
;
3735 DWORD CriticalSectionDefaultTimeout
;
3736 DWORD DeCommitFreeBlockThreshold
;
3737 DWORD DeCommitTotalFreeThreshold
;
3738 PVOID LockPrefixTable
;
3739 DWORD MaximumAllocationSize
;
3740 DWORD VirtualMemoryThreshold
;
3741 DWORD ProcessHeapFlags
;
3742 DWORD ProcessAffinityMask
;
3746 DWORD SecurityCookie
;
3747 DWORD SEHandlerTable
;
3748 DWORD SEHandlerCount
;
3749 } IMAGE_LOAD_CONFIG_DIRECTORY32
, *PIMAGE_LOAD_CONFIG_DIRECTORY32
;
3752 typedef IMAGE_LOAD_CONFIG_DIRECTORY64 IMAGE_LOAD_CONFIG_DIRECTORY
;
3753 typedef PIMAGE_LOAD_CONFIG_DIRECTORY64 PIMAGE_LOAD_CONFIG_DIRECTORY
;
3755 typedef IMAGE_LOAD_CONFIG_DIRECTORY32 IMAGE_LOAD_CONFIG_DIRECTORY
;
3756 typedef PIMAGE_LOAD_CONFIG_DIRECTORY32 PIMAGE_LOAD_CONFIG_DIRECTORY
;
3759 typedef struct _IMAGE_FUNCTION_ENTRY
{
3760 DWORD StartingAddress
;
3761 DWORD EndingAddress
;
3762 DWORD EndOfPrologue
;
3763 } IMAGE_FUNCTION_ENTRY
, *PIMAGE_FUNCTION_ENTRY
;
3765 #define IMAGE_DEBUG_MISC_EXENAME 1
3767 typedef struct _IMAGE_DEBUG_MISC
{
3773 } IMAGE_DEBUG_MISC
, *PIMAGE_DEBUG_MISC
;
3775 /* This is the structure that appears at the very start of a .DBG file. */
3777 typedef struct _IMAGE_SEPARATE_DEBUG_HEADER
{
3781 WORD Characteristics
;
3782 DWORD TimeDateStamp
;
3786 DWORD NumberOfSections
;
3787 DWORD ExportedNamesSize
;
3788 DWORD DebugDirectorySize
;
3789 DWORD SectionAlignment
;
3790 DWORD Reserved
[ 2 ];
3791 } IMAGE_SEPARATE_DEBUG_HEADER
,*PIMAGE_SEPARATE_DEBUG_HEADER
;
3793 #define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944
3796 typedef struct tagMESSAGE_RESOURCE_ENTRY
{
3800 } MESSAGE_RESOURCE_ENTRY
,*PMESSAGE_RESOURCE_ENTRY
;
3801 #define MESSAGE_RESOURCE_UNICODE 0x0001
3803 typedef struct tagMESSAGE_RESOURCE_BLOCK
{
3806 DWORD OffsetToEntries
;
3807 } MESSAGE_RESOURCE_BLOCK
,*PMESSAGE_RESOURCE_BLOCK
;
3809 typedef struct tagMESSAGE_RESOURCE_DATA
{
3810 DWORD NumberOfBlocks
;
3811 MESSAGE_RESOURCE_BLOCK Blocks
[ 1 ];
3812 } MESSAGE_RESOURCE_DATA
,*PMESSAGE_RESOURCE_DATA
;
3815 * Here follows typedefs for security and tokens.
3819 * First a constant for the following typedefs.
3822 #define ANYSIZE_ARRAY 1
3824 /* FIXME: Orphan. What does it point to? */
3825 typedef PVOID PACCESS_TOKEN
;
3826 typedef PVOID PSECURITY_DESCRIPTOR
;
3829 typedef enum _TOKEN_ELEVATION_TYPE
{
3830 TokenElevationTypeDefault
= 1,
3831 TokenElevationTypeFull
,
3832 TokenElevationTypeLimited
3833 } TOKEN_ELEVATION_TYPE
, *PTOKEN_ELEVATION_TYPE
;
3836 * TOKEN_INFORMATION_CLASS
3839 typedef enum _TOKEN_INFORMATION_CLASS
{
3848 TokenImpersonationLevel
,
3850 TokenRestrictedSids
,
3852 TokenGroupsAndPrivileges
,
3853 TokenSessionReference
,
3860 TokenHasRestrictions
,
3861 TokenAccessInformation
,
3862 TokenVirtualizationAllowed
,
3863 TokenVirtualizationEnabled
,
3864 TokenIntegrityLevel
,
3866 TokenMandatoryPolicy
,
3868 TokenIsAppContainer
,
3870 TokenAppContainerSid
,
3871 TokenAppContainerNumber
,
3872 TokenUserClaimAttributes
,
3873 TokenDeviceClaimAttributes
,
3874 TokenRestrictedUserClaimAttributes
,
3875 TokenRestrictedDeviceClaimAttributes
,
3877 TokenRestrictedDeviceGroups
,
3878 TokenSecurityAttributes
,
3880 TokenProcessTrustLevel
,
3882 } TOKEN_INFORMATION_CLASS
;
3884 #define TOKEN_TOKEN_ADJUST_DEFAULT 0x0080
3885 #define TOKEN_ADJUST_GROUPS 0x0040
3886 #define TOKEN_ADJUST_PRIVILEGES 0x0020
3887 #define TOKEN_ADJUST_SESSIONID 0x0100
3888 #define TOKEN_ASSIGN_PRIMARY 0x0001
3889 #define TOKEN_DUPLICATE 0x0002
3890 #define TOKEN_EXECUTE STANDARD_RIGHTS_EXECUTE
3891 #define TOKEN_IMPERSONATE 0x0004
3892 #define TOKEN_QUERY 0x0008
3893 #define TOKEN_QUERY_SOURCE 0x0010
3894 #define TOKEN_ADJUST_DEFAULT 0x0080
3895 #define TOKEN_READ (STANDARD_RIGHTS_READ|TOKEN_QUERY)
3896 #define TOKEN_WRITE (STANDARD_RIGHTS_WRITE | \
3897 TOKEN_ADJUST_PRIVILEGES | \
3898 TOKEN_ADJUST_GROUPS | \
3899 TOKEN_ADJUST_DEFAULT )
3900 #define TOKEN_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
3901 TOKEN_ASSIGN_PRIMARY | \
3903 TOKEN_IMPERSONATE | \
3905 TOKEN_QUERY_SOURCE | \
3906 TOKEN_ADJUST_PRIVILEGES | \
3907 TOKEN_ADJUST_GROUPS | \
3908 TOKEN_ADJUST_SESSIONID | \
3909 TOKEN_ADJUST_DEFAULT )
3911 #ifndef _SECURITY_DEFINED
3912 #define _SECURITY_DEFINED
3915 typedef DWORD ACCESS_MASK
, *PACCESS_MASK
;
3917 typedef struct _GENERIC_MAPPING
{
3918 ACCESS_MASK GenericRead
;
3919 ACCESS_MASK GenericWrite
;
3920 ACCESS_MASK GenericExecute
;
3921 ACCESS_MASK GenericAll
;
3922 } GENERIC_MAPPING
, *PGENERIC_MAPPING
;
3924 #ifndef SID_IDENTIFIER_AUTHORITY_DEFINED
3925 #define SID_IDENTIFIER_AUTHORITY_DEFINED
3928 } SID_IDENTIFIER_AUTHORITY
, *PSID_IDENTIFIER_AUTHORITY
;
3929 #endif /* !defined(SID_IDENTIFIER_AUTHORITY_DEFINED) */
3933 typedef struct _SID
{
3935 BYTE SubAuthorityCount
;
3936 SID_IDENTIFIER_AUTHORITY IdentifierAuthority
;
3937 DWORD SubAuthority
[1];
3939 #endif /* !defined(SID_DEFINED) */
3941 #define SID_REVISION (1) /* Current revision */
3942 #define SID_MAX_SUB_AUTHORITIES (15) /* current max subauths */
3943 #define SID_RECOMMENDED_SUB_AUTHORITIES (1) /* recommended subauths */
3945 #define SECURITY_MAX_SID_SIZE (sizeof(SID) - sizeof(DWORD) + (SID_MAX_SUB_AUTHORITIES * sizeof(DWORD)))
3951 #define ACL_REVISION1 1
3952 #define ACL_REVISION2 2
3953 #define ACL_REVISION3 3
3954 #define ACL_REVISION4 4
3956 #define MIN_ACL_REVISION ACL_REVISION2
3957 #define MAX_ACL_REVISION ACL_REVISION4
3959 #define ACL_REVISION 2
3961 typedef struct _ACL
{
3969 typedef enum _ACL_INFORMATION_CLASS
3971 AclRevisionInformation
= 1,
3973 } ACL_INFORMATION_CLASS
;
3975 typedef struct _ACL_REVISION_INFORMATION
3978 } ACL_REVISION_INFORMATION
, *PACL_REVISION_INFORMATION
;
3980 typedef struct _ACL_SIZE_INFORMATION
3983 DWORD AclBytesInUse
;
3985 } ACL_SIZE_INFORMATION
, *PACL_SIZE_INFORMATION
;
3987 /* SECURITY_DESCRIPTOR */
3988 #define SECURITY_DESCRIPTOR_REVISION 1
3989 #define SECURITY_DESCRIPTOR_REVISION1 1
3996 #if defined(_MSC_VER)
3997 #define SE_CREATE_TOKEN_NAME L"SeCreateTokenPrivilege"
3998 #define SE_ASSIGNPRIMARYTOKEN_NAME L"SeAssignPrimaryTokenPrivilege"
3999 #define SE_LOCK_MEMORY_NAME L"SeLockMemoryPrivilege"
4000 #define SE_INCREASE_QUOTA_NAME L"SeIncreaseQuotaPrivilege"
4001 #define SE_UNSOLICITED_INPUT_NAME L"SeUnsolicitedInputPrivilege"
4002 #define SE_MACHINE_ACCOUNT_NAME L"SeMachineAccountPrivilege"
4003 #define SE_TCB_NAME L"SeTcbPrivilege"
4004 #define SE_SECURITY_NAME L"SeSecurityPrivilege"
4005 #define SE_TAKE_OWNERSHIP_NAME L"SeTakeOwnershipPrivilege"
4006 #define SE_LOAD_DRIVER_NAME L"SeLoadDriverPrivilege"
4007 #define SE_SYSTEM_PROFILE_NAME L"SeSystemProfilePrivilege"
4008 #define SE_SYSTEMTIME_NAME L"SeSystemtimePrivilege"
4009 #define SE_PROF_SINGLE_PROCESS_NAME L"SeProfileSingleProcessPrivilege"
4010 #define SE_INC_BASE_PRIORITY_NAME L"SeIncreaseBasePriorityPrivilege"
4011 #define SE_CREATE_PAGEFILE_NAME L"SeCreatePagefilePrivilege"
4012 #define SE_CREATE_PERMANENT_NAME L"SeCreatePermanentPrivilege"
4013 #define SE_BACKUP_NAME L"SeBackupPrivilege"
4014 #define SE_RESTORE_NAME L"SeRestorePrivilege"
4015 #define SE_SHUTDOWN_NAME L"SeShutdownPrivilege"
4016 #define SE_DEBUG_NAME L"SeDebugPrivilege"
4017 #define SE_AUDIT_NAME L"SeAuditPrivilege"
4018 #define SE_SYSTEM_ENVIRONMENT_NAME L"SeSystemEnvironmentPrivilege"
4019 #define SE_CHANGE_NOTIFY_NAME L"SeChangeNotifyPrivilege"
4020 #define SE_REMOTE_SHUTDOWN_NAME L"SeRemoteShutdownPrivilege"
4021 #define SE_UNDOCK_NAME L"SeUndockPrivilege"
4022 #define SE_ENABLE_DELEGATION_NAME L"SeEnableDelegationPrivilege"
4023 #define SE_MANAGE_VOLUME_NAME L"SeManageVolumePrivilege"
4024 #define SE_IMPERSONATE_NAME L"SeImpersonatePrivilege"
4025 #define SE_CREATE_GLOBAL_NAME L"SeCreateGlobalPrivilege"
4026 #elif defined(__GNUC__)
4027 #define SE_CREATE_TOKEN_NAME (const WCHAR []){ 'S','e','C','r','e','a','t','e','T','o','k','e','n','P','r','i','v','i','l','e','g','e',0 }
4028 #define SE_ASSIGNPRIMARYTOKEN_NAME (const WCHAR []){ 'S','e','A','s','s','i','g','n','P','r','i','m','a','r','y','T','o','k','e','n','P','r','i','v','i','l','e','g','e',0 }
4029 #define SE_LOCK_MEMORY_NAME (const WCHAR []){ 'S','e','L','o','c','k','M','e','m','o','r','y','P','r','i','v','i','l','e','g','e',0 }
4030 #define SE_INCREASE_QUOTA_NAME (const WCHAR []){ 'S','e','I','n','c','r','e','a','s','e','Q','u','o','t','a','P','r','i','v','i','l','e','g','e',0 }
4031 #define SE_UNSOLICITED_INPUT_NAME (const WCHAR []){ 'S','e','U','n','s','o','l','i','c','i','t','e','d','I','n','p','u','t','P','r','i','v','i','l','e','g','e',0 }
4032 #define SE_MACHINE_ACCOUNT_NAME (const WCHAR []){ 'S','e','M','a','c','h','i','n','e','A','c','c','o','u','n','t','P','r','i','v','i','l','e','g','e',0 }
4033 #define SE_TCB_NAME (const WCHAR []){ 'S','e','T','c','b','P','r','i','v','i','l','e','g','e',0 }
4034 #define SE_SECURITY_NAME (const WCHAR []){ 'S','e','S','e','c','u','r','i','t','y','P','r','i','v','i','l','e','g','e',0 }
4035 #define SE_TAKE_OWNERSHIP_NAME (const WCHAR []){ 'S','e','T','a','k','e','O','w','n','e','r','s','h','i','p','P','r','i','v','i','l','e','g','e',0 }
4036 #define SE_LOAD_DRIVER_NAME (const WCHAR []){ 'S','e','L','o','a','d','D','r','i','v','e','r','P','r','i','v','i','l','e','g','e',0 }
4037 #define SE_SYSTEM_PROFILE_NAME (const WCHAR []){ 'S','e','S','y','s','t','e','m','P','r','o','f','i','l','e','P','r','i','v','i','l','e','g','e',0 }
4038 #define SE_SYSTEMTIME_NAME (const WCHAR []){ 'S','e','S','y','s','t','e','m','t','i','m','e','P','r','i','v','i','l','e','g','e',0 }
4039 #define SE_PROF_SINGLE_PROCESS_NAME (const WCHAR []){ 'S','e','P','r','o','f','i','l','e','S','i','n','g','l','e','P','r','o','c','e','s','s','P','r','i','v','i','l','e','g','e',0 }
4040 #define SE_INC_BASE_PRIORITY_NAME (const WCHAR []){ 'S','e','I','n','c','r','e','a','s','e','B','a','s','e','P','r','i','o','r','i','t','y','P','r','i','v','i','l','e','g','e',0 }
4041 #define SE_CREATE_PAGEFILE_NAME (const WCHAR []){ 'S','e','C','r','e','a','t','e','P','a','g','e','f','i','l','e','P','r','i','v','i','l','e','g','e',0 }
4042 #define SE_CREATE_PERMANENT_NAME (const WCHAR []){ 'S','e','C','r','e','a','t','e','P','e','r','m','a','n','e','n','t','P','r','i','v','i','l','e','g','e',0 }
4043 #define SE_BACKUP_NAME (const WCHAR []){ 'S','e','B','a','c','k','u','p','P','r','i','v','i','l','e','g','e',0 }
4044 #define SE_RESTORE_NAME (const WCHAR []){ 'S','e','R','e','s','t','o','r','e','P','r','i','v','i','l','e','g','e',0 }
4045 #define SE_SHUTDOWN_NAME (const WCHAR []){ 'S','e','S','h','u','t','d','o','w','n','P','r','i','v','i','l','e','g','e',0 }
4046 #define SE_DEBUG_NAME (const WCHAR []){ 'S','e','D','e','b','u','g','P','r','i','v','i','l','e','g','e',0 }
4047 #define SE_AUDIT_NAME (const WCHAR []){ 'S','e','A','u','d','i','t','P','r','i','v','i','l','e','g','e',0 }
4048 #define SE_SYSTEM_ENVIRONMENT_NAME (const WCHAR []){ 'S','e','S','y','s','t','e','m','E','n','v','i','r','o','n','m','e','n','t','P','r','i','v','i','l','e','g','e',0 }
4049 #define SE_CHANGE_NOTIFY_NAME (const WCHAR []){ 'S','e','C','h','a','n','g','e','N','o','t','i','f','y','P','r','i','v','i','l','e','g','e',0 }
4050 #define SE_REMOTE_SHUTDOWN_NAME (const WCHAR []){ 'S','e','R','e','m','o','t','e','S','h','u','t','d','o','w','n','P','r','i','v','i','l','e','g','e',0 }
4051 #define SE_UNDOCK_NAME (const WCHAR []){ 'S','e','U','n','d','o','c','k','P','r','i','v','i','l','e','g','e',0 }
4052 #define SE_ENABLE_DELEGATION_NAME (const WCHAR []){ 'S','e','E','n','a','b','l','e','D','e','l','e','g','a','t','i','o','n','P','r','i','v','i','l','e','g','e',0 }
4053 #define SE_MANAGE_VOLUME_NAME (const WCHAR []){ 'S','e','M','a','n','a','g','e','V','o','l','u','m','e','P','r','i','v','i','l','e','g','e',0 }
4054 #define SE_IMPERSONATE_NAME (const WCHAR []){ 'S','e','I','m','p','e','r','s','o','n','a','t','e','P','r','i','v','i','l','e','g','e',0 }
4055 #define SE_CREATE_GLOBAL_NAME (const WCHAR []){ 'S','e','C','r','e','a','t','e','G','l','o','b','a','l','P','r','i','v','i','l','e','g','e',0 }
4056 #else /* _MSC_VER/__GNUC__ */
4057 static const WCHAR SE_CREATE_TOKEN_NAME
[] = { 'S','e','C','r','e','a','t','e','T','o','k','e','n','P','r','i','v','i','l','e','g','e',0 };
4058 static const WCHAR SE_ASSIGNPRIMARYTOKEN_NAME
[] = { 'S','e','A','s','s','i','g','n','P','r','i','m','a','r','y','T','o','k','e','n','P','r','i','v','i','l','e','g','e',0 };
4059 static const WCHAR SE_LOCK_MEMORY_NAME
[] = { 'S','e','L','o','c','k','M','e','m','o','r','y','P','r','i','v','i','l','e','g','e',0 };
4060 static const WCHAR SE_INCREASE_QUOTA_NAME
[] = { 'S','e','I','n','c','r','e','a','s','e','Q','u','o','t','a','P','r','i','v','i','l','e','g','e',0 };
4061 static const WCHAR SE_UNSOLICITED_INPUT_NAME
[] = { 'S','e','U','n','s','o','l','i','c','i','t','e','d','I','n','p','u','t','P','r','i','v','i','l','e','g','e',0 };
4062 static const WCHAR SE_MACHINE_ACCOUNT_NAME
[] = { 'S','e','M','a','c','h','i','n','e','A','c','c','o','u','n','t','P','r','i','v','i','l','e','g','e',0 };
4063 static const WCHAR SE_TCB_NAME
[] = { 'S','e','T','c','b','P','r','i','v','i','l','e','g','e',0 };
4064 static const WCHAR SE_SECURITY_NAME
[] = { 'S','e','S','e','c','u','r','i','t','y','P','r','i','v','i','l','e','g','e',0 };
4065 static const WCHAR SE_TAKE_OWNERSHIP_NAME
[] = { 'S','e','T','a','k','e','O','w','n','e','r','s','h','i','p','P','r','i','v','i','l','e','g','e',0 };
4066 static const WCHAR SE_LOAD_DRIVER_NAME
[] = { 'S','e','L','o','a','d','D','r','i','v','e','r','P','r','i','v','i','l','e','g','e',0 };
4067 static const WCHAR SE_SYSTEM_PROFILE_NAME
[] = { 'S','e','S','y','s','t','e','m','P','r','o','f','i','l','e','P','r','i','v','i','l','e','g','e',0 };
4068 static const WCHAR SE_SYSTEMTIME_NAME
[] = { 'S','e','S','y','s','t','e','m','t','i','m','e','P','r','i','v','i','l','e','g','e',0 };
4069 static const WCHAR SE_PROF_SINGLE_PROCESS_NAME
[] = { 'S','e','P','r','o','f','i','l','e','S','i','n','g','l','e','P','r','o','c','e','s','s','P','r','i','v','i','l','e','g','e',0 };
4070 static const WCHAR SE_INC_BASE_PRIORITY_NAME
[] = { 'S','e','I','n','c','r','e','a','s','e','B','a','s','e','P','r','i','o','r','i','t','y','P','r','i','v','i','l','e','g','e',0 };
4071 static const WCHAR SE_CREATE_PAGEFILE_NAME
[] = { 'S','e','C','r','e','a','t','e','P','a','g','e','f','i','l','e','P','r','i','v','i','l','e','g','e',0 };
4072 static const WCHAR SE_CREATE_PERMANENT_NAME
[] = { 'S','e','C','r','e','a','t','e','P','e','r','m','a','n','e','n','t','P','r','i','v','i','l','e','g','e',0 };
4073 static const WCHAR SE_BACKUP_NAME
[] = { 'S','e','B','a','c','k','u','p','P','r','i','v','i','l','e','g','e',0 };
4074 static const WCHAR SE_RESTORE_NAME
[] = { 'S','e','R','e','s','t','o','r','e','P','r','i','v','i','l','e','g','e',0 };
4075 static const WCHAR SE_SHUTDOWN_NAME
[] = { 'S','e','S','h','u','t','d','o','w','n','P','r','i','v','i','l','e','g','e',0 };
4076 static const WCHAR SE_DEBUG_NAME
[] = { 'S','e','D','e','b','u','g','P','r','i','v','i','l','e','g','e',0 };
4077 static const WCHAR SE_AUDIT_NAME
[] = { 'S','e','A','u','d','i','t','P','r','i','v','i','l','e','g','e',0 };
4078 static const WCHAR SE_SYSTEM_ENVIRONMENT_NAME
[] = { 'S','e','S','y','s','t','e','m','E','n','v','i','r','o','n','m','e','n','t','P','r','i','v','i','l','e','g','e',0 };
4079 static const WCHAR SE_CHANGE_NOTIFY_NAME
[] = { 'S','e','C','h','a','n','g','e','N','o','t','i','f','y','P','r','i','v','i','l','e','g','e',0 };
4080 static const WCHAR SE_REMOTE_SHUTDOWN_NAME
[] = { 'S','e','R','e','m','o','t','e','S','h','u','t','d','o','w','n','P','r','i','v','i','l','e','g','e',0 };
4081 static const WCHAR SE_UNDOCK_NAME
[] = { 'S','e','U','n','d','o','c','k','P','r','i','v','i','l','e','g','e',0 };
4082 static const WCHAR SE_ENABLE_DELEGATION_NAME
[] = { 'S','e','E','n','a','b','l','e','D','e','l','e','g','a','t','i','o','n','P','r','i','v','i','l','e','g','e',0 };
4083 static const WCHAR SE_MANAGE_VOLUME_NAME
[] = { 'S','e','M','a','n','a','g','e','V','o','l','u','m','e','P','r','i','v','i','l','e','g','e',0 };
4084 static const WCHAR SE_IMPERSONATE_NAME
[] = { 'S','e','I','m','p','e','r','s','o','n','a','t','e','P','r','i','v','i','l','e','g','e',0 };
4085 static const WCHAR SE_CREATE_GLOBAL_NAME
[] = { 'S','e','C','r','e','a','t','e','G','l','o','b','a','l','P','r','i','v','i','l','e','g','e',0 };
4088 #define SE_CREATE_TOKEN_NAME "SeCreateTokenPrivilege"
4089 #define SE_ASSIGNPRIMARYTOKEN_NAME "SeAssignPrimaryTokenPrivilege"
4090 #define SE_LOCK_MEMORY_NAME "SeLockMemoryPrivilege"
4091 #define SE_INCREASE_QUOTA_NAME "SeIncreaseQuotaPrivilege"
4092 #define SE_UNSOLICITED_INPUT_NAME "SeUnsolicitedInputPrivilege"
4093 #define SE_MACHINE_ACCOUNT_NAME "SeMachineAccountPrivilege"
4094 #define SE_TCB_NAME "SeTcbPrivilege"
4095 #define SE_SECURITY_NAME "SeSecurityPrivilege"
4096 #define SE_TAKE_OWNERSHIP_NAME "SeTakeOwnershipPrivilege"
4097 #define SE_LOAD_DRIVER_NAME "SeLoadDriverPrivilege"
4098 #define SE_SYSTEM_PROFILE_NAME "SeSystemProfilePrivilege"
4099 #define SE_SYSTEMTIME_NAME "SeSystemtimePrivilege"
4100 #define SE_PROF_SINGLE_PROCESS_NAME "SeProfileSingleProcessPrivilege"
4101 #define SE_INC_BASE_PRIORITY_NAME "SeIncreaseBasePriorityPrivilege"
4102 #define SE_CREATE_PAGEFILE_NAME "SeCreatePagefilePrivilege"
4103 #define SE_CREATE_PERMANENT_NAME "SeCreatePermanentPrivilege"
4104 #define SE_BACKUP_NAME "SeBackupPrivilege"
4105 #define SE_RESTORE_NAME "SeRestorePrivilege"
4106 #define SE_SHUTDOWN_NAME "SeShutdownPrivilege"
4107 #define SE_DEBUG_NAME "SeDebugPrivilege"
4108 #define SE_AUDIT_NAME "SeAuditPrivilege"
4109 #define SE_SYSTEM_ENVIRONMENT_NAME "SeSystemEnvironmentPrivilege"
4110 #define SE_CHANGE_NOTIFY_NAME "SeChangeNotifyPrivilege"
4111 #define SE_REMOTE_SHUTDOWN_NAME "SeRemoteShutdownPrivilege"
4112 #define SE_UNDOCK_NAME "SeUndockPrivilege"
4113 #define SE_ENABLE_DELEGATION_NAME "SeEnableDelegationPrivilege"
4114 #define SE_MANAGE_VOLUME_NAME "SeManageVolumePrivilege"
4115 #define SE_IMPERSONATE_NAME "SeImpersonatePrivilege"
4116 #define SE_CREATE_GLOBAL_NAME "SeCreateGlobalPrivilege"
4119 #define SE_GROUP_MANDATORY 0x00000001
4120 #define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002
4121 #define SE_GROUP_ENABLED 0x00000004
4122 #define SE_GROUP_OWNER 0x00000008
4123 #define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010
4124 #define SE_GROUP_INTEGRITY 0x00000020
4125 #define SE_GROUP_INTEGRITY_ENABLED 0x00000040
4126 #define SE_GROUP_LOGON_ID 0xC0000000
4127 #define SE_GROUP_RESOURCE 0x20000000
4128 #define SE_GROUP_VALID_ATTRIBUTES 0xE000007F
4130 #define SE_PRIVILEGE_ENABLED_BY_DEFAULT 0x00000001
4131 #define SE_PRIVILEGE_ENABLED 0x00000002
4132 #define SE_PRIVILEGE_REMOVED 0x00000004
4133 #define SE_PRIVILEGE_USED_FOR_ACCESS 0x80000000
4135 #define PRIVILEGE_SET_ALL_NECESSARY 1
4137 #define SE_OWNER_DEFAULTED 0x00000001
4138 #define SE_GROUP_DEFAULTED 0x00000002
4139 #define SE_DACL_PRESENT 0x00000004
4140 #define SE_DACL_DEFAULTED 0x00000008
4141 #define SE_SACL_PRESENT 0x00000010
4142 #define SE_SACL_DEFAULTED 0x00000020
4143 #define SE_DACL_AUTO_INHERIT_REQ 0x00000100
4144 #define SE_SACL_AUTO_INHERIT_REQ 0x00000200
4145 #define SE_DACL_AUTO_INHERITED 0x00000400
4146 #define SE_SACL_AUTO_INHERITED 0x00000800
4147 #define SE_DACL_PROTECTED 0x00001000
4148 #define SE_SACL_PROTECTED 0x00002000
4149 #define SE_RM_CONTROL_VALID 0x00004000
4150 #define SE_SELF_RELATIVE 0x00008000
4152 typedef DWORD SECURITY_INFORMATION
, *PSECURITY_INFORMATION
;
4153 typedef WORD SECURITY_DESCRIPTOR_CONTROL
, *PSECURITY_DESCRIPTOR_CONTROL
;
4155 /* The security descriptor structure */
4159 SECURITY_DESCRIPTOR_CONTROL Control
;
4164 } SECURITY_DESCRIPTOR_RELATIVE
, *PISECURITY_DESCRIPTOR_RELATIVE
;
4169 SECURITY_DESCRIPTOR_CONTROL Control
;
4174 } SECURITY_DESCRIPTOR
, *PISECURITY_DESCRIPTOR
;
4176 #define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR))
4178 #endif /* _SECURITY_DEFINED */
4181 * SID_AND_ATTRIBUTES
4184 typedef struct _SID_AND_ATTRIBUTES
{
4187 } SID_AND_ATTRIBUTES
, *PSID_AND_ATTRIBUTES
;
4189 /* security entities */
4190 #define SECURITY_NULL_RID __MSABI_LONG(0x00000000)
4191 #define SECURITY_WORLD_RID __MSABI_LONG(0x00000000)
4192 #define SECURITY_LOCAL_RID __MSABI_LONG(0X00000000)
4194 #define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0}
4197 #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
4200 #define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2}
4203 #define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3}
4204 #define SECURITY_CREATOR_OWNER_RID __MSABI_LONG(0x00000000)
4205 #define SECURITY_CREATOR_GROUP_RID __MSABI_LONG(0x00000001)
4206 #define SECURITY_CREATOR_OWNER_SERVER_RID __MSABI_LONG(0x00000002)
4207 #define SECURITY_CREATOR_GROUP_SERVER_RID __MSABI_LONG(0x00000003)
4210 #define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4}
4213 #define SECURITY_NT_AUTHORITY {0,0,0,0,0,5}
4214 #define SECURITY_DIALUP_RID __MSABI_LONG(0x00000001)
4215 #define SECURITY_NETWORK_RID __MSABI_LONG(0x00000002)
4216 #define SECURITY_BATCH_RID __MSABI_LONG(0x00000003)
4217 #define SECURITY_INTERACTIVE_RID __MSABI_LONG(0x00000004)
4218 #define SECURITY_LOGON_IDS_RID __MSABI_LONG(0x00000005)
4219 #define SECURITY_SERVICE_RID __MSABI_LONG(0x00000006)
4220 #define SECURITY_ANONYMOUS_LOGON_RID __MSABI_LONG(0x00000007)
4221 #define SECURITY_PROXY_RID __MSABI_LONG(0x00000008)
4222 #define SECURITY_ENTERPRISE_CONTROLLERS_RID __MSABI_LONG(0x00000009)
4223 #define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID
4224 #define SECURITY_PRINCIPAL_SELF_RID __MSABI_LONG(0x0000000A)
4225 #define SECURITY_AUTHENTICATED_USER_RID __MSABI_LONG(0x0000000B)
4226 #define SECURITY_RESTRICTED_CODE_RID __MSABI_LONG(0x0000000C)
4227 #define SECURITY_TERMINAL_SERVER_RID __MSABI_LONG(0x0000000D)
4228 #define SECURITY_REMOTE_LOGON_RID __MSABI_LONG(0x0000000E)
4229 #define SECURITY_THIS_ORGANIZATION_RID __MSABI_LONG(0x0000000F)
4230 #define SECURITY_LOCAL_SYSTEM_RID __MSABI_LONG(0x00000012)
4231 #define SECURITY_LOCAL_SERVICE_RID __MSABI_LONG(0x00000013)
4232 #define SECURITY_NETWORK_SERVICE_RID __MSABI_LONG(0x00000014)
4233 #define SECURITY_NT_NON_UNIQUE __MSABI_LONG(0x00000015)
4234 #define SECURITY_BUILTIN_DOMAIN_RID __MSABI_LONG(0x00000020)
4236 #define SECURITY_PACKAGE_BASE_RID __MSABI_LONG(0x00000040)
4237 #define SECURITY_PACKAGE_NTLM_RID __MSABI_LONG(0x0000000A)
4238 #define SECURITY_PACKAGE_SCHANNEL_RID __MSABI_LONG(0x0000000E)
4239 #define SECURITY_PACKAGE_DIGEST_RID __MSABI_LONG(0x00000015)
4240 #define SECURITY_MAX_ALWAYS_FILTERED __MSABI_LONG(0x000003E7)
4241 #define SECURITY_MIN_NEVER_FILTERED __MSABI_LONG(0x000003E8)
4242 #define SECURITY_OTHER_ORGANIZATION_RID __MSABI_LONG(0x000003E8)
4244 #define FOREST_USER_RID_MAX __MSABI_LONG(0x000001F3)
4245 #define DOMAIN_USER_RID_ADMIN __MSABI_LONG(0x000001F4)
4246 #define DOMAIN_USER_RID_GUEST __MSABI_LONG(0x000001F5)
4247 #define DOMAIN_USER_RID_KRBTGT __MSABI_LONG(0x000001F6)
4248 #define DOMAIN_USER_RID_MAX __MSABI_LONG(0x000003E7)
4250 #define DOMAIN_GROUP_RID_ADMINS __MSABI_LONG(0x00000200)
4251 #define DOMAIN_GROUP_RID_USERS __MSABI_LONG(0x00000201)
4252 #define DOMAIN_GROUP_RID_GUESTS __MSABI_LONG(0x00000202)
4253 #define DOMAIN_GROUP_RID_COMPUTERS __MSABI_LONG(0x00000203)
4254 #define DOMAIN_GROUP_RID_CONTROLLERS __MSABI_LONG(0x00000204)
4255 #define DOMAIN_GROUP_RID_CERT_ADMINS __MSABI_LONG(0x00000205)
4256 #define DOMAIN_GROUP_RID_SCHEMA_ADMINS __MSABI_LONG(0x00000206)
4257 #define DOMAIN_GROUP_RID_ENTERPRISE_ADMINS __MSABI_LONG(0x00000207)
4258 #define DOMAIN_GROUP_RID_POLICY_ADMINS __MSABI_LONG(0x00000208)
4260 #define SECURITY_APP_PACKAGE_AUTHORITY {0,0,0,0,0,15}
4261 #define SECURITY_APP_PACKAGE_BASE_RID __MSABI_LONG(0x000000002)
4262 #define SECURITY_BUILTIN_APP_PACKAGE_RID_COUNT __MSABI_LONG(0x000000002)
4263 #define SECURITY_APP_PACKAGE_RID_COUNT __MSABI_LONG(0x000000008)
4264 #define SECURITY_CAPABILITY_BASE_RID __MSABI_LONG(0x000000003)
4265 #define SECURITY_CAPABILITY_APP_RID __MSABI_LONG(0x000000400)
4266 #define SECURITY_BUILTIN_CAPABILITY_RID_COUNT __MSABI_LONG(0x000000002)
4267 #define SECURITY_CAPABILITY_RID_COUNT __MSABI_LONG(0x000000005)
4268 #define SECURITY_PARENT_PACKAGE_RID_COUNT SECURITY_APP_PACKAGE_RID_COUNT
4269 #define SECURITY_CHILD_PACKAGE_RID_COUNT __MSABI_LONG(0x00000000c)
4270 #define SECURITY_BUILTIN_PACKAGE_ANY_PACKAGE __MSABI_LONG(0x000000001)
4272 #define SECURITY_MANDATORY_LABEL_AUTHORITY {0,0,0,0,0,16}
4273 #define SECURITY_MANDATORY_UNTRUSTED_RID __MSABI_LONG(0x00000000)
4274 #define SECURITY_MANDATORY_LOW_RID __MSABI_LONG(0x00001000)
4275 #define SECURITY_MANDATORY_MEDIUM_RID __MSABI_LONG(0x00002000)
4276 #define SECURITY_MANDATORY_HIGH_RID __MSABI_LONG(0x00003000)
4277 #define SECURITY_MANDATORY_SYSTEM_RID __MSABI_LONG(0x00004000)
4278 #define SECURITY_MANDATORY_PROTECTED_PROCESS_RID __MSABI_LONG(0x00005000)
4280 #define DOMAIN_ALIAS_RID_ADMINS __MSABI_LONG(0x00000220)
4281 #define DOMAIN_ALIAS_RID_USERS __MSABI_LONG(0x00000221)
4282 #define DOMAIN_ALIAS_RID_GUESTS __MSABI_LONG(0x00000222)
4283 #define DOMAIN_ALIAS_RID_POWER_USERS __MSABI_LONG(0x00000223)
4285 #define DOMAIN_ALIAS_RID_ACCOUNT_OPS __MSABI_LONG(0x00000224)
4286 #define DOMAIN_ALIAS_RID_SYSTEM_OPS __MSABI_LONG(0x00000225)
4287 #define DOMAIN_ALIAS_RID_PRINT_OPS __MSABI_LONG(0x00000226)
4288 #define DOMAIN_ALIAS_RID_BACKUP_OPS __MSABI_LONG(0x00000227)
4290 #define DOMAIN_ALIAS_RID_REPLICATOR __MSABI_LONG(0x00000228)
4291 #define DOMAIN_ALIAS_RID_RAS_SERVERS __MSABI_LONG(0x00000229)
4292 #define DOMAIN_ALIAS_RID_PREW2KCOMPACCESS __MSABI_LONG(0x0000022A)
4293 #define DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS __MSABI_LONG(0x0000022B)
4294 #define DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS __MSABI_LONG(0x0000022C)
4295 #define DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS __MSABI_LONG(0x0000022D)
4297 #define DOMAIN_ALIAS_RID_MONITORING_USERS __MSABI_LONG(0x0000022E)
4298 #define DOMAIN_ALIAS_RID_LOGGING_USERS __MSABI_LONG(0x0000022F)
4299 #define DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS __MSABI_LONG(0x00000230)
4300 #define DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS __MSABI_LONG(0x00000231)
4301 #define DOMAIN_ALIAS_RID_DCOM_USERS __MSABI_LONG(0x00000232)
4303 #define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID
4305 #define SECURITY_PACKAGE_RID_COUNT __MSABI_LONG(2)
4306 #define SECURITY_LOGON_IDS_RID_COUNT __MSABI_LONG(3)
4312 WinCreatorOwnerSid
= 3,
4313 WinCreatorGroupSid
= 4,
4314 WinCreatorOwnerServerSid
= 5,
4315 WinCreatorGroupServerSid
= 6,
4316 WinNtAuthoritySid
= 7,
4320 WinInteractiveSid
= 11,
4322 WinAnonymousSid
= 13,
4324 WinEnterpriseControllersSid
= 15,
4326 WinAuthenticatedUserSid
= 17,
4327 WinRestrictedCodeSid
= 18,
4328 WinTerminalServerSid
= 19,
4329 WinRemoteLogonIdSid
= 20,
4330 WinLogonIdsSid
= 21,
4331 WinLocalSystemSid
= 22,
4332 WinLocalServiceSid
= 23,
4333 WinNetworkServiceSid
= 24,
4334 WinBuiltinDomainSid
= 25,
4335 WinBuiltinAdministratorsSid
= 26,
4336 WinBuiltinUsersSid
= 27,
4337 WinBuiltinGuestsSid
= 28,
4338 WinBuiltinPowerUsersSid
= 29,
4339 WinBuiltinAccountOperatorsSid
= 30,
4340 WinBuiltinSystemOperatorsSid
= 31,
4341 WinBuiltinPrintOperatorsSid
= 32,
4342 WinBuiltinBackupOperatorsSid
= 33,
4343 WinBuiltinReplicatorSid
= 34,
4344 WinBuiltinPreWindows2000CompatibleAccessSid
= 35,
4345 WinBuiltinRemoteDesktopUsersSid
= 36,
4346 WinBuiltinNetworkConfigurationOperatorsSid
= 37,
4347 WinAccountAdministratorSid
= 38,
4348 WinAccountGuestSid
= 39,
4349 WinAccountKrbtgtSid
= 40,
4350 WinAccountDomainAdminsSid
= 41,
4351 WinAccountDomainUsersSid
= 42,
4352 WinAccountDomainGuestsSid
= 43,
4353 WinAccountComputersSid
= 44,
4354 WinAccountControllersSid
= 45,
4355 WinAccountCertAdminsSid
= 46,
4356 WinAccountSchemaAdminsSid
= 47,
4357 WinAccountEnterpriseAdminsSid
= 48,
4358 WinAccountPolicyAdminsSid
= 49,
4359 WinAccountRasAndIasServersSid
= 50,
4360 WinNTLMAuthenticationSid
= 51,
4361 WinDigestAuthenticationSid
= 52,
4362 WinSChannelAuthenticationSid
= 53,
4363 WinThisOrganizationSid
= 54,
4364 WinOtherOrganizationSid
= 55,
4365 WinBuiltinIncomingForestTrustBuildersSid
= 56,
4366 WinBuiltinPerfMonitoringUsersSid
= 57,
4367 WinBuiltinPerfLoggingUsersSid
= 58,
4368 WinBuiltinAuthorizationAccessSid
= 59,
4369 WinBuiltinTerminalServerLicenseServersSid
= 60,
4370 WinBuiltinDCOMUsersSid
= 61,
4371 WinBuiltinIUsersSid
= 62,
4373 WinBuiltinCryptoOperatorsSid
= 64,
4374 WinUntrustedLabelSid
= 65,
4375 WinLowLabelSid
= 66,
4376 WinMediumLabelSid
= 67,
4377 WinHighLabelSid
= 68,
4378 WinSystemLabelSid
= 69,
4379 WinWriteRestrictedCodeSid
= 70,
4380 WinCreatorOwnerRightsSid
= 71,
4381 WinCacheablePrincipalsGroupSid
= 72,
4382 WinNonCacheablePrincipalsGroupSid
= 73,
4383 WinEnterpriseReadonlyControllersSid
= 74,
4384 WinAccountReadonlyControllersSid
= 75,
4385 WinBuiltinEventLogReadersGroup
= 76,
4386 WinNewEnterpriseReadonlyControllersSid
= 77,
4387 WinBuiltinCertSvcDComAccessGroup
= 78,
4388 WinMediumPlusLabelSid
= 79,
4389 WinLocalLogonSid
= 80,
4390 WinConsoleLogonSid
= 81,
4391 WinThisOrganizationCertificateSid
= 82,
4392 WinApplicationPackageAuthoritySid
= 83,
4393 WinBuiltinAnyPackageSid
= 84,
4394 WinCapabilityInternetClientSid
= 85,
4395 WinCapabilityInternetClientServerSid
= 86,
4396 WinCapabilityPrivateNetworkClientServerSid
= 87,
4397 WinCapabilityPicturesLibrarySid
= 88,
4398 WinCapabilityVideosLibrarySid
= 89,
4399 WinCapabilityMusicLibrarySid
= 90,
4400 WinCapabilityDocumentsLibrarySid
= 91,
4401 WinCapabilitySharedUserCertificatesSid
= 92,
4402 WinCapabilityEnterpriseAuthenticationSid
= 93,
4403 WinCapabilityRemovableStorageSid
= 94,
4404 WinBuiltinRDSRemoteAccessServersSid
= 95,
4405 WinBuiltinRDSEndpointServersSid
= 96,
4406 WinBuiltinRDSManagementServersSid
= 97,
4407 WinUserModeDriversSid
= 98,
4408 WinBuiltinHyperVAdminsSid
= 99,
4409 WinAccountCloneableControllersSid
= 100,
4410 WinBuiltinAccessControlAssistanceOperatorsSid
= 101,
4411 WinBuiltinRemoteManagementUsersSid
= 102,
4412 WinAuthenticationAuthorityAssertedSid
= 103,
4413 WinAuthenticationServiceAssertedSid
= 104,
4414 WinLocalAccountSid
= 105,
4415 WinLocalAccountAndAdministratorSid
= 106,
4416 WinAccountProtectedUsersSid
= 107,
4417 } WELL_KNOWN_SID_TYPE
;
4423 typedef struct _TOKEN_USER
{
4424 SID_AND_ATTRIBUTES User
;
4425 } TOKEN_USER
, *PTOKEN_USER
;
4431 typedef struct _TOKEN_GROUPS
{
4433 SID_AND_ATTRIBUTES Groups
[ANYSIZE_ARRAY
];
4434 } TOKEN_GROUPS
, *PTOKEN_GROUPS
;
4437 * LUID_AND_ATTRIBUTES
4440 typedef union _LARGE_INTEGER
{
4442 #ifdef WORDS_BIGENDIAN
4450 #ifndef NONAMELESSSTRUCT
4452 #ifdef WORDS_BIGENDIAN
4462 } LARGE_INTEGER
, *PLARGE_INTEGER
;
4464 typedef union _ULARGE_INTEGER
{
4466 #ifdef WORDS_BIGENDIAN
4474 #ifndef NONAMELESSSTRUCT
4476 #ifdef WORDS_BIGENDIAN
4486 } ULARGE_INTEGER
, *PULARGE_INTEGER
;
4489 * Locally Unique Identifier
4492 typedef struct _LUID
{
4497 #include <pshpack4.h>
4498 typedef struct _LUID_AND_ATTRIBUTES
{
4501 } LUID_AND_ATTRIBUTES
, *PLUID_AND_ATTRIBUTES
;
4502 #include <poppack.h>
4508 typedef struct _PRIVILEGE_SET
{
4509 DWORD PrivilegeCount
;
4511 LUID_AND_ATTRIBUTES Privilege
[ANYSIZE_ARRAY
];
4512 } PRIVILEGE_SET
, *PPRIVILEGE_SET
;
4518 typedef struct _TOKEN_PRIVILEGES
{
4519 DWORD PrivilegeCount
;
4520 LUID_AND_ATTRIBUTES Privileges
[ANYSIZE_ARRAY
];
4521 } TOKEN_PRIVILEGES
, *PTOKEN_PRIVILEGES
;
4527 typedef struct _TOKEN_OWNER
{
4529 } TOKEN_OWNER
, *PTOKEN_OWNER
;
4532 * TOKEN_PRIMARY_GROUP
4535 typedef struct _TOKEN_PRIMARY_GROUP
{
4537 } TOKEN_PRIMARY_GROUP
, *PTOKEN_PRIMARY_GROUP
;
4541 * TOKEN_DEFAULT_DACL
4544 typedef struct _TOKEN_DEFAULT_DACL
{
4546 } TOKEN_DEFAULT_DACL
, *PTOKEN_DEFAULT_DACL
;
4552 #define TOKEN_SOURCE_LENGTH 8
4554 typedef struct _TOKEN_SOURCE
{
4555 char SourceName
[TOKEN_SOURCE_LENGTH
];
4556 LUID SourceIdentifier
;
4557 } TOKEN_SOURCE
, *PTOKEN_SOURCE
;
4563 typedef enum tagTOKEN_TYPE
{
4569 * SECURITY_IMPERSONATION_LEVEL
4572 typedef enum _SECURITY_IMPERSONATION_LEVEL
{
4574 SecurityIdentification
,
4575 SecurityImpersonation
,
4577 } SECURITY_IMPERSONATION_LEVEL
, *PSECURITY_IMPERSONATION_LEVEL
;
4579 #define SECURITY_DYNAMIC_TRACKING (TRUE)
4580 #define SECURITY_STATIC_TRACKING (FALSE)
4582 typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE
,
4583 * PSECURITY_CONTEXT_TRACKING_MODE
;
4585 * Quality of Service
4588 typedef struct _SECURITY_QUALITY_OF_SERVICE
{
4590 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
;
4591 SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode
;
4592 BOOLEAN EffectiveOnly
;
4593 } SECURITY_QUALITY_OF_SERVICE
, *PSECURITY_QUALITY_OF_SERVICE
;
4599 #include <pshpack4.h>
4600 typedef struct _TOKEN_STATISTICS
{
4602 LUID AuthenticationId
;
4603 LARGE_INTEGER ExpirationTime
;
4604 TOKEN_TYPE TokenType
;
4605 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
;
4606 DWORD DynamicCharged
;
4607 DWORD DynamicAvailable
;
4609 DWORD PrivilegeCount
;
4612 #include <poppack.h>
4614 typedef struct _TOKEN_GROUPS_AND_PRIVILEGES
{
4617 PSID_AND_ATTRIBUTES Sids
;
4618 DWORD RestrictedSidCount
;
4619 DWORD RestrictedSidLength
;
4620 PSID_AND_ATTRIBUTES RestrictedSids
;
4621 DWORD PrivilegeCount
;
4622 DWORD PrivilegeLength
;
4623 PLUID_AND_ATTRIBUTES Privileges
;
4624 LUID AuthenticationId
;
4625 } TOKEN_GROUPS_AND_PRIVILEGES
, * PTOKEN_GROUPS_AND_PRIVILEGES
;
4627 typedef struct _TOKEN_ORIGIN
{
4628 LUID OriginatingLogonSession
;
4629 } TOKEN_ORIGIN
, * PTOKEN_ORIGIN
;
4631 typedef struct _TOKEN_LINKED_TOKEN
{
4633 } TOKEN_LINKED_TOKEN
, * PTOKEN_LINKED_TOKEN
;
4635 typedef struct _TOKEN_ELEVATION
{
4636 DWORD TokenIsElevated
;
4637 } TOKEN_ELEVATION
, * PTOKEN_ELEVATION
;
4639 typedef struct _TOKEN_MANDATORY_LABEL
{
4640 SID_AND_ATTRIBUTES Label
;
4641 } TOKEN_MANDATORY_LABEL
, * PTOKEN_MANDATORY_LABEL
;
4643 typedef struct _TOKEN_APPCONTAINER_INFORMATION
{
4644 PSID TokenAppContainer
;
4645 } TOKEN_APPCONTAINER_INFORMATION
, * PTOKEN_APPCONTAINER_INFORMATION
;
4651 /* ACEs, directly starting after an ACL */
4652 typedef struct _ACE_HEADER
{
4656 } ACE_HEADER
,*PACE_HEADER
;
4659 #define ACCESS_ALLOWED_ACE_TYPE 0
4660 #define ACCESS_DENIED_ACE_TYPE 1
4661 #define SYSTEM_AUDIT_ACE_TYPE 2
4662 #define SYSTEM_ALARM_ACE_TYPE 3
4663 #define SYSTEM_MANDATORY_LABEL_ACE_TYPE 0x11
4665 /* inherit AceFlags */
4666 #define OBJECT_INHERIT_ACE 0x01
4667 #define CONTAINER_INHERIT_ACE 0x02
4668 #define NO_PROPAGATE_INHERIT_ACE 0x04
4669 #define INHERIT_ONLY_ACE 0x08
4670 #define INHERITED_ACE 0x10
4671 #define VALID_INHERIT_FLAGS 0x1F
4673 /* AceFlags mask for what events we (should) audit */
4674 #define SUCCESSFUL_ACCESS_ACE_FLAG 0x40
4675 #define FAILED_ACCESS_ACE_FLAG 0x80
4677 /* different ACEs depending on AceType
4678 * SidStart marks the begin of a SID
4679 * so the thing finally looks like this:
4684 typedef struct _ACCESS_ALLOWED_ACE
{
4688 } ACCESS_ALLOWED_ACE
,*PACCESS_ALLOWED_ACE
;
4690 typedef struct _ACCESS_DENIED_ACE
{
4694 } ACCESS_DENIED_ACE
,*PACCESS_DENIED_ACE
;
4696 typedef struct _SYSTEM_AUDIT_ACE
{
4700 } SYSTEM_AUDIT_ACE
,*PSYSTEM_AUDIT_ACE
;
4702 typedef struct _SYSTEM_ALARM_ACE
{
4706 } SYSTEM_ALARM_ACE
,*PSYSTEM_ALARM_ACE
;
4708 typedef struct _SYSTEM_MANDATORY_LABEL_ACE
{
4712 } SYSTEM_MANDATORY_LABEL_ACE
,*PSYSTEM_MANDATORY_LABEL_ACE
;
4714 #define SYSTEM_MANDATORY_LABEL_NO_WRITE_UP 0x1
4715 #define SYSTEM_MANDATORY_LABEL_NO_READ_UP 0x2
4716 #define SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP 0x4
4718 typedef enum tagSID_NAME_USE
{
4723 SidTypeWellKnownGroup
,
4724 SidTypeDeletedAccount
,
4727 } SID_NAME_USE
,*PSID_NAME_USE
;
4729 #define ACE_OBJECT_TYPE_PRESENT 0x1
4730 #define ACE_INHERITED_OBJECT_TYPE_PRESENT 0x2
4734 /* DELETE may be already defined via /usr/include/arpa/nameser_compat.h */
4736 #define DELETE 0x00010000
4737 #define READ_CONTROL 0x00020000
4738 #define WRITE_DAC 0x00040000
4739 #define WRITE_OWNER 0x00080000
4740 #define SYNCHRONIZE 0x00100000
4741 #define STANDARD_RIGHTS_REQUIRED 0x000f0000
4743 #define STANDARD_RIGHTS_READ READ_CONTROL
4744 #define STANDARD_RIGHTS_WRITE READ_CONTROL
4745 #define STANDARD_RIGHTS_EXECUTE READ_CONTROL
4747 #define STANDARD_RIGHTS_ALL 0x001f0000
4749 #define SPECIFIC_RIGHTS_ALL 0x0000ffff
4751 #define GENERIC_READ 0x80000000
4752 #define GENERIC_WRITE 0x40000000
4753 #define GENERIC_EXECUTE 0x20000000
4754 #define GENERIC_ALL 0x10000000
4756 #define MAXIMUM_ALLOWED 0x02000000
4757 #define ACCESS_SYSTEM_SECURITY 0x01000000
4759 #define EVENT_QUERY_STATE 0x0001
4760 #define EVENT_MODIFY_STATE 0x0002
4761 #define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
4763 #define SEMAPHORE_QUERY_STATE 0x0001
4764 #define SEMAPHORE_MODIFY_STATE 0x0002
4765 #define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
4767 #define MUTANT_QUERY_STATE 0x0001
4768 #define MUTANT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|MUTANT_QUERY_STATE)
4770 #define JOB_OBJECT_ASSIGN_PROCESS 0x0001
4771 #define JOB_OBJECT_SET_ATTRIBUTES 0x0002
4772 #define JOB_OBJECT_QUERY 0x0004
4773 #define JOB_OBJECT_TERMINATE 0x0008
4774 #define JOB_OBJECT_SET_SECURITY_ATTRIBUTES 0x0010
4775 #define JOB_OBJECT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1f)
4777 #define TIMER_QUERY_STATE 0x0001
4778 #define TIMER_MODIFY_STATE 0x0002
4779 #define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
4781 #define PROCESS_TERMINATE 0x0001
4782 #define PROCESS_CREATE_THREAD 0x0002
4783 #define PROCESS_VM_OPERATION 0x0008
4784 #define PROCESS_VM_READ 0x0010
4785 #define PROCESS_VM_WRITE 0x0020
4786 #define PROCESS_DUP_HANDLE 0x0040
4787 #define PROCESS_CREATE_PROCESS 0x0080
4788 #define PROCESS_SET_QUOTA 0x0100
4789 #define PROCESS_SET_INFORMATION 0x0200
4790 #define PROCESS_QUERY_INFORMATION 0x0400
4791 #define PROCESS_SUSPEND_RESUME 0x0800
4792 #define PROCESS_QUERY_LIMITED_INFORMATION 0x1000
4793 #define PROCESS_SET_LIMITED_INFORMATION 0x2000
4794 #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xffff)
4796 #define THREAD_TERMINATE 0x0001
4797 #define THREAD_SUSPEND_RESUME 0x0002
4798 #define THREAD_GET_CONTEXT 0x0008
4799 #define THREAD_SET_CONTEXT 0x0010
4800 #define THREAD_SET_INFORMATION 0x0020
4801 #define THREAD_QUERY_INFORMATION 0x0040
4802 #define THREAD_SET_THREAD_TOKEN 0x0080
4803 #define THREAD_IMPERSONATE 0x0100
4804 #define THREAD_DIRECT_IMPERSONATION 0x0200
4805 #define THREAD_SET_LIMITED_INFORMATION 0x0400
4806 #define THREAD_QUERY_LIMITED_INFORMATION 0x0800
4807 #define THREAD_RESUME 0x1000
4808 #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xffff)
4810 #define THREAD_BASE_PRIORITY_LOWRT 15
4811 #define THREAD_BASE_PRIORITY_MAX 2
4812 #define THREAD_BASE_PRIORITY_MIN -2
4813 #define THREAD_BASE_PRIORITY_IDLE -15
4815 typedef struct _QUOTA_LIMITS
{
4816 SIZE_T PagedPoolLimit
;
4817 SIZE_T NonPagedPoolLimit
;
4818 SIZE_T MinimumWorkingSetSize
;
4819 SIZE_T MaximumWorkingSetSize
;
4820 SIZE_T PagefileLimit
;
4821 LARGE_INTEGER TimeLimit
;
4822 } QUOTA_LIMITS
, *PQUOTA_LIMITS
;
4824 #define QUOTA_LIMITS_HARDWS_MIN_ENABLE 0x00000001
4825 #define QUOTA_LIMITS_HARDWS_MIN_DISABLE 0x00000002
4826 #define QUOTA_LIMITS_HARDWS_MAX_ENABLE 0x00000004
4827 #define QUOTA_LIMITS_HARDWS_MAX_DISABLE 0x00000008
4829 typedef struct _QUOTA_LIMITS_EX
{
4830 SIZE_T PagedPoolLimit
;
4831 SIZE_T NonPagedPoolLimit
;
4832 SIZE_T MinimumWorkingSetSize
;
4833 SIZE_T MaximumWorkingSetSize
;
4834 SIZE_T PagefileLimit
;
4835 LARGE_INTEGER TimeLimit
;
4842 } QUOTA_LIMITS_EX
, *PQUOTA_LIMITS_EX
;
4844 #define SECTION_QUERY 0x0001
4845 #define SECTION_MAP_WRITE 0x0002
4846 #define SECTION_MAP_READ 0x0004
4847 #define SECTION_MAP_EXECUTE 0x0008
4848 #define SECTION_EXTEND_SIZE 0x0010
4849 #define SECTION_MAP_EXECUTE_EXPLICIT 0x0020
4850 #define SECTION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|0x01f)
4852 #define FILE_READ_DATA 0x0001 /* file & pipe */
4853 #define FILE_LIST_DIRECTORY 0x0001 /* directory */
4854 #define FILE_WRITE_DATA 0x0002 /* file & pipe */
4855 #define FILE_ADD_FILE 0x0002 /* directory */
4856 #define FILE_APPEND_DATA 0x0004 /* file */
4857 #define FILE_ADD_SUBDIRECTORY 0x0004 /* directory */
4858 #define FILE_CREATE_PIPE_INSTANCE 0x0004 /* named pipe */
4859 #define FILE_READ_EA 0x0008 /* file & directory */
4860 #define FILE_READ_PROPERTIES FILE_READ_EA
4861 #define FILE_WRITE_EA 0x0010 /* file & directory */
4862 #define FILE_WRITE_PROPERTIES FILE_WRITE_EA
4863 #define FILE_EXECUTE 0x0020 /* file */
4864 #define FILE_TRAVERSE 0x0020 /* directory */
4865 #define FILE_DELETE_CHILD 0x0040 /* directory */
4866 #define FILE_READ_ATTRIBUTES 0x0080 /* all */
4867 #define FILE_WRITE_ATTRIBUTES 0x0100 /* all */
4868 #define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1ff)
4870 #define FILE_GENERIC_READ (STANDARD_RIGHTS_READ | FILE_READ_DATA | \
4871 FILE_READ_ATTRIBUTES | FILE_READ_EA | \
4873 #define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | \
4874 FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | \
4875 FILE_APPEND_DATA | SYNCHRONIZE)
4876 #define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE | FILE_EXECUTE | \
4877 FILE_READ_ATTRIBUTES | SYNCHRONIZE)
4879 #define DUPLICATE_CLOSE_SOURCE 0x00000001
4880 #define DUPLICATE_SAME_ACCESS 0x00000002
4882 /* File attribute flags */
4883 #define FILE_SHARE_READ 0x00000001
4884 #define FILE_SHARE_WRITE 0x00000002
4885 #define FILE_SHARE_DELETE 0x00000004
4887 #define FILE_ATTRIBUTE_READONLY 0x00000001
4888 #define FILE_ATTRIBUTE_HIDDEN 0x00000002
4889 #define FILE_ATTRIBUTE_SYSTEM 0x00000004
4890 #define FILE_ATTRIBUTE_DIRECTORY 0x00000010
4891 #define FILE_ATTRIBUTE_ARCHIVE 0x00000020
4892 #define FILE_ATTRIBUTE_DEVICE 0x00000040
4893 #define FILE_ATTRIBUTE_NORMAL 0x00000080
4894 #define FILE_ATTRIBUTE_TEMPORARY 0x00000100
4895 #define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
4896 #define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
4897 #define FILE_ATTRIBUTE_COMPRESSED 0x00000800
4898 #define FILE_ATTRIBUTE_OFFLINE 0x00001000
4899 #define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
4900 #define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
4901 #define FILE_ATTRIBUTE_INTEGRITY_STREAM 0x00008000
4902 #define FILE_ATTRIBUTE_VIRTUAL 0x00010000
4903 #define FILE_ATTRIBUTE_NO_SCRUB_DATA 0x00020000
4904 #define FILE_ATTRIBUTE_EA 0x00040000
4906 /* File notification flags */
4907 #define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
4908 #define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
4909 #define FILE_NOTIFY_CHANGE_NAME 0x00000003
4910 #define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
4911 #define FILE_NOTIFY_CHANGE_SIZE 0x00000008
4912 #define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
4913 #define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
4914 #define FILE_NOTIFY_CHANGE_CREATION 0x00000040
4915 #define FILE_NOTIFY_CHANGE_EA 0x00000080
4916 #define FILE_NOTIFY_CHANGE_SECURITY 0x00000100
4917 #define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200
4918 #define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400
4919 #define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800
4921 #define FILE_ACTION_ADDED 0x00000001
4922 #define FILE_ACTION_REMOVED 0x00000002
4923 #define FILE_ACTION_MODIFIED 0x00000003
4924 #define FILE_ACTION_RENAMED_OLD_NAME 0x00000004
4925 #define FILE_ACTION_RENAMED_NEW_NAME 0x00000005
4926 #define FILE_ACTION_ADDED_STREAM 0x00000006
4927 #define FILE_ACTION_REMOVED_STREAM 0x00000007
4928 #define FILE_ACTION_MODIFIED_STREAM 0x00000008
4929 #define FILE_ACTION_REMOVED_BY_DELETE 0x00000009
4930 #define FILE_ACTION_ID_NOT_TUNNELLED 0x0000000a
4931 #define FILE_ACTION_TUNNELLED_ID_COLLISION 0x0000000b
4933 #define FILE_CASE_SENSITIVE_SEARCH 0x00000001
4934 #define FILE_CASE_PRESERVED_NAMES 0x00000002
4935 #define FILE_UNICODE_ON_DISK 0x00000004
4936 #define FILE_PERSISTENT_ACLS 0x00000008
4937 #define FILE_FILE_COMPRESSION 0x00000010
4938 #define FILE_VOLUME_QUOTAS 0x00000020
4939 #define FILE_SUPPORTS_SPARSE_FILES 0x00000040
4940 #define FILE_SUPPORTS_REPARSE_POINTS 0x00000080
4941 #define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100
4942 #define FILE_VOLUME_IS_COMPRESSED 0x00008000
4943 #define FILE_SUPPORTS_OBJECT_IDS 0x00010000
4944 #define FILE_SUPPORTS_ENCRYPTION 0x00020000
4945 #define FILE_NAMED_STREAMS 0x00040000
4946 #define FILE_READ_ONLY_VOLUME 0x00080000
4947 #define FILE_SEQUENTIAL_WRITE_ONCE 0x00100000
4948 #define FILE_SUPPORTS_TRANSACTIONS 0x00200000
4949 #define FILE_SUPPORTS_HARD_LINKS 0x00400000
4950 #define FILE_SUPPORTS_EXTENDED_ATTRIBUTES 0x00800000
4951 #define FILE_SUPPORTS_OPEN_BY_FILE_ID 0x01000000
4952 #define FILE_SUPPORTS_USN_JOURNAL 0x02000000
4953 #define FILE_SUPPORTS_INTEGRITY_STREAMS 0x04000000
4954 #define FILE_SUPPORTS_BLOCK_REFCOUNTING 0x08000000
4955 #define FILE_SUPPORTS_SPARSE_VDL 0x10000000
4957 /* File alignments (NT) */
4958 #define FILE_BYTE_ALIGNMENT 0x00000000
4959 #define FILE_WORD_ALIGNMENT 0x00000001
4960 #define FILE_LONG_ALIGNMENT 0x00000003
4961 #define FILE_QUAD_ALIGNMENT 0x00000007
4962 #define FILE_OCTA_ALIGNMENT 0x0000000f
4963 #define FILE_32_BYTE_ALIGNMENT 0x0000001f
4964 #define FILE_64_BYTE_ALIGNMENT 0x0000003f
4965 #define FILE_128_BYTE_ALIGNMENT 0x0000007f
4966 #define FILE_256_BYTE_ALIGNMENT 0x000000ff
4967 #define FILE_512_BYTE_ALIGNMENT 0x000001ff
4969 #define COMPRESSION_FORMAT_NONE 0
4970 #define COMPRESSION_FORMAT_DEFAULT 1
4971 #define COMPRESSION_FORMAT_LZNT1 2
4972 #define COMPRESSION_ENGINE_STANDARD 0
4973 #define COMPRESSION_ENGINE_MAXIMUM 256
4975 #define MAILSLOT_NO_MESSAGE ((DWORD)-1)
4976 #define MAILSLOT_WAIT_FOREVER ((DWORD)-1)
4978 #define REG_NONE 0 /* no type */
4979 #define REG_SZ 1 /* string type (ASCII) */
4980 #define REG_EXPAND_SZ 2 /* string, includes %ENVVAR% (expanded by caller) (ASCII) */
4981 #define REG_BINARY 3 /* binary format, callerspecific */
4982 /* YES, REG_DWORD == REG_DWORD_LITTLE_ENDIAN */
4983 #define REG_DWORD 4 /* DWORD in little endian format */
4984 #define REG_DWORD_LITTLE_ENDIAN 4 /* DWORD in little endian format */
4985 #define REG_DWORD_BIG_ENDIAN 5 /* DWORD in big endian format */
4986 #define REG_LINK 6 /* symbolic link (UNICODE) */
4987 #define REG_MULTI_SZ 7 /* multiple strings, delimited by \0, terminated by \0\0 (ASCII) */
4988 #define REG_RESOURCE_LIST 8 /* resource list? huh? */
4989 #define REG_FULL_RESOURCE_DESCRIPTOR 9 /* full resource descriptor? huh? */
4990 #define REG_RESOURCE_REQUIREMENTS_LIST 10
4991 #define REG_QWORD 11 /* QWORD in little endian format */
4992 #define REG_QWORD_LITTLE_ENDIAN 11 /* QWORD in little endian format */
4994 /* ----------------------------- begin power management --------------------- */
4996 typedef enum _LATENCY_TIME
{
4999 } LATENCY_TIME
, *PLATENCY_TIME
;
5001 #define DISCHARGE_POLICY_CRITICAL 0
5002 #define DISCHARGE_POLICY_LOW 1
5003 #define NUM_DISCHARGE_POLICIES 4
5005 #define PO_THROTTLE_NONE 0
5006 #define PO_THROTTLE_CONSTANT 1
5007 #define PO_THROTTLE_DEGRADE 2
5008 #define PO_THROTTLE_ADAPTIVE 3
5010 typedef enum _POWER_ACTION
{
5011 PowerActionNone
= 0,
5012 PowerActionReserved
,
5014 PowerActionHibernate
,
5015 PowerActionShutdown
,
5016 PowerActionShutdownReset
,
5017 PowerActionShutdownOff
,
5018 PowerActionWarmEject
5022 typedef enum _POWER_PLATFORM_ROLE
{
5023 PlatformRoleUnspecified
,
5024 PlatformRoleDesktop
,
5026 PlatformRoleWorkstation
,
5027 PlatformRoleEnterpriseServer
,
5028 PlatformRoleSOHOServer
,
5029 PlatformRoleAppliancePC
,
5030 PlatformRolePerformanceServer
,
5033 } POWER_PLATFORM_ROLE
, *PPOWER_PLATFORM_ROLE
;
5035 typedef enum _SYSTEM_POWER_STATE
{
5036 PowerSystemUnspecified
= 0,
5037 PowerSystemWorking
= 1,
5038 PowerSystemSleeping1
= 2,
5039 PowerSystemSleeping2
= 3,
5040 PowerSystemSleeping3
= 4,
5041 PowerSystemHibernate
= 5,
5042 PowerSystemShutdown
= 6,
5043 PowerSystemMaximum
= 7
5044 } SYSTEM_POWER_STATE
,
5045 *PSYSTEM_POWER_STATE
;
5047 typedef enum _DEVICE_POWER_STATE
{
5048 PowerDeviceUnspecified
,
5054 } DEVICE_POWER_STATE
, *PDEVICE_POWER_STATE
;
5056 typedef enum _POWER_INFORMATION_LEVEL
{
5057 SystemPowerPolicyAc
,
5058 SystemPowerPolicyDc
,
5059 VerifySystemPolicyAc
,
5060 VerifySystemPolicyDc
,
5061 SystemPowerCapabilities
,
5063 SystemPowerStateHandler
,
5064 ProcessorStateHandler
,
5065 SystemPowerPolicyCurrent
,
5066 AdministratorPowerPolicy
,
5067 SystemReserveHiberFile
,
5068 ProcessorInformation
,
5069 SystemPowerInformation
,
5070 ProcessorStateHandler2
,
5073 SystemExecutionState
,
5074 SystemPowerStateNotifyHandler
,
5075 ProcessorPowerPolicyAc
,
5076 ProcessorPowerPolicyDc
,
5077 VerifyProcessorPowerPolicyAc
,
5078 VerifyProcessorPowerPolicyDc
,
5079 ProcessorPowerPolicyCurrent
5080 } POWER_INFORMATION_LEVEL
;
5082 typedef struct _ADMINISTRATOR_POWER_POLICY
{
5083 SYSTEM_POWER_STATE MinSleep
;
5084 SYSTEM_POWER_STATE MaxSleep
;
5085 ULONG MinVideoTimeout
;
5086 ULONG MaxVideoTimeout
;
5087 ULONG MinSpindownTimeout
;
5088 ULONG MaxSpindownTimeout
;
5089 } ADMINISTRATOR_POWER_POLICY
, *PADMINISTRATOR_POWER_POLICY
;
5094 } BATTERY_REPORTING_SCALE
,
5095 *PBATTERY_REPORTING_SCALE
;
5098 POWER_ACTION Action
;
5101 } POWER_ACTION_POLICY
,
5102 *PPOWER_ACTION_POLICY
;
5104 typedef struct _PROCESSOR_POWER_INFORMATION
{
5110 ULONG CurrentIdleState
;
5111 } PROCESSOR_POWER_INFORMATION
,
5112 *PPROCESSOR_POWER_INFORMATION
;
5114 typedef struct _PROCESSOR_POWER_POLICY_INFO
{
5118 UCHAR DemotePercent
;
5119 UCHAR PromotePercent
;
5121 ULONG AllowDemotion
:1;
5122 ULONG AllowPromotion
:1;
5124 } PROCESSOR_POWER_POLICY_INFO
,
5125 *PPROCESSOR_POWER_POLICY_INFO
;
5127 typedef struct _PROCESSOR_POWER_POLICY
{
5129 BYTE DynamicThrottle
;
5131 DWORD DisableCStates
:1;
5134 PROCESSOR_POWER_POLICY_INFO Policy
[3];
5135 } PROCESSOR_POWER_POLICY
,
5136 *PPROCESSOR_POWER_POLICY
;
5140 BOOLEAN BatteryPresent
;
5142 BOOLEAN Discharging
;
5145 ULONG RemainingCapacity
;
5147 ULONG EstimatedTime
;
5148 ULONG DefaultAlert1
;
5149 ULONG DefaultAlert2
;
5150 } SYSTEM_BATTERY_STATE
,
5151 *PSYSTEM_BATTERY_STATE
;
5154 BOOLEAN PowerButtonPresent
;
5155 BOOLEAN SleepButtonPresent
;
5162 BOOLEAN HiberFilePresent
;
5164 BOOLEAN VideoDimPresent
;
5167 BOOLEAN ThermalControl
;
5168 BOOLEAN ProcessorThrottle
;
5169 UCHAR ProcessorMinThrottle
;
5170 UCHAR ProcessorMaxThrottle
;
5172 BOOLEAN DiskSpinDown
;
5174 BOOLEAN SystemBatteriesPresent
;
5175 BOOLEAN BatteriesAreShortTerm
;
5176 BATTERY_REPORTING_SCALE BatteryScale
[3];
5177 SYSTEM_POWER_STATE AcOnLineWake
;
5178 SYSTEM_POWER_STATE SoftLidWake
;
5179 SYSTEM_POWER_STATE RtcWake
;
5180 SYSTEM_POWER_STATE MinDeviceWakeState
;
5181 SYSTEM_POWER_STATE DefaultLowLatencyWake
;
5182 } SYSTEM_POWER_CAPABILITIES
,
5183 *PSYSTEM_POWER_CAPABILITIES
;
5185 typedef struct _SYSTEM_POWER_INFORMATION
{
5186 ULONG MaxIdlenessAllowed
;
5188 ULONG TimeRemaining
;
5190 } SYSTEM_POWER_INFORMATION
,
5191 *PSYSTEM_POWER_INFORMATION
;
5193 typedef struct _SYSTEM_POWER_LEVEL
{
5197 POWER_ACTION_POLICY PowerPolicy
;
5198 SYSTEM_POWER_STATE MinSystemState
;
5199 } SYSTEM_POWER_LEVEL
,
5200 *PSYSTEM_POWER_LEVEL
;
5202 typedef struct _SYSTEM_POWER_POLICY
{
5204 POWER_ACTION_POLICY PowerButton
;
5205 POWER_ACTION_POLICY SleepButton
;
5206 POWER_ACTION_POLICY LidClose
;
5207 SYSTEM_POWER_STATE LidOpenWake
;
5209 POWER_ACTION_POLICY Idle
;
5211 UCHAR IdleSensitivity
;
5212 UCHAR DynamicThrottle
;
5214 SYSTEM_POWER_STATE MinSleep
;
5215 SYSTEM_POWER_STATE MaxSleep
;
5216 SYSTEM_POWER_STATE ReducedLatencySleep
;
5217 ULONG WinLogonFlags
;
5219 ULONG DozeS4Timeout
;
5220 ULONG BroadcastCapacityResolution
;
5221 SYSTEM_POWER_LEVEL DischargePolicy
[NUM_DISCHARGE_POLICIES
];
5223 BOOLEAN VideoDimDisplay
;
5224 ULONG VideoReserved
[3];
5225 ULONG SpindownTimeout
;
5226 BOOLEAN OptimizeForPower
;
5227 UCHAR FanThrottleTolerance
;
5228 UCHAR ForcedThrottle
;
5230 POWER_ACTION_POLICY OverThrottled
;
5231 } SYSTEM_POWER_POLICY
,
5232 *PSYSTEM_POWER_POLICY
;
5234 typedef union _FILE_SEGMENT_ELEMENT
{
5236 ULONGLONG Alignment
;
5237 } FILE_SEGMENT_ELEMENT
, *PFILE_SEGMENT_ELEMENT
;
5239 typedef struct _FILE_NOTIFY_INFORMATION
{
5240 DWORD NextEntryOffset
;
5242 DWORD FileNameLength
;
5244 } FILE_NOTIFY_INFORMATION
, *PFILE_NOTIFY_INFORMATION
;
5246 /* ----------------------------- begin tape storage --------------------- */
5248 #define TAPE_FIXED_PARTITIONS 0
5249 #define TAPE_SELECT_PARTITIONS 1
5250 #define TAPE_INITIATOR_PARTITIONS 2
5251 #define TAPE_ERASE_SHORT 0
5252 #define TAPE_ERASE_LONG 1
5254 #define TAPE_UNLOAD 1
5255 #define TAPE_TENSION 2
5257 #define TAPE_UNLOCK 4
5258 #define TAPE_FORMAT 5
5259 #define TAPE_SETMARKS 0
5260 #define TAPE_FILEMARKS 1
5261 #define TAPE_SHORT_FILEMARKS 2
5262 #define TAPE_LONG_FILEMARKS 3
5263 #define TAPE_REWIND 0
5264 #define TAPE_ABSOLUTE_BLOCK 1
5265 #define TAPE_LOGICAL_BLOCK 2
5266 #define TAPE_PSEUDO_LOGICAL_BLOCK 3
5267 #define TAPE_SPACE_END_OF_DATA 4
5268 #define TAPE_SPACE_RELATIVE_BLOCKS 5
5269 #define TAPE_SPACE_FILEMARKS 6
5270 #define TAPE_SPACE_SEQUENTIAL_FMKS 7
5271 #define TAPE_SPACE_SETMARKS 8
5272 #define TAPE_SPACE_SEQUENTIAL_SMKS 9
5274 typedef struct _TAPE_CREATE_PARTITION
{
5278 } TAPE_CREATE_PARTITION
, *PTAPE_CREATE_PARTITION
;
5280 typedef struct _TAPE_ERASE
{
5283 } TAPE_ERASE
, *PTAPE_ERASE
;
5285 typedef struct _TAPE_PREPARE
{
5288 } TAPE_PREPARE
, *PTAPE_PREPARE
;
5290 typedef struct _TAPE_SET_DRIVE_PARAMETERS
{
5292 BOOLEAN Compression
;
5293 BOOLEAN DataPadding
;
5294 BOOLEAN ReportSetmarks
;
5295 ULONG EOTWarningZoneSize
;
5296 } TAPE_SET_DRIVE_PARAMETERS
, *PTAPE_SET_DRIVE_PARAMETERS
;
5298 typedef struct _TAPE_SET_MEDIA_PARAMETERS
{
5300 } TAPE_SET_MEDIA_PARAMETERS
, *PTAPE_SET_MEDIA_PARAMETERS
;
5302 typedef struct _TAPE_WRITE_MARKS
{
5306 } TAPE_WRITE_MARKS
, *PTAPE_WRITE_MARKS
;
5308 typedef struct _TAPE_GET_POSITION
{
5313 } TAPE_GET_POSITION
, *PTAPE_GET_POSITION
;
5315 typedef struct _TAPE_SET_POSITION
{
5318 LARGE_INTEGER Offset
;
5320 } TAPE_SET_POSITION
, *PTAPE_SET_POSITION
;
5322 typedef struct _TAPE_GET_DRIVE_PARAMETERS
{
5324 BOOLEAN Compression
;
5325 BOOLEAN DataPadding
;
5326 BOOLEAN ReportSetmarks
;
5327 DWORD DefaultBlockSize
;
5328 DWORD MaximumBlockSize
;
5329 DWORD MinimumBlockSize
;
5330 DWORD MaximumPartitionCount
;
5333 DWORD EOTWarningZoneSize
;
5334 } TAPE_GET_DRIVE_PARAMETERS
, *PTAPE_GET_DRIVE_PARAMETERS
;
5336 typedef struct _TAPE_GET_MEDIA_PARAMETERS
{
5337 LARGE_INTEGER Capacity
;
5338 LARGE_INTEGER Remaining
;
5340 DWORD PartitionCount
;
5341 BOOLEAN WriteProtected
;
5342 } TAPE_GET_MEDIA_PARAMETERS
, *PTAPE_GET_MEDIA_PARAMETERS
;
5344 /* ----------------------------- begin registry ----------------------------- */
5346 /* Registry security values */
5347 #define OWNER_SECURITY_INFORMATION 0x00000001
5348 #define GROUP_SECURITY_INFORMATION 0x00000002
5349 #define DACL_SECURITY_INFORMATION 0x00000004
5350 #define SACL_SECURITY_INFORMATION 0x00000008
5351 #define LABEL_SECURITY_INFORMATION 0x00000010
5353 #define REG_OPTION_RESERVED 0x00000000
5354 #define REG_OPTION_NON_VOLATILE 0x00000000
5355 #define REG_OPTION_VOLATILE 0x00000001
5356 #define REG_OPTION_CREATE_LINK 0x00000002
5357 #define REG_OPTION_BACKUP_RESTORE 0x00000004 /* FIXME */
5358 #define REG_OPTION_OPEN_LINK 0x00000008
5359 #define REG_LEGAL_OPTION (REG_OPTION_RESERVED | \
5360 REG_OPTION_NON_VOLATILE | \
5361 REG_OPTION_VOLATILE | \
5362 REG_OPTION_CREATE_LINK | \
5363 REG_OPTION_BACKUP_RESTORE | \
5364 REG_OPTION_OPEN_LINK)
5367 #define REG_CREATED_NEW_KEY 0x00000001
5368 #define REG_OPENED_EXISTING_KEY 0x00000002
5370 /* For RegNotifyChangeKeyValue */
5371 #define REG_NOTIFY_CHANGE_NAME 0x01
5372 #define REG_NOTIFY_CHANGE_ATTRIBUTES 0x02
5373 #define REG_NOTIFY_CHANGE_LAST_SET 0x04
5374 #define REG_NOTIFY_CHANGE_SECURITY 0x08
5376 #define KEY_QUERY_VALUE 0x00000001
5377 #define KEY_SET_VALUE 0x00000002
5378 #define KEY_CREATE_SUB_KEY 0x00000004
5379 #define KEY_ENUMERATE_SUB_KEYS 0x00000008
5380 #define KEY_NOTIFY 0x00000010
5381 #define KEY_CREATE_LINK 0x00000020
5382 #define KEY_WOW64_64KEY 0x00000100
5383 #define KEY_WOW64_32KEY 0x00000200
5384 #define KEY_WOW64_RES 0x00000300
5386 /* for RegKeyRestore flags */
5387 #define REG_WHOLE_HIVE_VOLATILE 0x00000001
5388 #define REG_REFRESH_HIVE 0x00000002
5389 #define REG_NO_LAZY_FLUSH 0x00000004
5390 #define REG_FORCE_RESTORE 0x00000008
5392 #define KEY_READ ((STANDARD_RIGHTS_READ| \
5394 KEY_ENUMERATE_SUB_KEYS| \
5398 #define KEY_WRITE ((STANDARD_RIGHTS_WRITE| \
5400 KEY_CREATE_SUB_KEY) \
5403 #define KEY_EXECUTE ((KEY_READ) & (~SYNCHRONIZE))
5404 #define KEY_ALL_ACCESS ((STANDARD_RIGHTS_ALL| \
5407 KEY_CREATE_SUB_KEY| \
5408 KEY_ENUMERATE_SUB_KEYS| \
5413 /* ------------------------------ end registry ------------------------------ */
5416 #define EVENTLOG_SUCCESS 0x0000
5417 #define EVENTLOG_ERROR_TYPE 0x0001
5418 #define EVENTLOG_WARNING_TYPE 0x0002
5419 #define EVENTLOG_INFORMATION_TYPE 0x0004
5420 #define EVENTLOG_AUDIT_SUCCESS 0x0008
5421 #define EVENTLOG_AUDIT_FAILURE 0x0010
5423 #define EVENTLOG_SEQUENTIAL_READ 0x0001
5424 #define EVENTLOG_SEEK_READ 0x0002
5425 #define EVENTLOG_FORWARDS_READ 0x0004
5426 #define EVENTLOG_BACKWARDS_READ 0x0008
5428 typedef struct _EVENTLOGRECORD
{
5432 DWORD TimeGenerated
;
5439 DWORD ClosingRecordNumber
;
5441 DWORD UserSidLength
;
5442 DWORD UserSidOffset
;
5445 } EVENTLOGRECORD
, *PEVENTLOGRECORD
;
5447 #define SERVICE_BOOT_START 0x00000000
5448 #define SERVICE_SYSTEM_START 0x00000001
5449 #define SERVICE_AUTO_START 0x00000002
5450 #define SERVICE_DEMAND_START 0x00000003
5451 #define SERVICE_DISABLED 0x00000004
5453 #define SERVICE_ERROR_IGNORE 0x00000000
5454 #define SERVICE_ERROR_NORMAL 0x00000001
5455 #define SERVICE_ERROR_SEVERE 0x00000002
5456 #define SERVICE_ERROR_CRITICAL 0x00000003
5459 #define SERVICE_KERNEL_DRIVER 0x00000001
5460 #define SERVICE_FILE_SYSTEM_DRIVER 0x00000002
5461 #define SERVICE_ADAPTER 0x00000004
5462 #define SERVICE_RECOGNIZER_DRIVER 0x00000008
5464 #define SERVICE_DRIVER ( SERVICE_KERNEL_DRIVER | SERVICE_FILE_SYSTEM_DRIVER | \
5465 SERVICE_RECOGNIZER_DRIVER )
5467 #define SERVICE_WIN32_OWN_PROCESS 0x00000010
5468 #define SERVICE_WIN32_SHARE_PROCESS 0x00000020
5469 #define SERVICE_WIN32 (SERVICE_WIN32_OWN_PROCESS | SERVICE_WIN32_SHARE_PROCESS)
5471 #define SERVICE_INTERACTIVE_PROCESS 0x00000100
5473 #define SERVICE_TYPE_ALL ( SERVICE_WIN32 | SERVICE_ADAPTER | \
5474 SERVICE_DRIVER | SERVICE_INTERACTIVE_PROCESS )
5477 typedef enum _CM_SERVICE_NODE_TYPE
5479 DriverType
= SERVICE_KERNEL_DRIVER
,
5480 FileSystemType
= SERVICE_FILE_SYSTEM_DRIVER
,
5481 Win32ServiceOwnProcess
= SERVICE_WIN32_OWN_PROCESS
,
5482 Win32ServiceShareProcess
= SERVICE_WIN32_SHARE_PROCESS
,
5483 AdapterType
= SERVICE_ADAPTER
,
5484 RecognizerType
= SERVICE_RECOGNIZER_DRIVER
5485 } SERVICE_NODE_TYPE
;
5487 typedef enum _CM_SERVICE_LOAD_TYPE
5489 BootLoad
= SERVICE_BOOT_START
,
5490 SystemLoad
= SERVICE_SYSTEM_START
,
5491 AutoLoad
= SERVICE_AUTO_START
,
5492 DemandLoad
= SERVICE_DEMAND_START
,
5493 DisableLoad
= SERVICE_DISABLED
5494 } SERVICE_LOAD_TYPE
;
5496 typedef enum _CM_ERROR_CONTROL_TYPE
5498 IgnoreError
= SERVICE_ERROR_IGNORE
,
5499 NormalError
= SERVICE_ERROR_NORMAL
,
5500 SevereError
= SERVICE_ERROR_SEVERE
,
5501 CriticalError
= SERVICE_ERROR_CRITICAL
5502 } SERVICE_ERROR_TYPE
;
5504 NTSYSAPI SIZE_T WINAPI
RtlCompareMemory(const VOID
*, const VOID
*, SIZE_T
);
5506 #define RtlEqualMemory(Destination, Source, Length) (!memcmp((Destination),(Source),(Length)))
5507 #define RtlMoveMemory(Destination, Source, Length) memmove((Destination),(Source),(Length))
5508 #define RtlCopyMemory(Destination, Source, Length) memcpy((Destination),(Source),(Length))
5509 #define RtlFillMemory(Destination, Length, Fill) memset((Destination),(Fill),(Length))
5510 #define RtlZeroMemory(Destination, Length) memset((Destination),0,(Length))
5512 static FORCEINLINE
void *RtlSecureZeroMemory(void *buffer
, SIZE_T length
)
5514 volatile char *ptr
= (volatile char *)buffer
;
5516 while (length
--) *ptr
++ = 0;
5520 #include <guiddef.h>
5522 typedef struct _OBJECT_TYPE_LIST
{
5526 } OBJECT_TYPE_LIST
, *POBJECT_TYPE_LIST
;
5528 typedef struct _RTL_CRITICAL_SECTION_DEBUG
5531 WORD CreatorBackTraceIndex
;
5532 struct _RTL_CRITICAL_SECTION
*CriticalSection
;
5533 LIST_ENTRY ProcessLocksList
;
5535 DWORD ContentionCount
;
5536 #ifdef __WINESRC__ /* in Wine we store the name here */
5537 DWORD_PTR Spare
[8/sizeof(DWORD_PTR
)];
5541 } RTL_CRITICAL_SECTION_DEBUG
, *PRTL_CRITICAL_SECTION_DEBUG
, RTL_RESOURCE_DEBUG
, *PRTL_RESOURCE_DEBUG
;
5543 typedef struct _RTL_CRITICAL_SECTION
{
5544 PRTL_CRITICAL_SECTION_DEBUG DebugInfo
;
5546 LONG RecursionCount
;
5547 HANDLE OwningThread
;
5548 HANDLE LockSemaphore
;
5549 ULONG_PTR SpinCount
;
5550 } RTL_CRITICAL_SECTION
, *PRTL_CRITICAL_SECTION
;
5552 #define RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO 0x1000000
5553 #define RTL_CRITICAL_SECTION_FLAG_DYNAMIC_SPIN 0x2000000
5554 #define RTL_CRITICAL_SECTION_FLAG_STATIC_INIT 0x4000000
5555 #define RTL_CRITICAL_SECTION_ALL_FLAG_BITS 0xFF000000
5556 #define RTL_CRITICAL_SECTION_FLAG_RESERVED (RTL_CRITICAL_SECTION_ALL_FLAG_BITS & ~0x7000000)
5558 typedef struct _RTL_SRWLOCK
{
5560 } RTL_SRWLOCK
, *PRTL_SRWLOCK
;
5562 #define RTL_SRWLOCK_INIT {0}
5564 typedef struct _RTL_CONDITION_VARIABLE
{
5566 } RTL_CONDITION_VARIABLE
, *PRTL_CONDITION_VARIABLE
;
5567 #define RTL_CONDITION_VARIABLE_INIT {0}
5568 #define RTL_CONDITION_VARIABLE_LOCKMODE_SHARED 0x1
5570 typedef VOID (NTAPI
* WAITORTIMERCALLBACKFUNC
) (PVOID
, BOOLEAN
);
5571 typedef VOID (NTAPI
* PFLS_CALLBACK_FUNCTION
) ( PVOID
);
5573 #define RTL_RUN_ONCE_INIT {0}
5574 typedef union _RTL_RUN_ONCE
{
5576 } RTL_RUN_ONCE
, *PRTL_RUN_ONCE
;
5578 #define RTL_RUN_ONCE_CHECK_ONLY 0x00000001
5579 #define RTL_RUN_ONCE_ASYNC 0x00000002
5580 #define RTL_RUN_ONCE_INIT_FAILED 0x00000004
5582 typedef DWORD WINAPI
RTL_RUN_ONCE_INIT_FN(PRTL_RUN_ONCE
, PVOID
, PVOID
*);
5583 typedef RTL_RUN_ONCE_INIT_FN
*PRTL_RUN_ONCE_INIT_FN
;
5584 NTSYSAPI VOID WINAPI
RtlRunOnceInitialize(PRTL_RUN_ONCE
);
5585 NTSYSAPI DWORD WINAPI
RtlRunOnceExecuteOnce(PRTL_RUN_ONCE
,PRTL_RUN_ONCE_INIT_FN
,PVOID
,PVOID
*);
5586 NTSYSAPI DWORD WINAPI
RtlRunOnceBeginInitialize(PRTL_RUN_ONCE
, DWORD
, PVOID
*);
5587 NTSYSAPI DWORD WINAPI
RtlRunOnceComplete(PRTL_RUN_ONCE
, DWORD
, PVOID
);
5589 #include <pshpack8.h>
5590 typedef struct _IO_COUNTERS
{
5591 ULONGLONG
DECLSPEC_ALIGN(8) ReadOperationCount
;
5592 ULONGLONG
DECLSPEC_ALIGN(8) WriteOperationCount
;
5593 ULONGLONG
DECLSPEC_ALIGN(8) OtherOperationCount
;
5594 ULONGLONG
DECLSPEC_ALIGN(8) ReadTransferCount
;
5595 ULONGLONG
DECLSPEC_ALIGN(8) WriteTransferCount
;
5596 ULONGLONG
DECLSPEC_ALIGN(8) OtherTransferCount
;
5597 } IO_COUNTERS
, *PIO_COUNTERS
;
5598 #include <poppack.h>
5601 DWORD dwOSVersionInfoSize
;
5602 DWORD dwMajorVersion
;
5603 DWORD dwMinorVersion
;
5604 DWORD dwBuildNumber
;
5606 CHAR szCSDVersion
[128];
5607 } OSVERSIONINFOA
, *POSVERSIONINFOA
, *LPOSVERSIONINFOA
;
5610 DWORD dwOSVersionInfoSize
;
5611 DWORD dwMajorVersion
;
5612 DWORD dwMinorVersion
;
5613 DWORD dwBuildNumber
;
5615 WCHAR szCSDVersion
[128];
5616 } OSVERSIONINFOW
, *POSVERSIONINFOW
, *LPOSVERSIONINFOW
, RTL_OSVERSIONINFOW
, *PRTL_OSVERSIONINFOW
;
5618 DECL_WINELIB_TYPE_AW(OSVERSIONINFO
)
5619 DECL_WINELIB_TYPE_AW(POSVERSIONINFO
)
5620 DECL_WINELIB_TYPE_AW(LPOSVERSIONINFO
)
5623 DWORD dwOSVersionInfoSize
;
5624 DWORD dwMajorVersion
;
5625 DWORD dwMinorVersion
;
5626 DWORD dwBuildNumber
;
5628 CHAR szCSDVersion
[128];
5629 WORD wServicePackMajor
;
5630 WORD wServicePackMinor
;
5634 } OSVERSIONINFOEXA
, *POSVERSIONINFOEXA
, *LPOSVERSIONINFOEXA
;
5637 DWORD dwOSVersionInfoSize
;
5638 DWORD dwMajorVersion
;
5639 DWORD dwMinorVersion
;
5640 DWORD dwBuildNumber
;
5642 WCHAR szCSDVersion
[128];
5643 WORD wServicePackMajor
;
5644 WORD wServicePackMinor
;
5648 } OSVERSIONINFOEXW
, *POSVERSIONINFOEXW
, *LPOSVERSIONINFOEXW
, RTL_OSVERSIONINFOEXW
, *PRTL_OSVERSIONINFOEXW
;
5650 DECL_WINELIB_TYPE_AW(OSVERSIONINFOEX
)
5651 DECL_WINELIB_TYPE_AW(POSVERSIONINFOEX
)
5652 DECL_WINELIB_TYPE_AW(LPOSVERSIONINFOEX
)
5654 NTSYSAPI ULONGLONG WINAPI
VerSetConditionMask(ULONGLONG
,DWORD
,BYTE
);
5656 #define VER_SET_CONDITION(_m_,_t_,_c_) ((_m_)=VerSetConditionMask((_m_),(_t_),(_c_)))
5658 #define VER_PLATFORM_WIN32s 0
5659 #define VER_PLATFORM_WIN32_WINDOWS 1
5660 #define VER_PLATFORM_WIN32_NT 2
5662 #define VER_MINORVERSION 0x00000001
5663 #define VER_MAJORVERSION 0x00000002
5664 #define VER_BUILDNUMBER 0x00000004
5665 #define VER_PLATFORMID 0x00000008
5666 #define VER_SERVICEPACKMINOR 0x00000010
5667 #define VER_SERVICEPACKMAJOR 0x00000020
5668 #define VER_SUITENAME 0x00000040
5669 #define VER_PRODUCT_TYPE 0x00000080
5671 #define VER_NT_WORKSTATION 1
5672 #define VER_NT_DOMAIN_CONTROLLER 2
5673 #define VER_NT_SERVER 3
5675 #define VER_SUITE_SMALLBUSINESS 0x00000001
5676 #define VER_SUITE_ENTERPRISE 0x00000002
5677 #define VER_SUITE_BACKOFFICE 0x00000004
5678 #define VER_SUITE_COMMUNICATIONS 0x00000008
5679 #define VER_SUITE_TERMINAL 0x00000010
5680 #define VER_SUITE_SMALLBUSINESS_RESTRICTED 0x00000020
5681 #define VER_SUITE_EMBEDDEDNT 0x00000040
5682 #define VER_SUITE_DATACENTER 0x00000080
5683 #define VER_SUITE_SINGLEUSERTS 0x00000100
5684 #define VER_SUITE_PERSONAL 0x00000200
5685 #define VER_SUITE_BLADE 0x00000400
5686 #define VER_SUITE_EMBEDDED_RESTRICTED 0x00000800
5687 #define VER_SUITE_SECURITY_APPLIANCE 0x00001000
5688 #define VER_SUITE_STORAGE_SERVER 0x00002000
5689 #define VER_SUITE_COMPUTE_SERVER 0x00004000
5690 #define VER_SUITE_WH_SERVER 0x00008000
5693 #define VER_GREATER 2
5694 #define VER_GREATER_EQUAL 3
5696 #define VER_LESS_EQUAL 5
5700 typedef struct _ACTIVATION_CONTEXT_DETAILED_INFORMATION
{
5702 DWORD ulFormatVersion
;
5703 DWORD ulAssemblyCount
;
5704 DWORD ulRootManifestPathType
;
5705 DWORD ulRootManifestPathChars
;
5706 DWORD ulRootConfigurationPathType
;
5707 DWORD ulRootConfigurationPathChars
;
5708 DWORD ulAppDirPathType
;
5709 DWORD ulAppDirPathChars
;
5710 PCWSTR lpRootManifestPath
;
5711 PCWSTR lpRootConfigurationPath
;
5712 PCWSTR lpAppDirPath
;
5713 } ACTIVATION_CONTEXT_DETAILED_INFORMATION
, *PACTIVATION_CONTEXT_DETAILED_INFORMATION
;
5715 typedef struct _ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION
{
5717 DWORD ulEncodedAssemblyIdentityLength
;
5718 DWORD ulManifestPathType
;
5719 DWORD ulManifestPathLength
;
5720 LARGE_INTEGER liManifestLastWriteTime
;
5721 DWORD ulPolicyPathType
;
5722 DWORD ulPolicyPathLength
;
5723 LARGE_INTEGER liPolicyLastWriteTime
;
5724 DWORD ulMetadataSatelliteRosterIndex
;
5725 DWORD ulManifestVersionMajor
;
5726 DWORD ulManifestVersionMinor
;
5727 DWORD ulPolicyVersionMajor
;
5728 DWORD ulPolicyVersionMinor
;
5729 DWORD ulAssemblyDirectoryNameLength
;
5730 PCWSTR lpAssemblyEncodedAssemblyIdentity
;
5731 PCWSTR lpAssemblyManifestPath
;
5732 PCWSTR lpAssemblyPolicyPath
;
5733 PCWSTR lpAssemblyDirectoryName
;
5735 } ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION
, *PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION
;
5737 typedef struct _ACTIVATION_CONTEXT_QUERY_INDEX
{
5738 DWORD ulAssemblyIndex
;
5739 DWORD ulFileIndexInAssembly
;
5740 } ACTIVATION_CONTEXT_QUERY_INDEX
, *PACTIVATION_CONTEXT_QUERY_INDEX
;
5742 typedef const struct _ACTIVATION_CONTEXT_QUERY_INDEX
*PCACTIVATION_CONTEXT_QUERY_INDEX
;
5744 typedef struct _ASSEMBLY_FILE_DETAILED_INFORMATION
{
5746 DWORD ulFilenameLength
;
5750 } ASSEMBLY_FILE_DETAILED_INFORMATION
, *PASSEMBLY_FILE_DETAILED_INFORMATION
;
5752 typedef const ASSEMBLY_FILE_DETAILED_INFORMATION
*PCASSEMBLY_FILE_DETAILED_INFORMATION
;
5754 typedef enum _ACTIVATION_CONTEXT_INFO_CLASS
{
5755 ActivationContextBasicInformation
= 1,
5756 ActivationContextDetailedInformation
= 2,
5757 AssemblyDetailedInformationInActivationContext
= 3,
5758 FileInformationInAssemblyOfAssemblyInActivationContext
= 4,
5759 MaxActivationContextInfoClass
,
5761 AssemblyDetailedInformationInActivationContxt
= 3,
5762 FileInformationInAssemblyOfAssemblyInActivationContxt
= 4
5763 } ACTIVATION_CONTEXT_INFO_CLASS
;
5765 #define ACTIVATION_CONTEXT_PATH_TYPE_NONE 1
5766 #define ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE 2
5767 #define ACTIVATION_CONTEXT_PATH_TYPE_URL 3
5768 #define ACTIVATION_CONTEXT_PATH_TYPE_ASSEMBLYREF 4
5770 #define ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION 1
5771 #define ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION 2
5772 #define ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION 3
5773 #define ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION 4
5774 #define ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION 5
5775 #define ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION 6
5776 #define ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION 7
5777 #define ACTIVATION_CONTEXT_SECTION_GLOBAL_OBJECT_RENAME_TABLE 8
5778 #define ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES 9
5780 typedef enum _JOBOBJECTINFOCLASS
5782 JobObjectBasicAccountingInformation
= 1,
5783 JobObjectBasicLimitInformation
,
5784 JobObjectBasicProcessIdList
,
5785 JobObjectBasicUIRestrictions
,
5786 JobObjectSecurityLimitInformation
,
5787 JobObjectEndOfJobTimeInformation
,
5788 JobObjectAssociateCompletionPortInformation
,
5789 JobObjectBasicAndIoAccountingInformation
,
5790 JobObjectExtendedLimitInformation
,
5791 JobObjectJobSetInformation
,
5792 MaxJobObjectInfoClass
5793 } JOBOBJECTINFOCLASS
;
5795 typedef struct _JOBOBJECT_BASIC_ACCOUNTING_INFORMATION
{
5796 LARGE_INTEGER TotalUserTime
;
5797 LARGE_INTEGER TotalKernelTime
;
5798 LARGE_INTEGER ThisPeriodTotalUserTime
;
5799 LARGE_INTEGER ThisPeriodTotalKernelTime
;
5800 DWORD TotalPageFaultCount
;
5801 DWORD TotalProcesses
;
5802 DWORD ActiveProcesses
;
5803 DWORD TotalTerminatedProcesses
;
5804 } JOBOBJECT_BASIC_ACCOUNTING_INFORMATION
, *PJOBOBJECT_BASIC_ACCOUNTING_INFORMATION
;
5806 typedef struct _JOBOBJECT_BASIC_LIMIT_INFORMATION
{
5807 LARGE_INTEGER PerProcessUserTimeLimit
;
5808 LARGE_INTEGER PerJobUserTimeLimit
;
5810 SIZE_T MinimumWorkingSetSize
;
5811 SIZE_T MaximumWorkingSetSize
;
5812 DWORD ActiveProcessLimit
;
5814 DWORD PriorityClass
;
5815 DWORD SchedulingClass
;
5816 } JOBOBJECT_BASIC_LIMIT_INFORMATION
, *PJOBOBJECT_BASIC_LIMIT_INFORMATION
;
5818 typedef struct _JOBOBJECT_BASIC_PROCESS_ID_LIST
{
5819 DWORD NumberOfAssignedProcesses
;
5820 DWORD NumberOfProcessIdsInList
;
5821 ULONG_PTR ProcessIdList
[1];
5822 } JOBOBJECT_BASIC_PROCESS_ID_LIST
, *PJOBOBJECT_BASIC_PROCESS_ID_LIST
;
5824 typedef struct _JOBOBJECT_BASIC_UI_RESTRICTIONS
{
5825 DWORD UIRestrictionsClass
;
5826 } JOBOBJECT_BASIC_UI_RESTRICTIONS
, *PJOBOBJECT_BASIC_UI_RESTRICTIONS
;
5828 typedef struct _JOBOBJECT_SECURITY_LIMIT_INFORMATION
{
5829 DWORD SecurityLimitFlags
;
5831 PTOKEN_GROUPS SidsToDisable
;
5832 PTOKEN_PRIVILEGES PrivilegesToDelete
;
5833 PTOKEN_GROUPS RestrictedSids
;
5834 } JOBOBJECT_SECURITY_LIMIT_INFORMATION
, *PJOBOBJECT_SECURITY_LIMIT_INFORMATION
;
5836 typedef struct _JOBOBJECT_END_OF_JOB_TIME_INFORMATION
{
5837 DWORD EndOfJobTimeAction
;
5838 } JOBOBJECT_END_OF_JOB_TIME_INFORMATION
, PJOBOBJECT_END_OF_JOB_TIME_INFORMATION
;
5840 typedef struct _JOBOBJECT_ASSOCIATE_COMPLETION_PORT
{
5841 PVOID CompletionKey
;
5842 HANDLE CompletionPort
;
5843 } JOBOBJECT_ASSOCIATE_COMPLETION_PORT
, *PJOBOBJECT_ASSOCIATE_COMPLETION_PORT
;
5845 #define JOB_OBJECT_MSG_END_OF_JOB_TIME 1
5846 #define JOB_OBJECT_MSG_END_OF_PROCESS_TIME 2
5847 #define JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT 3
5848 #define JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO 4
5849 #define JOB_OBJECT_MSG_NEW_PROCESS 6
5850 #define JOB_OBJECT_MSG_EXIT_PROCESS 7
5851 #define JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS 8
5852 #define JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT 9
5853 #define JOB_OBJECT_MSG_JOB_MEMORY_LIMIT 10
5855 typedef struct JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION
{
5856 JOBOBJECT_BASIC_ACCOUNTING_INFORMATION BasicInfo
;
5858 } JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION
, *PJOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION
;
5860 typedef struct _JOBOBJECT_EXTENDED_LIMIT_INFORMATION
{
5861 JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation
;
5863 SIZE_T ProcessMemoryLimit
;
5864 SIZE_T JobMemoryLimit
;
5865 SIZE_T PeakProcessMemoryUsed
;
5866 SIZE_T PeakJobMemoryUsed
;
5867 } JOBOBJECT_EXTENDED_LIMIT_INFORMATION
, *PJOBOBJECT_EXTENDED_LIMIT_INFORMATION
;
5869 #define JOB_OBJECT_LIMIT_WORKINGSET 0x00000001
5870 #define JOB_OBJECT_LIMIT_PROCESS_TIME 0x00000002
5871 #define JOB_OBJECT_LIMIT_JOB_TIME 0x00000004
5872 #define JOB_OBJECT_LIMIT_ACTIVE_PROCESS 0x00000008
5873 #define JOB_OBJECT_LIMIT_AFFINITY 0x00000010
5874 #define JOB_OBJECT_LIMIT_PRIORITY_CLASS 0x00000020
5875 #define JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME 0x00000040
5876 #define JOB_OBJECT_LIMIT_SCHEDULING_CLASS 0x00000080
5877 #define JOB_OBJECT_LIMIT_PROCESS_MEMORY 0x00000100
5878 #define JOB_OBJECT_LIMIT_JOB_MEMORY 0x00000200
5879 #define JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION 0x00000400
5880 #define JOB_OBJECT_LIMIT_BREAKAWAY_OK 0x00000800
5881 #define JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK 0x00001000
5882 #define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE 0x00002000
5883 #define JOB_OBJECT_LIMIT_SUBSET_AFFINITY 0x00004000
5885 #define JOB_OBJECT_LIMIT_VALID_FLAGS 0x0007ffff
5886 #define JOB_OBJECT_BASIC_LIMIT_VALID_FLAGS 0x000000ff
5887 #define JOB_OBJECT_EXTENDED_LIMIT_VALID_FLAGS 0x00007fff
5889 typedef enum _LOGICAL_PROCESSOR_RELATIONSHIP
5891 RelationProcessorCore
= 0,
5892 RelationNumaNode
= 1,
5894 RelationProcessorPackage
= 3,
5896 RelationAll
= 0xffff
5897 } LOGICAL_PROCESSOR_RELATIONSHIP
;
5899 typedef enum _PROCESSOR_CACHE_TYPE
5905 } PROCESSOR_CACHE_TYPE
;
5907 typedef struct _PROCESSOR_GROUP_INFO
5909 BYTE MaximumProcessorCount
;
5910 BYTE ActiveProcessorCount
;
5912 KAFFINITY ActiveProcessorMask
;
5913 } PROCESSOR_GROUP_INFO
, *PPROCESSOR_GROUP_INFO
;
5915 typedef struct _CACHE_DESCRIPTOR
5921 PROCESSOR_CACHE_TYPE Type
;
5922 } CACHE_DESCRIPTOR
, *PCACHE_DESCRIPTOR
;
5924 typedef struct _GROUP_AFFINITY
5929 } GROUP_AFFINITY
, *PGROUP_AFFINITY
;
5931 typedef struct _PROCESSOR_NUMBER
5936 } PROCESSOR_NUMBER
, *PPROCESSOR_NUMBER
;
5938 typedef struct _PROCESSOR_RELATIONSHIP
5941 BYTE EfficiencyClass
;
5944 GROUP_AFFINITY GroupMask
[ANYSIZE_ARRAY
];
5945 } PROCESSOR_RELATIONSHIP
, *PPROCESSOR_RELATIONSHIP
;
5947 typedef struct _NUMA_NODE_RELATIONSHIP
5951 GROUP_AFFINITY GroupMask
;
5952 } NUMA_NODE_RELATIONSHIP
, *PNUMA_NODE_RELATIONSHIP
;
5954 typedef struct _CACHE_RELATIONSHIP
5960 PROCESSOR_CACHE_TYPE Type
;
5962 GROUP_AFFINITY GroupMask
;
5963 } CACHE_RELATIONSHIP
, *PCACHE_RELATIONSHIP
;
5965 typedef struct _GROUP_RELATIONSHIP
5967 WORD MaximumGroupCount
;
5968 WORD ActiveGroupCount
;
5970 PROCESSOR_GROUP_INFO GroupInfo
[ANYSIZE_ARRAY
];
5971 } GROUP_RELATIONSHIP
, *PGROUP_RELATIONSHIP
;
5973 typedef struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION
5975 ULONG_PTR ProcessorMask
;
5976 LOGICAL_PROCESSOR_RELATIONSHIP Relationship
;
5987 CACHE_DESCRIPTOR Cache
;
5988 ULONGLONG Reserved
[2];
5990 } SYSTEM_LOGICAL_PROCESSOR_INFORMATION
, *PSYSTEM_LOGICAL_PROCESSOR_INFORMATION
;
5992 typedef struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
5994 LOGICAL_PROCESSOR_RELATIONSHIP Relationship
;
5998 PROCESSOR_RELATIONSHIP Processor
;
5999 NUMA_NODE_RELATIONSHIP NumaNode
;
6000 CACHE_RELATIONSHIP Cache
;
6001 GROUP_RELATIONSHIP Group
;
6003 } SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
, *PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
;
6005 /* Threadpool things */
6006 typedef DWORD TP_VERSION
,*PTP_VERSION
;
6008 typedef struct _TP_CALLBACK_INSTANCE TP_CALLBACK_INSTANCE
,*PTP_CALLBACK_INSTANCE
;
6010 typedef VOID (CALLBACK
*PTP_SIMPLE_CALLBACK
)(PTP_CALLBACK_INSTANCE
,PVOID
);
6012 typedef struct _TP_POOL TP_POOL
,*PTP_POOL
;
6014 typedef enum _TP_CALLBACK_PRIORITY
6016 TP_CALLBACK_PRIORITY_HIGH
,
6017 TP_CALLBACK_PRIORITY_NORMAL
,
6018 TP_CALLBACK_PRIORITY_LOW
,
6019 TP_CALLBACK_PRIORITY_INVALID
,
6020 TP_CALLBACK_PRIORITY_COUNT
= TP_CALLBACK_PRIORITY_INVALID
6021 } TP_CALLBACK_PRIORITY
;
6023 typedef struct _TP_POOL_STACK_INFORMATION
6025 SIZE_T StackReserve
;
6027 } TP_POOL_STACK_INFORMATION
,*PTP_POOL_STACK_INFORMATION
;
6029 typedef struct _TP_CLEANUP_GROUP TP_CLEANUP_GROUP
,*PTP_CLEANUP_GROUP
;
6031 typedef VOID (CALLBACK
*PTP_CLEANUP_GROUP_CANCEL_CALLBACK
)(PVOID
,PVOID
);
6033 typedef struct _TP_CALLBACK_ENVIRON_V1
6037 PTP_CLEANUP_GROUP CleanupGroup
;
6038 PTP_CLEANUP_GROUP_CANCEL_CALLBACK CleanupGroupCancelCallback
;
6040 struct _ACTIVATION_CONTEXT
* ActivationContext
;
6041 PTP_SIMPLE_CALLBACK FinalizationCallback
;
6047 DWORD LongFunction
:1;
6052 } TP_CALLBACK_ENVIRON_V1
;
6054 typedef struct _TP_CALLBACK_ENVIRON_V3
6058 PTP_CLEANUP_GROUP CleanupGroup
;
6059 PTP_CLEANUP_GROUP_CANCEL_CALLBACK CleanupGroupCancelCallback
;
6061 struct _ACTIVATION_CONTEXT
*ActivationContext
;
6062 PTP_SIMPLE_CALLBACK FinalizationCallback
;
6068 DWORD LongFunction
:1;
6073 TP_CALLBACK_PRIORITY CallbackPriority
;
6075 } TP_CALLBACK_ENVIRON_V3
;
6077 typedef struct _TP_WORK TP_WORK
, *PTP_WORK
;
6078 typedef struct _TP_TIMER TP_TIMER
, *PTP_TIMER
;
6080 typedef DWORD TP_WAIT_RESULT
;
6081 typedef struct _TP_WAIT TP_WAIT
, *PTP_WAIT
;
6083 typedef struct _TP_IO TP_IO
, *PTP_IO
;
6085 typedef TP_CALLBACK_ENVIRON_V1 TP_CALLBACK_ENVIRON
, *PTP_CALLBACK_ENVIRON
;
6087 typedef VOID (CALLBACK
*PTP_WORK_CALLBACK
)(PTP_CALLBACK_INSTANCE
,PVOID
,PTP_WORK
);
6088 typedef VOID (CALLBACK
*PTP_TIMER_CALLBACK
)(PTP_CALLBACK_INSTANCE
,PVOID
,PTP_TIMER
);
6089 typedef VOID (CALLBACK
*PTP_WAIT_CALLBACK
)(PTP_CALLBACK_INSTANCE
,PVOID
,PTP_WAIT
,TP_WAIT_RESULT
);
6090 typedef VOID (CALLBACK
*PTP_WIN32_IO_CALLBACK
)(PTP_CALLBACK_INSTANCE
,PVOID
,PVOID
,ULONG
,ULONG_PTR
,PTP_IO
);
6093 NTSYSAPI BOOLEAN NTAPI
RtlGetProductInfo(DWORD
,DWORD
,DWORD
,DWORD
,PDWORD
);
6099 #endif /* _WINNT_ */