ReactOS 0.4.16-dev-336-gb667d82
winnt_old.h
Go to the documentation of this file.
1
2#if defined(__ROS_LONG64__)
3#undef InterlockedExchange
4#define InterlockedExchange(a,b) _InterlockedExchange((long*)a,b)
5#undef InterlockedExchangeAdd
6#define InterlockedExchangeAdd(a,b) _InterlockedExchangeAdd((long*)a,b)
7#undef InterlockedCompareExchange
8#define InterlockedCompareExchange(a,b,c) _InterlockedCompareExchange((long*)a,b,c)
9#undef InterlockedIncrement
10#define InterlockedIncrement(a) _InterlockedIncrement((long*)a)
11#undef InterlockedDecrement
12#define InterlockedDecrement(a) _InterlockedDecrement((long*)a)
13#endif
14
15#undef __C89_NAMELESS
16#undef __C89_NAMELESSSTRUCTNAME
17#undef __C89_NAMELESSSTRUCTNAME1
18#undef __C89_NAMELESSSTRUCTNAME2
19#undef __C89_NAMELESSSTRUCTNAME3
20#undef __C89_NAMELESSSTRUCTNAME4
21#undef __C89_NAMELESSSTRUCTNAME5
22#undef __C89_NAMELESSUNIONNAME
23#undef __C89_NAMELESSUNIONNAME1
24#undef __C89_NAMELESSUNIONNAME2
25#undef __C89_NAMELESSUNIONNAME3
26#undef __C89_NAMELESSUNIONNAME4
27#undef __C89_NAMELESSUNIONNAME5
28#undef __C89_NAMELESSUNIONNAME6
29#undef __C89_NAMELESSUNIONNAME7
30#undef __C89_NAMELESSUNIONNAME8
31
32#if !defined(__WINESRC__) && !defined(WINE_NO_NAMELESS_EXTENSION)
33# ifdef __GNUC__
34 /* Anonymous structs support starts with gcc 2.96/g++ 2.95 */
35# if (__GNUC__ > 2) || ((__GNUC__ == 2) && ((__GNUC_MINOR__ > 95) || ((__GNUC_MINOR__ == 95) && defined(__cplusplus))))
36# define __C89_NAMELESS __extension__
37# endif
38# elif defined(_MSC_VER)
39# define __C89_NAMELESS
40# endif
41#endif
42
43#ifdef __C89_NAMELESS
44# define __C89_NAMELESSSTRUCTNAME
45# define __C89_NAMELESSSTRUCTNAME1
46# define __C89_NAMELESSSTRUCTNAME2
47# define __C89_NAMELESSSTRUCTNAME3
48# define __C89_NAMELESSSTRUCTNAME4
49# define __C89_NAMELESSSTRUCTNAME5
50# define __C89_NAMELESSUNIONNAME
51# define __C89_NAMELESSUNIONNAME1
52# define __C89_NAMELESSUNIONNAME2
53# define __C89_NAMELESSUNIONNAME3
54# define __C89_NAMELESSUNIONNAME4
55# define __C89_NAMELESSUNIONNAME5
56# define __C89_NAMELESSUNIONNAME6
57# define __C89_NAMELESSUNIONNAME7
58# define __C89_NAMELESSUNIONNAME8
59#else
60# define __C89_NAMELESS
61# define __C89_NAMELESSSTRUCTNAME DUMMYSTRUCTNAME
62# define __C89_NAMELESSSTRUCTNAME1 DUMMYSTRUCTNAME1
63# define __C89_NAMELESSSTRUCTNAME2 DUMMYSTRUCTNAME2
64# define __C89_NAMELESSSTRUCTNAME3 DUMMYSTRUCTNAME3
65# define __C89_NAMELESSSTRUCTNAME4 DUMMYSTRUCTNAME4
66# define __C89_NAMELESSSTRUCTNAME5 DUMMYSTRUCTNAME5
67# define __C89_NAMELESSUNIONNAME DUMMYUNIONNAME
68# define __C89_NAMELESSUNIONNAME1 DUMMYUNIONNAME1
69# define __C89_NAMELESSUNIONNAME2 DUMMYUNIONNAME2
70# define __C89_NAMELESSUNIONNAME3 DUMMYUNIONNAME3
71# define __C89_NAMELESSUNIONNAME4 DUMMYUNIONNAME4
72# define __C89_NAMELESSUNIONNAME5 DUMMYUNIONNAME5
73# define __C89_NAMELESSUNIONNAME6 DUMMYUNIONNAME6
74# define __C89_NAMELESSUNIONNAME7 DUMMYUNIONNAME7
75# define __C89_NAMELESSUNIONNAME8 DUMMYUNIONNAME8
76#endif
77
78#define DECLSPEC_HIDDEN
79
80/*#ifdef _WINE*/
81#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
82# define __WINE_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
83#else
84# define __WINE_ALLOC_SIZE(x)
85#endif
86/*#endif*/
87
88#ifdef __GNUC__
89# define _HAVE_INT64
90# ifndef _INTEGRAL_MAX_BITS
91# define _INTEGRAL_MAX_BITS 64
92# endif
93# undef __int64
94# define __int64 long long
95#elif (defined(__WATCOMC__) || defined(_MSC_VER)) && (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64 )
96# define _HAVE_INT64
97#endif /* __GNUC__/__WATCOMC */
98
99#ifdef _MSC_VER
100# pragma warning(push)
101# pragma warning(disable:4201)
102# pragma warning(disable:4214)
103# pragma warning(disable:4820)
104#endif
105
106#define ACE_OBJECT_TYPE_PRESENT 0x00000001
107#define ACE_INHERITED_OBJECT_TYPE_PRESENT 0x00000002
108
109/* also in ddk/ntifs.h */
110#define COMPRESSION_FORMAT_NONE (0x0000)
111#define COMPRESSION_FORMAT_DEFAULT (0x0001)
112#define COMPRESSION_FORMAT_LZNT1 (0x0002)
113#define COMPRESSION_ENGINE_STANDARD (0x0000)
114#define COMPRESSION_ENGINE_MAXIMUM (0x0100)
115#define COMPRESSION_ENGINE_HIBER (0x0200)
116#define ACCESS_ALLOWED_ACE_TYPE (0x0)
117#define ACCESS_DENIED_ACE_TYPE (0x1)
118#define SYSTEM_AUDIT_ACE_TYPE (0x2)
119#define SYSTEM_ALARM_ACE_TYPE (0x3)
120/*end ntifs.h */
121
122#define REG_STANDARD_FORMAT 1
123#define REG_LATEST_FORMAT 2
124#define REG_NO_COMPRESSION 4
125
126#ifndef WIN32_NO_STATUS
127
128#define STATUS_WAIT_0 ((DWORD)0x00000000)
129#define STATUS_ABANDONED_WAIT_0 ((DWORD)0x00000080)
130#define STATUS_USER_APC ((DWORD)0x000000C0)
131#define STATUS_TIMEOUT ((DWORD)0x00000102)
132#define STATUS_PENDING ((DWORD)0x00000103)
133#define DBG_EXCEPTION_HANDLED ((DWORD)0x00010001)
134#define DBG_CONTINUE ((DWORD)0x00010002)
135#define STATUS_SEGMENT_NOTIFICATION ((DWORD)0x40000005)
136#define STATUS_FATAL_APP_EXIT ((DWORD)0x40000015)
137#define DBG_REPLY_LATER ((DWORD)0x40010001)
138#define DBG_TERMINATE_THREAD ((DWORD)0x40010003)
139#define DBG_TERMINATE_PROCESS ((DWORD)0x40010004)
140#define DBG_CONTROL_C ((DWORD)0x40010005)
141#define DBG_PRINTEXCEPTION_C ((DWORD)0x40010006)
142#define DBG_RIPEXCEPTION ((DWORD)0x40010007)
143#define DBG_CONTROL_BREAK ((DWORD)0x40010008)
144#define DBG_COMMAND_EXCEPTION ((DWORD)0x40010009)
145#define DBG_PRINTEXCEPTION_WIDE_C ((DWORD)0x4001000A)
146#define STATUS_GUARD_PAGE_VIOLATION ((DWORD)0x80000001)
147#define STATUS_DATATYPE_MISALIGNMENT ((DWORD)0x80000002)
148#define STATUS_BREAKPOINT ((DWORD)0x80000003)
149#define STATUS_SINGLE_STEP ((DWORD)0x80000004)
150#define STATUS_LONGJUMP ((DWORD)0x80000026)
151#define STATUS_UNWIND_CONSOLIDATE ((DWORD)0x80000029)
152#define DBG_EXCEPTION_NOT_HANDLED ((DWORD)0x80010001)
153#define STATUS_ACCESS_VIOLATION ((DWORD)0xC0000005)
154#define STATUS_IN_PAGE_ERROR ((DWORD)0xC0000006)
155#define STATUS_INVALID_HANDLE ((DWORD)0xC0000008)
156#define STATUS_INVALID_PARAMETER ((DWORD)0xC000000D)
157#define STATUS_NO_MEMORY ((DWORD)0xC0000017)
158#define STATUS_ILLEGAL_INSTRUCTION ((DWORD)0xC000001D)
159#define STATUS_NONCONTINUABLE_EXCEPTION ((DWORD)0xC0000025)
160#define STATUS_INVALID_DISPOSITION ((DWORD)0xC0000026)
161#define STATUS_ARRAY_BOUNDS_EXCEEDED ((DWORD)0xC000008C)
162#define STATUS_FLOAT_DENORMAL_OPERAND ((DWORD)0xC000008D)
163#define STATUS_FLOAT_DIVIDE_BY_ZERO ((DWORD)0xC000008E)
164#define STATUS_FLOAT_INEXACT_RESULT ((DWORD)0xC000008F)
165#define STATUS_FLOAT_INVALID_OPERATION ((DWORD)0xC0000090)
166#define STATUS_FLOAT_OVERFLOW ((DWORD)0xC0000091)
167#define STATUS_FLOAT_STACK_CHECK ((DWORD)0xC0000092)
168#define STATUS_FLOAT_UNDERFLOW ((DWORD)0xC0000093)
169#define STATUS_INTEGER_DIVIDE_BY_ZERO ((DWORD)0xC0000094)
170#define STATUS_INTEGER_OVERFLOW ((DWORD)0xC0000095)
171#define STATUS_PRIVILEGED_INSTRUCTION ((DWORD)0xC0000096)
172#define STATUS_STACK_OVERFLOW ((DWORD)0xC00000FD)
173#define STATUS_DLL_NOT_FOUND ((DWORD)0xC0000135)
174#define STATUS_ORDINAL_NOT_FOUND ((DWORD)0xC0000138)
175#define STATUS_ENTRYPOINT_NOT_FOUND ((DWORD)0xC0000139)
176#define STATUS_CONTROL_C_EXIT ((DWORD)0xC000013A)
177#define STATUS_DLL_INIT_FAILED ((DWORD)0xC0000142)
178#define STATUS_CONTROL_STACK_VIOLATION ((DWORD)0xC00001B2)
179#define STATUS_FLOAT_MULTIPLE_FAULTS ((DWORD)0xC00002B4)
180#define STATUS_FLOAT_MULTIPLE_TRAPS ((DWORD)0xC00002B5)
181#define STATUS_REG_NAT_CONSUMPTION ((DWORD)0xC00002C9)
182#define STATUS_HEAP_CORRUPTION ((DWORD)0xC0000374)
183#define STATUS_STACK_BUFFER_OVERRUN ((DWORD)0xC0000409)
184#define STATUS_INVALID_CRUNTIME_PARAMETER ((DWORD)0xC0000417)
185#define STATUS_ASSERTION_FAILURE ((DWORD)0xC0000420)
186#define STATUS_ENCLAVE_VIOLATION ((DWORD)0xC00004A2)
187#define STATUS_INTERRUPTED ((DWORD)0xC0000515)
188#define STATUS_THREAD_NOT_RUNNING ((DWORD)0xC0000516)
189#define STATUS_ALREADY_REGISTERED ((DWORD)0xC0000718)
190#define STATUS_SXS_EARLY_DEACTIVATION ((DWORD)0xC015000F)
191#define STATUS_SXS_INVALID_DEACTIVATION ((DWORD)0xC0150010)
192
193#define DBG_EXCEPTION_HANDLED ((DWORD)0x00010001)
194#define DBG_CONTINUE ((DWORD)0x00010002)
195#define DBG_TERMINATE_THREAD ((DWORD)0x40010003)
196#define DBG_TERMINATE_PROCESS ((DWORD)0x40010004)
197#define DBG_CONTROL_C ((DWORD)0x40010005)
198#define DBG_CONTROL_BREAK ((DWORD)0x40010008)
199#define DBG_COMMAND_EXCEPTION ((DWORD)0x40010009)
200#define DBG_EXCEPTION_NOT_HANDLED ((DWORD)0x80010001)
201
202#endif /* WIN32_NO_STATUS */
203
204#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
205
206/* Also in ddk/winddk.h */
207#define FILE_LIST_DIRECTORY 0x00000001
208#define FILE_READ_DATA 0x00000001
209#define FILE_ADD_FILE 0x00000002
210#define FILE_WRITE_DATA 0x00000002
211#define FILE_ADD_SUBDIRECTORY 0x00000004
212#define FILE_APPEND_DATA 0x00000004
213#define FILE_CREATE_PIPE_INSTANCE 0x00000004
214#define FILE_READ_EA 0x00000008
215#define FILE_READ_PROPERTIES 0x00000008
216#define FILE_WRITE_EA 0x00000010
217#define FILE_WRITE_PROPERTIES 0x00000010
218#define FILE_EXECUTE 0x00000020
219#define FILE_TRAVERSE 0x00000020
220#define FILE_DELETE_CHILD 0x00000040
221#define FILE_READ_ATTRIBUTES 0x00000080
222#define FILE_WRITE_ATTRIBUTES 0x00000100
223
224#define FILE_SHARE_READ 0x00000001
225#define FILE_SHARE_WRITE 0x00000002
226#define FILE_SHARE_DELETE 0x00000004
227#define FILE_SHARE_VALID_FLAGS 0x00000007
228
229#define FILE_ATTRIBUTE_READONLY 0x00000001
230#define FILE_ATTRIBUTE_HIDDEN 0x00000002
231#define FILE_ATTRIBUTE_SYSTEM 0x00000004
232#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
233#define FILE_ATTRIBUTE_ARCHIVE 0x00000020
234#define FILE_ATTRIBUTE_DEVICE 0x00000040
235#define FILE_ATTRIBUTE_NORMAL 0x00000080
236#define FILE_ATTRIBUTE_TEMPORARY 0x00000100
237#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
238#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
239#define FILE_ATTRIBUTE_COMPRESSED 0x00000800
240#define FILE_ATTRIBUTE_OFFLINE 0x00001000
241#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
242#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
243#define FILE_ATTRIBUTE_INTEGRITY_STREAM 0x00008000
244#define FILE_ATTRIBUTE_VIRTUAL 0x00010000
245#define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
246#define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
247
248#define FILE_COPY_STRUCTURED_STORAGE 0x00000041
249#define FILE_STRUCTURED_STORAGE 0x00000441
250
251#define FILE_VALID_OPTION_FLAGS 0x00ffffff
252#define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032
253#define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032
254#define FILE_VALID_SET_FLAGS 0x00000036
255
256#define FILE_DIRECTORY_FILE 0x00000001
257#define FILE_WRITE_THROUGH 0x00000002
258#define FILE_SEQUENTIAL_ONLY 0x00000004
259#define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
260#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
261#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
262#define FILE_NON_DIRECTORY_FILE 0x00000040
263#define FILE_CREATE_TREE_CONNECTION 0x00000080
264#define FILE_COMPLETE_IF_OPLOCKED 0x00000100
265#define FILE_NO_EA_KNOWLEDGE 0x00000200
266#define FILE_OPEN_REMOTE_INSTANCE 0x00000400
267#define FILE_RANDOM_ACCESS 0x00000800
268#define FILE_DELETE_ON_CLOSE 0x00001000
269#define FILE_OPEN_BY_FILE_ID 0x00002000
270#define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
271#define FILE_NO_COMPRESSION 0x00008000
272#define FILE_RESERVE_OPFILTER 0x00100000
273#define FILE_OPEN_REPARSE_POINT 0x00200000
274#define FILE_OPEN_NO_RECALL 0x00400000
275#define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
276
277#define FILE_ALL_ACCESS \
278 (STANDARD_RIGHTS_REQUIRED | \
279 SYNCHRONIZE | \
280 0x1FF)
281
282#define FILE_GENERIC_EXECUTE \
283 (STANDARD_RIGHTS_EXECUTE | \
284 FILE_READ_ATTRIBUTES | \
285 FILE_EXECUTE | \
286 SYNCHRONIZE)
287
288#define FILE_GENERIC_READ \
289 (STANDARD_RIGHTS_READ | \
290 FILE_READ_DATA | \
291 FILE_READ_ATTRIBUTES | \
292 FILE_READ_EA | \
293 SYNCHRONIZE)
294
295#define FILE_GENERIC_WRITE \
296 (STANDARD_RIGHTS_WRITE | \
297 FILE_WRITE_DATA | \
298 FILE_WRITE_ATTRIBUTES | \
299 FILE_WRITE_EA | \
300 FILE_APPEND_DATA | \
301 SYNCHRONIZE)
302/* end winddk.h */
303/* also in ddk/ntifs.h */
304#define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
305#define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
306#define FILE_NOTIFY_CHANGE_NAME 0x00000003
307#define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
308#define FILE_NOTIFY_CHANGE_SIZE 0x00000008
309#define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
310#define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
311#define FILE_NOTIFY_CHANGE_CREATION 0x00000040
312#define FILE_NOTIFY_CHANGE_EA 0x00000080
313#define FILE_NOTIFY_CHANGE_SECURITY 0x00000100
314#define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200
315#define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400
316#define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800
317#define FILE_NOTIFY_VALID_MASK 0x00000fff
318
319#define FILE_CASE_SENSITIVE_SEARCH 0x00000001
320#define FILE_CASE_PRESERVED_NAMES 0x00000002
321#define FILE_UNICODE_ON_DISK 0x00000004
322#define FILE_PERSISTENT_ACLS 0x00000008
323#define FILE_FILE_COMPRESSION 0x00000010
324#define FILE_VOLUME_QUOTAS 0x00000020
325#define FILE_SUPPORTS_SPARSE_FILES 0x00000040
326#define FILE_SUPPORTS_REPARSE_POINTS 0x00000080
327#define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100
328#define FS_LFN_APIS 0x00004000
329#define FILE_VOLUME_IS_COMPRESSED 0x00008000
330#define FILE_SUPPORTS_OBJECT_IDS 0x00010000
331#define FILE_SUPPORTS_ENCRYPTION 0x00020000
332#define FILE_NAMED_STREAMS 0x00040000
333#define FILE_READ_ONLY_VOLUME 0x00080000
334#define FILE_SEQUENTIAL_WRITE_ONCE 0x00100000
335#define FILE_SUPPORTS_TRANSACTIONS 0x00200000
336#define FILE_SUPPORTS_HARD_LINKS 0x00400000
337#define FILE_SUPPORTS_EXTENDED_ATTRIBUTES 0x00800000
338#define FILE_SUPPORTS_OPEN_BY_FILE_ID 0x01000000
339#define FILE_SUPPORTS_USN_JOURNAL 0x02000000
340#define FILE_SUPPORTS_INTEGRITY_STREAMS 0x04000000
341#define FILE_SUPPORTS_BLOCK_REFCOUNTING 0x08000000
342#define FILE_SUPPORTS_SPARSE_VDL 0x10000000
343#define FILE_DAX_VOLUME 0x20000000
344
345#define IO_COMPLETION_QUERY_STATE 0x0001
346#define IO_COMPLETION_MODIFY_STATE 0x0002
347#define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
348/* end ntifs.h */
349
350/* also in ddk/winddk.h */
351#define DUPLICATE_CLOSE_SOURCE 0x00000001
352#define DUPLICATE_SAME_ACCESS 0x00000002
353/* end winddk.k */
354
355#define MAILSLOT_NO_MESSAGE ((DWORD)-1)
356#define MAILSLOT_WAIT_FOREVER ((DWORD)-1)
357#define PROCESS_TERMINATE 1
358#define PROCESS_CREATE_THREAD 2
359#define PROCESS_SET_SESSIONID 4
360#define PROCESS_VM_OPERATION 8
361#define PROCESS_VM_READ 16
362#define PROCESS_VM_WRITE 32
363#define PROCESS_CREATE_PROCESS 128
364#define PROCESS_SET_QUOTA 256
365#define PROCESS_SET_INFORMATION 512
366#define PROCESS_QUERY_INFORMATION 1024
367#define PROCESS_SUSPEND_RESUME 2048
368#define PROCESS_QUERY_LIMITED_INFORMATION 0x1000
369#define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xFFF)
370#define PROCESS_DUP_HANDLE 64
371#define THREAD_TERMINATE 1
372#define THREAD_SUSPEND_RESUME 2
373#define THREAD_GET_CONTEXT 8
374#define THREAD_SET_CONTEXT 16
375#define THREAD_SET_INFORMATION 32
376#define THREAD_QUERY_INFORMATION 64
377#define THREAD_SET_THREAD_TOKEN 128
378#define THREAD_IMPERSONATE 256
379#define THREAD_DIRECT_IMPERSONATION 0x200
380#define THREAD_QUERY_LIMITED_INFORMATION 0x0800
381#define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3FF)
382#define MUTANT_QUERY_STATE 0x0001
383#define MUTANT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|MUTANT_QUERY_STATE)
384#define TIMER_QUERY_STATE 0x0001
385#define TIMER_MODIFY_STATE 0x0002
386#define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|TIMER_QUERY_STATE|TIMER_MODIFY_STATE)
387#define THREAD_BASE_PRIORITY_LOWRT 15
388#define THREAD_BASE_PRIORITY_MAX 2
389#define THREAD_BASE_PRIORITY_MIN (-2)
390#define THREAD_BASE_PRIORITY_IDLE (-15)
391
392#define PROCESS_SET_LIMITED_INFORMATION 0x2000
393#define THREAD_RESUME 0x1000
394
395#define SE_CREATE_TOKEN_NAME TEXT("SeCreateTokenPrivilege")
396#define SE_ASSIGNPRIMARYTOKEN_NAME TEXT("SeAssignPrimaryTokenPrivilege")
397#define SE_LOCK_MEMORY_NAME TEXT("SeLockMemoryPrivilege")
398#define SE_INCREASE_QUOTA_NAME TEXT("SeIncreaseQuotaPrivilege")
399#define SE_UNSOLICITED_INPUT_NAME TEXT("SeUnsolicitedInputPrivilege")
400#define SE_MACHINE_ACCOUNT_NAME TEXT("SeMachineAccountPrivilege")
401#define SE_TCB_NAME TEXT("SeTcbPrivilege")
402#define SE_SECURITY_NAME TEXT("SeSecurityPrivilege")
403#define SE_TAKE_OWNERSHIP_NAME TEXT("SeTakeOwnershipPrivilege")
404#define SE_LOAD_DRIVER_NAME TEXT("SeLoadDriverPrivilege")
405#define SE_SYSTEM_PROFILE_NAME TEXT("SeSystemProfilePrivilege")
406#define SE_SYSTEMTIME_NAME TEXT("SeSystemtimePrivilege")
407#define SE_PROF_SINGLE_PROCESS_NAME TEXT("SeProfileSingleProcessPrivilege")
408#define SE_INC_BASE_PRIORITY_NAME TEXT("SeIncreaseBasePriorityPrivilege")
409#define SE_CREATE_PAGEFILE_NAME TEXT("SeCreatePagefilePrivilege")
410#define SE_CREATE_PERMANENT_NAME TEXT("SeCreatePermanentPrivilege")
411#define SE_BACKUP_NAME TEXT("SeBackupPrivilege")
412#define SE_RESTORE_NAME TEXT("SeRestorePrivilege")
413#define SE_SHUTDOWN_NAME TEXT("SeShutdownPrivilege")
414#define SE_DEBUG_NAME TEXT("SeDebugPrivilege")
415#define SE_AUDIT_NAME TEXT("SeAuditPrivilege")
416#define SE_SYSTEM_ENVIRONMENT_NAME TEXT("SeSystemEnvironmentPrivilege")
417#define SE_CHANGE_NOTIFY_NAME TEXT("SeChangeNotifyPrivilege")
418#define SE_REMOTE_SHUTDOWN_NAME TEXT("SeRemoteShutdownPrivilege")
419#define SE_UNDOCK_NAME TEXT("SeUndockPrivilege")
420#define SE_SYNC_AGENT_NAME TEXT("SeSyncAgentPrivilege")
421#define SE_ENABLE_DELEGATION_NAME TEXT("SeEnableDelegationPrivilege")
422#define SE_MANAGE_VOLUME_NAME TEXT("SeManageVolumePrivilege")
423#define SE_IMPERSONATE_NAME TEXT("SeImpersonatePrivilege")
424#define SE_CREATE_GLOBAL_NAME TEXT("SeCreateGlobalPrivilege")
425
426#define SE_GROUP_MANDATORY 0x00000001
427#define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002
428#define SE_GROUP_ENABLED 0x00000004
429#define SE_GROUP_OWNER 0x00000008
430#define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010
431#define SE_GROUP_INTEGRITY 0x00000020
432#define SE_GROUP_INTEGRITY_ENABLED 0x00000040
433#define SE_GROUP_LOGON_ID 0xC0000000
434#define SE_GROUP_RESOURCE 0x20000000
435#define SE_GROUP_VALID_ATTRIBUTES 0xE000007F
436
437/* FIXME: non-standard */
438#define LANG_ESPERANTO 0x8f
439#define LANG_WALON 0x90
440#define LANG_CORNISH 0x92
441
442/* FIXME: not present in the official headers */
443#define LANG_MALAGASY 0x8d
444#define LANG_GAELIC 0x94
445#define LANG_SAAMI 0x3b
446#define LANG_SUTU 0x30
447#define LANG_TSONGA 0x31
448#define LANG_VENDA 0x33
449#define LANG_MANX_GAELIC 0x94
450#define SUBLANG_PORTUGUESE_PORTUGAL 0x02
451
452#define PROCESSOR_INTEL_386 386
453#define PROCESSOR_INTEL_486 486
454#define PROCESSOR_INTEL_PENTIUM 586
455#define PROCESSOR_MIPS_R4000 4000
456#define PROCESSOR_ALPHA_21064 21064
457#define PROCESSOR_INTEL_IA64 2200
458#define PROCESSOR_PPC_601 601
459#define PROCESSOR_PPC_603 603
460#define PROCESSOR_PPC_604 604
461#define PROCESSOR_PPC_620 620
462#define PROCESSOR_INTEL_860 860
463#define PROCESSOR_AMD_X8664 8664
464#define PROCESSOR_MIPS_R2000 2000
465#define PROCESSOR_MIPS_R3000 3000
466#define PROCESSOR_HITACHI_SH3 10003
467#define PROCESSOR_HITACHI_SH3E 10004
468#define PROCESSOR_HITACHI_SH4 10005
469#define PROCESSOR_MOTOROLA_821 821
470#define PROCESSOR_SHx_SH3 103
471#define PROCESSOR_SHx_SH4 104
472#define PROCESSOR_STRONGARM 2577
473#define PROCESSOR_ARM720 1824
474#define PROCESSOR_ARM820 2080
475#define PROCESSOR_ARM920 2336
476#define PROCESSOR_ARM_7TDMI 70001
477#define PROCESSOR_ARCHITECTURE_INTEL 0
478#define PROCESSOR_ARCHITECTURE_MIPS 1
479#define PROCESSOR_ARCHITECTURE_ALPHA 2
480#define PROCESSOR_ARCHITECTURE_PPC 3
481#define PROCESSOR_ARCHITECTURE_SHX 4
482#define PROCESSOR_ARCHITECTURE_ARM 5
483#define PROCESSOR_ARCHITECTURE_IA64 6
484#define PROCESSOR_ARCHITECTURE_ALPHA64 7
485#define PROCESSOR_ARCHITECTURE_MSIL 8
486#define PROCESSOR_ARCHITECTURE_AMD64 9
487#define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
488
489/* also in ddk/ntifs.h */
490#define FILE_ACTION_ADDED 0x00000001
491#define FILE_ACTION_REMOVED 0x00000002
492#define FILE_ACTION_MODIFIED 0x00000003
493#define FILE_ACTION_RENAMED_OLD_NAME 0x00000004
494#define FILE_ACTION_RENAMED_NEW_NAME 0x00000005
495#define FILE_ACTION_ADDED_STREAM 0x00000006
496#define FILE_ACTION_REMOVED_STREAM 0x00000007
497#define FILE_ACTION_MODIFIED_STREAM 0x00000008
498#define FILE_ACTION_REMOVED_BY_DELETE 0x00000009
499#define FILE_ACTION_ID_NOT_TUNNELLED 0x0000000A
500#define FILE_ACTION_TUNNELLED_ID_COLLISION 0x0000000B
501/* end ntifs.h */
502#define HEAP_NO_SERIALIZE 1
503#define HEAP_GROWABLE 2
504#define HEAP_GENERATE_EXCEPTIONS 4
505#define HEAP_ZERO_MEMORY 8
506#define HEAP_REALLOC_IN_PLACE_ONLY 16
507#define HEAP_TAIL_CHECKING_ENABLED 32
508#define HEAP_FREE_CHECKING_ENABLED 64
509#define HEAP_DISABLE_COALESCE_ON_FREE 128
510#define HEAP_CREATE_ALIGN_16 0x10000
511#define HEAP_CREATE_ENABLE_TRACING 0x20000
512#define HEAP_CREATE_ENABLE_EXECUTE 0x00040000
513#define HEAP_MAXIMUM_TAG 0xFFF
514#define HEAP_PSEUDO_TAG_FLAG 0x8000
515#define HEAP_TAG_SHIFT 16
516#define HEAP_MAKE_TAG_FLAGS(b,o) ((DWORD)((b)+(o)<<16)))
517
518#define KEY_QUERY_VALUE 1
519#define KEY_SET_VALUE 2
520#define KEY_CREATE_SUB_KEY 4
521#define KEY_ENUMERATE_SUB_KEYS 8
522#define KEY_NOTIFY 16
523#define KEY_CREATE_LINK 32
524#define KEY_WOW64_64KEY 0x00000100
525#define KEY_WOW64_32KEY 0x00000200
526#define KEY_WOW64_RES 0x00000300
527
528#define KEY_WRITE 0x20006
529#define KEY_EXECUTE 0x20019
530#define KEY_READ 0x20019
531#define KEY_ALL_ACCESS 0xf003f
532#define REG_WHOLE_HIVE_VOLATILE 1
533#define REG_REFRESH_HIVE 2
534#define REG_NO_LAZY_FLUSH 4
535#define REG_FORCE_RESTORE 8
536#define REG_OPTION_RESERVED 0
537#define REG_OPTION_NON_VOLATILE 0
538#define REG_OPTION_VOLATILE 1
539#define REG_OPTION_CREATE_LINK 2
540#define REG_OPTION_BACKUP_RESTORE 4
541#define REG_OPTION_OPEN_LINK 8
542#define REG_LEGAL_OPTION 15
543#define MAXIMUM_PROCESSORS 32
544#define PAGE_NOACCESS 0x0001
545#define PAGE_READONLY 0x0002
546#define PAGE_READWRITE 0x0004
547#define PAGE_WRITECOPY 0x0008
548#define PAGE_EXECUTE 0x0010
549#define PAGE_EXECUTE_READ 0x0020
550#define PAGE_EXECUTE_READWRITE 0x0040
551#define PAGE_EXECUTE_WRITECOPY 0x0080
552#define PAGE_GUARD 0x0100
553#define PAGE_NOCACHE 0x0200
554#define PAGE_WRITECOMBINE 0x0400
555#define MEM_COMMIT 0x1000
556#define MEM_RESERVE 0x2000
557#define MEM_DECOMMIT 0x4000
558#define MEM_RELEASE 0x8000
559#define MEM_FREE 0x10000
560#define MEM_PRIVATE 0x20000
561#define MEM_MAPPED 0x40000
562#define MEM_RESET 0x80000
563#define MEM_TOP_DOWN 0x100000
564#define MEM_WRITE_WATCH 0x200000 /* 98/Me */
565#define MEM_PHYSICAL 0x400000
566#define MEM_4MB_PAGES 0x80000000
567#define MEM_IMAGE SEC_IMAGE
568#define SEC_NO_CHANGE 0x00400000
569#define SEC_FILE 0x00800000
570#define SEC_IMAGE 0x01000000
571#define SEC_VLM 0x02000000
572#define SEC_RESERVE 0x04000000
573#define SEC_COMMIT 0x08000000
574#define SEC_NOCACHE 0x10000000
575#define SEC_WRITECOMBINE 0x40000000
576#define SEC_LARGE_PAGES 0x80000000
577#define SEC_IMAGE_NO_EXECUTE (SEC_IMAGE | SEC_NOCACHE)
578#define SECTION_MAP_EXECUTE_EXPLICIT 0x0020
579#define SECTION_EXTEND_SIZE 16
580#define SECTION_MAP_READ 4
581#define SECTION_MAP_WRITE 2
582#define SECTION_QUERY 1
583#define SECTION_MAP_EXECUTE 8
584#define SECTION_ALL_ACCESS 0xf001f
585#define WRITE_WATCH_FLAG_RESET 0x01
586#define MESSAGE_RESOURCE_UNICODE 1
587#define RTL_CRITSECT_TYPE 0
588#define RTL_RESOURCE_TYPE 1
589
590#define AT_ROUND_TO_PAGE 0x40000000
591
592#define IMAGE_SIZEOF_FILE_HEADER 20
593#define IMAGE_FILE_RELOCS_STRIPPED 1
594#define IMAGE_FILE_EXECUTABLE_IMAGE 2
595#define IMAGE_FILE_LINE_NUMS_STRIPPED 4
596#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 8
597#define IMAGE_FILE_AGGRESIVE_WS_TRIM 16
598#define IMAGE_FILE_LARGE_ADDRESS_AWARE 32
599#define IMAGE_FILE_BYTES_REVERSED_LO 128
600#define IMAGE_FILE_32BIT_MACHINE 256
601#define IMAGE_FILE_DEBUG_STRIPPED 512
602#define IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP 1024
603#define IMAGE_FILE_NET_RUN_FROM_SWAP 2048
604#define IMAGE_FILE_SYSTEM 4096
605#define IMAGE_FILE_DLL 8192
606#define IMAGE_FILE_UP_SYSTEM_ONLY 16384
607#define IMAGE_FILE_BYTES_REVERSED_HI 32768
608#define IMAGE_FILE_MACHINE_UNKNOWN 0
609
610#define IMAGE_FILE_MACHINE_AM33 0x1d3
611#define IMAGE_FILE_MACHINE_AMD64 0x8664
612#define IMAGE_FILE_MACHINE_ARM 0x1c0
613#define IMAGE_FILE_MACHINE_ARMNT 0x1c4
614#define IMAGE_FILE_MACHINE_EBC 0xebc
615#define IMAGE_FILE_MACHINE_I386 0x14c
616#define IMAGE_FILE_MACHINE_IA64 0x200
617#define IMAGE_FILE_MACHINE_M32R 0x9041
618#define IMAGE_FILE_MACHINE_MIPS16 0x266
619#define IMAGE_FILE_MACHINE_MIPSFPU 0x366
620#define IMAGE_FILE_MACHINE_MIPSFPU16 0x466
621#define IMAGE_FILE_MACHINE_POWERPC 0x1f0
622#define IMAGE_FILE_MACHINE_POWERPCFP 0x1f1
623#define IMAGE_FILE_MACHINE_R4000 0x166
624#define IMAGE_FILE_MACHINE_SH3 0x1a2
625#define IMAGE_FILE_MACHINE_SH3E 0x01a4
626#define IMAGE_FILE_MACHINE_SH3DSP 0x1a3
627#define IMAGE_FILE_MACHINE_SH4 0x1a6
628#define IMAGE_FILE_MACHINE_SH5 0x1a8
629#define IMAGE_FILE_MACHINE_THUMB 0x1c2
630#define IMAGE_FILE_MACHINE_WCEMIPSV2 0x169
631#define IMAGE_FILE_MACHINE_R3000 0x162
632#define IMAGE_FILE_MACHINE_R10000 0x168
633#define IMAGE_FILE_MACHINE_ALPHA 0x184
634#define IMAGE_FILE_MACHINE_ALPHA64 0x0284
635#define IMAGE_FILE_MACHINE_AXP64 IMAGE_FILE_MACHINE_ALPHA64
636#define IMAGE_FILE_MACHINE_CEE 0xC0EE
637#define IMAGE_FILE_MACHINE_TRICORE 0x0520
638#define IMAGE_FILE_MACHINE_CEF 0x0CEF
639#define IMAGE_FILE_MACHINE_ARM64 0xAA64
640
641#define IMAGE_FILE_EXPORT_DIRECTORY 0
642#define IMAGE_FILE_IMPORT_DIRECTORY 1
643#define IMAGE_FILE_RESOURCE_DIRECTORY 2
644#define IMAGE_FILE_EXCEPTION_DIRECTORY 3
645#define IMAGE_FILE_SECURITY_DIRECTORY 4
646#define IMAGE_FILE_BASE_RELOCATION_TABLE 5
647#define IMAGE_FILE_DEBUG_DIRECTORY 6
648#define IMAGE_FILE_DESCRIPTION_STRING 7
649#define IMAGE_FILE_MACHINE_VALUE 8 /* Mips */
650#define IMAGE_FILE_THREAD_LOCAL_STORAGE 9
651#define IMAGE_FILE_CALLBACK_DIRECTORY 10
652
653#define IMAGE_DOS_SIGNATURE 0x5A4D
654#define IMAGE_OS2_SIGNATURE 0x454E
655#define IMAGE_OS2_SIGNATURE_LE 0x454C
656#define IMAGE_VXD_SIGNATURE 0x454C
657#define IMAGE_NT_SIGNATURE 0x00004550
658#define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b
659#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
660#ifdef _WIN64
661#define IMAGE_NT_OPTIONAL_HDR_MAGIC IMAGE_NT_OPTIONAL_HDR64_MAGIC
662#else
663#define IMAGE_NT_OPTIONAL_HDR_MAGIC IMAGE_NT_OPTIONAL_HDR32_MAGIC
664#endif
665#define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
666#define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944
667#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
668#define IMAGE_SIZEOF_ROM_OPTIONAL_HEADER 56
669#define IMAGE_SIZEOF_STD_OPTIONAL_HEADER 28
670#define IMAGE_SIZEOF_NT_OPTIONAL_HEADER 224
671#define IMAGE_SIZEOF_SHORT_NAME 8
672#define IMAGE_SIZEOF_SECTION_HEADER 40
673#define IMAGE_SIZEOF_SYMBOL 18
674#define IMAGE_SIZEOF_AUX_SYMBOL 18
675#define IMAGE_SIZEOF_RELOCATION 10
676#define IMAGE_SIZEOF_BASE_RELOCATION 8
677#define IMAGE_SIZEOF_LINENUMBER 6
678#define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
679#define SIZEOF_RFPO_DATA 16
680
681#define IMAGE_SUBSYSTEM_UNKNOWN 0
682#define IMAGE_SUBSYSTEM_NATIVE 1
683#define IMAGE_SUBSYSTEM_WINDOWS_GUI 2
684#define IMAGE_SUBSYSTEM_WINDOWS_CUI 3
685#define IMAGE_SUBSYSTEM_OS2_CUI 5
686#define IMAGE_SUBSYSTEM_POSIX_CUI 7
687#define IMAGE_SUBSYSTEM_NATIVE_WINDOWS 8
688#define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9
689#define IMAGE_SUBSYSTEM_EFI_APPLICATION 10
690#define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
691#define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
692#define IMAGE_SUBSYSTEM_EFI_ROM 13
693#define IMAGE_SUBSYSTEM_XBOX 14
694
695#define IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE 0x0040
696#define IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY 0x0080
697#define IMAGE_DLLCHARACTERISTICS_NX_COMPAT 0x0100
698#define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION 0x0200
699#define IMAGE_DLLCHARACTERISTICS_NO_SEH 0x0400
700#define IMAGE_DLLCHARACTERISTICS_NO_BIND 0x0800
701#define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000
702#define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000
703#define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((ULONG_PTR)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEADERS)(h))->FileHeader.SizeOfOptionalHeader))
704#define IMAGE_DIRECTORY_ENTRY_EXPORT 0
705#define IMAGE_DIRECTORY_ENTRY_IMPORT 1
706#define IMAGE_DIRECTORY_ENTRY_RESOURCE 2
707#define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3
708#define IMAGE_DIRECTORY_ENTRY_SECURITY 4
709#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5
710#define IMAGE_DIRECTORY_ENTRY_DEBUG 6
711#define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7
712#define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8
713#define IMAGE_DIRECTORY_ENTRY_TLS 9
714#define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10
715#define IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT 11
716#define IMAGE_DIRECTORY_ENTRY_IAT 12
717#define IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT 13
718#define IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR 14
719#define IMAGE_SCN_TYPE_REG 0
720#define IMAGE_SCN_TYPE_DSECT 1
721//#define IMAGE_SCN_TYPE_NOLOAD 2
722#define IMAGE_SCN_TYPE_GROUP 4
723#define IMAGE_SCN_TYPE_NO_PAD 8
724#define IMAGE_SCN_CNT_CODE 32
725#define IMAGE_SCN_CNT_INITIALIZED_DATA 64
726#define IMAGE_SCN_CNT_UNINITIALIZED_DATA 128
727#define IMAGE_SCN_LNK_OTHER 256
728#define IMAGE_SCN_LNK_INFO 512
729#define IMAGE_SCN_LNK_REMOVE 2048
730#define IMAGE_SCN_LNK_COMDAT 4096
731#define IMAGE_SCN_MEM_FARDATA 0x8000
732#define IMAGE_SCN_MEM_PURGEABLE 0x20000
733#define IMAGE_SCN_MEM_16BIT 0x20000
734#define IMAGE_SCN_MEM_LOCKED 0x40000
735#define IMAGE_SCN_MEM_PRELOAD 0x80000
736#define IMAGE_SCN_ALIGN_1BYTES 0x100000
737#define IMAGE_SCN_ALIGN_2BYTES 0x200000
738#define IMAGE_SCN_ALIGN_4BYTES 0x300000
739#define IMAGE_SCN_ALIGN_8BYTES 0x400000
740#define IMAGE_SCN_ALIGN_16BYTES 0x500000
741#define IMAGE_SCN_ALIGN_32BYTES 0x600000
742#define IMAGE_SCN_ALIGN_64BYTES 0x700000
743#define IMAGE_SCN_LNK_NRELOC_OVFL 0x1000000
744#define IMAGE_SCN_MEM_DISCARDABLE 0x2000000
745#define IMAGE_SCN_MEM_NOT_CACHED 0x4000000
746#define IMAGE_SCN_MEM_NOT_PAGED 0x8000000
747#define IMAGE_SCN_MEM_SHARED 0x10000000
748#define IMAGE_SCN_MEM_EXECUTE 0x20000000
749#define IMAGE_SCN_MEM_READ 0x40000000
750#define IMAGE_SCN_MEM_WRITE 0x80000000
751#define IMAGE_SYM_UNDEFINED 0
752#define IMAGE_SYM_ABSOLUTE (-1)
753#define IMAGE_SYM_DEBUG (-2)
754#define IMAGE_SYM_TYPE_NULL 0
755#define IMAGE_SYM_TYPE_VOID 1
756#define IMAGE_SYM_TYPE_CHAR 2
757#define IMAGE_SYM_TYPE_SHORT 3
758#define IMAGE_SYM_TYPE_INT 4
759#define IMAGE_SYM_TYPE_LONG 5
760#define IMAGE_SYM_TYPE_FLOAT 6
761#define IMAGE_SYM_TYPE_DOUBLE 7
762#define IMAGE_SYM_TYPE_STRUCT 8
763#define IMAGE_SYM_TYPE_UNION 9
764#define IMAGE_SYM_TYPE_ENUM 10
765#define IMAGE_SYM_TYPE_MOE 11
766#define IMAGE_SYM_TYPE_BYTE 12
767#define IMAGE_SYM_TYPE_WORD 13
768#define IMAGE_SYM_TYPE_UINT 14
769#define IMAGE_SYM_TYPE_DWORD 15
770#define IMAGE_SYM_TYPE_PCODE 32768
771#define IMAGE_SYM_DTYPE_NULL 0
772#define IMAGE_SYM_DTYPE_POINTER 1
773#define IMAGE_SYM_DTYPE_FUNCTION 2
774#define IMAGE_SYM_DTYPE_ARRAY 3
775#define IMAGE_SYM_CLASS_END_OF_FUNCTION (-1)
776#define IMAGE_SYM_CLASS_NULL 0
777#define IMAGE_SYM_CLASS_AUTOMATIC 1
778#define IMAGE_SYM_CLASS_EXTERNAL 2
779#define IMAGE_SYM_CLASS_STATIC 3
780#define IMAGE_SYM_CLASS_REGISTER 4
781#define IMAGE_SYM_CLASS_EXTERNAL_DEF 5
782#define IMAGE_SYM_CLASS_LABEL 6
783#define IMAGE_SYM_CLASS_UNDEFINED_LABEL 7
784#define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 8
785#define IMAGE_SYM_CLASS_ARGUMENT 9
786#define IMAGE_SYM_CLASS_STRUCT_TAG 10
787#define IMAGE_SYM_CLASS_MEMBER_OF_UNION 11
788#define IMAGE_SYM_CLASS_UNION_TAG 12
789#define IMAGE_SYM_CLASS_TYPE_DEFINITION 13
790#define IMAGE_SYM_CLASS_UNDEFINED_STATIC 14
791#define IMAGE_SYM_CLASS_ENUM_TAG 15
792#define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 16
793#define IMAGE_SYM_CLASS_REGISTER_PARAM 17
794#define IMAGE_SYM_CLASS_BIT_FIELD 18
795#define IMAGE_SYM_CLASS_FAR_EXTERNAL 68
796#define IMAGE_SYM_CLASS_BLOCK 100
797#define IMAGE_SYM_CLASS_FUNCTION 101
798#define IMAGE_SYM_CLASS_END_OF_STRUCT 102
799#define IMAGE_SYM_CLASS_FILE 103
800#define IMAGE_SYM_CLASS_SECTION 104
801#define IMAGE_SYM_CLASS_WEAK_EXTERNAL 105
802#define IMAGE_COMDAT_SELECT_NODUPLICATES 1
803#define IMAGE_COMDAT_SELECT_ANY 2
804#define IMAGE_COMDAT_SELECT_SAME_SIZE 3
805#define IMAGE_COMDAT_SELECT_EXACT_MATCH 4
806#define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
807#define IMAGE_COMDAT_SELECT_LARGEST 6
808#define IMAGE_COMDAT_SELECT_NEWEST 7
809#define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
810#define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
811#define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
812#define IMAGE_REL_I386_ABSOLUTE 0
813#define IMAGE_REL_I386_DIR16 1
814#define IMAGE_REL_I386_REL16 2
815#define IMAGE_REL_I386_DIR32 6
816#define IMAGE_REL_I386_DIR32NB 7
817#define IMAGE_REL_I386_SEG12 9
818#define IMAGE_REL_I386_SECTION 10
819#define IMAGE_REL_I386_SECREL 11
820#define IMAGE_REL_I386_REL32 20
821#define IMAGE_REL_MIPS_ABSOLUTE 0
822#define IMAGE_REL_MIPS_REFHALF 1
823#define IMAGE_REL_MIPS_REFWORD 2
824#define IMAGE_REL_MIPS_JMPADDR 3
825#define IMAGE_REL_MIPS_REFHI 4
826#define IMAGE_REL_MIPS_REFLO 5
827#define IMAGE_REL_MIPS_GPREL 6
828#define IMAGE_REL_MIPS_LITERAL 7
829#define IMAGE_REL_MIPS_SECTION 10
830#define IMAGE_REL_MIPS_SECREL 11
831#define IMAGE_REL_MIPS_SECRELLO 12
832#define IMAGE_REL_MIPS_SECRELHI 13
833#define IMAGE_REL_MIPS_REFWORDNB 34
834#define IMAGE_REL_MIPS_PAIR 35
835#define IMAGE_REL_ALPHA_ABSOLUTE 0
836#define IMAGE_REL_ALPHA_REFLONG 1
837#define IMAGE_REL_ALPHA_REFQUAD 2
838#define IMAGE_REL_ALPHA_GPREL32 3
839#define IMAGE_REL_ALPHA_LITERAL 4
840#define IMAGE_REL_ALPHA_LITUSE 5
841#define IMAGE_REL_ALPHA_GPDISP 6
842#define IMAGE_REL_ALPHA_BRADDR 7
843#define IMAGE_REL_ALPHA_HINT 8
844#define IMAGE_REL_ALPHA_INLINE_REFLONG 9
845#define IMAGE_REL_ALPHA_REFHI 10
846#define IMAGE_REL_ALPHA_REFLO 11
847#define IMAGE_REL_ALPHA_PAIR 12
848#define IMAGE_REL_ALPHA_MATCH 13
849#define IMAGE_REL_ALPHA_SECTION 14
850#define IMAGE_REL_ALPHA_SECREL 15
851#define IMAGE_REL_ALPHA_REFLONGNB 16
852#define IMAGE_REL_ALPHA_SECRELLO 17
853#define IMAGE_REL_ALPHA_SECRELHI 18
854#define IMAGE_REL_PPC_ABSOLUTE 0
855#define IMAGE_REL_PPC_ADDR64 1
856#define IMAGE_REL_PPC_ADDR32 2
857#define IMAGE_REL_PPC_ADDR24 3
858#define IMAGE_REL_PPC_ADDR16 4
859#define IMAGE_REL_PPC_ADDR14 5
860#define IMAGE_REL_PPC_REL24 6
861#define IMAGE_REL_PPC_REL14 7
862#define IMAGE_REL_PPC_TOCREL16 8
863#define IMAGE_REL_PPC_TOCREL14 9
864#define IMAGE_REL_PPC_ADDR32NB 10
865#define IMAGE_REL_PPC_SECREL 11
866#define IMAGE_REL_PPC_SECTION 12
867#define IMAGE_REL_PPC_IFGLUE 13
868#define IMAGE_REL_PPC_IMGLUE 14
869#define IMAGE_REL_PPC_SECREL16 15
870#define IMAGE_REL_PPC_REFHI 16
871#define IMAGE_REL_PPC_REFLO 17
872#define IMAGE_REL_PPC_PAIR 18
873#define IMAGE_REL_PPC_TYPEMASK 255
874#define IMAGE_REL_PPC_NEG 256
875#define IMAGE_REL_PPC_BRTAKEN 512
876#define IMAGE_REL_PPC_BRNTAKEN 1024
877#define IMAGE_REL_PPC_TOCDEFN 2048
878#define IMAGE_REL_BASED_ABSOLUTE 0
879#define IMAGE_REL_BASED_HIGH 1
880#define IMAGE_REL_BASED_LOW 2
881#define IMAGE_REL_BASED_HIGHLOW 3
882#define IMAGE_REL_BASED_HIGHADJ 4
883#define IMAGE_REL_BASED_MIPS_JMPADDR 5
884#define IMAGE_REL_BASED_MIPS_JMPADDR16 9
885#define IMAGE_REL_BASED_IA64_IMM64 9
886#define IMAGE_REL_BASED_DIR64 10
887#define IMAGE_ARCHIVE_START_SIZE 8
888#define IMAGE_ARCHIVE_START "!<arch>\n"
889#define IMAGE_ARCHIVE_END "`\n"
890#define IMAGE_ARCHIVE_PAD "\n"
891#define IMAGE_ARCHIVE_LINKER_MEMBER "/ "
892#define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
893#define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000
894#define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000
895#define IMAGE_DEBUG_TYPE_UNKNOWN 0
896#define IMAGE_DEBUG_TYPE_COFF 1
897#define IMAGE_DEBUG_TYPE_CODEVIEW 2
898#define IMAGE_DEBUG_TYPE_FPO 3
899#define IMAGE_DEBUG_TYPE_MISC 4
900#define IMAGE_DEBUG_TYPE_EXCEPTION 5
901#define IMAGE_DEBUG_TYPE_FIXUP 6
902#define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7
903#define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8
904#define FRAME_FPO 0
905#define FRAME_TRAP 1
906#define FRAME_TSS 2
907#define FRAME_NONFPO 3
908#define IMAGE_DEBUG_MISC_EXENAME 1
909#define N_BTMASK 0x000F
910#define N_TMASK 0x0030
911#define N_TMASK1 0x00C0
912#define N_TMASK2 0x00F0
913#define N_BTSHFT 4
914#define N_TSHIFT 2
915#define IS_TEXT_UNICODE_ASCII16 1
916#define IS_TEXT_UNICODE_REVERSE_ASCII16 16
917#define IS_TEXT_UNICODE_STATISTICS 2
918#define IS_TEXT_UNICODE_REVERSE_STATISTICS 32
919#define IS_TEXT_UNICODE_CONTROLS 4
920#define IS_TEXT_UNICODE_REVERSE_CONTROLS 64
921#define IS_TEXT_UNICODE_SIGNATURE 8
922#define IS_TEXT_UNICODE_REVERSE_SIGNATURE 128
923#define IS_TEXT_UNICODE_ILLEGAL_CHARS 256
924#define IS_TEXT_UNICODE_ODD_LENGTH 512
925#define IS_TEXT_UNICODE_DBCS_LEADBYTE 1024
926#define IS_TEXT_UNICODE_NULL_BYTES 4096
927#define IS_TEXT_UNICODE_UNICODE_MASK 15
928#define IS_TEXT_UNICODE_REVERSE_MASK 240
929#define IS_TEXT_UNICODE_NOT_UNICODE_MASK 3840
930#define IS_TEXT_UNICODE_NOT_ASCII_MASK 61440
931#define SERVICE_KERNEL_DRIVER 1
932#define SERVICE_FILE_SYSTEM_DRIVER 2
933#define SERVICE_ADAPTER 4
934#define SERVICE_RECOGNIZER_DRIVER 8
935#define SERVICE_DRIVER (SERVICE_KERNEL_DRIVER|SERVICE_FILE_SYSTEM_DRIVER|SERVICE_RECOGNIZER_DRIVER)
936#define SERVICE_WIN32_OWN_PROCESS 16
937#define SERVICE_WIN32_SHARE_PROCESS 32
938#define SERVICE_WIN32 (SERVICE_WIN32_OWN_PROCESS|SERVICE_WIN32_SHARE_PROCESS)
939#define SERVICE_INTERACTIVE_PROCESS 256
940#define SERVICE_TYPE_ALL (SERVICE_WIN32|SERVICE_ADAPTER|SERVICE_DRIVER|SERVICE_INTERACTIVE_PROCESS)
941#define SERVICE_BOOT_START 0
942#define SERVICE_SYSTEM_START 1
943#define SERVICE_AUTO_START 2
944#define SERVICE_DEMAND_START 3
945#define SERVICE_DISABLED 4
946#define SERVICE_ERROR_IGNORE 0
947#define SERVICE_ERROR_NORMAL 1
948#define SERVICE_ERROR_SEVERE 2
949#define SERVICE_ERROR_CRITICAL 3
950
951#define DLL_PROCESS_DETACH 0
952#define DLL_PROCESS_ATTACH 1
953#define DLL_THREAD_ATTACH 2
954#define DLL_THREAD_DETACH 3
955#ifdef __WINESRC__
956#define DLL_WINE_PREATTACH 8 /* Never called, but defined for compatibility with Wine source */
957#endif
958#define TAPE_ABSOLUTE_POSITION 0
959#define TAPE_LOGICAL_POSITION 1
960#define TAPE_PSEUDO_LOGICAL_POSITION 2
961#define TAPE_REWIND 0
962#define TAPE_ABSOLUTE_BLOCK 1
963#define TAPE_LOGICAL_BLOCK 2
964#define TAPE_PSEUDO_LOGICAL_BLOCK 3
965#define TAPE_SPACE_END_OF_DATA 4
966#define TAPE_SPACE_RELATIVE_BLOCKS 5
967#define TAPE_SPACE_FILEMARKS 6
968#define TAPE_SPACE_SEQUENTIAL_FMKS 7
969#define TAPE_SPACE_SETMARKS 8
970#define TAPE_SPACE_SEQUENTIAL_SMKS 9
971#define TAPE_DRIVE_FIXED 1
972#define TAPE_DRIVE_SELECT 2
973#define TAPE_DRIVE_INITIATOR 4
974#define TAPE_DRIVE_ERASE_SHORT 16
975#define TAPE_DRIVE_ERASE_LONG 32
976#define TAPE_DRIVE_ERASE_BOP_ONLY 64
977#define TAPE_DRIVE_ERASE_IMMEDIATE 128
978#define TAPE_DRIVE_TAPE_CAPACITY 256
979#define TAPE_DRIVE_TAPE_REMAINING 512
980#define TAPE_DRIVE_FIXED_BLOCK 1024
981#define TAPE_DRIVE_VARIABLE_BLOCK 2048
982#define TAPE_DRIVE_WRITE_PROTECT 4096
983#define TAPE_DRIVE_EOT_WZ_SIZE 8192
984#define TAPE_DRIVE_ECC 0x10000
985#define TAPE_DRIVE_COMPRESSION 0x20000
986#define TAPE_DRIVE_PADDING 0x40000
987#define TAPE_DRIVE_REPORT_SMKS 0x80000
988#define TAPE_DRIVE_GET_ABSOLUTE_BLK 0x100000
989#define TAPE_DRIVE_GET_LOGICAL_BLK 0x200000
990#define TAPE_DRIVE_SET_EOT_WZ_SIZE 0x400000
991#define TAPE_DRIVE_EJECT_MEDIA 0x1000000
992#define TAPE_DRIVE_CLEAN_REQUESTS 0x2000000
993#define TAPE_DRIVE_SET_CMP_BOP_ONLY 0x4000000
994#define TAPE_DRIVE_RESERVED_BIT 0x80000000
995#define TAPE_DRIVE_LOAD_UNLOAD 0x80000001
996#define TAPE_DRIVE_TENSION 0x80000002
997#define TAPE_DRIVE_LOCK_UNLOCK 0x80000004
998#define TAPE_DRIVE_REWIND_IMMEDIATE 0x80000008
999#define TAPE_DRIVE_SET_BLOCK_SIZE 0x80000010
1000#define TAPE_DRIVE_LOAD_UNLD_IMMED 0x80000020
1001#define TAPE_DRIVE_TENSION_IMMED 0x80000040
1002#define TAPE_DRIVE_LOCK_UNLK_IMMED 0x80000080
1003#define TAPE_DRIVE_SET_ECC 0x80000100
1004#define TAPE_DRIVE_SET_COMPRESSION 0x80000200
1005#define TAPE_DRIVE_SET_PADDING 0x80000400
1006#define TAPE_DRIVE_SET_REPORT_SMKS 0x80000800
1007#define TAPE_DRIVE_ABSOLUTE_BLK 0x80001000
1008#define TAPE_DRIVE_ABS_BLK_IMMED 0x80002000
1009#define TAPE_DRIVE_LOGICAL_BLK 0x80004000
1010#define TAPE_DRIVE_LOG_BLK_IMMED 0x80008000
1011#define TAPE_DRIVE_END_OF_DATA 0x80010000
1012#define TAPE_DRIVE_RELATIVE_BLKS 0x80020000
1013#define TAPE_DRIVE_FILEMARKS 0x80040000
1014#define TAPE_DRIVE_SEQUENTIAL_FMKS 0x80080000
1015#define TAPE_DRIVE_SETMARKS 0x80100000
1016#define TAPE_DRIVE_SEQUENTIAL_SMKS 0x80200000
1017#define TAPE_DRIVE_REVERSE_POSITION 0x80400000
1018#define TAPE_DRIVE_SPACE_IMMEDIATE 0x80800000
1019#define TAPE_DRIVE_WRITE_SETMARKS 0x81000000
1020#define TAPE_DRIVE_WRITE_FILEMARKS 0x82000000
1021#define TAPE_DRIVE_WRITE_SHORT_FMKS 0x84000000
1022#define TAPE_DRIVE_WRITE_LONG_FMKS 0x88000000
1023#define TAPE_DRIVE_WRITE_MARK_IMMED 0x90000000
1024#define TAPE_DRIVE_FORMAT 0xA0000000
1025#define TAPE_DRIVE_FORMAT_IMMEDIATE 0xC0000000
1026#define TAPE_DRIVE_HIGH_FEATURES 0x80000000
1027#define TAPE_FIXED_PARTITIONS 0
1028#define TAPE_INITIATOR_PARTITIONS 2
1029#define TAPE_SELECT_PARTITIONS 1
1030#define TAPE_FILEMARKS 1
1031#define TAPE_LONG_FILEMARKS 3
1032#define TAPE_SETMARKS 0
1033#define TAPE_SHORT_FILEMARKS 2
1034#define TAPE_ERASE_LONG 1
1035#define TAPE_ERASE_SHORT 0
1036#define TAPE_LOAD 0
1037#define TAPE_UNLOAD 1
1038#define TAPE_TENSION 2
1039#define TAPE_LOCK 3
1040#define TAPE_UNLOCK 4
1041#define TAPE_FORMAT 5
1042#if (_WIN32_WINNT >= 0x0500)
1043#define VER_MINORVERSION 0x0000001
1044#define VER_MAJORVERSION 0x0000002
1045#define VER_BUILDNUMBER 0x0000004
1046#define VER_PLATFORMID 0x0000008
1047#define VER_SERVICEPACKMINOR 0x0000010
1048#define VER_SERVICEPACKMAJOR 0x0000020
1049#define VER_SUITENAME 0x0000040
1050#define VER_PRODUCT_TYPE 0x0000080
1051#define VER_EQUAL 1
1052#define VER_GREATER 2
1053#define VER_GREATER_EQUAL 3
1054#define VER_LESS 4
1055#define VER_LESS_EQUAL 5
1056#define VER_AND 6
1057#define VER_OR 7
1058#endif
1059
1060#define VER_PLATFORM_WIN32s 0
1061#define VER_PLATFORM_WIN32_WINDOWS 1
1062#define VER_PLATFORM_WIN32_NT 2
1063#define VER_NT_WORKSTATION 1
1064#define VER_NT_DOMAIN_CONTROLLER 2
1065#define VER_NT_SERVER 3
1066
1067#define WT_EXECUTEDEFAULT 0x00000000
1068#define WT_EXECUTEINIOTHREAD 0x00000001
1069#define WT_EXECUTEINUITHREAD 0x00000002
1070#define WT_EXECUTEINWAITTHREAD 0x00000004
1071#define WT_EXECUTEONLYONCE 0x00000008
1072#define WT_EXECUTELONGFUNCTION 0x00000010
1073#define WT_EXECUTEINTIMERTHREAD 0x00000020
1074#define WT_EXECUTEINPERSISTENTIOTHREAD 0x00000040
1075#define WT_EXECUTEINPERSISTENTTHREAD 0x00000080
1076#define WT_TRANSFER_IMPERSONATION 0x00000100
1077#define WT_SET_MAX_THREADPOOL_THREADS(flags,limit) ((flags)|=(limit)<<16)
1079#if (_WIN32_WINNT >= 0x0501)
1080#define ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION 1
1081#define ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION 2
1082#define ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION 3
1083#define ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION 4
1084#define ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION 5
1085#define ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION 6
1086#define ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION 7
1087#define ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES 9
1088#define ACTIVATION_CONTEXT_SECTION_APPLICATION_SETTINGS 10
1089#define ACTIVATION_CONTEXT_SECTION_COMPATIBILITY_INFO 11
1090#endif /* (_WIN32_WINNT >= 0x0501) */
1091#define BTYPE(x) ((x)&N_BTMASK)
1092#define ISPTR(x) (((x)&N_TMASK)==(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT))
1093#define ISFCN(x) (((x)&N_TMASK)==(IMAGE_SYM_DTYPE_FUNCTION<<N_BTSHFT))
1094#define ISARY(x) (((x)&N_TMASK)==(IMAGE_SYM_DTYPE_ARRAY<<N_BTSHFT))
1095#define ISTAG(x) ((x)==IMAGE_SYM_CLASS_STRUCT_TAG||(x)==IMAGE_SYM_CLASS_UNION_TAG||(x)==IMAGE_SYM_CLASS_ENUM_TAG)
1096#define INCREF(x) ((((x)&~N_BTMASK)<<N_TSHIFT)|(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT)|((x)&N_BTMASK))
1097#define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
1098#define TLS_MINIMUM_AVAILABLE 64
1099#define FLS_MAXIMUM_AVAILABLE 128
1100#define REPARSE_GUID_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(REPARSE_GUID_DATA_BUFFER, GenericReparseBuffer)
1101#define MAXIMUM_REPARSE_DATA_BUFFER_SIZE 16384
1102#define IO_REPARSE_TAG_RESERVED_ZERO 0
1103#define IO_REPARSE_TAG_RESERVED_ONE 1
1104#define IO_REPARSE_TAG_RESERVED_RANGE IO_REPARSE_TAG_RESERVED_ONE
1105#define IsReparseTagMicrosoft(x) ((x)&0x80000000)
1106#define IsReparseTagHighLatency(x) ((x)&0x40000000)
1107#define IsReparseTagNameSurrogate(x) ((x)&0x20000000)
1108#define IO_REPARSE_TAG_VALID_VALUES 0xE000FFFF
1109#define IsReparseTagValid(x) (!((x)&~IO_REPARSE_TAG_VALID_VALUES)&&((x)>IO_REPARSE_TAG_RESERVED_RANGE))
1110#define IO_REPARSE_TAG_SYMBOLIC_LINK IO_REPARSE_TAG_RESERVED_ZERO
1111#define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003
1112#define IO_REPARSE_TAG_SYMLINK 0xA000000CL
1113
1114#define RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO 0x01000000
1115#define RTL_CRITICAL_SECTION_FLAG_DYNAMIC_SPIN 0x02000000
1116#define RTL_CRITICAL_SECTION_FLAG_STATIC_INIT 0x04000000
1117#define RTL_CRITICAL_SECTION_FLAG_RESOURCE_TYPE 0x08000000
1118#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO 0x10000000
1119#define RTL_CRITICAL_SECTION_ALL_FLAG_BITS 0xFF000000
1120#define RTL_CRITICAL_SECTION_FLAG_RESERVED \
1121 (RTL_CRITICAL_SECTION_ALL_FLAG_BITS & \
1122 (~(RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO | \
1123 RTL_CRITICAL_SECTION_FLAG_DYNAMIC_SPIN | \
1124 RTL_CRITICAL_SECTION_FLAG_STATIC_INIT | \
1125 RTL_CRITICAL_SECTION_FLAG_RESOURCE_TYPE | \
1126 RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO)))
1127
1128#ifndef RC_INVOKED
1129
1130#ifdef _GUID_DEFINED
1131# warning _GUID_DEFINED is deprecated, use GUID_DEFINED instead
1132#endif
1133
1134#if ! (defined _GUID_DEFINED || defined GUID_DEFINED) /* also defined in basetyps.h */
1135#define GUID_DEFINED
1136typedef struct _GUID {
1137 unsigned long Data1;
1138 unsigned short Data2;
1139 unsigned short Data3;
1140 unsigned char Data4[8];
1142#endif /* GUID_DEFINED */
1143
1148
1152
1158
1159#ifndef _LDT_ENTRY_DEFINED
1160#define _LDT_ENTRY_DEFINED
1161
1162typedef struct _LDT_ENTRY {
1163 WORD LimitLow;
1164 WORD BaseLow;
1165 union {
1166 struct {
1167 BYTE BaseMid;
1168 BYTE Flags1;
1169 BYTE Flags2;
1170 BYTE BaseHi;
1172 struct {
1173 DWORD BaseMid:8;
1174 DWORD Type:5;
1175 DWORD Dpl:2;
1176 DWORD Pres:1;
1177 DWORD LimitHi:4;
1178 DWORD Sys:1;
1179 DWORD Reserved_0:1;
1182 DWORD BaseHi:8;
1186
1187#endif /* _LDT_ENTRY_DEFINED */
1188
1189/* FIXME: add more machines */
1190#if defined(_X86_)
1191#define SIZE_OF_80387_REGISTERS 80
1192#define CONTEXT_i386 0x10000
1193#define CONTEXT_i486 0x10000
1194#define CONTEXT_CONTROL (CONTEXT_i386|0x00000001L)
1195#define CONTEXT_INTEGER (CONTEXT_i386|0x00000002L)
1196#define CONTEXT_SEGMENTS (CONTEXT_i386|0x00000004L)
1197#define CONTEXT_FLOATING_POINT (CONTEXT_i386|0x00000008L)
1198#define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386|0x00000010L)
1199#define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386|0x00000020L)
1200#define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_SEGMENTS)
1201#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | \
1202 CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS | \
1203 CONTEXT_EXTENDED_REGISTERS)
1204#define MAXIMUM_SUPPORTED_EXTENSION 512
1205
1206#define EXCEPTION_READ_FAULT 0
1207#define EXCEPTION_WRITE_FAULT 1
1208#define EXCEPTION_EXECUTE_FAULT 8
1209
1210typedef struct _FLOATING_SAVE_AREA {
1213 DWORD TagWord;
1221
1222typedef struct _CONTEXT {
1224 DWORD Dr0;
1225 DWORD Dr1;
1226 DWORD Dr2;
1227 DWORD Dr3;
1228 DWORD Dr6;
1229 DWORD Dr7;
1231 DWORD SegGs;
1232 DWORD SegFs;
1233 DWORD SegEs;
1234 DWORD SegDs;
1235 DWORD Edi;
1236 DWORD Esi;
1237 DWORD Ebx;
1238 DWORD Edx;
1239 DWORD Ecx;
1240 DWORD Eax;
1241 DWORD Ebp;
1242 DWORD Eip;
1243 DWORD SegCs;
1244 DWORD EFlags;
1245 DWORD Esp;
1246 DWORD SegSs;
1248} CONTEXT;
1249#elif defined(_AMD64_)
1250
1251#define CONTEXT_AMD64 0x100000
1252
1253#if !defined(RC_INVOKED)
1254#define CONTEXT_CONTROL (CONTEXT_AMD64 | 0x1L)
1255#define CONTEXT_INTEGER (CONTEXT_AMD64 | 0x2L)
1256#define CONTEXT_SEGMENTS (CONTEXT_AMD64 | 0x4L)
1257#define CONTEXT_FLOATING_POINT (CONTEXT_AMD64 | 0x8L)
1258#define CONTEXT_DEBUG_REGISTERS (CONTEXT_AMD64 | 0x10L)
1259
1260#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)
1261#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS)
1262
1263#define CONTEXT_EXCEPTION_ACTIVE 0x8000000
1264#define CONTEXT_SERVICE_ACTIVE 0x10000000
1265#define CONTEXT_EXCEPTION_REQUEST 0x40000000
1266#define CONTEXT_EXCEPTION_REPORTING 0x80000000
1267#endif
1268
1269#define INITIAL_MXCSR 0x1f80
1270#define INITIAL_FPCSR 0x027f
1271#define EXCEPTION_READ_FAULT 0
1272#define EXCEPTION_WRITE_FAULT 1
1273#define EXCEPTION_EXECUTE_FAULT 8
1274
1275typedef struct DECLSPEC_ALIGN(16) _M128A {
1276 ULONGLONG Low;
1277 LONGLONG High;
1278} M128A, *PM128A;
1279
1280typedef struct _XMM_SAVE_AREA32 {
1281 WORD ControlWord;
1282 WORD StatusWord;
1283 BYTE TagWord;
1285 WORD ErrorOpcode;
1286 DWORD ErrorOffset;
1287 WORD ErrorSelector;
1289 DWORD DataOffset;
1290 WORD DataSelector;
1292 DWORD MxCsr;
1293 DWORD MxCsr_Mask;
1294 M128A FloatRegisters[8];
1295 M128A XmmRegisters[16];
1296 BYTE Reserved4[96];
1298
1299typedef struct DECLSPEC_ALIGN(16) _CONTEXT {
1300 DWORD64 P1Home;
1301 DWORD64 P2Home;
1302 DWORD64 P3Home;
1303 DWORD64 P4Home;
1304 DWORD64 P5Home;
1305 DWORD64 P6Home;
1306
1307 /* Control flags */
1308 DWORD ContextFlags;
1309 DWORD MxCsr;
1310
1311 /* Segment */
1312 WORD SegCs;
1313 WORD SegDs;
1314 WORD SegEs;
1315 WORD SegFs;
1316 WORD SegGs;
1317 WORD SegSs;
1318 DWORD EFlags;
1319
1320 /* Debug */
1321 DWORD64 Dr0;
1322 DWORD64 Dr1;
1323 DWORD64 Dr2;
1324 DWORD64 Dr3;
1325 DWORD64 Dr6;
1326 DWORD64 Dr7;
1327
1328 /* Integer */
1329 DWORD64 Rax;
1330 DWORD64 Rcx;
1331 DWORD64 Rdx;
1332 DWORD64 Rbx;
1333 DWORD64 Rsp;
1334 DWORD64 Rbp;
1335 DWORD64 Rsi;
1336 DWORD64 Rdi;
1337 DWORD64 R8;
1338 DWORD64 R9;
1339 DWORD64 R10;
1340 DWORD64 R11;
1341 DWORD64 R12;
1342 DWORD64 R13;
1343 DWORD64 R14;
1344 DWORD64 R15;
1345
1346 /* Counter */
1347 DWORD64 Rip;
1348
1349 /* Floating point */
1350 union {
1351 XMM_SAVE_AREA32 FltSave;
1352 struct {
1353 M128A Header[2];
1354 M128A Legacy[8];
1355 M128A Xmm0;
1356 M128A Xmm1;
1357 M128A Xmm2;
1358 M128A Xmm3;
1359 M128A Xmm4;
1360 M128A Xmm5;
1361 M128A Xmm6;
1362 M128A Xmm7;
1363 M128A Xmm8;
1364 M128A Xmm9;
1365 M128A Xmm10;
1366 M128A Xmm11;
1367 M128A Xmm12;
1368 M128A Xmm13;
1369 M128A Xmm14;
1370 M128A Xmm15;
1373
1374 /* Vector */
1375 M128A VectorRegister[26];
1376 DWORD64 VectorControl;
1377
1378 /* Debug control */
1379 DWORD64 DebugControl;
1380 DWORD64 LastBranchToRip;
1381 DWORD64 LastBranchFromRip;
1382 DWORD64 LastExceptionToRip;
1383 DWORD64 LastExceptionFromRip;
1384} CONTEXT;
1385
1386
1387typedef struct _KNONVOLATILE_CONTEXT_POINTERS {
1388 union {
1389 PM128A FloatingContext[16];
1390 struct {
1391 PM128A Xmm0;
1392 PM128A Xmm1;
1393 PM128A Xmm2;
1394 PM128A Xmm3;
1395 PM128A Xmm4;
1396 PM128A Xmm5;
1397 PM128A Xmm6;
1398 PM128A Xmm7;
1399 PM128A Xmm8;
1400 PM128A Xmm9;
1401 PM128A Xmm10;
1402 PM128A Xmm11;
1403 PM128A Xmm12;
1404 PM128A Xmm13;
1405 PM128A Xmm14;
1406 PM128A Xmm15;
1409
1410 union {
1411 PULONG64 IntegerContext[16];
1412 struct {
1413 PULONG64 Rax;
1414 PULONG64 Rcx;
1415 PULONG64 Rdx;
1416 PULONG64 Rbx;
1417 PULONG64 Rsp;
1418 PULONG64 Rbp;
1419 PULONG64 Rsi;
1420 PULONG64 Rdi;
1421 PULONG64 R8;
1422 PULONG64 R9;
1423 PULONG64 R10;
1424 PULONG64 R11;
1425 PULONG64 R12;
1426 PULONG64 R13;
1427 PULONG64 R14;
1428 PULONG64 R15;
1431} KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS;
1432
1433#define UNW_FLAG_NHANDLER 0x0
1434#define UNW_FLAG_EHANDLER 0x1
1435#define UNW_FLAG_UHANDLER 0x2
1436#define UNW_FLAG_CHAININFO 0x4
1437#define UNW_FLAG_NO_EPILOGUE 0x80000000UL
1438
1439#define RUNTIME_FUNCTION_INDIRECT 0x1
1440
1441typedef struct _RUNTIME_FUNCTION {
1442 DWORD BeginAddress;
1443 DWORD EndAddress;
1444 DWORD UnwindData;
1446
1447#define UNWIND_HISTORY_TABLE_SIZE 12
1448
1449typedef struct _UNWIND_HISTORY_TABLE_ENTRY
1450{
1451 DWORD64 ImageBase;
1452 PRUNTIME_FUNCTION FunctionEntry;
1453} UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY;
1454
1455typedef struct _UNWIND_HISTORY_TABLE
1456{
1457 DWORD Count;
1458 BYTE LocalHint;
1459 BYTE GlobalHint;
1460 BYTE Search;
1461 BYTE Once;
1462 ULONG64 LowAddress;
1464 UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE];
1465} UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE;
1466
1467typedef
1468_Function_class_(GET_RUNTIME_FUNCTION_CALLBACK)
1470GET_RUNTIME_FUNCTION_CALLBACK(
1471 _In_ DWORD64 ControlPc,
1473typedef GET_RUNTIME_FUNCTION_CALLBACK *PGET_RUNTIME_FUNCTION_CALLBACK;
1474
1475typedef
1476_Function_class_(OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK)
1477DWORD
1478OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK(
1480 _In_ PVOID TableAddress,
1482 _Out_ PRUNTIME_FUNCTION* Functions);
1483typedef OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK *POUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK;
1484
1485struct _EXCEPTION_POINTERS;
1486typedef
1487LONG
1488(*PEXCEPTION_FILTER) (
1489 struct _EXCEPTION_POINTERS *ExceptionPointers,
1491
1492typedef
1493VOID
1494(*PTERMINATION_HANDLER) (
1497
1498typedef struct _DISPATCHER_CONTEXT
1499{
1505 struct _CONTEXT *ContextRecord;
1508 PUNWIND_HISTORY_TABLE HistoryTable;
1510 ULONG Fill0;
1512
1513typedef struct _SCOPE_TABLE_AMD64
1514{
1515 DWORD Count;
1516 struct
1517 {
1518 DWORD BeginAddress;
1519 DWORD EndAddress;
1520 DWORD HandlerAddress;
1521 DWORD JumpTarget;
1522 } ScopeRecord[1];
1523} SCOPE_TABLE_AMD64, *PSCOPE_TABLE_AMD64;
1524typedef SCOPE_TABLE_AMD64 SCOPE_TABLE, *PSCOPE_TABLE;
1525
1526#define OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME "OutOfProcessFunctionTableCallback"
1527
1529VOID
1530__cdecl
1532 struct _EXCEPTION_RECORD *ExceptionRecord);
1533
1535BOOLEAN
1536__cdecl
1538 DWORD EntryCount,
1540
1542BOOLEAN
1543__cdecl
1546 DWORD Length,
1547 PGET_RUNTIME_FUNCTION_CALLBACK Callback,
1548 PVOID Context,
1549 PCWSTR OutOfProcessCallbackDll);
1550
1552BOOLEAN
1553__cdecl
1555
1558NTAPI
1560 _In_ DWORD64 ControlPc,
1561 _Out_ PDWORD64 ImageBase,
1562 _Inout_opt_ PUNWIND_HISTORY_TABLE HistoryTable);
1563
1566NTAPI
1569 _In_ DWORD64 ImageBase,
1570 _In_ DWORD64 ControlPc,
1571 _In_ PRUNTIME_FUNCTION FunctionEntry,
1573 _Out_ PVOID *HandlerData,
1575 _Inout_opt_ PKNONVOLATILE_CONTEXT_POINTERS ContextPointers);
1576
1578VOID
1579NTAPI
1581 _In_opt_ PVOID TargetFrame,
1582 _In_opt_ PVOID TargetIp,
1583 _In_opt_ struct _EXCEPTION_RECORD *ExceptionRecord,
1585 _In_ struct _CONTEXT *ContextRecord,
1586 _In_opt_ PUNWIND_HISTORY_TABLE HistoryTable);
1587
1588#elif defined(_PPC_)
1589#define CONTEXT_CONTROL 1L
1590#define CONTEXT_FLOATING_POINT 2L
1591#define CONTEXT_INTEGER 4L
1592#define CONTEXT_DEBUG_REGISTERS 8L
1593#define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_FLOATING_POINT|CONTEXT_INTEGER)
1594typedef struct _FLOATING_SAVE_AREA
1595{
1596 double Fpr0;
1597 double Fpr1;
1598 double Fpr2;
1599 double Fpr3;
1600 double Fpr4;
1601 double Fpr5;
1602 double Fpr6;
1603 double Fpr7;
1604 double Fpr8;
1605 double Fpr9;
1606 double Fpr10;
1607 double Fpr11;
1608 double Fpr12;
1609 double Fpr13;
1610 double Fpr14;
1611 double Fpr15;
1612 double Fpr16;
1613 double Fpr17;
1614 double Fpr18;
1615 double Fpr19;
1616 double Fpr20;
1617 double Fpr21;
1618 double Fpr22;
1619 double Fpr23;
1620 double Fpr24;
1621 double Fpr25;
1622 double Fpr26;
1623 double Fpr27;
1624 double Fpr28;
1625 double Fpr29;
1626 double Fpr30;
1627 double Fpr31;
1628 double Fpscr;
1630
1631typedef struct _CONTEXT {
1633 DWORD Gpr0;
1634 DWORD Gpr1;
1635 DWORD Gpr2;
1636 DWORD Gpr3;
1637 DWORD Gpr4;
1638 DWORD Gpr5;
1639 DWORD Gpr6;
1640 DWORD Gpr7;
1641 DWORD Gpr8;
1642 DWORD Gpr9;
1643 DWORD Gpr10;
1644 DWORD Gpr11;
1645 DWORD Gpr12;
1646 DWORD Gpr13;
1647 DWORD Gpr14;
1648 DWORD Gpr15;
1649 DWORD Gpr16;
1650 DWORD Gpr17;
1651 DWORD Gpr18;
1652 DWORD Gpr19;
1653 DWORD Gpr20;
1654 DWORD Gpr21;
1655 DWORD Gpr22;
1656 DWORD Gpr23;
1657 DWORD Gpr24;
1658 DWORD Gpr25;
1659 DWORD Gpr26;
1660 DWORD Gpr27;
1661 DWORD Gpr28;
1662 DWORD Gpr29;
1663 DWORD Gpr30;
1664 DWORD Gpr31;
1665 DWORD Cr;
1666 DWORD Xer;
1667 DWORD Msr;
1668 DWORD Iar;
1669 DWORD Lr;
1670 DWORD Ctr;
1672 DWORD Fill[3];
1673 DWORD Dr0;
1674 DWORD Dr1;
1675 DWORD Dr2;
1676 DWORD Dr3;
1677 DWORD Dr4;
1678 DWORD Dr5;
1679 DWORD Dr6;
1680 DWORD Dr7;
1681} CONTEXT;
1682#elif defined(_ALPHA_)
1683#define CONTEXT_ALPHA 0x20000
1684#define CONTEXT_CONTROL (CONTEXT_ALPHA|1L)
1685#define CONTEXT_FLOATING_POINT (CONTEXT_ALPHA|2L)
1686#define CONTEXT_INTEGER (CONTEXT_ALPHA|4L)
1687#define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_FLOATING_POINT|CONTEXT_INTEGER)
1688typedef struct _CONTEXT {
1689 ULONGLONG FltF0;
1690 ULONGLONG FltF1;
1691 ULONGLONG FltF2;
1692 ULONGLONG FltF3;
1693 ULONGLONG FltF4;
1694 ULONGLONG FltF5;
1695 ULONGLONG FltF6;
1696 ULONGLONG FltF7;
1697 ULONGLONG FltF8;
1698 ULONGLONG FltF9;
1699 ULONGLONG FltF10;
1700 ULONGLONG FltF11;
1701 ULONGLONG FltF12;
1702 ULONGLONG FltF13;
1703 ULONGLONG FltF14;
1704 ULONGLONG FltF15;
1705 ULONGLONG FltF16;
1706 ULONGLONG FltF17;
1707 ULONGLONG FltF18;
1708 ULONGLONG FltF19;
1709 ULONGLONG FltF20;
1710 ULONGLONG FltF21;
1711 ULONGLONG FltF22;
1712 ULONGLONG FltF23;
1713 ULONGLONG FltF24;
1714 ULONGLONG FltF25;
1715 ULONGLONG FltF26;
1716 ULONGLONG FltF27;
1717 ULONGLONG FltF28;
1718 ULONGLONG FltF29;
1719 ULONGLONG FltF30;
1720 ULONGLONG FltF31;
1721 ULONGLONG IntV0;
1722 ULONGLONG IntT0;
1723 ULONGLONG IntT1;
1724 ULONGLONG IntT2;
1725 ULONGLONG IntT3;
1726 ULONGLONG IntT4;
1727 ULONGLONG IntT5;
1728 ULONGLONG IntT6;
1729 ULONGLONG IntT7;
1730 ULONGLONG IntS0;
1731 ULONGLONG IntS1;
1732 ULONGLONG IntS2;
1733 ULONGLONG IntS3;
1734 ULONGLONG IntS4;
1735 ULONGLONG IntS5;
1736 ULONGLONG IntFp;
1737 ULONGLONG IntA0;
1738 ULONGLONG IntA1;
1739 ULONGLONG IntA2;
1740 ULONGLONG IntA3;
1741 ULONGLONG IntA4;
1742 ULONGLONG IntA5;
1743 ULONGLONG IntT8;
1744 ULONGLONG IntT9;
1745 ULONGLONG IntT10;
1746 ULONGLONG IntT11;
1747 ULONGLONG IntRa;
1748 ULONGLONG IntT12;
1749 ULONGLONG IntAt;
1750 ULONGLONG IntGp;
1751 ULONGLONG IntSp;
1752 ULONGLONG IntZero;
1754 ULONGLONG SoftFpcr;
1755 ULONGLONG Fir;
1756 DWORD Psr;
1758 DWORD Fill[4];
1759} CONTEXT;
1760#elif defined(_SH_)
1761
1762/* These are the debug or break registers on the SH3 */
1763typedef struct _DEBUG_REGISTERS {
1764 DWORD BarA;
1765 UCHAR BasrA;
1766 UCHAR BamrA;
1767 USHORT BbrA;
1768 DWORD BarB;
1769 UCHAR BasrB;
1770 UCHAR BamrB;
1771 USHORT BbrB;
1772 DWORD BdrB;
1773 DWORD BdmrB;
1774 USHORT Brcr;
1775 USHORT Align;
1776} DEBUG_REGISTERS, *PDEBUG_REGISTERS;
1777
1778/* The following flags control the contents of the CONTEXT structure. */
1779
1780#define CONTEXT_SH3 0x00000040
1781#define CONTEXT_SH4 0x000000c0 /* CONTEXT_SH3 | 0x80 - must contain the SH3 bits */
1782
1783#ifdef SH3
1784#define CONTEXT_CONTROL (CONTEXT_SH3 | 0x00000001L)
1785#define CONTEXT_INTEGER (CONTEXT_SH3 | 0x00000002L)
1786#define CONTEXT_DEBUG_REGISTERS (CONTEXT_SH3 | 0x00000008L)
1787#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_DEBUG_REGISTERS)
1788#else /* SH4 */
1789#define CONTEXT_CONTROL (CONTEXT_SH4 | 0x00000001L)
1790#define CONTEXT_INTEGER (CONTEXT_SH4 | 0x00000002L)
1791#define CONTEXT_DEBUG_REGISTERS (CONTEXT_SH4 | 0x00000008L)
1792#define CONTEXT_FLOATING_POINT (CONTEXT_SH4 | 0x00000004L)
1793#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_DEBUG_REGISTERS | CONTEXT_FLOATING_POINT)
1794#endif
1795
1796/* Context Frame */
1797
1798/* This frame is used to store a limited processor context into the */
1799/* Thread structure for CPUs which have no floating point support. */
1800
1801typedef struct _CONTEXT {
1802 /* The flags values within this flag control the contents of */
1803 /* a CONTEXT record. */
1804
1805 /* If the context record is used as an input parameter, then */
1806 /* for each portion of the context record controlled by a flag */
1807 /* whose value is set, it is assumed that that portion of the */
1808 /* context record contains valid context. If the context record */
1809 /* is being used to modify a thread's context, then only that */
1810 /* portion of the threads context will be modified. */
1811
1812 /* If the context record is used as an IN OUT parameter to capture */
1813 /* the context of a thread, then only those portions of the thread's */
1814 /* context corresponding to set flags will be returned. */
1815
1816 /* The context record is never used as an OUT only parameter. */
1817
1818
1820
1821 /* This section is specified/returned if the ContextFlags word contains */
1822 /* the flag CONTEXT_INTEGER. */
1823
1824 /* N.B. The registers RA and R15 are defined in this section, but are */
1825 /* considered part of the control context rather than part of the integer */
1826 /* context. */
1827
1828 DWORD PR;
1829 DWORD MACH;
1830 DWORD MACL;
1831 DWORD GBR;
1832 DWORD R0;
1833 DWORD R1;
1834 DWORD R2;
1835 DWORD R3;
1836 DWORD R4;
1837 DWORD R5;
1838 DWORD R6;
1839 DWORD R7;
1840 DWORD R8;
1841 DWORD R9;
1842 DWORD R10;
1843 DWORD R11;
1844 DWORD R12;
1845 DWORD R13;
1846 DWORD R14;
1847 DWORD R15;
1848
1849 /* This section is specified/returned if the ContextFlags word contains */
1850 /* the flag CONTEXT_CONTROL. */
1851
1852 /* N.B. The registers r15 and ra are defined in the integer section, */
1853 /* but are considered part of the control context rather than part of */
1854 /* the integer context. */
1855
1856 DWORD Fir;
1857 DWORD Psr;
1858
1859#if !defined(SH3e) && !defined(SH4)
1860 DWORD OldStuff[2];
1861 DEBUG_REGISTERS DebugRegisters;
1862#else
1863 DWORD Fpscr;
1864 DWORD Fpul;
1865 DWORD FRegs[16];
1866#if defined(SH4)
1867 DWORD xFRegs[16];
1868#endif
1869#endif
1870} CONTEXT;
1871
1872#elif defined(_MIPS_)
1873
1874/* The following flags control the contents of the CONTEXT structure. */
1875
1876#define CONTEXT_R4000 0x00010000 /* r4000 context */
1877
1878#define CONTEXT_CONTROL (CONTEXT_R4000 | 0x00000001L)
1879#define CONTEXT_FLOATING_POINT (CONTEXT_R4000 | 0x00000002L)
1880#define CONTEXT_INTEGER (CONTEXT_R4000 | 0x00000004L)
1881
1882#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
1883
1884/* Context Frame */
1885
1886/* N.B. This frame must be exactly a multiple of 16 bytes in length. */
1887
1888/* This frame has a several purposes: 1) it is used as an argument to */
1889/* NtContinue, 2) it is used to constuct a call frame for APC delivery, */
1890/* 3) it is used to construct a call frame for exception dispatching */
1891/* in user mode, and 4) it is used in the user level thread creation */
1892/* routines. */
1893
1894/* The layout of the record conforms to a standard call frame. */
1895
1896
1897typedef struct _CONTEXT {
1898
1899 /* This section is always present and is used as an argument build */
1900 /* area. */
1901
1902 DWORD Argument[4];
1903
1904 /* This section is specified/returned if the ContextFlags word contains */
1905 /* the flag CONTEXT_FLOATING_POINT. */
1906
1907 DWORD FltF0;
1908 DWORD FltF1;
1909 DWORD FltF2;
1910 DWORD FltF3;
1911 DWORD FltF4;
1912 DWORD FltF5;
1913 DWORD FltF6;
1914 DWORD FltF7;
1915 DWORD FltF8;
1916 DWORD FltF9;
1917 DWORD FltF10;
1918 DWORD FltF11;
1919 DWORD FltF12;
1920 DWORD FltF13;
1921 DWORD FltF14;
1922 DWORD FltF15;
1923 DWORD FltF16;
1924 DWORD FltF17;
1925 DWORD FltF18;
1926 DWORD FltF19;
1927 DWORD FltF20;
1928 DWORD FltF21;
1929 DWORD FltF22;
1930 DWORD FltF23;
1931 DWORD FltF24;
1932 DWORD FltF25;
1933 DWORD FltF26;
1934 DWORD FltF27;
1935 DWORD FltF28;
1936 DWORD FltF29;
1937 DWORD FltF30;
1938 DWORD FltF31;
1939
1940 /* This section is specified/returned if the ContextFlags word contains */
1941 /* the flag CONTEXT_INTEGER. */
1942
1943 /* N.B. The registers gp, sp, and ra are defined in this section, but are */
1944 /* considered part of the control context rather than part of the integer */
1945 /* context. */
1946
1947 /* N.B. Register zero is not stored in the frame. */
1948
1949 DWORD IntZero;
1950 DWORD IntAt;
1951 DWORD IntV0;
1952 DWORD IntV1;
1953 DWORD IntA0;
1954 DWORD IntA1;
1955 DWORD IntA2;
1956 DWORD IntA3;
1957 DWORD IntT0;
1958 DWORD IntT1;
1959 DWORD IntT2;
1960 DWORD IntT3;
1961 DWORD IntT4;
1962 DWORD IntT5;
1963 DWORD IntT6;
1964 DWORD IntT7;
1965 DWORD IntS0;
1966 DWORD IntS1;
1967 DWORD IntS2;
1968 DWORD IntS3;
1969 DWORD IntS4;
1970 DWORD IntS5;
1971 DWORD IntS6;
1972 DWORD IntS7;
1973 DWORD IntT8;
1974 DWORD IntT9;
1975 DWORD IntK0;
1976 DWORD IntK1;
1977 DWORD IntGp;
1978 DWORD IntSp;
1979 DWORD IntS8;
1980 DWORD IntRa;
1981 DWORD IntLo;
1982 DWORD IntHi;
1983
1984 /* This section is specified/returned if the ContextFlags word contains */
1985 /* the flag CONTEXT_FLOATING_POINT. */
1986
1987 DWORD Fsr;
1988
1989 /* This section is specified/returned if the ContextFlags word contains */
1990 /* the flag CONTEXT_CONTROL. */
1991
1992 /* N.B. The registers gp, sp, and ra are defined in the integer section, */
1993 /* but are considered part of the control context rather than part of */
1994 /* the integer context. */
1995
1996 DWORD Fir;
1997 DWORD Psr;
1998
1999 /* The flags values within this flag control the contents of */
2000 /* a CONTEXT record. */
2001
2002 /* If the context record is used as an input parameter, then */
2003 /* for each portion of the context record controlled by a flag */
2004 /* whose value is set, it is assumed that that portion of the */
2005 /* context record contains valid context. If the context record */
2006 /* is being used to modify a thread's context, then only that */
2007 /* portion of the threads context will be modified. */
2008
2009 /* If the context record is used as an IN OUT parameter to capture */
2010 /* the context of a thread, then only those portions of the thread's */
2011 /* context corresponding to set flags will be returned. */
2012
2013 /* The context record is never used as an OUT only parameter. */
2014
2016
2017 DWORD Fill[2];
2018
2019} CONTEXT;
2020#elif defined(_ARM_)
2021
2022#ifndef PAGE_SIZE
2023#define PAGE_SIZE 0x1000 // FIXME: This should probably go elsewhere
2024#endif
2025
2026/* The following flags control the contents of the CONTEXT structure. */
2027
2028#define CONTEXT_ARM 0x200000L
2029#define CONTEXT_CONTROL (CONTEXT_ARM | 0x00000001L)
2030#define CONTEXT_INTEGER (CONTEXT_ARM | 0x00000002L)
2031#define CONTEXT_FLOATING_POINT (CONTEXT_ARM | 0x00000004L)
2032#define CONTEXT_DEBUG_REGISTERS (CONTEXT_ARM | 0x00000008L)
2033#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)
2034
2035#define EXCEPTION_READ_FAULT 0
2036#define EXCEPTION_WRITE_FAULT 1
2037#define EXCEPTION_EXECUTE_FAULT 8
2038
2039typedef struct _NEON128
2040{
2041 ULONGLONG Low;
2042 LONGLONG High;
2043} NEON128, *PNEON128;
2044
2045#define ARM_MAX_BREAKPOINTS 8
2046#define ARM_MAX_WATCHPOINTS 1
2047
2048typedef struct _CONTEXT
2049{
2050 /* The flags values within this flag control the contents of
2051 a CONTEXT record.
2052
2053 If the context record is used as an input parameter, then
2054 for each portion of the context record controlled by a flag
2055 whose value is set, it is assumed that that portion of the
2056 context record contains valid context. If the context record
2057 is being used to modify a thread's context, then only that
2058 portion of the threads context will be modified.
2059
2060 If the context record is used as an IN OUT parameter to capture
2061 the context of a thread, then only those portions of the thread's
2062 context corresponding to set flags will be returned.
2063
2064 The context record is never used as an OUT only parameter. */
2066
2067 /* This section is specified/returned if the ContextFlags word contains
2068 the flag CONTEXT_INTEGER. */
2069 DWORD R0;
2070 DWORD R1;
2071 DWORD R2;
2072 DWORD R3;
2073 DWORD R4;
2074 DWORD R5;
2075 DWORD R6;
2076 DWORD R7;
2077 DWORD R8;
2078 DWORD R9;
2079 DWORD R10;
2080 DWORD R11;
2081 DWORD R12;
2082
2083 DWORD Sp;
2084 DWORD Lr;
2085 DWORD Pc;
2086 DWORD Cpsr;
2087
2088 /* Floating Point/NEON Registers */
2089 DWORD Fpscr;
2090 DWORD Padding;
2091 union
2092 {
2093 NEON128 Q[16];
2094 ULONGLONG D[32];
2095 DWORD S[32];
2097
2098 /* Debug registers */
2103
2104 DWORD Padding2[2];
2105} CONTEXT, *PCONTEXT;
2106
2107typedef struct _IMAGE_ARM_RUNTIME_FUNCTION_ENTRY
2108{
2109 DWORD BeginAddress;
2110 union
2111 {
2112 DWORD UnwindData;
2113 struct
2114 {
2115 DWORD Flag : 2;
2116 DWORD FunctionLength : 11;
2117 DWORD Ret : 2;
2118 DWORD H : 1;
2119 DWORD Reg : 3;
2120 DWORD R : 1;
2121 DWORD L : 1;
2122 DWORD C : 1;
2123 DWORD StackAdjust : 10;
2126} IMAGE_ARM_RUNTIME_FUNCTION_ENTRY, *PIMAGE_ARM_RUNTIME_FUNCTION_ENTRY;
2127typedef IMAGE_ARM_RUNTIME_FUNCTION_ENTRY RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
2128
2129typedef struct _SCOPE_TABLE_ARM
2130{
2131 DWORD Count;
2132 struct
2133 {
2134 DWORD BeginAddress;
2135 DWORD EndAddress;
2136 DWORD HandlerAddress;
2137 DWORD JumpTarget;
2138 } ScopeRecord[1];
2139} SCOPE_TABLE_ARM, *PSCOPE_TABLE_ARM;
2140typedef SCOPE_TABLE_ARM SCOPE_TABLE, *PSCOPE_TABLE;
2141
2142typedef struct _DISPATCHER_CONTEXT
2143{
2152 struct _UNWIND_HISTORY_TABLE *HistoryTable;
2158
2159#elif defined(_ARM64_)
2160
2161#define CONTEXT_ARM64 0x00400000L
2162#define CONTEXT_CONTROL (CONTEXT_ARM64 | 0x1L)
2163#define CONTEXT_INTEGER (CONTEXT_ARM64 | 0x2L)
2164#define CONTEXT_FLOATING_POINT (CONTEXT_ARM64 | 0x4L)
2165#define CONTEXT_DEBUG_REGISTERS (CONTEXT_ARM64 | 0x8L)
2166#define CONTEXT_X18 (CONTEXT_ARM64 | 0x10L)
2167#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)
2168
2169
2170#define EXCEPTION_READ_FAULT 0
2171#define EXCEPTION_WRITE_FAULT 1
2172#define EXCEPTION_EXECUTE_FAULT 8
2173
2174typedef union NEON128 {
2175 struct {
2176 ULONGLONG Low;
2177 LONGLONG High;
2179 double D[2];
2180 float S[4];
2181 WORD H[8];
2182 BYTE B[16];
2183} NEON128, *PNEON128;
2184
2185#define ARM64_MAX_BREAKPOINTS 8
2186#define ARM64_MAX_WATCHPOINTS 2
2187
2188typedef struct _CONTEXT {
2189
2190 //
2191 // Control flags.
2192 //
2193
2195
2196 //
2197 // Integer registers
2198 //
2199
2200 DWORD Cpsr;
2201 union {
2202 struct {
2203 DWORD64 X0;
2204 DWORD64 X1;
2205 DWORD64 X2;
2206 DWORD64 X3;
2207 DWORD64 X4;
2208 DWORD64 X5;
2209 DWORD64 X6;
2210 DWORD64 X7;
2211 DWORD64 X8;
2212 DWORD64 X9;
2213 DWORD64 X10;
2214 DWORD64 X11;
2215 DWORD64 X12;
2216 DWORD64 X13;
2217 DWORD64 X14;
2218 DWORD64 X15;
2219 DWORD64 X16;
2220 DWORD64 X17;
2221 DWORD64 X18;
2222 DWORD64 X19;
2223 DWORD64 X20;
2224 DWORD64 X21;
2225 DWORD64 X22;
2226 DWORD64 X23;
2227 DWORD64 X24;
2228 DWORD64 X25;
2229 DWORD64 X26;
2230 DWORD64 X27;
2231 DWORD64 X28;
2232 DWORD64 Fp;
2233 DWORD64 Lr;
2235 DWORD64 X[31];
2237
2238 DWORD64 Sp;
2239 DWORD64 Pc;
2240
2241 //
2242 // Floating Point/NEON Registers
2243 //
2244
2245 NEON128 V[32];
2246 DWORD Fpcr;
2247 DWORD Fpsr;
2248
2249 //
2250 // Debug registers
2251 //
2252
2257
2258} _CONTEXT, *P_CONTEXT;
2259typedef _CONTEXT CONTEXT, *PCONTEXT;
2260
2261typedef struct _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY {
2262 DWORD BeginAddress;
2263 union {
2264 DWORD UnwindData;
2265 struct {
2266 DWORD Flag : 2;
2267 DWORD FunctionLength : 11;
2268 DWORD RegF : 3;
2269 DWORD RegI : 4;
2270 DWORD H : 1;
2271 DWORD CR : 2;
2272 DWORD FrameSize : 9;
2275} IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY, * PIMAGE_ARM64_RUNTIME_FUNCTION_ENTRY;
2276typedef struct _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
2277
2278typedef struct _SCOPE_TABLE_ARM64 {
2279 DWORD Count;
2280 struct
2281 {
2282 DWORD BeginAddress;
2283 DWORD EndAddress;
2284 DWORD HandlerAddress;
2285 DWORD JumpTarget;
2286 } ScopeRecord[1];
2287} SCOPE_TABLE_ARM64, *PSCOPE_TABLE_ARM64;
2288typedef SCOPE_TABLE_ARM64 SCOPE_TABLE, *PSCOPE_TABLE;
2289
2290typedef struct _DISPATCHER_CONTEXT {
2299 struct _UNWIND_HISTORY_TABLE *HistoryTable;
2304#else
2305#error "undefined processor type"
2306#endif
2308
2309/* The WoW64 context */
2310#define WOW64_CONTEXT_i386 0x00010000
2311#define WOW64_CONTEXT_i486 0x00010000
2312#define WOW64_CONTEXT_CONTROL (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000001))
2313#define WOW64_CONTEXT_INTEGER (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000002))
2314#define WOW64_CONTEXT_SEGMENTS (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000004))
2315#define WOW64_CONTEXT_FLOATING_POINT (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000008))
2316#define WOW64_CONTEXT_DEBUG_REGISTERS (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000010))
2317#define WOW64_CONTEXT_EXTENDED_REGISTERS (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000020))
2318#define WOW64_CONTEXT_FULL (WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER | WOW64_CONTEXT_SEGMENTS)
2319#define WOW64_CONTEXT_ALL (WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER | \
2320 WOW64_CONTEXT_SEGMENTS | WOW64_CONTEXT_FLOATING_POINT | \
2321 WOW64_CONTEXT_DEBUG_REGISTERS | WOW64_CONTEXT_EXTENDED_REGISTERS)
2322
2323#define WOW64_CONTEXT_XSTATE (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000040))
2324
2325#define WOW64_CONTEXT_EXCEPTION_ACTIVE 0x08000000
2326#define WOW64_CONTEXT_SERVICE_ACTIVE 0x10000000
2327#define WOW64_CONTEXT_EXCEPTION_REQUEST 0x40000000
2328#define WOW64_CONTEXT_EXCEPTION_REPORTING 0x80000000
2329
2330#define WOW64_SIZE_OF_80387_REGISTERS 80
2331#define WOW64_MAXIMUM_SUPPORTED_EXTENSION 512
2332
2333typedef struct _WOW64_FLOATING_SAVE_AREA
2334{
2337 DWORD TagWord;
2345
2346#include "pshpack4.h"
2347typedef struct _WOW64_CONTEXT
2348{
2350 DWORD Dr0;
2351 DWORD Dr1;
2352 DWORD Dr2;
2353 DWORD Dr3;
2354 DWORD Dr6;
2355 DWORD Dr7;
2357 DWORD SegGs;
2358 DWORD SegFs;
2359 DWORD SegEs;
2360 DWORD SegDs;
2361 DWORD Edi;
2362 DWORD Esi;
2363 DWORD Ebx;
2364 DWORD Edx;
2365 DWORD Ecx;
2366 DWORD Eax;
2367 DWORD Ebp;
2368 DWORD Eip;
2369 DWORD SegCs;
2370 DWORD EFlags;
2371 DWORD Esp;
2372 DWORD SegSs;
2375#include "poppack.h"
2376
2377
2378#define EXCEPTION_MAXIMUM_PARAMETERS 15
2379#define EXCEPTION_NONCONTINUABLE 0x01
2380#define EXCEPTION_UNWINDING 0x02
2381#define EXCEPTION_EXIT_UNWIND 0x04
2382#define EXCEPTION_STACK_INVALID 0x08
2383#define EXCEPTION_NESTED_CALL 0x10
2384#define EXCEPTION_TARGET_UNWIND 0x20
2385#define EXCEPTION_COLLIDED_UNWIND 0x40
2386#define EXCEPTION_UNWIND (EXCEPTION_UNWINDING | EXCEPTION_EXIT_UNWIND | \
2387 EXCEPTION_TARGET_UNWIND | EXCEPTION_COLLIDED_UNWIND)
2388
2389#define IS_UNWINDING(Flag) ((Flag & EXCEPTION_UNWIND) != 0)
2390#define IS_DISPATCHING(Flag) ((Flag & EXCEPTION_UNWIND) == 0)
2391#define IS_TARGET_UNWIND(Flag) (Flag & EXCEPTION_TARGET_UNWIND)
2392
2393typedef struct _EXCEPTION_RECORD {
2401
2402typedef struct _EXCEPTION_RECORD32 {
2410
2411typedef struct _EXCEPTION_RECORD64 {
2420
2421typedef struct _EXCEPTION_POINTERS {
2425
2426typedef struct _SECURITY_ATTRIBUTES {
2427 DWORD nLength;
2431
2432#define SECURITY_MIN_SID_SIZE (sizeof(SID))
2433
2434$include(setypes.h)
2435
2436typedef struct _SYSTEM_AUDIT_OBJECT_ACE {
2439 DWORD Flags;
2441 GUID InheritedObjectType;
2442 DWORD SidStart;
2444
2453
2454typedef struct _ACCESS_ALLOWED_CALLBACK_ACE {
2459
2460typedef struct _ACCESS_DENIED_CALLBACK_ACE {
2465
2466typedef struct _SYSTEM_AUDIT_CALLBACK_ACE {
2471
2477
2481 DWORD Flags;
2486
2490 DWORD Flags;
2495
2496typedef struct _SYSTEM_AUDIT_CALLBACK_OBJECT_ACE {
2499 DWORD Flags;
2504
2513
2519
2520typedef struct _QUOTA_LIMITS {
2528
2529typedef union _RATE_QUOTA_LIMIT {
2531 struct {
2536
2537typedef struct _QUOTA_LIMITS_EX {
2551
2552typedef struct _IO_COUNTERS {
2560
2567
2568typedef struct _TAPE_ERASE {
2572
2586
2594
2595typedef struct _TAPE_GET_POSITION {
2600
2601typedef struct _TAPE_PREPARE {
2605
2613
2617
2618typedef struct _TAPE_SET_POSITION {
2624
2625typedef struct _TAPE_WRITE_MARKS {
2630
2636
2637typedef struct _MEMORY_BASIC_INFORMATION {
2646
2647typedef struct _MESSAGE_RESOURCE_ENTRY {
2652
2653typedef struct _MESSAGE_RESOURCE_BLOCK {
2658
2659typedef struct _MESSAGE_RESOURCE_DATA {
2663
2664//
2665// Slist Header
2666//
2667#ifndef _SLIST_HEADER_
2668#define _SLIST_HEADER_
2669
2670#if defined(_WIN64)
2671
2672typedef struct DECLSPEC_ALIGN(16) _SLIST_ENTRY {
2673 struct _SLIST_ENTRY *Next;
2675
2676typedef struct _SLIST_ENTRY32 {
2677 DWORD Next;
2679
2680typedef union DECLSPEC_ALIGN(16) _SLIST_HEADER {
2681 _ANONYMOUS_STRUCT struct {
2685 struct {
2686 ULONGLONG Depth:16;
2687 ULONGLONG Sequence:9;
2688 ULONGLONG NextEntry:39;
2689 ULONGLONG HeaderType:1;
2690 ULONGLONG Init:1;
2692 ULONGLONG Region:3;
2693 } Header8;
2694 struct {
2695 ULONGLONG Depth:16;
2696 ULONGLONG Sequence:48;
2697 ULONGLONG HeaderType:1;
2698 ULONGLONG Init:1;
2700 ULONGLONG NextEntry:60;
2701 } Header16;
2702 struct {
2703 ULONGLONG Depth:16;
2704 ULONGLONG Sequence:48;
2705 ULONGLONG HeaderType:1;
2707 ULONGLONG NextEntry:60;
2708 } HeaderX64;
2710
2711typedef union _SLIST_HEADER32{
2713 _ANONYMOUS_STRUCT struct {
2714 SLIST_ENTRY32 Next;
2715 WORD Depth;
2716 WORD Sequence;
2719
2720#else
2721
2722#define SLIST_ENTRY SINGLE_LIST_ENTRY
2723#define _SLIST_ENTRY _SINGLE_LIST_ENTRY
2724#define PSLIST_ENTRY PSINGLE_LIST_ENTRY
2725
2727
2728typedef union _SLIST_HEADER {
2730 _ANONYMOUS_STRUCT struct {
2736
2738
2739#endif /* defined(_WIN64) */
2740
2741#endif /* _SLIST_HEADER_ */
2742
2744VOID
2745NTAPI
2747 _Out_ PSLIST_HEADER ListHead);
2748
2752NTAPI
2754 _In_ const SLIST_HEADER *ListHead);
2755
2758NTAPI
2760 _Inout_ PSLIST_HEADER ListHead);
2761
2764NTAPI
2766 _Inout_ PSLIST_HEADER ListHead,
2768
2771NTAPI
2773 _Inout_ PSLIST_HEADER ListHead);
2774
2776WORD
2777NTAPI
2779 _In_ PSLIST_HEADER ListHead);
2780
2781
2782#define RTL_CONDITION_VARIABLE_INIT {0}
2783#define RTL_CONDITION_VARIABLE_LOCKMODE_SHARED 0x1
2784
2785typedef struct _RTL_CONDITION_VARIABLE {
2786 PVOID Ptr;
2788
2789typedef struct _RTL_CRITICAL_SECTION_DEBUG {
2800
2801#include "pshpack8.h"
2802typedef struct _RTL_CRITICAL_SECTION {
2810#include "poppack.h"
2811
2813WORD
2814NTAPI
2816 IN DWORD FramesToSkip,
2818 OUT PVOID *BackTrace,
2820);
2821
2823VOID
2824NTAPI
2827);
2828
2830PVOID
2831NTAPI
2833 _In_ PVOID PcValue,
2834 _Out_ PVOID* BaseOfImage);
2835
2837VOID
2838NTAPI
2839RtlUnwind(
2840 _In_opt_ PVOID TargetFrame,
2841 _In_opt_ PVOID TargetIp,
2842 _In_opt_ PEXCEPTION_RECORD ExceptionRecord,
2844
2845#define RTL_SRWLOCK_INIT {0}
2846
2847typedef struct _RTL_SRWLOCK {
2848 PVOID Ptr;
2850
2851typedef LONG
2853 struct _EXCEPTION_POINTERS *ExceptionInfo
2854);
2855
2856
2857#define EVENTLOG_SEQUENTIAL_READ 1
2858#define EVENTLOG_SEEK_READ 2
2859#define EVENTLOG_FORWARDS_READ 4
2860#define EVENTLOG_BACKWARDS_READ 8
2861
2862#define EVENTLOG_SUCCESS 0
2863#define EVENTLOG_ERROR_TYPE 1
2864#define EVENTLOG_WARNING_TYPE 2
2865#define EVENTLOG_INFORMATION_TYPE 4
2866#define EVENTLOG_AUDIT_SUCCESS 8
2867#define EVENTLOG_AUDIT_FAILURE 16
2868
2869typedef struct _EVENTLOGRECORD {
2870 DWORD Length; /* Length of full record, including the data portion */
2877 WORD NumStrings; /* Number of strings in the 'Strings' array */
2884 DWORD DataLength; /* Length of the data portion */
2885 DWORD DataOffset; /* Offset from beginning of record */
2886/*
2887 * Length-varying data:
2888 *
2889 * WCHAR SourceName[];
2890 * WCHAR ComputerName[];
2891 * SID UserSid; // Must be aligned on a DWORD boundary
2892 * WCHAR Strings[];
2893 * BYTE Data[];
2894 * CHAR Pad[]; // Padding for DWORD boundary
2895 * DWORD Length; // Same as the first 'Length' member at the beginning
2896 */
2898
2899
2900typedef struct _OSVERSIONINFOA {
2906 CHAR szCSDVersion[128];
2908
2909typedef struct _OSVERSIONINFOW {
2915 WCHAR szCSDVersion[128];
2917
2918typedef struct _OSVERSIONINFOEXA {
2924 CHAR szCSDVersion[128];
2931
2932typedef struct _OSVERSIONINFOEXW {
2938 WCHAR szCSDVersion[128];
2945
2946#include <pshpack2.h>
2947
2948typedef struct _IMAGE_VXD_HEADER {
3001
3002typedef struct _IMAGE_DOS_HEADER {
3003 WORD e_magic;
3004 WORD e_cblp;
3005 WORD e_cp;
3006 WORD e_crlc;
3010 WORD e_ss;
3011 WORD e_sp;
3012 WORD e_csum;
3013 WORD e_ip;
3014 WORD e_cs;
3015 WORD e_lfarlc;
3016 WORD e_ovno;
3017 WORD e_res[4];
3018 WORD e_oemid;
3020 WORD e_res2[10];
3021 LONG e_lfanew;
3023
3024typedef struct _IMAGE_OS2_HEADER {
3056
3057#include <poppack.h>
3058
3059typedef struct _IMAGE_FILE_HEADER {
3060 WORD Machine;
3068
3069typedef struct _IMAGE_DATA_DIRECTORY {
3071 DWORD Size;
3073
3074typedef struct _IMAGE_OPTIONAL_HEADER32 {
3075 WORD Magic;
3107
3108typedef struct _IMAGE_OPTIONAL_HEADER64 {
3109 WORD Magic;
3140
3141typedef struct _IMAGE_ROM_OPTIONAL_HEADER {
3156
3157typedef struct _IMAGE_NT_HEADERS32 {
3162
3163typedef struct _IMAGE_NT_HEADERS64 {
3168
3169#ifdef _WIN64
3174#else
3179#endif
3180
3181typedef struct _IMAGE_ROM_HEADERS {
3185
3186typedef struct _IMAGE_SECTION_HEADER {
3188 union {
3201
3202#include <pshpack2.h>
3203
3204typedef struct _IMAGE_SYMBOL {
3205 union {
3206 BYTE ShortName[8];
3207 struct {
3208 DWORD Short;
3209 DWORD Long;
3212 } N;
3213 DWORD Value;
3215 WORD Type;
3219
3220typedef struct _IMAGE_LINENUMBER {
3221 union {
3227
3234
3235typedef union _IMAGE_AUX_SYMBOL {
3236 struct {
3238 union {
3239 struct {
3245 union {
3246 struct {
3250 struct {
3256 struct {
3259 struct {
3270 struct {
3275
3276typedef struct _IMAGE_RELOCATION {
3277 _ANONYMOUS_UNION union {
3282 WORD Type;
3284
3285#include <poppack.h>
3286
3287#ifndef __IMAGE_COR20_HEADER_DEFINED__
3288#define __IMAGE_COR20_HEADER_DEFINED__
3289
3315 MAX_PACKAGE_NAME = 1024
3317
3318typedef struct IMAGE_COR20_HEADER {
3324 _ANONYMOUS_UNION union {
3335
3336#endif /* __IMAGE_COR20_HEADER_DEFINED__ */
3337
3348
3349typedef struct _IMAGE_BASE_RELOCATION {
3353
3363
3364typedef struct _IMAGE_EXPORT_DIRECTORY {
3369 DWORD Name;
3370 DWORD Base;
3377
3378typedef struct _IMAGE_IMPORT_BY_NAME {
3379 WORD Hint;
3380 BYTE Name[1];
3382
3383#include <pshpack8.h>
3384typedef struct _IMAGE_THUNK_DATA64 {
3385 union {
3392#include <poppack.h>
3393
3394typedef struct _IMAGE_THUNK_DATA32 {
3395 union {
3402
3403#define IMAGE_ORDINAL_FLAG64 0x8000000000000000ULL
3404#define IMAGE_ORDINAL_FLAG32 0x80000000
3405#define IMAGE_ORDINAL64(Ordinal) (Ordinal & 0xffff)
3406#define IMAGE_ORDINAL32(Ordinal) (Ordinal & 0xffff)
3407#define IMAGE_SNAP_BY_ORDINAL64(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG64)!=0)
3408#define IMAGE_SNAP_BY_ORDINAL32(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG32)!=0)
3409
3410typedef VOID
3412
3413typedef struct _IMAGE_TLS_DIRECTORY64 {
3421
3422typedef struct _IMAGE_TLS_DIRECTORY32 {
3430
3431#ifdef _WIN64
3432#define IMAGE_ORDINAL_FLAG IMAGE_ORDINAL_FLAG64
3433#define IMAGE_ORDINAL(Ordinal) IMAGE_ORDINAL64(Ordinal)
3436#define IMAGE_SNAP_BY_ORDINAL(Ordinal) IMAGE_SNAP_BY_ORDINAL64(Ordinal)
3439#else
3440#define IMAGE_ORDINAL_FLAG IMAGE_ORDINAL_FLAG32
3441#define IMAGE_ORDINAL(Ordinal) IMAGE_ORDINAL32(Ordinal)
3444#define IMAGE_SNAP_BY_ORDINAL(Ordinal) IMAGE_SNAP_BY_ORDINAL32(Ordinal)
3447#endif
3448
3449typedef struct _IMAGE_IMPORT_DESCRIPTOR {
3450 _ANONYMOUS_UNION union {
3459
3465
3471
3473 union {
3475 struct {
3478 };
3488
3490
3491typedef struct _IMAGE_RESOURCE_DIRECTORY {
3499
3500typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
3501 _ANONYMOUS_UNION union {
3502 _ANONYMOUS_STRUCT struct {
3506 DWORD Name;
3509 _ANONYMOUS_UNION union {
3511 _ANONYMOUS_STRUCT struct {
3517
3518typedef struct _IMAGE_RESOURCE_DIRECTORY_STRING {
3519 WORD Length;
3520 CHAR NameString[1];
3522
3523typedef struct _IMAGE_RESOURCE_DIR_STRING_U {
3524 WORD Length;
3525 WCHAR NameString[1];
3527
3528typedef struct _IMAGE_RESOURCE_DATA_ENTRY {
3530 DWORD Size;
3534
3557
3580
3581#ifdef _WIN64
3584#else
3587#endif
3588
3594
3595typedef struct _IMAGE_DEBUG_DIRECTORY {
3600 DWORD Type;
3605
3606typedef struct _FPO_DATA {
3618
3619typedef struct _IMAGE_DEBUG_MISC {
3621 DWORD Length;
3623 BYTE Reserved[3];
3624 BYTE Data[1];
3626
3632
3633typedef struct _IMAGE_SEPARATE_DEBUG_HEADER {
3635 WORD Flags;
3636 WORD Machine;
3646 DWORD Reserved[2];
3648
3657
3665
3672
3673typedef struct _NT_TIB {
3678 _ANONYMOUS_UNION union {
3680 DWORD Version;
3683 struct _NT_TIB *Self;
3685
3686typedef struct _NT_TIB32 {
3691 _ANONYMOUS_UNION union {
3698
3699typedef struct _NT_TIB64 {
3704 _ANONYMOUS_UNION union {
3711
3712typedef struct _REPARSE_GUID_DATA_BUFFER {
3717 struct {
3721
3726
3727typedef union _FILE_SEGMENT_ELEMENT {
3731
3732/* JOBOBJECT_BASIC_LIMIT_INFORMATION.LimitFlags constants */
3733#define JOB_OBJECT_LIMIT_WORKINGSET 0x0001
3734#define JOB_OBJECT_LIMIT_PROCESS_TIME 0x0002
3735#define JOB_OBJECT_LIMIT_JOB_TIME 0x0004
3736#define JOB_OBJECT_LIMIT_ACTIVE_PROCESS 0x0008
3737#define JOB_OBJECT_LIMIT_AFFINITY 0x0010
3738#define JOB_OBJECT_LIMIT_PRIORITY_CLASS 0x0020
3739#define JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME 0x0040
3740#define JOB_OBJECT_LIMIT_SCHEDULING_CLASS 0x0080
3741#define JOB_OBJECT_LIMIT_PROCESS_MEMORY 0x0100
3742#define JOB_OBJECT_LIMIT_JOB_MEMORY 0x0200
3743#define JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION 0x0400
3744#define JOB_OBJECT_LIMIT_BREAKAWAY_OK 0x0800
3745#define JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK 0x1000
3746#define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE 0x2000
3747
3748/* JOBOBJECT_BASIC_UI_RESTRICTIONS.UIRestrictionsClass constants */
3749#define JOB_OBJECT_UILIMIT_HANDLES 0x0001
3750#define JOB_OBJECT_UILIMIT_READCLIPBOARD 0x0002
3751#define JOB_OBJECT_UILIMIT_WRITECLIPBOARD 0x0004
3752#define JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS 0x0008
3753#define JOB_OBJECT_UILIMIT_DISPLAYSETTINGS 0x0010
3754#define JOB_OBJECT_UILIMIT_GLOBALATOMS 0x0020
3755#define JOB_OBJECT_UILIMIT_DESKTOP 0x0040
3756#define JOB_OBJECT_UILIMIT_EXITWINDOWS 0x0080
3757
3758/* JOBOBJECT_SECURITY_LIMIT_INFORMATION.SecurityLimitFlags constants */
3759#define JOB_OBJECT_SECURITY_NO_ADMIN 0x0001
3760#define JOB_OBJECT_SECURITY_RESTRICTED_TOKEN 0x0002
3761#define JOB_OBJECT_SECURITY_ONLY_TOKEN 0x0004
3762#define JOB_OBJECT_SECURITY_FILTER_TOKENS 0x0008
3763
3764/* JOBOBJECT_END_OF_JOB_TIME_INFORMATION.EndOfJobTimeAction constants */
3765#define JOB_OBJECT_TERMINATE_AT_END_OF_JOB 0
3766#define JOB_OBJECT_POST_AT_END_OF_JOB 1
3767
3768#define JOB_OBJECT_MSG_END_OF_JOB_TIME 1
3769#define JOB_OBJECT_MSG_END_OF_PROCESS_TIME 2
3770#define JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT 3
3771#define JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO 4
3772#define JOB_OBJECT_MSG_NEW_PROCESS 6
3773#define JOB_OBJECT_MSG_EXIT_PROCESS 7
3774#define JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS 8
3775#define JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT 9
3776#define JOB_OBJECT_MSG_JOB_MEMORY_LIMIT 10
3777
3778#define JOB_OBJECT_ASSIGN_PROCESS 1
3779#define JOB_OBJECT_SET_ATTRIBUTES 2
3780#define JOB_OBJECT_QUERY 4
3781#define JOB_OBJECT_TERMINATE 8
3782#define JOB_OBJECT_SET_SECURITY_ATTRIBUTES 16
3783#define JOB_OBJECT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|31)
3784
3799
3800typedef struct _JOB_SET_ARRAY {
3805