Merge branch 'master' of http://repo.or.cz/r/msysgit into devel
[msysgit/historical-msysgit.git] / mingw / include / winnt.h
blob2db64bd93947d18793e2b63ec912bb592f7dea5c
1 #ifndef _WINNT_H
2 #define _WINNT_H
3 #if __GNUC__ >= 3
4 #pragma GCC system_header
5 #endif
7 /* translate GCC target defines to MS equivalents. Keep this synchronized
8 with windows.h. */
9 #if defined(__i686__) && !defined(_M_IX86)
10 #define _M_IX86 600
11 #elif defined(__i586__) && !defined(_M_IX86)
12 #define _M_IX86 500
13 #elif defined(__i486__) && !defined(_M_IX86)
14 #define _M_IX86 400
15 #elif defined(__i386__) && !defined(_M_IX86)
16 #define _M_IX86 300
17 #endif
18 #if defined(_M_IX86) && !defined(_X86_)
19 #define _X86_
20 #elif defined(_M_ALPHA) && !defined(_ALPHA_)
21 #define _ALPHA_
22 #elif defined(_M_PPC) && !defined(_PPC_)
23 #define _PPC_
24 #elif defined(_M_MRX000) && !defined(_MIPS_)
25 #define _MIPS_
26 #elif defined(_M_M68K) && !defined(_68K_)
27 #define _68K_
28 #endif
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
34 #include <winerror.h>
36 #ifndef RC_INVOKED
37 #include <string.h>
39 /* FIXME: add more architectures. Is there a way to specify this in GCC? */
40 #ifdef _X86_
41 #define UNALIGNED
42 #else
43 #define UNALIGNED
44 #endif
46 #ifndef DECLSPEC_ALIGN
47 #ifdef __GNUC__
48 #define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
49 #else
50 #define DECLSPEC_ALIGN(x)
51 #endif
52 #endif
54 #ifndef DECLSPEC_SELECTANY
55 #if (__GNUC__ >= 4)
56 #define DECLSPEC_SELECTANY __attribute__((selectany))
57 #else
58 #define DECLSPEC_SELECTANY
59 #endif
60 #endif
62 #ifndef FORCEINLINE
63 #if (__GNUC__ >= 3)
64 #define FORCEINLINE __inline __attribute__((always_inline))
65 #else
66 #define FORCEINLINE __inline
67 #endif
68 #endif
70 #ifndef C_ASSERT
71 #define C_ASSERT(expr) typedef char __C_ASSERT__[(expr)?1:-1]
72 #endif
74 #ifndef VOID
75 #define VOID void
76 #endif
77 typedef char CHAR;
78 typedef short SHORT;
79 typedef long LONG;
80 typedef char CCHAR, *PCCHAR;
81 typedef unsigned char UCHAR,*PUCHAR;
82 typedef unsigned short USHORT,*PUSHORT;
83 typedef unsigned long ULONG,*PULONG;
84 typedef char *PSZ;
86 typedef void *PVOID,*LPVOID;
88 /* FIXME for __WIN64 */
89 #ifndef __ptr64
90 #define __ptr64
91 #endif
92 typedef void* __ptr64 PVOID64;
94 #ifndef _WCHAR_T_DEFINED
95 #define _WCHAR_T_DEFINED
96 #ifndef _WCHAR_T_
97 #define _WCHAR_T_
98 #undef __need_wchar_t
99 #ifndef __cplusplus
100 typedef unsigned short wchar_t;
101 #endif
102 #endif
103 #endif
105 typedef wchar_t WCHAR;
106 typedef WCHAR *PWCHAR,*LPWCH,*PWCH,*NWPSTR,*LPWSTR,*PWSTR;
107 typedef CONST WCHAR *LPCWCH,*PCWCH,*LPCWSTR,*PCWSTR;
108 typedef CHAR *PCHAR,*LPCH,*PCH,*NPSTR,*LPSTR,*PSTR;
109 typedef CONST CHAR *LPCCH,*PCSTR,*LPCSTR;
110 #ifndef _TCHAR_DEFINED
111 #define _TCHAR_DEFINED
112 #ifdef UNICODE
114 * NOTE: This tests UNICODE, which is different from the _UNICODE define
115 * used to differentiate standard C runtime calls.
117 typedef WCHAR TCHAR;
118 typedef WCHAR _TCHAR;
119 #else
120 typedef CHAR TCHAR;
121 typedef CHAR _TCHAR;
122 #endif
123 #endif
124 typedef TCHAR TBYTE,*PTCH,*PTBYTE;
125 typedef TCHAR *LPTCH,*PTSTR,*LPTSTR,*LP,*PTCHAR;
126 typedef const TCHAR *LPCTSTR;
127 #ifdef UNICODE
129 * __TEXT is a private macro whose specific use is to force the expansion of a
130 * macro passed as an argument to the macro TEXT. DO NOT use this
131 * macro within your programs. It's name and function could change without
132 * notice.
134 #define __TEXT(q) L##q
135 #else
136 #define __TEXT(q) q
137 #endif
139 * UNICODE a constant string when UNICODE is defined, else returns the string
140 * unmodified.
141 * The corresponding macros _TEXT() and _T() for mapping _UNICODE strings
142 * passed to C runtime functions are defined in mingw/tchar.h
144 #define TEXT(q) __TEXT(q)
145 typedef SHORT *PSHORT;
146 typedef LONG *PLONG;
147 #ifdef STRICT
148 typedef void *HANDLE;
149 #define DECLARE_HANDLE(n) typedef struct n##__{int i;}*n
150 #else
151 typedef PVOID HANDLE;
152 #define DECLARE_HANDLE(n) typedef HANDLE n
153 #endif
154 typedef HANDLE *PHANDLE,*LPHANDLE;
155 typedef DWORD LCID;
156 typedef PDWORD PLCID;
157 typedef WORD LANGID;
158 #ifdef __GNUC__
159 #define _HAVE_INT64
160 #define _INTEGRAL_MAX_BITS 64
161 #undef __int64
162 #define __int64 long long
163 #elif defined(__WATCOMC__) && (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64 )
164 #define _HAVE_INT64
165 #endif /* __GNUC__/__WATCOMC */
166 #if defined(_HAVE_INT64) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64)
167 typedef __int64 LONGLONG;
168 typedef unsigned __int64 DWORDLONG;
169 #else
170 typedef double LONGLONG,DWORDLONG;
171 #endif
172 typedef LONGLONG *PLONGLONG;
173 typedef DWORDLONG *PDWORDLONG;
174 typedef DWORDLONG ULONGLONG,*PULONGLONG;
175 typedef LONGLONG USN;
176 #ifdef _HAVE_INT64
177 #define Int32x32To64(a,b) ((LONGLONG)(a)*(LONGLONG)(b))
178 #define UInt32x32To64(a,b) ((DWORDLONG)(a)*(DWORDLONG)(b))
179 #define Int64ShllMod32(a,b) ((DWORDLONG)(a)<<(b))
180 #define Int64ShraMod32(a,b) ((LONGLONG)(a)>>(b))
181 #define Int64ShrlMod32(a,b) ((DWORDLONG)(a)>>(b))
182 #endif
183 #define ANSI_NULL '\0'
184 #define UNICODE_NULL L'\0'
185 typedef BYTE BOOLEAN,*PBOOLEAN;
186 #endif
187 typedef BYTE FCHAR;
188 typedef WORD FSHORT;
189 typedef DWORD FLONG;
191 #define NTAPI __stdcall
192 #include <basetsd.h>
193 #define ACE_OBJECT_TYPE_PRESENT 0x00000001
194 #define ACE_INHERITED_OBJECT_TYPE_PRESENT 0x00000002
195 #define APPLICATION_ERROR_MASK 0x20000000
196 #define ERROR_SEVERITY_SUCCESS 0x00000000
197 #define ERROR_SEVERITY_INFORMATIONAL 0x40000000
198 #define ERROR_SEVERITY_WARNING 0x80000000
199 #define ERROR_SEVERITY_ERROR 0xC0000000
200 /* also in ddk/ntifs.h */
201 #define COMPRESSION_FORMAT_NONE (0x0000)
202 #define COMPRESSION_FORMAT_DEFAULT (0x0001)
203 #define COMPRESSION_FORMAT_LZNT1 (0x0002)
204 #define COMPRESSION_ENGINE_STANDARD (0x0000)
205 #define COMPRESSION_ENGINE_MAXIMUM (0x0100)
206 #define COMPRESSION_ENGINE_HIBER (0x0200)
207 #define ACCESS_ALLOWED_ACE_TYPE (0x0)
208 #define ACCESS_DENIED_ACE_TYPE (0x1)
209 #define SYSTEM_AUDIT_ACE_TYPE (0x2)
210 #define SYSTEM_ALARM_ACE_TYPE (0x3)
211 /*end ntifs.h */
212 #define ANYSIZE_ARRAY 1
213 #define OBJECT_INHERIT_ACE 1
214 #define CONTAINER_INHERIT_ACE 2
215 #define NO_PROPAGATE_INHERIT_ACE 4
216 #define INHERIT_ONLY_ACE 8
217 #define INHERITED_ACE 16
218 #define VALID_INHERIT_FLAGS \
219 | OBJECT_INHERIT_ACE \
220 | CONTAINER_INHERIT_ACE \
221 | NO_PROPAGATE_INHERIT_ACE \
222 | INHERIT_ONLY_ACE \
223 | INHERITED_ACE
224 #define SUCCESSFUL_ACCESS_ACE_FLAG 64
225 #define FAILED_ACCESS_ACE_FLAG 128
226 #define DELETE 0x00010000L
227 #define READ_CONTROL 0x20000L
228 #define WRITE_DAC 0x40000L
229 #define WRITE_OWNER 0x80000L
230 #define SYNCHRONIZE 0x100000L
231 #define STANDARD_RIGHTS_REQUIRED 0xF0000
232 #define STANDARD_RIGHTS_READ 0x20000
233 #define STANDARD_RIGHTS_WRITE 0x20000
234 #define STANDARD_RIGHTS_EXECUTE 0x20000
235 #define STANDARD_RIGHTS_ALL 0x1F0000
236 #define SPECIFIC_RIGHTS_ALL 0xFFFF
237 #define ACCESS_SYSTEM_SECURITY 0x1000000
239 #define MAXIMUM_ALLOWED 0x2000000
240 #define GENERIC_READ 0x80000000
241 #define GENERIC_WRITE 0x40000000
242 #define GENERIC_EXECUTE 0x20000000
243 #define GENERIC_ALL 0x10000000
245 #define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
247 /* Also in ddk/winddk.h */
248 #define FILE_LIST_DIRECTORY 0x00000001
249 #define FILE_READ_DATA 0x00000001
250 #define FILE_ADD_FILE 0x00000002
251 #define FILE_WRITE_DATA 0x00000002
252 #define FILE_ADD_SUBDIRECTORY 0x00000004
253 #define FILE_APPEND_DATA 0x00000004
254 #define FILE_CREATE_PIPE_INSTANCE 0x00000004
255 #define FILE_READ_EA 0x00000008
256 #define FILE_READ_PROPERTIES 0x00000008
257 #define FILE_WRITE_EA 0x00000010
258 #define FILE_WRITE_PROPERTIES 0x00000010
259 #define FILE_EXECUTE 0x00000020
260 #define FILE_TRAVERSE 0x00000020
261 #define FILE_DELETE_CHILD 0x00000040
262 #define FILE_READ_ATTRIBUTES 0x00000080
263 #define FILE_WRITE_ATTRIBUTES 0x00000100
265 #define FILE_SHARE_READ 0x00000001
266 #define FILE_SHARE_WRITE 0x00000002
267 #define FILE_SHARE_DELETE 0x00000004
268 #define FILE_SHARE_VALID_FLAGS 0x00000007
270 #define FILE_ATTRIBUTE_READONLY 0x00000001
271 #define FILE_ATTRIBUTE_HIDDEN 0x00000002
272 #define FILE_ATTRIBUTE_SYSTEM 0x00000004
273 #define FILE_ATTRIBUTE_DIRECTORY 0x00000010
274 #define FILE_ATTRIBUTE_ARCHIVE 0x00000020
275 #define FILE_ATTRIBUTE_DEVICE 0x00000040
276 #define FILE_ATTRIBUTE_NORMAL 0x00000080
277 #define FILE_ATTRIBUTE_TEMPORARY 0x00000100
278 #define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
279 #define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
280 #define FILE_ATTRIBUTE_COMPRESSED 0x00000800
281 #define FILE_ATTRIBUTE_OFFLINE 0x00001000
282 #define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
283 #define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
284 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
285 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
287 #define FILE_COPY_STRUCTURED_STORAGE 0x00000041
288 #define FILE_STRUCTURED_STORAGE 0x00000441
290 #define FILE_VALID_OPTION_FLAGS 0x00ffffff
291 #define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032
292 #define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032
293 #define FILE_VALID_SET_FLAGS 0x00000036
295 #define FILE_SUPERSEDE 0x00000000
296 #define FILE_OPEN 0x00000001
297 #define FILE_CREATE 0x00000002
298 #define FILE_OPEN_IF 0x00000003
299 #define FILE_OVERWRITE 0x00000004
300 #define FILE_OVERWRITE_IF 0x00000005
301 #define FILE_MAXIMUM_DISPOSITION 0x00000005
303 #define FILE_DIRECTORY_FILE 0x00000001
304 #define FILE_WRITE_THROUGH 0x00000002
305 #define FILE_SEQUENTIAL_ONLY 0x00000004
306 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
307 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
308 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
309 #define FILE_NON_DIRECTORY_FILE 0x00000040
310 #define FILE_CREATE_TREE_CONNECTION 0x00000080
311 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
312 #define FILE_NO_EA_KNOWLEDGE 0x00000200
313 #define FILE_OPEN_FOR_RECOVERY 0x00000400
314 #define FILE_RANDOM_ACCESS 0x00000800
315 #define FILE_DELETE_ON_CLOSE 0x00001000
316 #define FILE_OPEN_BY_FILE_ID 0x00002000
317 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
318 #define FILE_NO_COMPRESSION 0x00008000
319 #define FILE_RESERVE_OPFILTER 0x00100000
320 #define FILE_OPEN_REPARSE_POINT 0x00200000
321 #define FILE_OPEN_NO_RECALL 0x00400000
322 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
324 #define FILE_ALL_ACCESS \
325 (STANDARD_RIGHTS_REQUIRED | \
326 SYNCHRONIZE | \
327 0x1FF)
329 #define FILE_GENERIC_EXECUTE \
330 (STANDARD_RIGHTS_EXECUTE | \
331 FILE_READ_ATTRIBUTES | \
332 FILE_EXECUTE | \
333 SYNCHRONIZE)
335 #define FILE_GENERIC_READ \
336 (STANDARD_RIGHTS_READ | \
337 FILE_READ_DATA | \
338 FILE_READ_ATTRIBUTES | \
339 FILE_READ_EA | \
340 SYNCHRONIZE)
342 #define FILE_GENERIC_WRITE \
343 (STANDARD_RIGHTS_WRITE | \
344 FILE_WRITE_DATA | \
345 FILE_WRITE_ATTRIBUTES | \
346 FILE_WRITE_EA | \
347 FILE_APPEND_DATA | \
348 SYNCHRONIZE)
349 /* end winddk.h */
350 /* also in ddk/ntifs.h */
351 #define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
352 #define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
353 #define FILE_NOTIFY_CHANGE_NAME 0x00000003
354 #define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
355 #define FILE_NOTIFY_CHANGE_SIZE 0x00000008
356 #define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
357 #define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
358 #define FILE_NOTIFY_CHANGE_CREATION 0x00000040
359 #define FILE_NOTIFY_CHANGE_EA 0x00000080
360 #define FILE_NOTIFY_CHANGE_SECURITY 0x00000100
361 #define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200
362 #define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400
363 #define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800
364 #define FILE_NOTIFY_VALID_MASK 0x00000fff
366 #define FILE_CASE_SENSITIVE_SEARCH 0x00000001
367 #define FILE_CASE_PRESERVED_NAMES 0x00000002
368 #define FILE_UNICODE_ON_DISK 0x00000004
369 #define FILE_PERSISTENT_ACLS 0x00000008
370 #define FILE_FILE_COMPRESSION 0x00000010
371 #define FILE_VOLUME_QUOTAS 0x00000020
372 #define FILE_SUPPORTS_SPARSE_FILES 0x00000040
373 #define FILE_SUPPORTS_REPARSE_POINTS 0x00000080
374 #define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100
375 #define FS_LFN_APIS 0x00004000
376 #define FILE_VOLUME_IS_COMPRESSED 0x00008000
377 #define FILE_SUPPORTS_OBJECT_IDS 0x00010000
378 #define FILE_SUPPORTS_ENCRYPTION 0x00020000
379 #define FILE_NAMED_STREAMS 0x00040000
381 #define IO_COMPLETION_QUERY_STATE 0x0001
382 #define IO_COMPLETION_MODIFY_STATE 0x0002
383 #define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
384 /* end ntifs.h */
386 /* also in ddk/winddk.h */
387 #define DUPLICATE_CLOSE_SOURCE 0x00000001
388 #define DUPLICATE_SAME_ACCESS 0x00000002
389 #define DUPLICATE_SAME_ATTRIBUTES 0x00000004
390 /* end winddk.k */
392 #define MAILSLOT_NO_MESSAGE ((DWORD)-1)
393 #define MAILSLOT_WAIT_FOREVER ((DWORD)-1)
394 #define PROCESS_TERMINATE 1
395 #define PROCESS_CREATE_THREAD 2
396 #define PROCESS_SET_SESSIONID 4
397 #define PROCESS_VM_OPERATION 8
398 #define PROCESS_VM_READ 16
399 #define PROCESS_VM_WRITE 32
400 #define PROCESS_DUP_HANDLE 64
401 #define PROCESS_CREATE_PROCESS 128
402 #define PROCESS_SET_QUOTA 256
403 #define PROCESS_SET_INFORMATION 512
404 #define PROCESS_QUERY_INFORMATION 1024
405 #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xFFF)
406 #define THREAD_TERMINATE 1
407 #define THREAD_SUSPEND_RESUME 2
408 #define THREAD_GET_CONTEXT 8
409 #define THREAD_SET_CONTEXT 16
410 #define THREAD_SET_INFORMATION 32
411 #define THREAD_QUERY_INFORMATION 64
412 #define THREAD_SET_THREAD_TOKEN 128
413 #define THREAD_IMPERSONATE 256
414 #define THREAD_DIRECT_IMPERSONATION 0x200
415 #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3FF)
416 #define THREAD_BASE_PRIORITY_LOWRT 15
417 #define THREAD_BASE_PRIORITY_MAX 2
418 #define THREAD_BASE_PRIORITY_MIN (-2)
419 #define THREAD_BASE_PRIORITY_IDLE (-15)
420 #define EXCEPTION_NONCONTINUABLE 1
421 #define EXCEPTION_MAXIMUM_PARAMETERS 15
422 #define MUTANT_QUERY_STATE 0x0001
423 #define MUTANT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|MUTANT_QUERY_STATE)
424 #define TIMER_QUERY_STATE 0x0001
425 #define TIMER_MODIFY_STATE 0x0002
426 #define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|TIMER_QUERY_STATE|TIMER_MODIFY_STATE)
428 * To prevent gcc compiler warnings, bracket these defines when initialising
429 * a SID_IDENTIFIER_AUTHORITY, eg.
430 * SID_IDENTIFIER_AUTHORITY aNullSidAuthority = {SECURITY_NULL_SID_AUTHORITY};
432 #define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0}
433 #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
434 #define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2}
435 #define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3}
436 #define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4}
437 #define SECURITY_NT_AUTHORITY {0,0,0,0,0,5}
438 #define SECURITY_NULL_RID 0
439 #define SECURITY_WORLD_RID (0x00000000L)
440 #define SECURITY_LOCAL_RID 0
441 #define SECURITY_CREATOR_OWNER_RID 0
442 #define SECURITY_CREATOR_GROUP_RID 1
443 #define SECURITY_DIALUP_RID 1
444 #define SECURITY_NETWORK_RID 2
445 #define SECURITY_BATCH_RID 3
446 #define SECURITY_INTERACTIVE_RID 4
447 #define SECURITY_LOGON_IDS_RID 5
448 #define SECURITY_SERVICE_RID 6
449 #define SECURITY_LOCAL_SYSTEM_RID 18
450 #define SECURITY_BUILTIN_DOMAIN_RID 32
451 #define SECURITY_PRINCIPAL_SELF_RID 10
452 #define SECURITY_CREATOR_OWNER_SERVER_RID 0x2
453 #define SECURITY_CREATOR_GROUP_SERVER_RID 0x3
454 #define SECURITY_LOGON_IDS_RID_COUNT 0x3
455 #define SECURITY_ANONYMOUS_LOGON_RID 0x7
456 #define SECURITY_PROXY_RID 0x8
457 #define SECURITY_ENTERPRISE_CONTROLLERS_RID 0x9
458 #define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID
459 #define SECURITY_AUTHENTICATED_USER_RID 0xB
460 #define SECURITY_RESTRICTED_CODE_RID 0xC
461 #define SECURITY_NT_NON_UNIQUE_RID 0x15
462 #define SID_REVISION 1
463 #define DOMAIN_USER_RID_ADMIN 0x1F4L
464 #define DOMAIN_USER_RID_GUEST 0x1F5L
465 #define DOMAIN_GROUP_RID_ADMINS 0x200L
466 #define DOMAIN_GROUP_RID_USERS 0x201L
467 #define DOMAIN_ALIAS_RID_ADMINS 0x220L
468 #define DOMAIN_ALIAS_RID_USERS 0x221L
469 #define DOMAIN_ALIAS_RID_GUESTS 0x222L
470 #define DOMAIN_ALIAS_RID_POWER_USERS 0x223L
471 #define DOMAIN_ALIAS_RID_ACCOUNT_OPS 0x224L
472 #define DOMAIN_ALIAS_RID_SYSTEM_OPS 0x225L
473 #define DOMAIN_ALIAS_RID_PRINT_OPS 0x226L
474 #define DOMAIN_ALIAS_RID_BACKUP_OPS 0x227L
475 #define DOMAIN_ALIAS_RID_REPLICATOR 0x228L
476 #define SE_CREATE_TOKEN_NAME TEXT("SeCreateTokenPrivilege")
477 #define SE_ASSIGNPRIMARYTOKEN_NAME TEXT("SeAssignPrimaryTokenPrivilege")
478 #define SE_LOCK_MEMORY_NAME TEXT("SeLockMemoryPrivilege")
479 #define SE_INCREASE_QUOTA_NAME TEXT("SeIncreaseQuotaPrivilege")
480 #define SE_UNSOLICITED_INPUT_NAME TEXT("SeUnsolicitedInputPrivilege")
481 #define SE_MACHINE_ACCOUNT_NAME TEXT("SeMachineAccountPrivilege")
482 #define SE_TCB_NAME TEXT("SeTcbPrivilege")
483 #define SE_SECURITY_NAME TEXT("SeSecurityPrivilege")
484 #define SE_TAKE_OWNERSHIP_NAME TEXT("SeTakeOwnershipPrivilege")
485 #define SE_LOAD_DRIVER_NAME TEXT("SeLoadDriverPrivilege")
486 #define SE_SYSTEM_PROFILE_NAME TEXT("SeSystemProfilePrivilege")
487 #define SE_SYSTEMTIME_NAME TEXT("SeSystemtimePrivilege")
488 #define SE_PROF_SINGLE_PROCESS_NAME TEXT("SeProfileSingleProcessPrivilege")
489 #define SE_INC_BASE_PRIORITY_NAME TEXT("SeIncreaseBasePriorityPrivilege")
490 #define SE_CREATE_PAGEFILE_NAME TEXT("SeCreatePagefilePrivilege")
491 #define SE_CREATE_PERMANENT_NAME TEXT("SeCreatePermanentPrivilege")
492 #define SE_BACKUP_NAME TEXT("SeBackupPrivilege")
493 #define SE_RESTORE_NAME TEXT("SeRestorePrivilege")
494 #define SE_SHUTDOWN_NAME TEXT("SeShutdownPrivilege")
495 #define SE_DEBUG_NAME TEXT("SeDebugPrivilege")
496 #define SE_AUDIT_NAME TEXT("SeAuditPrivilege")
497 #define SE_SYSTEM_ENVIRONMENT_NAME TEXT("SeSystemEnvironmentPrivilege")
498 #define SE_CHANGE_NOTIFY_NAME TEXT("SeChangeNotifyPrivilege")
499 #define SE_REMOTE_SHUTDOWN_NAME TEXT("SeRemoteShutdownPrivilege")
500 #define SE_CREATE_GLOBAL_NAME TEXT("SeCreateGlobalPrivilege")
501 #define SE_UNDOCK_NAME TEXT("SeUndockPrivilege")
502 #define SE_MANAGE_VOLUME_NAME TEXT("SeManageVolumePrivilege")
503 #define SE_IMPERSONATE_NAME TEXT("SeImpersonatePrivilege")
504 #define SE_ENABLE_DELEGATION_NAME TEXT("SeEnableDelegationPrivilege")
505 #define SE_SYNC_AGENT_NAME TEXT("SeSyncAgentPrivilege")
506 #define SE_RELABEL_NAME TEXT("SeRelabelPrivilege")
507 #define SE_INCREASE_WORKING_SET_NAME TEXT("SeIncreaseWorkingSetPrivilege")
508 #define SE_TIME_ZONE_NAME TEXT("SeTimeZonePrivilege")
509 #define SE_CREATE_SYMBOLIC_LINK_NAME TEXT("SeCreateSymbolicLinkPrivilege")
510 #define SE_GROUP_MANDATORY 1
511 #define SE_GROUP_ENABLED_BY_DEFAULT 2
512 #define SE_GROUP_ENABLED 4
513 #define SE_GROUP_OWNER 8
514 #define SE_GROUP_USE_FOR_DENY_ONLY 16
515 #define SE_GROUP_LOGON_ID 3221225472U
516 #define SE_GROUP_RESOURCE 536870912
517 #define LANG_NEUTRAL 0x00
518 #define LANG_ARABIC 0x01
519 #define LANG_BULGARIAN 0x02
520 #define LANG_CATALAN 0x03
521 #define LANG_CHINESE 0x04
522 #define LANG_CZECH 0x05
523 #define LANG_DANISH 0x06
524 #define LANG_GERMAN 0x07
525 #define LANG_GREEK 0x08
526 #define LANG_ENGLISH 0x09
527 #define LANG_SPANISH 0x0a
528 #define LANG_FINNISH 0x0b
529 #define LANG_FRENCH 0x0c
530 #define LANG_HEBREW 0x0d
531 #define LANG_HUNGARIAN 0x0e
532 #define LANG_ICELANDIC 0x0f
533 #define LANG_ITALIAN 0x10
534 #define LANG_JAPANESE 0x11
535 #define LANG_KOREAN 0x12
536 #define LANG_DUTCH 0x13
537 #define LANG_NORWEGIAN 0x14
538 #define LANG_POLISH 0x15
539 #define LANG_PORTUGUESE 0x16
540 #define LANG_ROMANIAN 0x18
541 #define LANG_RUSSIAN 0x19
542 #define LANG_CROATIAN 0x1a
543 #define LANG_SERBIAN 0x1a
544 #define LANG_SERBIAN_NEUTRAL 0x7c1a
545 #define LANG_BOSNIAN 0x1a
546 #define LANG_BOSNIAN_NEUTRAL 0x781a
547 #define LANG_SLOVAK 0x1b
548 #define LANG_ALBANIAN 0x1c
549 #define LANG_SWEDISH 0x1d
550 #define LANG_THAI 0x1e
551 #define LANG_TURKISH 0x1f
552 #define LANG_URDU 0x20
553 #define LANG_INDONESIAN 0x21
554 #define LANG_UKRAINIAN 0x22
555 #define LANG_BELARUSIAN 0x23
556 #define LANG_SLOVENIAN 0x24
557 #define LANG_ESTONIAN 0x25
558 #define LANG_LATVIAN 0x26
559 #define LANG_LITHUANIAN 0x27
560 #define LANG_PERSIAN 0x29
561 #define LANG_FARSI LANG_PERSIAN
562 #define LANG_VIETNAMESE 0x2a
563 #define LANG_ARMENIAN 0x2b
564 #define LANG_AZERI 0x2c
565 #define LANG_BASQUE 0x2d
566 #define LANG_LOWER_SORBIAN 0x2e
567 #define LANG_UPPER_SORBIAN 0x2e
568 #define LANG_MACEDONIAN 0x2f
569 #define LANG_TSWANA 0x32
570 #define LANG_XHOSA 0x34
571 #define LANG_ZULU 0x35
572 #define LANG_AFRIKAANS 0x36
573 #define LANG_GEORGIAN 0x37
574 #define LANG_FAEROESE 0x38
575 #define LANG_HINDI 0x39
576 #define LANG_MALTESE 0x3a
577 #define LANG_SAMI 0x3b
578 #define LANG_IRISH 0x3c
579 #define LANG_MALAY 0x3e
580 #define LANG_KAZAK 0x3f
581 #define LANG_KYRGYZ 0x40
582 #define LANG_SWAHILI 0x41
583 #define LANG_UZBEK 0x43
584 #define LANG_TATAR 0x44
585 #define LANG_BENGALI 0x45
586 #define LANG_PUNJABI 0x46
587 #define LANG_GUJARATI 0x47
588 #define LANG_ORIYA 0x48
589 #define LANG_TAMIL 0x49
590 #define LANG_TELUGU 0x4a
591 #define LANG_KANNADA 0x4b
592 #define LANG_MALAYALAM 0x4c
593 #define LANG_ASSAMESE 0x4d
594 #define LANG_MARATHI 0x4e
595 #define LANG_SANSKRIT 0x4f
596 #define LANG_MONGOLIAN 0x50
597 #define LANG_TIBETAN 0x51
598 #define LANG_WELSH 0x52
599 #define LANG_KHMER 0x53
600 #define LANG_LAO 0x54
601 #define LANG_GALICIAN 0x56
602 #define LANG_KONKANI 0x57
603 #define LANG_MANIPURI 0x58
604 #define LANG_SINDHI 0x59
605 #define LANG_SYRIAC 0x5a
606 #define LANG_SINHALESE 0x5b
607 #define LANG_INUKTITUT 0x5d
608 #define LANG_AMHARIC 0x5e
609 #define LANG_TAMAZIGHT 0x5f
610 #define LANG_KASHMIRI 0x60
611 #define LANG_NEPALI 0x61
612 #define LANG_FRISIAN 0x62
613 #define LANG_PASHTO 0x63
614 #define LANG_FILIPINO 0x64
615 #define LANG_DIVEHI 0x65
616 #define LANG_HAUSA 0x68
617 #define LANG_YORUBA 0x6a
618 #define LANG_QUECHUA 0x6b
619 #define LANG_SOTHO 0x6c
620 #define LANG_BASHKIR 0x6d
621 #define LANG_LUXEMBOURGISH 0x6e
622 #define LANG_GREENLANDIC 0x6f
623 #define LANG_IGBO 0x70
624 #define LANG_TIGRIGNA 0x73
625 #define LANG_YI 0x78
626 #define LANG_MAPUDUNGUN 0x7a
627 #define LANG_MOHAWK 0x7c
628 #define LANG_BRETON 0x7e
629 #define LANG_INVARIANT 0x7f
630 #define LANG_UIGHUR 0x80
631 #define LANG_MAORI 0x81
632 #define LANG_OCCITAN 0x82
633 #define LANG_CORSICAN 0x83
634 #define LANG_ALSATIAN 0x84
635 #define LANG_YAKUT 0x85
636 #define LANG_KICHE 0x86
637 #define LANG_KINYARWANDA 0x87
638 #define LANG_WOLOF 0x88
639 #define LANG_DARI 0x8c
640 #define LANG_MALAGASY 0x8d
641 #define SUBLANG_NEUTRAL 0x00
642 #define SUBLANG_DEFAULT 0x01
643 #define SUBLANG_SYS_DEFAULT 0x02
644 #define SUBLANG_CUSTOM_DEFAULT 0x03
645 #define SUBLANG_CUSTOM_UNSPECIFIED 0x04
646 #define SUBLANG_UI_CUSTOM_DEFAULT 0x03
647 #define SUBLANG_AFRIKAANS_SOUTH_AFRICA 0x01
648 #define SUBLANG_ALBANIAN_ALBANIA 0x01
649 #define SUBLANG_ALSATIAN_FRANCE 0x01
650 #define SUBLANG_AMHARIC_ETHIOPIA 0x01
651 #define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
652 #define SUBLANG_ARABIC_IRAQ 0x02
653 #define SUBLANG_ARABIC_EGYPT 0x03
654 #define SUBLANG_ARABIC_LIBYA 0x04
655 #define SUBLANG_ARABIC_ALGERIA 0x05
656 #define SUBLANG_ARABIC_MOROCCO 0x06
657 #define SUBLANG_ARABIC_TUNISIA 0x07
658 #define SUBLANG_ARABIC_OMAN 0x08
659 #define SUBLANG_ARABIC_YEMEN 0x09
660 #define SUBLANG_ARABIC_SYRIA 0x0a
661 #define SUBLANG_ARABIC_JORDAN 0x0b
662 #define SUBLANG_ARABIC_LEBANON 0x0c
663 #define SUBLANG_ARABIC_KUWAIT 0x0d
664 #define SUBLANG_ARABIC_UAE 0x0e
665 #define SUBLANG_ARABIC_BAHRAIN 0x0f
666 #define SUBLANG_ARABIC_QATAR 0x10
667 #define SUBLANG_ARMENIAN_ARMENIA 0x01
668 #define SUBLANG_ASSAMESE_INDIA 0x01
669 #define SUBLANG_AZERI_LATIN 0x01
670 #define SUBLANG_AZERI_CYRILLIC 0x02
671 #define SUBLANG_BASHKIR_RUSSIA 0x01
672 #define SUBLANG_BASQUE_BASQUE 0x01
673 #define SUBLANG_BELARUSIAN_BELARUS 0x01
674 #define SUBLANG_BENGALI_INDIA 0x01
675 #define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN 0x05
676 #define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x08
677 #define SUBLANG_BRETON_FRANCE 0x01
678 #define SUBLANG_BULGARIAN_BULGARIA 0x01
679 #define SUBLANG_CATALAN_CATALAN 0x01
680 #define SUBLANG_CHINESE_TRADITIONAL 0x01
681 #define SUBLANG_CHINESE_SIMPLIFIED 0x02
682 #define SUBLANG_CHINESE_HONGKONG 0x03
683 #define SUBLANG_CHINESE_SINGAPORE 0x04
684 #define SUBLANG_CHINESE_MACAU 0x05
685 #define SUBLANG_CORSICAN_FRANCE 0x01
686 #define SUBLANG_CZECH_CZECH_REPUBLIC 0x01
687 #define SUBLANG_CROATIAN_CROATIA 0x01
688 #define SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN 0x04
689 #define SUBLANG_DANISH_DENMARK 0x01
690 #define SUBLANG_DIVEHI_MALDIVES 0x01
691 #define SUBLANG_DUTCH 0x01
692 #define SUBLANG_DUTCH_BELGIAN 0x02
693 #define SUBLANG_ENGLISH_US 0x01
694 #define SUBLANG_ENGLISH_UK 0x02
695 #define SUBLANG_ENGLISH_AUS 0x03
696 #define SUBLANG_ENGLISH_CAN 0x04
697 #define SUBLANG_ENGLISH_NZ 0x05
698 #if (WINVER >= 0x0600)
699 #define SUBLANG_ENGLISH_IRELAND 0x06
700 #endif
701 #define SUBLANG_ENGLISH_EIRE 0x06
702 #define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07
703 #define SUBLANG_ENGLISH_JAMAICA 0x08
704 #define SUBLANG_ENGLISH_CARIBBEAN 0x09
705 #define SUBLANG_ENGLISH_BELIZE 0x0a
706 #define SUBLANG_ENGLISH_TRINIDAD 0x0b
707 #define SUBLANG_ENGLISH_ZIMBABWE 0x0c
708 #define SUBLANG_ENGLISH_PHILIPPINES 0x0d
709 #define SUBLANG_ENGLISH_INDIA 0x10
710 #define SUBLANG_ENGLISH_MALAYSIA 0x11
711 #define SUBLANG_ENGLISH_SINGAPORE 0x12
712 #define SUBLANG_ESTONIAN_ESTONIA 0x01
713 #define SUBLANG_FAEROESE_FAROE_ISLANDS 0x01
714 #define SUBLANG_FILIPINO_PHILIPPINES 0x01
715 #define SUBLANG_FINNISH_FINLAND 0x01
716 #define SUBLANG_FRENCH 0x01
717 #define SUBLANG_FRENCH_BELGIAN 0x02
718 #define SUBLANG_FRENCH_CANADIAN 0x03
719 #define SUBLANG_FRENCH_SWISS 0x04
720 #define SUBLANG_FRENCH_LUXEMBOURG 0x05
721 #define SUBLANG_FRENCH_MONACO 0x06
722 #define SUBLANG_FRISIAN_NETHERLANDS 0x01
723 #define SUBLANG_GALICIAN_GALICIAN 0x01
724 #define SUBLANG_GEORGIAN_GEORGIA 0x01
725 #define SUBLANG_GERMAN 0x01
726 #define SUBLANG_GERMAN_SWISS 0x02
727 #define SUBLANG_GERMAN_AUSTRIAN 0x03
728 #define SUBLANG_GERMAN_LUXEMBOURG 0x04
729 #define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
730 #define SUBLANG_GREEK_GREECE 0x01
731 #define SUBLANG_GREENLANDIC_GREENLAND 0x01
732 #define SUBLANG_GUJARATI_INDIA 0x01
733 #define SUBLANG_HAUSA_NIGERIA 0x01
734 #define SUBLANG_HEBREW_ISRAEL 0x01
735 #define SUBLANG_HINDI_INDIA 0x01
736 #define SUBLANG_HUNGARIAN_HUNGARY 0x01
737 #define SUBLANG_ICELANDIC_ICELAND 0x01
738 #define SUBLANG_IGBO_NIGERIA 0x01
739 #define SUBLANG_INDONESIAN_INDONESIA 0x01
740 #define SUBLANG_INUKTITUT_CANADA 0x01
741 #define SUBLANG_INUKTITUT_CANADA_LATIN 0x01
742 #define SUBLANG_IRISH_IRELAND 0x01
743 #define SUBLANG_ITALIAN 0x01
744 #define SUBLANG_ITALIAN_SWISS 0x02
745 #define SUBLANG_JAPANESE_JAPAN 0x01
746 #define SUBLANG_KASHMIRI_INDIA 0x02
747 #define SUBLANG_KASHMIRI_SASIA 0x02
748 #define SUBLANG_KAZAK_KAZAKHSTAN 0x01
749 #define SUBLANG_KHMER_CAMBODIA 0x01
750 #define SUBLANG_KICHE_GUATEMALA 0x01
751 #define SUBLANG_KINYARWANDA_RWANDA 0x01
752 #define SUBLANG_KONKANI_INDIA 0x01
753 #define SUBLANG_KOREAN 0x01
754 #define SUBLANG_KYRGYZ_KYRGYZSTAN 0x01
755 #define SUBLANG_LAO_LAO_PDR 0x01
756 #define SUBLANG_LATVIAN_LATVIA 0x01
757 #if (WINVER >= 0x0600)
758 #define SUBLANG_LITHUANIAN_LITHUANIA 0x01
759 #endif
760 #define SUBLANG_LITHUANIAN 0x01
761 #define SUBLANG_LOWER_SORBIAN_GERMANY 0x01
762 #define SUBLANG_LUXEMBOURGISH_LUXEMBOURG 0x01
763 #define SUBLANG_MACEDONIAN_MACEDONIA 0x01
764 #define SUBLANG_MALAY_MALAYSIA 0x01
765 #define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
766 #define SUBLANG_MALAYALAM_INDIA 0x01
767 #define SUBLANG_MALTESE_MALTA 0x01
768 #define SUBLANG_MAORI_NEW_ZEALAND 0x01
769 #define SUBLANG_MAPUDUNGUN_CHILE 0x01
770 #define SUBLANG_MARATHI_INDIA 0x01
771 #define SUBLANG_MOHAWK_MOHAWK 0x01
772 #define SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA 0x01
773 #define SUBLANG_MONGOLIAN_PRC 0x02
774 #define SUBLANG_NEPALI_NEPAL 0x01
775 #define SUBLANG_NEPALI_INDIA 0x02
776 #define SUBLANG_NORWEGIAN_BOKMAL 0x01
777 #define SUBLANG_NORWEGIAN_NYNORSK 0x02
778 #define SUBLANG_OCCITAN_FRANCE 0x01
779 #define SUBLANG_ORIYA_INDIA 0x01
780 #define SUBLANG_PASHTO_AFGHANISTAN 0x01
781 #define SUBLANG_PERSIAN_IRAN 0x01
782 #define SUBLANG_POLISH_POLAND 0x01
783 #define SUBLANG_PORTUGUESE_BRAZILIAN 0x01
784 #if (WINVER >= 0x0600)
785 #define SUBLANG_PORTUGUESE_PORTUGAL 0x02
786 #endif
787 #define SUBLANG_PORTUGUESE 0x02
788 #define SUBLANG_PUNJABI_INDIA 0x01
789 #define SUBLANG_QUECHUA_BOLIVIA 0x01
790 #define SUBLANG_QUECHUA_ECUADOR 0x02
791 #define SUBLANG_QUECHUA_PERU 0x03
792 #define SUBLANG_ROMANIAN_ROMANIA 0x01
793 #define SUBLANG_ROMANSH_SWITZERLAND 0x01
794 #define SUBLANG_RUSSIAN_RUSSIA 0x01
795 #define SUBLANG_SAMI_NORTHERN_NORWAY 0x01
796 #define SUBLANG_SAMI_NORTHERN_SWEDEN 0x02
797 #define SUBLANG_SAMI_NORTHERN_FINLAND 0x03
798 #define SUBLANG_SAMI_LULE_NORWAY 0x04
799 #define SUBLANG_SAMI_LULE_SWEDEN 0x05
800 #define SUBLANG_SAMI_SOUTHERN_NORWAY 0x06
801 #define SUBLANG_SAMI_SOUTHERN_SWEDEN 0x07
802 #define SUBLANG_SAMI_SKOLT_FINLAND 0x03
803 #define SUBLANG_SAMI_INARI_FINLAND 0x03
804 #define SUBLANG_SANSKRIT_INDIA 0x01
805 #define SUBLANG_SERBIAN_LATIN 0x02
806 #define SUBLANG_SERBIAN_CYRILLIC 0x03
807 #define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN 0x06
808 #define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x07
809 #define SUBLANG_SINDHI_AFGHANISTAN 0x02
810 #define SUBLANG_SINHALESE_SRI_LANKA 0x01
811 #define SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA 0x01
812 #define SUBLANG_SLOVAK_SLOVAKIA 0x01
813 #define SUBLANG_SLOVENIAN_SLOVENIA 0x01
814 #define SUBLANG_SPANISH 0x01
815 #define SUBLANG_SPANISH_MEXICAN 0x02
816 #define SUBLANG_SPANISH_MODERN 0x03
817 #define SUBLANG_SPANISH_GUATEMALA 0x04
818 #define SUBLANG_SPANISH_COSTA_RICA 0x05
819 #define SUBLANG_SPANISH_PANAMA 0x06
820 #define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07
821 #define SUBLANG_SPANISH_VENEZUELA 0x08
822 #define SUBLANG_SPANISH_COLOMBIA 0x09
823 #define SUBLANG_SPANISH_PERU 0x0a
824 #define SUBLANG_SPANISH_ARGENTINA 0x0b
825 #define SUBLANG_SPANISH_ECUADOR 0x0c
826 #define SUBLANG_SPANISH_CHILE 0x0d
827 #define SUBLANG_SPANISH_URUGUAY 0x0e
828 #define SUBLANG_SPANISH_PARAGUAY 0x0f
829 #define SUBLANG_SPANISH_BOLIVIA 0x10
830 #define SUBLANG_SPANISH_EL_SALVADOR 0x11
831 #define SUBLANG_SPANISH_HONDURAS 0x12
832 #define SUBLANG_SPANISH_NICARAGUA 0x13
833 #define SUBLANG_SPANISH_PUERTO_RICO 0x14
834 #define SUBLANG_SPANISH_US 0x15
835 #if (WINVER >= 0x0600)
836 #define SUBLANG_SWEDISH_SWEDEN 0x01
837 #endif
838 #define SUBLANG_SWEDISH 0x01
839 #define SUBLANG_SWEDISH_FINLAND 0x02
840 #define SUBLANG_SYRIAC 0x01
841 #define SUBLANG_TAJIK_TAJIKISTAN 0x01
842 #define SUBLANG_TAMAZIGHT_ALGERIA_LATIN 0x02
843 #define SUBLANG_TAMIL_INDIA 0x01
844 #define SUBLANG_TATAR_RUSSIA 0x01
845 #define SUBLANG_TELUGU_INDIA 0x01
846 #define SUBLANG_THAI_THAILAND 0x01
847 #define SUBLANG_TIBETAN_PRC 0x01
848 #define SUBLANG_TIBETAN_BHUTAN 0x01
849 #define SUBLANG_TIGRIGNA_ERITREA 0x01
850 #define SUBLANG_TSWANA_SOUTH_AFRICA 0x01
851 #define SUBLANG_TURKISH_TURKEY 0x01
852 #define SUBLANG_TURKMEN_TURKMENISTAN 0x01
853 #define SUBLANG_UIGHUR_PRC 0x01
854 #define SUBLANG_UKRAINIAN_UKRAINE 0x01
855 #define SUBLANG_UPPER_SORBIAN_GERMANY 0x01
856 #define SUBLANG_URDU_PAKISTAN 0x01
857 #define SUBLANG_URDU_INDIA 0x02
858 #define SUBLANG_UZBEK_LATIN 0x01
859 #define SUBLANG_UZBEK_CYRILLIC 0x02
860 #define SUBLANG_VIETNAMESE_VIETNAM 0x01
861 #define SUBLANG_WELSH_UNITED_KINGDOM 0x01
862 #define SUBLANG_WOLOF_SENEGAL 0x01
863 #define SUBLANG_YORUBA_NIGERIA 0x01
864 #define SUBLANG_XHOSA_SOUTH_AFRICA 0x01
865 #define SUBLANG_YAKUT_RUSSIA 0x01
866 #define SUBLANG_YI_PRC 0x01
867 #define SUBLANG_ZULU_SOUTH_AFRICA 0x01
868 #define NLS_VALID_LOCALE_MASK 1048575
869 #define SORT_DEFAULT 0
870 #define SORT_JAPANESE_XJIS 0
871 #define SORT_JAPANESE_UNICODE 1
872 #define SORT_CHINESE_BIG5 0
873 #define SORT_CHINESE_PRCP 0
874 #define SORT_CHINESE_UNICODE 1
875 #define SORT_CHINESE_PRC 2
876 #define SORT_CHINESE_BOPOMOFO 3
877 #define SORT_KOREAN_KSC 0
878 #define SORT_KOREAN_UNICODE 1
879 #define SORT_GERMAN_PHONE_BOOK 1
880 #define SORT_HUNGARIAN_DEFAULT 0
881 #define SORT_HUNGARIAN_TECHNICAL 1
882 #define SORT_GEORGIAN_TRADITIONAL 0
883 #define SORT_GEORGIAN_MODERN 1
884 #define MAKELANGID(p,s) ((((WORD)(s))<<10)|(WORD)(p))
885 #define MAKELCID(l,s) ((DWORD)((((DWORD)((WORD)(s)))<<16)|((DWORD)((WORD)(l)))))
886 #define PRIMARYLANGID(l) ((WORD)(l)&0x3ff)
887 #define SORTIDFROMLCID(l) ((WORD)((((DWORD)(l))&NLS_VALID_LOCALE_MASK)>>16))
888 #define SORTVERSIONFROMLCID(l) ((WORD)((((DWORD)(l))>>20)&0xf))
889 #define SUBLANGID(l) ((WORD)(l)>>10)
890 #define LANGIDFROMLCID(l) ((WORD)(l))
891 #define LANG_SYSTEM_DEFAULT MAKELANGID(LANG_NEUTRAL,SUBLANG_SYS_DEFAULT)
892 #define LANG_USER_DEFAULT MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT)
893 #define LOCALE_NEUTRAL MAKELCID(MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL),SORT_DEFAULT)
894 #define ACL_REVISION 2
895 #define ACL_REVISION_DS 4
896 #define ACL_REVISION1 1
897 #define ACL_REVISION2 2
898 #define ACL_REVISION3 3
899 #define ACL_REVISION4 4
900 #define MIN_ACL_REVISION 2
901 #define MAX_ACL_REVISION 4
902 #define MINCHAR 0x80
903 #define MAXCHAR 0x7f
904 #define MINSHORT 0x8000
905 #define MAXSHORT 0x7fff
906 #define MINLONG 0x80000000
907 #define MAXLONG 0x7fffffff
908 #define MAXBYTE 0xff
909 #define MAXWORD 0xffff
910 #define MAXDWORD 0xffffffff
911 #define PROCESSOR_INTEL_386 386
912 #define PROCESSOR_INTEL_486 486
913 #define PROCESSOR_INTEL_PENTIUM 586
914 #define PROCESSOR_MIPS_R4000 4000
915 #define PROCESSOR_ALPHA_21064 21064
916 #define PROCESSOR_INTEL_IA64 2200
917 #define PROCESSOR_ARCHITECTURE_INTEL 0
918 #define PROCESSOR_ARCHITECTURE_MIPS 1
919 #define PROCESSOR_ARCHITECTURE_ALPHA 2
920 #define PROCESSOR_ARCHITECTURE_PPC 3
921 #define PROCESSOR_ARCHITECTURE_SHX 4
922 #define PROCESSOR_ARCHITECTURE_ARM 5
923 #define PROCESSOR_ARCHITECTURE_IA64 6
924 #define PROCESSOR_ARCHITECTURE_ALPHA64 7
925 #define PROCESSOR_ARCHITECTURE_MSIL 8
926 #define PROCESSOR_ARCHITECTURE_AMD64 9
927 #define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 10
928 #define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
929 #define PF_FLOATING_POINT_PRECISION_ERRATA 0
930 #define PF_FLOATING_POINT_EMULATED 1
931 #define PF_COMPARE_EXCHANGE_DOUBLE 2
932 #define PF_MMX_INSTRUCTIONS_AVAILABLE 3
933 #define PF_PPC_MOVEMEM_64BIT_OK 4
934 #define PF_ALPHA_BYTE_INSTRUCTIONS 5
935 #define PF_XMMI_INSTRUCTIONS_AVAILABLE 6
936 #define PF_3DNOW_INSTRUCTIONS_AVAILABLE 7
937 #define PF_RDTSC_INSTRUCTION_AVAILABLE 8
938 #define PF_PAE_ENABLED 9
939 #define PF_XMMI64_INSTRUCTIONS_AVAILABLE 10
940 /* also in ddk/ntifs.h */
941 #define FILE_ACTION_ADDED 0x00000001
942 #define FILE_ACTION_REMOVED 0x00000002
943 #define FILE_ACTION_MODIFIED 0x00000003
944 #define FILE_ACTION_RENAMED_OLD_NAME 0x00000004
945 #define FILE_ACTION_RENAMED_NEW_NAME 0x00000005
946 #define FILE_ACTION_ADDED_STREAM 0x00000006
947 #define FILE_ACTION_REMOVED_STREAM 0x00000007
948 #define FILE_ACTION_MODIFIED_STREAM 0x00000008
949 #define FILE_ACTION_REMOVED_BY_DELETE 0x00000009
950 #define FILE_ACTION_ID_NOT_TUNNELLED 0x0000000A
951 #define FILE_ACTION_TUNNELLED_ID_COLLISION 0x0000000B
952 /* end ntifs.h */
953 #define HEAP_NO_SERIALIZE 1
954 #define HEAP_GROWABLE 2
955 #define HEAP_GENERATE_EXCEPTIONS 4
956 #define HEAP_ZERO_MEMORY 8
957 #define HEAP_REALLOC_IN_PLACE_ONLY 16
958 #define HEAP_TAIL_CHECKING_ENABLED 32
959 #define HEAP_FREE_CHECKING_ENABLED 64
960 #define HEAP_DISABLE_COALESCE_ON_FREE 128
961 #define HEAP_CREATE_ALIGN_16 0x0000
962 #define HEAP_CREATE_ENABLE_TRACING 0x20000
963 #define HEAP_MAXIMUM_TAG 0xFFF
964 #define HEAP_PSEUDO_TAG_FLAG 0x8000
965 #define HEAP_TAG_SHIFT 16
966 #define HEAP_MAKE_TAG_FLAGS(b,o) ((DWORD)((b)+(o)<<16)))
967 #define KEY_QUERY_VALUE 1
968 #define KEY_SET_VALUE 2
969 #define KEY_CREATE_SUB_KEY 4
970 #define KEY_ENUMERATE_SUB_KEYS 8
971 #define KEY_NOTIFY 16
972 #define KEY_CREATE_LINK 32
973 #define KEY_WRITE 0x20006
974 #define KEY_EXECUTE 0x20019
975 #define KEY_READ 0x20019
976 #define KEY_ALL_ACCESS 0xf003f
977 #define REG_WHOLE_HIVE_VOLATILE 1
978 #define REG_REFRESH_HIVE 2
979 #define REG_NO_LAZY_FLUSH 4
980 #define REG_OPTION_RESERVED 0
981 #define REG_OPTION_NON_VOLATILE 0
982 #define REG_OPTION_VOLATILE 1
983 #define REG_OPTION_CREATE_LINK 2
984 #define REG_OPTION_BACKUP_RESTORE 4
985 #define REG_OPTION_OPEN_LINK 8
986 #define REG_LEGAL_OPTION 15
987 #define OWNER_SECURITY_INFORMATION 1
988 #define GROUP_SECURITY_INFORMATION 2
989 #define DACL_SECURITY_INFORMATION 4
990 #define SACL_SECURITY_INFORMATION 8
991 #define MAXIMUM_PROCESSORS 32
992 #define PAGE_NOACCESS 0x0001
993 #define PAGE_READONLY 0x0002
994 #define PAGE_READWRITE 0x0004
995 #define PAGE_WRITECOPY 0x0008
996 #define PAGE_EXECUTE 0x0010
997 #define PAGE_EXECUTE_READ 0x0020
998 #define PAGE_EXECUTE_READWRITE 0x0040
999 #define PAGE_EXECUTE_WRITECOPY 0x0080
1000 #define PAGE_GUARD 0x0100
1001 #define PAGE_NOCACHE 0x0200
1002 #define MEM_COMMIT 0x1000
1003 #define MEM_RESERVE 0x2000
1004 #define MEM_DECOMMIT 0x4000
1005 #define MEM_RELEASE 0x8000
1006 #define MEM_FREE 0x10000
1007 #define MEM_PRIVATE 0x20000
1008 #define MEM_MAPPED 0x40000
1009 #define MEM_RESET 0x80000
1010 #define MEM_TOP_DOWN 0x100000
1011 #define MEM_WRITE_WATCH 0x200000 /* 98/Me */
1012 #define MEM_PHYSICAL 0x400000
1013 #define MEM_4MB_PAGES 0x80000000
1014 /* also in ddk/ntifs.h */
1015 #define MEM_IMAGE SEC_IMAGE
1016 #define SEC_BASED 0x00200000
1017 #define SEC_NO_CHANGE 0x00400000
1018 #define SEC_FILE 0x00800000
1019 #define SEC_IMAGE 0x01000000
1020 #define SEC_VLM 0x02000000
1021 #define SEC_RESERVE 0x04000000
1022 #define SEC_COMMIT 0x08000000
1023 #define SEC_NOCACHE 0x10000000
1024 /* end ntifs.h */
1025 #define SECTION_EXTEND_SIZE 16
1026 #define SECTION_MAP_READ 4
1027 #define SECTION_MAP_WRITE 2
1028 #define SECTION_QUERY 1
1029 #define SECTION_MAP_EXECUTE 8
1030 #define SECTION_ALL_ACCESS 0xf001f
1031 #define MESSAGE_RESOURCE_UNICODE 1
1032 #define RTL_CRITSECT_TYPE 0
1033 #define RTL_RESOURCE_TYPE 1
1034 /* Also in winddk.h */
1035 #define FIELD_OFFSET(t,f) ((LONG)&(((t*)0)->f))
1036 #ifndef CONTAINING_RECORD
1037 #define CONTAINING_RECORD(address, type, field) \
1038 ((type*)((PCHAR)(address) - (PCHAR)(&((type *)0)->field)))
1039 #endif
1040 /* end winddk.h */
1041 #define IMAGE_SIZEOF_FILE_HEADER 20
1042 #define IMAGE_FILE_RELOCS_STRIPPED 1
1043 #define IMAGE_FILE_EXECUTABLE_IMAGE 2
1044 #define IMAGE_FILE_LINE_NUMS_STRIPPED 4
1045 #define IMAGE_FILE_LOCAL_SYMS_STRIPPED 8
1046 #define IMAGE_FILE_AGGRESIVE_WS_TRIM 16
1047 #define IMAGE_FILE_LARGE_ADDRESS_AWARE 32
1048 #define IMAGE_FILE_BYTES_REVERSED_LO 128
1049 #define IMAGE_FILE_32BIT_MACHINE 256
1050 #define IMAGE_FILE_DEBUG_STRIPPED 512
1051 #define IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP 1024
1052 #define IMAGE_FILE_NET_RUN_FROM_SWAP 2048
1053 #define IMAGE_FILE_SYSTEM 4096
1054 #define IMAGE_FILE_DLL 8192
1055 #define IMAGE_FILE_UP_SYSTEM_ONLY 16384
1056 #define IMAGE_FILE_BYTES_REVERSED_HI 32768
1058 #define IMAGE_FILE_MACHINE_UNKNOWN 0x0000
1059 #define IMAGE_FILE_MACHINE_AM33 0x01d3 /* Matsushita AM33 */
1060 #define IMAGE_FILE_MACHINE_AMD64 0x8664 /* x64 */
1061 #define IMAGE_FILE_MACHINE_ARM 0x01c0 /* ARM little endian */
1062 #define IMAGE_FILE_MACHINE_EBC 0x0ebc /* EFI byte code */
1063 #define IMAGE_FILE_MACHINE_I386 0x014c /* Intel 386 or later processors
1064 and compatible processors */
1065 #define IMAGE_FILE_MACHINE_IA64 0x0200 /* Intel Itanium processor family */
1066 #define IMAGE_FILE_MACHINE_M32R 0x9041 /* Mitsubishi M32R little endian */
1067 #define IMAGE_FILE_MACHINE_MIPS16 0x0266 /* MIPS16 */
1068 #define IMAGE_FILE_MACHINE_MIPSFPU 0x0366 /* MIPS with FPU */
1069 #define IMAGE_FILE_MACHINE_MIPSFPU16 0x0466 /* MIPS16 with FPU */
1070 #define IMAGE_FILE_MACHINE_POWERPC 0x01f0 /* Power PC little endian */
1071 #define IMAGE_FILE_MACHINE_POWERPCFP 0x01f1 /* Power PC with floating point support */
1072 #define IMAGE_FILE_MACHINE_R4000 0x0166 /* MIPS little endian */
1073 #define IMAGE_FILE_MACHINE_SH3 0x01a2 /* Hitachi SH3 */
1074 #define IMAGE_FILE_MACHINE_SH3DSP 0x01a3 /* Hitachi SH3 DSP */
1075 #define IMAGE_FILE_MACHINE_SH4 0x01a6 /* Hitachi SH4 */
1076 #define IMAGE_FILE_MACHINE_SH5 0x01a8 /* Hitachi SH5 */
1077 #define IMAGE_FILE_MACHINE_THUMB 0x01c2 /* Thumb */
1078 #define IMAGE_FILE_MACHINE_WCEMIPSV2 0x0169 /* MIPS little-endian WCE v2 */
1080 #define IMAGE_DOS_SIGNATURE 0x5A4D
1081 #define IMAGE_OS2_SIGNATURE 0x454E
1082 #define IMAGE_OS2_SIGNATURE_LE 0x454C
1083 #define IMAGE_VXD_SIGNATURE 0x454C
1084 #define IMAGE_NT_SIGNATURE 0x00004550
1085 #define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b
1086 #define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
1087 #ifdef _WIN64
1088 #define IMAGE_NT_OPTIONAL_HDR_MAGIC IMAGE_NT_OPTIONAL_HDR64_MAGIC
1089 #else
1090 #define IMAGE_NT_OPTIONAL_HDR_MAGIC IMAGE_NT_OPTIONAL_HDR32_MAGIC
1091 #endif
1092 #define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
1093 #define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944
1094 #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
1095 #define IMAGE_SIZEOF_ROM_OPTIONAL_HEADER 56
1096 #define IMAGE_SIZEOF_STD_OPTIONAL_HEADER 28
1097 #define IMAGE_SIZEOF_NT_OPTIONAL_HEADER 224
1098 #define IMAGE_SIZEOF_SHORT_NAME 8
1099 #define IMAGE_SIZEOF_SECTION_HEADER 40
1100 #define IMAGE_SIZEOF_SYMBOL 18
1101 #define IMAGE_SIZEOF_AUX_SYMBOL 18
1102 #define IMAGE_SIZEOF_RELOCATION 10
1103 #define IMAGE_SIZEOF_BASE_RELOCATION 8
1104 #define IMAGE_SIZEOF_LINENUMBER 6
1105 #define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
1106 #define SIZEOF_RFPO_DATA 16
1108 #define IMAGE_SUBSYSTEM_UNKNOWN 0
1109 #define IMAGE_SUBSYSTEM_NATIVE 1
1110 #define IMAGE_SUBSYSTEM_WINDOWS_GUI 2
1111 #define IMAGE_SUBSYSTEM_WINDOWS_CUI 3
1112 #define IMAGE_SUBSYSTEM_OS2_CUI 5 /* Not in PECOFF v8 spec */
1113 #define IMAGE_SUBSYSTEM_POSIX_CUI 7
1114 #define IMAGE_SUBSYSTEM_NATIVE_WINDOWS 8 /* Not in PECOFF v8 spec */
1115 #define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9
1116 #define IMAGE_SUBSYSTEM_EFI_APPLICATION 10
1117 #define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
1118 #define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
1119 #define IMAGE_SUBSYSTEM_EFI_ROM 13
1120 #define IMAGE_SUBSYSTEM_XBOX 14
1122 #define IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE 0x0040
1123 #define IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY 0x0080
1124 #define IMAGE_DLL_CHARACTERISTICS_NX_COMPAT 0x0100
1125 #define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION 0x0200
1126 #define IMAGE_DLLCHARACTERISTICS_NO_SEH 0x0400
1127 #define IMAGE_DLLCHARACTERISTICS_NO_BIND 0x0800
1128 #define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000
1129 #define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000
1131 #define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((DWORD)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEADERS)(h))->FileHeader.SizeOfOptionalHeader))
1132 #define IMAGE_DIRECTORY_ENTRY_EXPORT 0
1133 #define IMAGE_DIRECTORY_ENTRY_IMPORT 1
1134 #define IMAGE_DIRECTORY_ENTRY_RESOURCE 2
1135 #define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3
1136 #define IMAGE_DIRECTORY_ENTRY_SECURITY 4
1137 #define IMAGE_DIRECTORY_ENTRY_BASERELOC 5
1138 #define IMAGE_DIRECTORY_ENTRY_DEBUG 6
1139 #define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7
1140 #define IMAGE_DIRECTORY_ENTRY_ARCHITECTURE 7
1141 #define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8
1142 #define IMAGE_DIRECTORY_ENTRY_TLS 9
1143 #define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10
1144 #define IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT 11
1145 #define IMAGE_DIRECTORY_ENTRY_IAT 12
1146 #define IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT 13
1147 #define IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR 14
1148 #define IMAGE_SCN_TYPE_REG 0
1149 #define IMAGE_SCN_TYPE_DSECT 1
1150 #define IMAGE_SCN_TYPE_NOLOAD 2
1151 #define IMAGE_SCN_TYPE_GROUP 4
1152 #define IMAGE_SCN_TYPE_NO_PAD 8
1153 #define IMAGE_SCN_TYPE_COPY 16
1154 #define IMAGE_SCN_CNT_CODE 32
1155 #define IMAGE_SCN_CNT_INITIALIZED_DATA 64
1156 #define IMAGE_SCN_CNT_UNINITIALIZED_DATA 128
1157 #define IMAGE_SCN_LNK_OTHER 256
1158 #define IMAGE_SCN_LNK_INFO 512
1159 #define IMAGE_SCN_TYPE_OVER 1024
1160 #define IMAGE_SCN_LNK_REMOVE 2048
1161 #define IMAGE_SCN_LNK_COMDAT 4096
1162 #define IMAGE_SCN_GPREL 0x8000 /* Valid only for IA64 */
1163 #define IMAGE_SCN_MEM_FARDATA 0x8000 /* Not in PECOFF v8 spec */
1164 #define IMAGE_SCN_MEM_PURGEABLE 0x20000
1165 #define IMAGE_SCN_MEM_16BIT 0x20000
1166 #define IMAGE_SCN_MEM_LOCKED 0x40000
1167 #define IMAGE_SCN_MEM_PRELOAD 0x80000
1168 #define IMAGE_SCN_ALIGN_1BYTES 0x100000
1169 #define IMAGE_SCN_ALIGN_2BYTES 0x200000
1170 #define IMAGE_SCN_ALIGN_4BYTES 0x300000
1171 #define IMAGE_SCN_ALIGN_8BYTES 0x400000
1172 #define IMAGE_SCN_ALIGN_16BYTES 0x500000
1173 #define IMAGE_SCN_ALIGN_32BYTES 0x600000
1174 #define IMAGE_SCN_ALIGN_64BYTES 0x700000
1175 #define IMAGE_SCN_ALIGN_128BYTES 0x800000
1176 #define IMAGE_SCN_ALIGN_256BYTES 0x900000
1177 #define IMAGE_SCN_ALIGN_512BYTES 0xa00000
1178 #define IMAGE_SCN_ALIGN_1024BYTES 0xb00000
1179 #define IMAGE_SCN_ALIGN_2048BYTES 0xc00000
1180 #define IMAGE_SCN_ALIGN_4096BYTES 0xd00000
1181 #define IMAGE_SCN_ALIGN_8192BYTES 0xe00000
1182 #define IMAGE_SCN_LNK_NRELOC_OVFL 0x1000000
1183 #define IMAGE_SCN_MEM_DISCARDABLE 0x2000000
1184 #define IMAGE_SCN_MEM_NOT_CACHED 0x4000000
1185 #define IMAGE_SCN_MEM_NOT_PAGED 0x8000000
1186 #define IMAGE_SCN_MEM_SHARED 0x10000000
1187 #define IMAGE_SCN_MEM_EXECUTE 0x20000000
1188 #define IMAGE_SCN_MEM_READ 0x40000000
1189 #define IMAGE_SCN_MEM_WRITE 0x80000000
1190 #define IMAGE_SYM_UNDEFINED 0
1191 #define IMAGE_SYM_ABSOLUTE (-1)
1192 #define IMAGE_SYM_DEBUG (-2)
1193 #define IMAGE_SYM_TYPE_NULL 0
1194 #define IMAGE_SYM_TYPE_VOID 1
1195 #define IMAGE_SYM_TYPE_CHAR 2
1196 #define IMAGE_SYM_TYPE_SHORT 3
1197 #define IMAGE_SYM_TYPE_INT 4
1198 #define IMAGE_SYM_TYPE_LONG 5
1199 #define IMAGE_SYM_TYPE_FLOAT 6
1200 #define IMAGE_SYM_TYPE_DOUBLE 7
1201 #define IMAGE_SYM_TYPE_STRUCT 8
1202 #define IMAGE_SYM_TYPE_UNION 9
1203 #define IMAGE_SYM_TYPE_ENUM 10
1204 #define IMAGE_SYM_TYPE_MOE 11
1205 #define IMAGE_SYM_TYPE_BYTE 12
1206 #define IMAGE_SYM_TYPE_WORD 13
1207 #define IMAGE_SYM_TYPE_UINT 14
1208 #define IMAGE_SYM_TYPE_DWORD 15
1209 #define IMAGE_SYM_TYPE_PCODE 32768
1210 #define IMAGE_SYM_DTYPE_NULL 0
1211 #define IMAGE_SYM_DTYPE_POINTER 1
1212 #define IMAGE_SYM_DTYPE_FUNCTION 2
1213 #define IMAGE_SYM_DTYPE_ARRAY 3
1214 #define IMAGE_SYM_CLASS_END_OF_FUNCTION (-1)
1215 #define IMAGE_SYM_CLASS_NULL 0
1216 #define IMAGE_SYM_CLASS_AUTOMATIC 1
1217 #define IMAGE_SYM_CLASS_EXTERNAL 2
1218 #define IMAGE_SYM_CLASS_STATIC 3
1219 #define IMAGE_SYM_CLASS_REGISTER 4
1220 #define IMAGE_SYM_CLASS_EXTERNAL_DEF 5
1221 #define IMAGE_SYM_CLASS_LABEL 6
1222 #define IMAGE_SYM_CLASS_UNDEFINED_LABEL 7
1223 #define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 8
1224 #define IMAGE_SYM_CLASS_ARGUMENT 9
1225 #define IMAGE_SYM_CLASS_STRUCT_TAG 10
1226 #define IMAGE_SYM_CLASS_MEMBER_OF_UNION 11
1227 #define IMAGE_SYM_CLASS_UNION_TAG 12
1228 #define IMAGE_SYM_CLASS_TYPE_DEFINITION 13
1229 #define IMAGE_SYM_CLASS_UNDEFINED_STATIC 14
1230 #define IMAGE_SYM_CLASS_ENUM_TAG 15
1231 #define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 16
1232 #define IMAGE_SYM_CLASS_REGISTER_PARAM 17
1233 #define IMAGE_SYM_CLASS_BIT_FIELD 18
1234 #define IMAGE_SYM_CLASS_FAR_EXTERNAL 68 /* Not in PECOFF v8 spec */
1235 #define IMAGE_SYM_CLASS_BLOCK 100
1236 #define IMAGE_SYM_CLASS_FUNCTION 101
1237 #define IMAGE_SYM_CLASS_END_OF_STRUCT 102
1238 #define IMAGE_SYM_CLASS_FILE 103
1239 #define IMAGE_SYM_CLASS_SECTION 104
1240 #define IMAGE_SYM_CLASS_WEAK_EXTERNAL 105
1241 #define IMAGE_SYM_CLASS_CLR_TOKEN 107
1243 #define IMAGE_COMDAT_SELECT_NODUPLICATES 1
1244 #define IMAGE_COMDAT_SELECT_ANY 2
1245 #define IMAGE_COMDAT_SELECT_SAME_SIZE 3
1246 #define IMAGE_COMDAT_SELECT_EXACT_MATCH 4
1247 #define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
1248 #define IMAGE_COMDAT_SELECT_LARGEST 6
1249 #define IMAGE_COMDAT_SELECT_NEWEST 7 /* Not in PECOFF v8 spec */
1251 #define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
1252 #define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
1253 #define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
1255 #define IMAGE_REL_I386_ABSOLUTE 0x0000
1256 #define IMAGE_REL_I386_DIR16 0x0001
1257 #define IMAGE_REL_I386_REL16 0x0002
1258 #define IMAGE_REL_I386_DIR32 0x0006
1259 #define IMAGE_REL_I386_DIR32NB 0x0007
1260 #define IMAGE_REL_I386_SEG12 0x0009
1261 #define IMAGE_REL_I386_SECTION 0x000A
1262 #define IMAGE_REL_I386_SECREL 0x000B
1263 #define IMAGE_REL_I386_TOKEN 0x000C
1264 #define IMAGE_REL_I386_SECREL7 0x000D
1265 #define IMAGE_REL_I386_REL32 0x0014
1267 #define IMAGE_REL_AMD64_ABSOLUTE 0x0000
1268 #define IMAGE_REL_AMD64_ADDR64 0x0001
1269 #define IMAGE_REL_AMD64_ADDR32 0x0002
1270 #define IMAGE_REL_AMD64_ADDR32NB 0x0003
1271 #define IMAGE_REL_AMD64_REL32 0x0004
1272 #define IMAGE_REL_AMD64_REL32_1 0x0005
1273 #define IMAGE_REL_AMD64_REL32_2 0x0006
1274 #define IMAGE_REL_AMD64_REL32_3 0x0007
1275 #define IMAGE_REL_AMD64_REL32_4 0x0008
1276 #define IMAGE_REL_AMD64_REL32_5 0x0009
1277 #define IMAGE_REL_AMD64_SECTION 0x000A
1278 #define IMAGE_REL_AMD64_SECREL 0x000B
1279 #define IMAGE_REL_AMD64_SECREL7 0x000C
1280 #define IMAGE_REL_AMD64_TOKEN 0x000D
1281 #define IMAGE_REL_AMD64_SREL32 0x000E
1282 #define IMAGE_REL_AMD64_PAIR 0x000F
1283 #define IMAGE_REL_AMD64_SSPAN32 0x0010
1285 #define IMAGE_REL_IA64_ABSOLUTE 0x0000
1286 #define IMAGE_REL_IA64_IMM14 0x0001
1287 #define IMAGE_REL_IA64_IMM22 0x0002
1288 #define IMAGE_REL_IA64_IMM64 0x0003
1289 #define IMAGE_REL_IA64_DIR32 0x0004
1290 #define IMAGE_REL_IA64_DIR64 0x0005
1291 #define IMAGE_REL_IA64_PCREL21B 0x0006
1292 #define IMAGE_REL_IA64_PCREL21M 0x0007
1293 #define IMAGE_REL_IA64_PCREL21F 0x0008
1294 #define IMAGE_REL_IA64_GPREL22 0x0009
1295 #define IMAGE_REL_IA64_LTOFF22 0x000A
1296 #define IMAGE_REL_IA64_SECTION 0x000B
1297 #define IMAGE_REL_IA64_SECREL22 0x000C
1298 #define IMAGE_REL_IA64_SECREL64I 0x000D
1299 #define IMAGE_REL_IA64_SECREL32 0x000E
1300 #define IMAGE_REL_IA64_DIR32NB 0x0010
1301 #define IMAGE_REL_IA64_SREL14 0x0011
1302 #define IMAGE_REL_IA64_SREL22 0x0012
1303 #define IMAGE_REL_IA64_SREL32 0x0013
1304 #define IMAGE_REL_IA64_UREL32 0x0014
1305 #define IMAGE_REL_IA64_PCREL60X 0x0015
1306 #define IMAGE_REL_IA64_PCREL60B 0x0016
1307 #define IMAGE_REL_IA64_PCREL60F 0x0017
1308 #define IMAGE_REL_IA64_PCREL60I 0x0018
1309 #define IMAGE_REL_IA64_PCREL60M 0x0019
1310 #define IMAGE_REL_IA64_IMMGPREL64 0x001a
1311 #define IMAGE_REL_IA64_TOKEN 0x001b
1312 #define IMAGE_REL_IA64_GPREL32 0x001c
1313 #define IMAGE_REL_IA64_ADDEND 0x001F
1315 #define IMAGE_REL_SH3_ABSOLUTE 0x0000
1316 #define IMAGE_REL_SH3_DIRECT16 0x0001
1317 #define IMAGE_REL_SH3_DIRECT32 0x0002
1318 #define IMAGE_REL_SH3_DIRECT8 0x0003
1319 #define IMAGE_REL_SH3_DIRECT8_WORD 0x0004
1320 #define IMAGE_REL_SH3_DIRECT8_LONG 0x0005
1321 #define IMAGE_REL_SH3_DIRECT4 0x0006
1322 #define IMAGE_REL_SH3_DIRECT4_WORD 0x0007
1323 #define IMAGE_REL_SH3_DIRECT4_LONG 0x0008
1324 #define IMAGE_REL_SH3_PCREL8_WORD 0x0009
1325 #define IMAGE_REL_SH3_PCREL8_LONG 0x000A
1326 #define IMAGE_REL_SH3_PCREL12_WORD 0x000B
1327 #define IMAGE_REL_SH3_STARTOF_SECTION 0x000C
1328 #define IMAGE_REL_SH3_SIZEOF_SECTION 0x000D
1329 #define IMAGE_REL_SH3_SECTION 0x000E
1330 #define IMAGE_REL_SH3_SECREL 0x000F
1331 #define IMAGE_REL_SH3_DIRECT32_NB 0x0010
1332 #define IMAGE_REL_SH3_GPREL4_LONG 0x0011
1333 #define IMAGE_REL_SH3_TOKEN 0x0012
1334 #define IMAGE_REL_SHM_PCRELPT 0x0013
1335 #define IMAGE_REL_SHM_REFLO 0x0014
1336 #define IMAGE_REL_SHM_REFHALF 0x0015
1337 #define IMAGE_REL_SHM_RELLO 0x0016
1338 #define IMAGE_REL_SHM_RELHALF 0x0017
1339 #define IMAGE_REL_SHM_PAIR 0x0018
1340 #define IMAGE_REL_SHM_NOMODE 0x8000
1342 #define IMAGE_REL_M32R_ABSOLUTE 0x0000
1343 #define IMAGE_REL_M32R_ADDR32 0x0001
1344 #define IMAGE_REL_M32R_ADDR32NB 0x0002
1345 #define IMAGE_REL_M32R_ADDR24 0x0003
1346 #define IMAGE_REL_M32R_GPREL16 0x0004
1347 #define IMAGE_REL_M32R_PCREL24 0x0005
1348 #define IMAGE_REL_M32R_PCREL16 0x0006
1349 #define IMAGE_REL_M32R_PCREL8 0x0007
1350 #define IMAGE_REL_M32R_REFHALF 0x0008
1351 #define IMAGE_REL_M32R_REFHI 0x0009
1352 #define IMAGE_REL_M32R_REFLO 0x000A
1353 #define IMAGE_REL_M32R_PAIR 0x000B
1354 #define IMAGE_REL_M32R_SECTION 0x000C
1355 #define IMAGE_REL_M32R_SECREL 0x000D
1356 #define IMAGE_REL_M32R_TOKEN 0x000E
1358 #define IMAGE_REL_MIPS_ABSOLUTE 0x0000
1359 #define IMAGE_REL_MIPS_REFHALF 0x0001
1360 #define IMAGE_REL_MIPS_REFWORD 0x0002
1361 #define IMAGE_REL_MIPS_JMPADDR 0x0003
1362 #define IMAGE_REL_MIPS_REFHI 0x0004
1363 #define IMAGE_REL_MIPS_REFLO 0x0005
1364 #define IMAGE_REL_MIPS_GPREL 0x0006
1365 #define IMAGE_REL_MIPS_LITERAL 0x0007
1366 #define IMAGE_REL_MIPS_SECTION 0x000A
1367 #define IMAGE_REL_MIPS_SECREL 0x000B
1368 #define IMAGE_REL_MIPS_SECRELLO 0x000C
1369 #define IMAGE_REL_MIPS_SECRELHI 0x000D
1370 #define IMAGE_REL_MIPS_JMPADDR16 0x0010
1371 #define IMAGE_REL_MIPS_REFWORDNB 0x0022
1372 #define IMAGE_REL_MIPS_PAIR 0x0025
1374 #define IMAGE_REL_ALPHA_ABSOLUTE 0
1375 #define IMAGE_REL_ALPHA_REFLONG 1
1376 #define IMAGE_REL_ALPHA_REFQUAD 2
1377 #define IMAGE_REL_ALPHA_GPREL32 3
1378 #define IMAGE_REL_ALPHA_LITERAL 4
1379 #define IMAGE_REL_ALPHA_LITUSE 5
1380 #define IMAGE_REL_ALPHA_GPDISP 6
1381 #define IMAGE_REL_ALPHA_BRADDR 7
1382 #define IMAGE_REL_ALPHA_HINT 8
1383 #define IMAGE_REL_ALPHA_INLINE_REFLONG 9
1384 #define IMAGE_REL_ALPHA_REFHI 10
1385 #define IMAGE_REL_ALPHA_REFLO 11
1386 #define IMAGE_REL_ALPHA_PAIR 12
1387 #define IMAGE_REL_ALPHA_MATCH 13
1388 #define IMAGE_REL_ALPHA_SECTION 14
1389 #define IMAGE_REL_ALPHA_SECREL 15
1390 #define IMAGE_REL_ALPHA_REFLONGNB 16
1391 #define IMAGE_REL_ALPHA_SECRELLO 17
1392 #define IMAGE_REL_ALPHA_SECRELHI 18
1393 #define IMAGE_REL_PPC_ABSOLUTE 0
1394 #define IMAGE_REL_PPC_ADDR64 1
1395 #define IMAGE_REL_PPC_ADDR32 2
1396 #define IMAGE_REL_PPC_ADDR24 3
1397 #define IMAGE_REL_PPC_ADDR16 4
1398 #define IMAGE_REL_PPC_ADDR14 5
1399 #define IMAGE_REL_PPC_REL24 6
1400 #define IMAGE_REL_PPC_REL14 7
1401 #define IMAGE_REL_PPC_TOCREL16 8
1402 #define IMAGE_REL_PPC_TOCREL14 9
1403 #define IMAGE_REL_PPC_ADDR32NB 10
1404 #define IMAGE_REL_PPC_SECREL 11
1405 #define IMAGE_REL_PPC_SECTION 12
1406 #define IMAGE_REL_PPC_IFGLUE 13
1407 #define IMAGE_REL_PPC_IMGLUE 14
1408 #define IMAGE_REL_PPC_SECREL16 15
1409 #define IMAGE_REL_PPC_REFHI 16
1410 #define IMAGE_REL_PPC_REFLO 17
1411 #define IMAGE_REL_PPC_PAIR 18
1412 #define IMAGE_REL_PPC_TYPEMASK 255
1413 #define IMAGE_REL_PPC_NEG 256
1414 #define IMAGE_REL_PPC_BRTAKEN 512
1415 #define IMAGE_REL_PPC_BRNTAKEN 1024
1416 #define IMAGE_REL_PPC_TOCDEFN 2048
1417 #define IMAGE_REL_BASED_ABSOLUTE 0
1418 #define IMAGE_REL_BASED_HIGH 1
1419 #define IMAGE_REL_BASED_LOW 2
1420 #define IMAGE_REL_BASED_HIGHLOW 3
1421 #define IMAGE_REL_BASED_HIGHADJ 4
1422 #define IMAGE_REL_BASED_MIPS_JMPADDR 5
1423 #define IMAGE_ARCHIVE_START_SIZE 8
1424 #define IMAGE_ARCHIVE_START "!<arch>\n"
1425 #define IMAGE_ARCHIVE_END "`\n"
1426 #define IMAGE_ARCHIVE_PAD "\n"
1427 #define IMAGE_ARCHIVE_LINKER_MEMBER "/ "
1428 #define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
1429 #define IMAGE_ORDINAL_FLAG32 0x80000000
1430 #define IMAGE_SNAP_BY_ORDINAL32(o) ((o&IMAGE_ORDINAL_FLAG32)!=0)
1431 #define IMAGE_ORDINAL32(o) (o&0xffff)
1432 #define IMAGE_ORDINAL_FLAG64 0x8000000000000000ULL
1433 #define IMAGE_SNAP_BY_ORDINAL64(o) ((o&IMAGE_ORDINAL_FLAG64)!=0)
1434 #define IMAGE_ORDINAL64(o) (o&0xffff)
1435 #ifdef _WIN64
1436 #define IMAGE_ORDINAL_FLAG IMAGE_ORDINAL_FLAG64
1437 #define IMAGE_SNAP_BY_ORDINAL(o) IMAGE_SNAP_BY_ORDINAL64(o)
1438 #define IMAGE_ORDINAL(o) IMAGE_ORDINAL64(o)
1439 #else
1440 #define IMAGE_ORDINAL_FLAG IMAGE_ORDINAL_FLAG32
1441 #define IMAGE_SNAP_BY_ORDINAL(o) IMAGE_SNAP_BY_ORDINAL32(o)
1442 #define IMAGE_ORDINAL(o) IMAGE_ORDINAL32(o)
1443 #endif
1444 #define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000
1445 #define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000
1446 #define IMAGE_DEBUG_TYPE_UNKNOWN 0
1447 #define IMAGE_DEBUG_TYPE_COFF 1
1448 #define IMAGE_DEBUG_TYPE_CODEVIEW 2
1449 #define IMAGE_DEBUG_TYPE_FPO 3
1450 #define IMAGE_DEBUG_TYPE_MISC 4
1451 #define IMAGE_DEBUG_TYPE_EXCEPTION 5
1452 #define IMAGE_DEBUG_TYPE_FIXUP 6
1453 #define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7
1454 #define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8
1455 #define IMAGE_DEBUG_TYPE_BORLAND 9
1456 #define FRAME_FPO 0
1457 #define FRAME_TRAP 1
1458 #define FRAME_TSS 2
1459 #define FRAME_NONFPO 3
1460 #define IMAGE_DEBUG_MISC_EXENAME 1
1461 #define N_BTMASK 0x000F
1462 #define N_TMASK 0x0030
1463 #define N_TMASK1 0x00C0
1464 #define N_TMASK2 0x00F0
1465 #define N_BTSHFT 4
1466 #define N_TSHIFT 2
1467 #define IS_TEXT_UNICODE_ASCII16 1
1468 #define IS_TEXT_UNICODE_REVERSE_ASCII16 16
1469 #define IS_TEXT_UNICODE_STATISTICS 2
1470 #define IS_TEXT_UNICODE_REVERSE_STATISTICS 32
1471 #define IS_TEXT_UNICODE_CONTROLS 4
1472 #define IS_TEXT_UNICODE_REVERSE_CONTROLS 64
1473 #define IS_TEXT_UNICODE_SIGNATURE 8
1474 #define IS_TEXT_UNICODE_REVERSE_SIGNATURE 128
1475 #define IS_TEXT_UNICODE_ILLEGAL_CHARS 256
1476 #define IS_TEXT_UNICODE_ODD_LENGTH 512
1477 #define IS_TEXT_UNICODE_NULL_BYTES 4096
1478 #define IS_TEXT_UNICODE_UNICODE_MASK 15
1479 #define IS_TEXT_UNICODE_REVERSE_MASK 240
1480 #define IS_TEXT_UNICODE_NOT_UNICODE_MASK 3840
1481 #define IS_TEXT_UNICODE_NOT_ASCII_MASK 61440
1482 #define SERVICE_KERNEL_DRIVER 1
1483 #define SERVICE_FILE_SYSTEM_DRIVER 2
1484 #define SERVICE_ADAPTER 4
1485 #define SERVICE_RECOGNIZER_DRIVER 8
1486 #define SERVICE_DRIVER (SERVICE_KERNEL_DRIVER|SERVICE_FILE_SYSTEM_DRIVER|SERVICE_RECOGNIZER_DRIVER)
1487 #define SERVICE_WIN32_OWN_PROCESS 16
1488 #define SERVICE_WIN32_SHARE_PROCESS 32
1489 #define SERVICE_WIN32 (SERVICE_WIN32_OWN_PROCESS|SERVICE_WIN32_SHARE_PROCESS)
1490 #define SERVICE_INTERACTIVE_PROCESS 256
1491 #define SERVICE_TYPE_ALL (SERVICE_WIN32|SERVICE_ADAPTER|SERVICE_DRIVER|SERVICE_INTERACTIVE_PROCESS)
1492 #define SERVICE_BOOT_START 0
1493 #define SERVICE_SYSTEM_START 1
1494 #define SERVICE_AUTO_START 2
1495 #define SERVICE_DEMAND_START 3
1496 #define SERVICE_DISABLED 4
1497 #define SERVICE_ERROR_IGNORE 0
1498 #define SERVICE_ERROR_NORMAL 1
1499 #define SERVICE_ERROR_SEVERE 2
1500 #define SERVICE_ERROR_CRITICAL 3
1501 #define SE_OWNER_DEFAULTED 1
1502 #define SE_GROUP_DEFAULTED 2
1503 #define SE_DACL_PRESENT 4
1504 #define SE_DACL_DEFAULTED 8
1505 #define SE_SACL_PRESENT 16
1506 #define SE_SACL_DEFAULTED 32
1507 #define SE_DACL_AUTO_INHERIT_REQ 256
1508 #define SE_SACL_AUTO_INHERIT_REQ 512
1509 #define SE_DACL_AUTO_INHERITED 1024
1510 #define SE_SACL_AUTO_INHERITED 2048
1511 #define SE_DACL_PROTECTED 4096
1512 #define SE_SACL_PROTECTED 8192
1513 #define SE_SELF_RELATIVE 0x8000
1514 #define SECURITY_DESCRIPTOR_MIN_LENGTH 20
1515 #define SECURITY_DESCRIPTOR_REVISION 1
1516 #define SECURITY_DESCRIPTOR_REVISION1 1
1517 #define SE_PRIVILEGE_ENABLED_BY_DEFAULT 1
1518 #define SE_PRIVILEGE_ENABLED 2
1519 #define SE_PRIVILEGE_USED_FOR_ACCESS 0x80000000
1520 #define PRIVILEGE_SET_ALL_NECESSARY 1
1521 #define SECURITY_MAX_IMPERSONATION_LEVEL SecurityDelegation
1522 #define DEFAULT_IMPERSONATION_LEVEL SecurityImpersonation
1523 #define SECURITY_DYNAMIC_TRACKING TRUE
1524 #define SECURITY_STATIC_TRACKING FALSE
1525 /* also in ddk/ntifs.h */
1526 #define TOKEN_ASSIGN_PRIMARY (0x0001)
1527 #define TOKEN_DUPLICATE (0x0002)
1528 #define TOKEN_IMPERSONATE (0x0004)
1529 #define TOKEN_QUERY (0x0008)
1530 #define TOKEN_QUERY_SOURCE (0x0010)
1531 #define TOKEN_ADJUST_PRIVILEGES (0x0020)
1532 #define TOKEN_ADJUST_GROUPS (0x0040)
1533 #define TOKEN_ADJUST_DEFAULT (0x0080)
1534 #define TOKEN_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\
1535 TOKEN_ASSIGN_PRIMARY |\
1536 TOKEN_DUPLICATE |\
1537 TOKEN_IMPERSONATE |\
1538 TOKEN_QUERY |\
1539 TOKEN_QUERY_SOURCE |\
1540 TOKEN_ADJUST_PRIVILEGES |\
1541 TOKEN_ADJUST_GROUPS |\
1542 TOKEN_ADJUST_DEFAULT)
1543 #define TOKEN_READ (STANDARD_RIGHTS_READ |\
1544 TOKEN_QUERY)
1545 #define TOKEN_WRITE (STANDARD_RIGHTS_WRITE |\
1546 TOKEN_ADJUST_PRIVILEGES |\
1547 TOKEN_ADJUST_GROUPS |\
1548 TOKEN_ADJUST_DEFAULT)
1550 #define TOKEN_EXECUTE (STANDARD_RIGHTS_EXECUTE)
1551 #define TOKEN_SOURCE_LENGTH 8
1552 /* end ddk/ntifs.h */
1553 #define DLL_PROCESS_DETACH 0
1554 #define DLL_PROCESS_ATTACH 1
1555 #define DLL_THREAD_ATTACH 2
1556 #define DLL_THREAD_DETACH 3
1557 #define DBG_CONTINUE 0x10002
1558 #define DBG_TERMINATE_THREAD 0x40010003
1559 #define DBG_TERMINATE_PROCESS 0x40010004
1560 #define DBG_CONTROL_C 0x40010005
1561 #define DBG_CONTROL_BREAK 0x40010008
1562 #define DBG_EXCEPTION_NOT_HANDLED 0x80010001
1563 #define TAPE_ABSOLUTE_POSITION 0
1564 #define TAPE_LOGICAL_POSITION 1
1565 #define TAPE_PSEUDO_LOGICAL_POSITION 2
1566 #define TAPE_REWIND 0
1567 #define TAPE_ABSOLUTE_BLOCK 1
1568 #define TAPE_LOGICAL_BLOCK 2
1569 #define TAPE_PSEUDO_LOGICAL_BLOCK 3
1570 #define TAPE_SPACE_END_OF_DATA 4
1571 #define TAPE_SPACE_RELATIVE_BLOCKS 5
1572 #define TAPE_SPACE_FILEMARKS 6
1573 #define TAPE_SPACE_SEQUENTIAL_FMKS 7
1574 #define TAPE_SPACE_SETMARKS 8
1575 #define TAPE_SPACE_SEQUENTIAL_SMKS 9
1576 #define TAPE_DRIVE_FIXED 1
1577 #define TAPE_DRIVE_SELECT 2
1578 #define TAPE_DRIVE_INITIATOR 4
1579 #define TAPE_DRIVE_ERASE_SHORT 16
1580 #define TAPE_DRIVE_ERASE_LONG 32
1581 #define TAPE_DRIVE_ERASE_BOP_ONLY 64
1582 #define TAPE_DRIVE_ERASE_IMMEDIATE 128
1583 #define TAPE_DRIVE_TAPE_CAPACITY 256
1584 #define TAPE_DRIVE_TAPE_REMAINING 512
1585 #define TAPE_DRIVE_FIXED_BLOCK 1024
1586 #define TAPE_DRIVE_VARIABLE_BLOCK 2048
1587 #define TAPE_DRIVE_WRITE_PROTECT 4096
1588 #define TAPE_DRIVE_EOT_WZ_SIZE 8192
1589 #define TAPE_DRIVE_ECC 0x10000
1590 #define TAPE_DRIVE_COMPRESSION 0x20000
1591 #define TAPE_DRIVE_PADDING 0x40000
1592 #define TAPE_DRIVE_REPORT_SMKS 0x80000
1593 #define TAPE_DRIVE_GET_ABSOLUTE_BLK 0x100000
1594 #define TAPE_DRIVE_GET_LOGICAL_BLK 0x200000
1595 #define TAPE_DRIVE_SET_EOT_WZ_SIZE 0x400000
1596 #define TAPE_DRIVE_EJECT_MEDIA 0x1000000
1597 #define TAPE_DRIVE_CLEAN_REQUESTS 0x2000000
1598 #define TAPE_DRIVE_SET_CMP_BOP_ONLY 0x4000000
1599 #define TAPE_DRIVE_RESERVED_BIT 0x80000000
1600 #define TAPE_DRIVE_LOAD_UNLOAD 0x80000001
1601 #define TAPE_DRIVE_TENSION 0x80000002
1602 #define TAPE_DRIVE_LOCK_UNLOCK 0x80000004
1603 #define TAPE_DRIVE_REWIND_IMMEDIATE 0x80000008
1604 #define TAPE_DRIVE_SET_BLOCK_SIZE 0x80000010
1605 #define TAPE_DRIVE_LOAD_UNLD_IMMED 0x80000020
1606 #define TAPE_DRIVE_TENSION_IMMED 0x80000040
1607 #define TAPE_DRIVE_LOCK_UNLK_IMMED 0x80000080
1608 #define TAPE_DRIVE_SET_ECC 0x80000100
1609 #define TAPE_DRIVE_SET_COMPRESSION 0x80000200
1610 #define TAPE_DRIVE_SET_PADDING 0x80000400
1611 #define TAPE_DRIVE_SET_REPORT_SMKS 0x80000800
1612 #define TAPE_DRIVE_ABSOLUTE_BLK 0x80001000
1613 #define TAPE_DRIVE_ABS_BLK_IMMED 0x80002000
1614 #define TAPE_DRIVE_LOGICAL_BLK 0x80004000
1615 #define TAPE_DRIVE_LOG_BLK_IMMED 0x80008000
1616 #define TAPE_DRIVE_END_OF_DATA 0x80010000
1617 #define TAPE_DRIVE_RELATIVE_BLKS 0x80020000
1618 #define TAPE_DRIVE_FILEMARKS 0x80040000
1619 #define TAPE_DRIVE_SEQUENTIAL_FMKS 0x80080000
1620 #define TAPE_DRIVE_SETMARKS 0x80100000
1621 #define TAPE_DRIVE_SEQUENTIAL_SMKS 0x80200000
1622 #define TAPE_DRIVE_REVERSE_POSITION 0x80400000
1623 #define TAPE_DRIVE_SPACE_IMMEDIATE 0x80800000
1624 #define TAPE_DRIVE_WRITE_SETMARKS 0x81000000
1625 #define TAPE_DRIVE_WRITE_FILEMARKS 0x82000000
1626 #define TAPE_DRIVE_WRITE_SHORT_FMKS 0x84000000
1627 #define TAPE_DRIVE_WRITE_LONG_FMKS 0x88000000
1628 #define TAPE_DRIVE_WRITE_MARK_IMMED 0x90000000
1629 #define TAPE_DRIVE_FORMAT 0xA0000000
1630 #define TAPE_DRIVE_FORMAT_IMMEDIATE 0xC0000000
1631 #define TAPE_DRIVE_HIGH_FEATURES 0x80000000
1632 #define TAPE_FIXED_PARTITIONS 0
1633 #define TAPE_INITIATOR_PARTITIONS 2
1634 #define TAPE_SELECT_PARTITIONS 1
1635 #define TAPE_FILEMARKS 1
1636 #define TAPE_LONG_FILEMARKS 3
1637 #define TAPE_SETMARKS 0
1638 #define TAPE_SHORT_FILEMARKS 2
1639 #define TAPE_ERASE_LONG 1
1640 #define TAPE_ERASE_SHORT 0
1641 #define TAPE_LOAD 0
1642 #define TAPE_UNLOAD 1
1643 #define TAPE_TENSION 2
1644 #define TAPE_LOCK 3
1645 #define TAPE_UNLOCK 4
1646 #define TAPE_FORMAT 5
1647 #if (_WIN32_WINNT >= 0x0500)
1648 #define VER_MINORVERSION 0x0000001
1649 #define VER_MAJORVERSION 0x0000002
1650 #define VER_BUILDNUMBER 0x0000004
1651 #define VER_PLATFORMID 0x0000008
1652 #define VER_SERVICEPACKMINOR 0x0000010
1653 #define VER_SERVICEPACKMAJOR 0x0000020
1654 #define VER_SUITENAME 0x0000040
1655 #define VER_PRODUCT_TYPE 0x0000080
1656 #define VER_EQUAL 1
1657 #define VER_GREATER 2
1658 #define VER_GREATER_EQUAL 3
1659 #define VER_LESS 4
1660 #define VER_LESS_EQUAL 5
1661 #define VER_AND 6
1662 #define VER_OR 7
1663 #endif
1664 #define VER_PLATFORM_WIN32s 0
1665 #define VER_PLATFORM_WIN32_WINDOWS 1
1666 #define VER_PLATFORM_WIN32_NT 2
1667 #define VER_NT_WORKSTATION 1
1668 #define VER_NT_DOMAIN_CONTROLLER 2
1669 #define VER_NT_SERVER 3
1670 #define VER_SUITE_SMALLBUSINESS 1
1671 #define VER_SUITE_ENTERPRISE 2
1672 #define VER_SUITE_BACKOFFICE 4
1673 #define VER_SUITE_TERMINAL 16
1674 #define VER_SUITE_SMALLBUSINESS_RESTRICTED 32
1675 #define VER_SUITE_EMBEDDEDNT 64
1676 #define VER_SUITE_DATACENTER 128
1677 #define VER_SUITE_SINGLEUSERTS 256
1678 #define VER_SUITE_PERSONAL 512
1679 #define VER_SUITE_BLADE 1024
1680 #define VER_SUITE_STORAGE_SERVER 8192
1681 #define VER_SUITE_COMPUTE_SERVER 16384
1682 #define WT_EXECUTEDEFAULT 0x00000000
1683 #define WT_EXECUTEINIOTHREAD 0x00000001
1684 #define WT_EXECUTEINWAITTHREAD 0x00000004
1685 #define WT_EXECUTEONLYONCE 0x00000008
1686 #define WT_EXECUTELONGFUNCTION 0x00000010
1687 #define WT_EXECUTEINTIMERTHREAD 0x00000020
1688 #define WT_EXECUTEINPERSISTENTTHREAD 0x00000080
1689 #define WT_TRANSFER_IMPERSONATION 0x00000100
1690 #if (_WIN32_WINNT >= 0x0501)
1691 #define ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION 1
1692 #define ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION 2
1693 #define ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION 3
1694 #define ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION 4
1695 #define ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION 5
1696 #define ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION 6
1697 #define ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION 7
1698 #define ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES 9
1699 #endif /* (_WIN32_WINNT >= 0x0501) */
1700 #define BTYPE(x) ((x)&N_BTMASK)
1701 #define ISPTR(x) (((x)&N_TMASK)==(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT))
1702 #define ISFCN(x) (((x)&N_TMASK)==(IMAGE_SYM_DTYPE_FUNCTION<<N_BTSHFT))
1703 #define ISARY(x) (((x)&N_TMASK)==(IMAGE_SYM_DTYPE_ARRAY<<N_BTSHFT))
1704 #define ISTAG(x) ((x)==IMAGE_SYM_CLASS_STRUCT_TAG||(x)==IMAGE_SYM_CLASS_UNION_TAG||(x)==IMAGE_SYM_CLASS_ENUM_TAG)
1705 #define INCREF(x) ((((x)&~N_BTMASK)<<N_TSHIFT)|(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT)|((x)&N_BTMASK))
1706 #define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
1707 #define TLS_MINIMUM_AVAILABLE 64
1708 #define REPARSE_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(REPARSE_DATA_BUFFER, GenericReparseBuffer)
1709 #define REPARSE_GUID_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(REPARSE_GUID_DATA_BUFFER, GenericReparseBuffer)
1710 #define MAXIMUM_REPARSE_DATA_BUFFER_SIZE 16384
1711 #define IO_REPARSE_TAG_RESERVED_ZERO 0
1712 #define IO_REPARSE_TAG_RESERVED_ONE 1
1713 #define IO_REPARSE_TAG_RESERVED_RANGE IO_REPARSE_TAG_RESERVED_ONE
1714 #define IsReparseTagMicrosoft(x) ((x)&0x80000000)
1715 #define IsReparseTagHighLatency(x) ((x)&0x40000000)
1716 #define IsReparseTagNameSurrogate(x) ((x)&0x20000000)
1717 #define IO_REPARSE_TAG_VALID_VALUES 0xE000FFFF
1718 #define IsReparseTagValid(x) (!((x)&~IO_REPARSE_TAG_VALID_VALUES)&&((x)>IO_REPARSE_TAG_RESERVED_RANGE))
1719 #define IO_REPARSE_TAG_SYMBOLIC_LINK IO_REPARSE_TAG_RESERVED_ZERO
1720 #define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003
1721 #define IO_REPARSE_TAG_SYMLINK 0xA000000C
1722 #define WT_SET_MAX_THREADPOOL_THREADS(Flags,Limit) ((Flags)|=(Limit)<<16)
1723 #ifndef RC_INVOKED
1724 typedef DWORD ACCESS_MASK, *PACCESS_MASK;
1726 #ifdef _GUID_DEFINED
1727 # warning _GUID_DEFINED is deprecated, use GUID_DEFINED instead
1728 #endif
1730 #if ! (defined _GUID_DEFINED || defined GUID_DEFINED) /* also defined in basetyps.h */
1731 #define GUID_DEFINED
1732 typedef struct _GUID {
1733 unsigned long Data1;
1734 unsigned short Data2;
1735 unsigned short Data3;
1736 unsigned char Data4[8];
1737 } GUID, *REFGUID, *LPGUID;
1738 #define SYSTEM_LUID { 0x3e7, 0x0 }
1739 #endif /* GUID_DEFINED */
1740 typedef struct _GENERIC_MAPPING {
1741 ACCESS_MASK GenericRead;
1742 ACCESS_MASK GenericWrite;
1743 ACCESS_MASK GenericExecute;
1744 ACCESS_MASK GenericAll;
1745 } GENERIC_MAPPING, *PGENERIC_MAPPING;
1746 typedef struct _ACE_HEADER {
1747 BYTE AceType;
1748 BYTE AceFlags;
1749 WORD AceSize;
1750 } ACE_HEADER, *PACE_HEADER;
1751 typedef struct _ACCESS_ALLOWED_ACE {
1752 ACE_HEADER Header;
1753 ACCESS_MASK Mask;
1754 DWORD SidStart;
1755 } ACCESS_ALLOWED_ACE, *PACCESS_ALLOWED_ACE;
1756 typedef struct _ACCESS_DENIED_ACE {
1757 ACE_HEADER Header;
1758 ACCESS_MASK Mask;
1759 DWORD SidStart;
1760 } ACCESS_DENIED_ACE, *PACCESS_DENIED_ACE;
1761 typedef struct _SYSTEM_AUDIT_ACE {
1762 ACE_HEADER Header;
1763 ACCESS_MASK Mask;
1764 DWORD SidStart;
1765 } SYSTEM_AUDIT_ACE;
1766 typedef SYSTEM_AUDIT_ACE *PSYSTEM_AUDIT_ACE;
1767 typedef struct _SYSTEM_ALARM_ACE {
1768 ACE_HEADER Header;
1769 ACCESS_MASK Mask;
1770 DWORD SidStart;
1771 } SYSTEM_ALARM_ACE,*PSYSTEM_ALARM_ACE;
1772 typedef struct _ACCESS_ALLOWED_OBJECT_ACE {
1773 ACE_HEADER Header;
1774 ACCESS_MASK Mask;
1775 DWORD Flags;
1776 GUID ObjectType;
1777 GUID InheritedObjectType;
1778 DWORD SidStart;
1779 } ACCESS_ALLOWED_OBJECT_ACE,*PACCESS_ALLOWED_OBJECT_ACE;
1780 typedef struct _ACCESS_DENIED_OBJECT_ACE {
1781 ACE_HEADER Header;
1782 ACCESS_MASK Mask;
1783 DWORD Flags;
1784 GUID ObjectType;
1785 GUID InheritedObjectType;
1786 DWORD SidStart;
1787 } ACCESS_DENIED_OBJECT_ACE,*PACCESS_DENIED_OBJECT_ACE;
1788 typedef struct _SYSTEM_AUDIT_OBJECT_ACE {
1789 ACE_HEADER Header;
1790 ACCESS_MASK Mask;
1791 DWORD Flags;
1792 GUID ObjectType;
1793 GUID InheritedObjectType;
1794 DWORD SidStart;
1795 } SYSTEM_AUDIT_OBJECT_ACE,*PSYSTEM_AUDIT_OBJECT_ACE;
1796 typedef struct _SYSTEM_ALARM_OBJECT_ACE {
1797 ACE_HEADER Header;
1798 ACCESS_MASK Mask;
1799 DWORD Flags;
1800 GUID ObjectType;
1801 GUID InheritedObjectType;
1802 DWORD SidStart;
1803 } SYSTEM_ALARM_OBJECT_ACE,*PSYSTEM_ALARM_OBJECT_ACE;
1804 typedef struct _ACL {
1805 BYTE AclRevision;
1806 BYTE Sbz1;
1807 WORD AclSize;
1808 WORD AceCount;
1809 WORD Sbz2;
1810 } ACL,*PACL;
1811 typedef struct _ACL_REVISION_INFORMATION {
1812 DWORD AclRevision;
1813 } ACL_REVISION_INFORMATION;
1814 typedef struct _ACL_SIZE_INFORMATION {
1815 DWORD AceCount;
1816 DWORD AclBytesInUse;
1817 DWORD AclBytesFree;
1818 } ACL_SIZE_INFORMATION;
1820 /* FIXME: add more machines */
1821 #ifdef _X86_
1822 #define SIZE_OF_80387_REGISTERS 80
1823 #define CONTEXT_i386 0x10000
1824 #define CONTEXT_i486 0x10000
1825 #define CONTEXT_CONTROL (CONTEXT_i386|0x00000001L)
1826 #define CONTEXT_INTEGER (CONTEXT_i386|0x00000002L)
1827 #define CONTEXT_SEGMENTS (CONTEXT_i386|0x00000004L)
1828 #define CONTEXT_FLOATING_POINT (CONTEXT_i386|0x00000008L)
1829 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386|0x00000010L)
1830 #define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386|0x00000020L)
1831 #define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_SEGMENTS)
1832 #define MAXIMUM_SUPPORTED_EXTENSION 512
1833 typedef struct _FLOATING_SAVE_AREA {
1834 DWORD ControlWord;
1835 DWORD StatusWord;
1836 DWORD TagWord;
1837 DWORD ErrorOffset;
1838 DWORD ErrorSelector;
1839 DWORD DataOffset;
1840 DWORD DataSelector;
1841 BYTE RegisterArea[80];
1842 DWORD Cr0NpxState;
1843 } FLOATING_SAVE_AREA;
1844 typedef struct _CONTEXT {
1845 DWORD ContextFlags;
1846 DWORD Dr0;
1847 DWORD Dr1;
1848 DWORD Dr2;
1849 DWORD Dr3;
1850 DWORD Dr6;
1851 DWORD Dr7;
1852 FLOATING_SAVE_AREA FloatSave;
1853 DWORD SegGs;
1854 DWORD SegFs;
1855 DWORD SegEs;
1856 DWORD SegDs;
1857 DWORD Edi;
1858 DWORD Esi;
1859 DWORD Ebx;
1860 DWORD Edx;
1861 DWORD Ecx;
1862 DWORD Eax;
1863 DWORD Ebp;
1864 DWORD Eip;
1865 DWORD SegCs;
1866 DWORD EFlags;
1867 DWORD Esp;
1868 DWORD SegSs;
1869 BYTE ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];
1870 } CONTEXT;
1871 #elif defined(_PPC_)
1872 #define CONTEXT_CONTROL 1L
1873 #define CONTEXT_FLOATING_POINT 2L
1874 #define CONTEXT_INTEGER 4L
1875 #define CONTEXT_DEBUG_REGISTERS 8L
1876 #define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_FLOATING_POINT|CONTEXT_INTEGER)
1877 typedef struct {
1878 double Fpr0;
1879 double Fpr1;
1880 double Fpr2;
1881 double Fpr3;
1882 double Fpr4;
1883 double Fpr5;
1884 double Fpr6;
1885 double Fpr7;
1886 double Fpr8;
1887 double Fpr9;
1888 double Fpr10;
1889 double Fpr11;
1890 double Fpr12;
1891 double Fpr13;
1892 double Fpr14;
1893 double Fpr15;
1894 double Fpr16;
1895 double Fpr17;
1896 double Fpr18;
1897 double Fpr19;
1898 double Fpr20;
1899 double Fpr21;
1900 double Fpr22;
1901 double Fpr23;
1902 double Fpr24;
1903 double Fpr25;
1904 double Fpr26;
1905 double Fpr27;
1906 double Fpr28;
1907 double Fpr29;
1908 double Fpr30;
1909 double Fpr31;
1910 double Fpscr;
1911 DWORD Gpr0;
1912 DWORD Gpr1;
1913 DWORD Gpr2;
1914 DWORD Gpr3;
1915 DWORD Gpr4;
1916 DWORD Gpr5;
1917 DWORD Gpr6;
1918 DWORD Gpr7;
1919 DWORD Gpr8;
1920 DWORD Gpr9;
1921 DWORD Gpr10;
1922 DWORD Gpr11;
1923 DWORD Gpr12;
1924 DWORD Gpr13;
1925 DWORD Gpr14;
1926 DWORD Gpr15;
1927 DWORD Gpr16;
1928 DWORD Gpr17;
1929 DWORD Gpr18;
1930 DWORD Gpr19;
1931 DWORD Gpr20;
1932 DWORD Gpr21;
1933 DWORD Gpr22;
1934 DWORD Gpr23;
1935 DWORD Gpr24;
1936 DWORD Gpr25;
1937 DWORD Gpr26;
1938 DWORD Gpr27;
1939 DWORD Gpr28;
1940 DWORD Gpr29;
1941 DWORD Gpr30;
1942 DWORD Gpr31;
1943 DWORD Cr;
1944 DWORD Xer;
1945 DWORD Msr;
1946 DWORD Iar;
1947 DWORD Lr;
1948 DWORD Ctr;
1949 DWORD ContextFlags;
1950 DWORD Fill[3];
1951 DWORD Dr0;
1952 DWORD Dr1;
1953 DWORD Dr2;
1954 DWORD Dr3;
1955 DWORD Dr4;
1956 DWORD Dr5;
1957 DWORD Dr6;
1958 DWORD Dr7;
1959 } CONTEXT;
1960 #elif defined(_ALPHA_)
1961 #define CONTEXT_ALPHA 0x20000
1962 #define CONTEXT_CONTROL (CONTEXT_ALPHA|1L)
1963 #define CONTEXT_FLOATING_POINT (CONTEXT_ALPHA|2L)
1964 #define CONTEXT_INTEGER (CONTEXT_ALPHA|4L)
1965 #define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_FLOATING_POINT|CONTEXT_INTEGER)
1966 typedef struct _CONTEXT {
1967 ULONGLONG FltF0;
1968 ULONGLONG FltF1;
1969 ULONGLONG FltF2;
1970 ULONGLONG FltF3;
1971 ULONGLONG FltF4;
1972 ULONGLONG FltF5;
1973 ULONGLONG FltF6;
1974 ULONGLONG FltF7;
1975 ULONGLONG FltF8;
1976 ULONGLONG FltF9;
1977 ULONGLONG FltF10;
1978 ULONGLONG FltF11;
1979 ULONGLONG FltF12;
1980 ULONGLONG FltF13;
1981 ULONGLONG FltF14;
1982 ULONGLONG FltF15;
1983 ULONGLONG FltF16;
1984 ULONGLONG FltF17;
1985 ULONGLONG FltF18;
1986 ULONGLONG FltF19;
1987 ULONGLONG FltF20;
1988 ULONGLONG FltF21;
1989 ULONGLONG FltF22;
1990 ULONGLONG FltF23;
1991 ULONGLONG FltF24;
1992 ULONGLONG FltF25;
1993 ULONGLONG FltF26;
1994 ULONGLONG FltF27;
1995 ULONGLONG FltF28;
1996 ULONGLONG FltF29;
1997 ULONGLONG FltF30;
1998 ULONGLONG FltF31;
1999 ULONGLONG IntV0;
2000 ULONGLONG IntT0;
2001 ULONGLONG IntT1;
2002 ULONGLONG IntT2;
2003 ULONGLONG IntT3;
2004 ULONGLONG IntT4;
2005 ULONGLONG IntT5;
2006 ULONGLONG IntT6;
2007 ULONGLONG IntT7;
2008 ULONGLONG IntS0;
2009 ULONGLONG IntS1;
2010 ULONGLONG IntS2;
2011 ULONGLONG IntS3;
2012 ULONGLONG IntS4;
2013 ULONGLONG IntS5;
2014 ULONGLONG IntFp;
2015 ULONGLONG IntA0;
2016 ULONGLONG IntA1;
2017 ULONGLONG IntA2;
2018 ULONGLONG IntA3;
2019 ULONGLONG IntA4;
2020 ULONGLONG IntA5;
2021 ULONGLONG IntT8;
2022 ULONGLONG IntT9;
2023 ULONGLONG IntT10;
2024 ULONGLONG IntT11;
2025 ULONGLONG IntRa;
2026 ULONGLONG IntT12;
2027 ULONGLONG IntAt;
2028 ULONGLONG IntGp;
2029 ULONGLONG IntSp;
2030 ULONGLONG IntZero;
2031 ULONGLONG Fpcr;
2032 ULONGLONG SoftFpcr;
2033 ULONGLONG Fir;
2034 DWORD Psr;
2035 DWORD ContextFlags;
2036 DWORD Fill[4];
2037 } CONTEXT;
2038 #elif defined(SHx)
2040 /* These are the debug or break registers on the SH3 */
2041 typedef struct _DEBUG_REGISTERS {
2042 ULONG BarA;
2043 UCHAR BasrA;
2044 UCHAR BamrA;
2045 USHORT BbrA;
2046 ULONG BarB;
2047 UCHAR BasrB;
2048 UCHAR BamrB;
2049 USHORT BbrB;
2050 ULONG BdrB;
2051 ULONG BdmrB;
2052 USHORT Brcr;
2053 USHORT Align;
2054 } DEBUG_REGISTERS, *PDEBUG_REGISTERS;
2056 /* The following flags control the contents of the CONTEXT structure. */
2058 #define CONTEXT_SH3 0x00000040
2059 #define CONTEXT_SH4 0x000000c0 /* CONTEXT_SH3 | 0x80 - must contain the SH3 bits */
2061 #ifdef SH3
2062 #define CONTEXT_CONTROL (CONTEXT_SH3 | 0x00000001L)
2063 #define CONTEXT_INTEGER (CONTEXT_SH3 | 0x00000002L)
2064 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_SH3 | 0x00000008L)
2065 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_DEBUG_REGISTERS)
2066 #else /* SH4 */
2067 #define CONTEXT_CONTROL (CONTEXT_SH4 | 0x00000001L)
2068 #define CONTEXT_INTEGER (CONTEXT_SH4 | 0x00000002L)
2069 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_SH4 | 0x00000008L)
2070 #define CONTEXT_FLOATING_POINT (CONTEXT_SH4 | 0x00000004L)
2071 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_DEBUG_REGISTERS | CONTEXT_FLOATING_POINT)
2072 #endif
2074 /* Context Frame */
2076 /* This frame is used to store a limited processor context into the */
2077 /* Thread structure for CPUs which have no floating point support. */
2079 typedef struct _CONTEXT {
2080 /* The flags values within this flag control the contents of */
2081 /* a CONTEXT record. */
2083 /* If the context record is used as an input parameter, then */
2084 /* for each portion of the context record controlled by a flag */
2085 /* whose value is set, it is assumed that that portion of the */
2086 /* context record contains valid context. If the context record */
2087 /* is being used to modify a thread's context, then only that */
2088 /* portion of the threads context will be modified. */
2090 /* If the context record is used as an IN OUT parameter to capture */
2091 /* the context of a thread, then only those portions of the thread's */
2092 /* context corresponding to set flags will be returned. */
2094 /* The context record is never used as an OUT only parameter. */
2097 ULONG ContextFlags;
2099 /* This section is specified/returned if the ContextFlags word contains */
2100 /* the flag CONTEXT_INTEGER. */
2102 /* N.B. The registers RA and R15 are defined in this section, but are */
2103 /* considered part of the control context rather than part of the integer */
2104 /* context. */
2106 ULONG PR;
2107 ULONG MACH;
2108 ULONG MACL;
2109 ULONG GBR;
2110 ULONG R0;
2111 ULONG R1;
2112 ULONG R2;
2113 ULONG R3;
2114 ULONG R4;
2115 ULONG R5;
2116 ULONG R6;
2117 ULONG R7;
2118 ULONG R8;
2119 ULONG R9;
2120 ULONG R10;
2121 ULONG R11;
2122 ULONG R12;
2123 ULONG R13;
2124 ULONG R14;
2125 ULONG R15;
2127 /* This section is specified/returned if the ContextFlags word contains */
2128 /* the flag CONTEXT_CONTROL. */
2130 /* N.B. The registers r15 and ra are defined in the integer section, */
2131 /* but are considered part of the control context rather than part of */
2132 /* the integer context. */
2134 ULONG Fir;
2135 ULONG Psr;
2137 #if !defined(SH3e) && !defined(SH4)
2138 ULONG OldStuff[2];
2139 DEBUG_REGISTERS DebugRegisters;
2140 #else
2141 ULONG Fpscr;
2142 ULONG Fpul;
2143 ULONG FRegs[16];
2144 #if defined(SH4)
2145 ULONG xFRegs[16];
2146 #endif
2147 #endif
2148 } CONTEXT;
2150 #elif defined(MIPS)
2152 /* The following flags control the contents of the CONTEXT structure. */
2154 #define CONTEXT_R4000 0x00010000 /* r4000 context */
2156 #define CONTEXT_CONTROL (CONTEXT_R4000 | 0x00000001L)
2157 #define CONTEXT_FLOATING_POINT (CONTEXT_R4000 | 0x00000002L)
2158 #define CONTEXT_INTEGER (CONTEXT_R4000 | 0x00000004L)
2160 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
2162 /* Context Frame */
2164 /* N.B. This frame must be exactly a multiple of 16 bytes in length. */
2166 /* This frame has a several purposes: 1) it is used as an argument to */
2167 /* NtContinue, 2) it is used to constuct a call frame for APC delivery, */
2168 /* 3) it is used to construct a call frame for exception dispatching */
2169 /* in user mode, and 4) it is used in the user level thread creation */
2170 /* routines. */
2172 /* The layout of the record conforms to a standard call frame. */
2175 typedef struct _CONTEXT {
2177 /* This section is always present and is used as an argument build */
2178 /* area. */
2180 DWORD Argument[4];
2182 /* This section is specified/returned if the ContextFlags word contains */
2183 /* the flag CONTEXT_FLOATING_POINT. */
2185 DWORD FltF0;
2186 DWORD FltF1;
2187 DWORD FltF2;
2188 DWORD FltF3;
2189 DWORD FltF4;
2190 DWORD FltF5;
2191 DWORD FltF6;
2192 DWORD FltF7;
2193 DWORD FltF8;
2194 DWORD FltF9;
2195 DWORD FltF10;
2196 DWORD FltF11;
2197 DWORD FltF12;
2198 DWORD FltF13;
2199 DWORD FltF14;
2200 DWORD FltF15;
2201 DWORD FltF16;
2202 DWORD FltF17;
2203 DWORD FltF18;
2204 DWORD FltF19;
2205 DWORD FltF20;
2206 DWORD FltF21;
2207 DWORD FltF22;
2208 DWORD FltF23;
2209 DWORD FltF24;
2210 DWORD FltF25;
2211 DWORD FltF26;
2212 DWORD FltF27;
2213 DWORD FltF28;
2214 DWORD FltF29;
2215 DWORD FltF30;
2216 DWORD FltF31;
2218 /* This section is specified/returned if the ContextFlags word contains */
2219 /* the flag CONTEXT_INTEGER. */
2221 /* N.B. The registers gp, sp, and ra are defined in this section, but are */
2222 /* considered part of the control context rather than part of the integer */
2223 /* context. */
2225 /* N.B. Register zero is not stored in the frame. */
2227 DWORD IntZero;
2228 DWORD IntAt;
2229 DWORD IntV0;
2230 DWORD IntV1;
2231 DWORD IntA0;
2232 DWORD IntA1;
2233 DWORD IntA2;
2234 DWORD IntA3;
2235 DWORD IntT0;
2236 DWORD IntT1;
2237 DWORD IntT2;
2238 DWORD IntT3;
2239 DWORD IntT4;
2240 DWORD IntT5;
2241 DWORD IntT6;
2242 DWORD IntT7;
2243 DWORD IntS0;
2244 DWORD IntS1;
2245 DWORD IntS2;
2246 DWORD IntS3;
2247 DWORD IntS4;
2248 DWORD IntS5;
2249 DWORD IntS6;
2250 DWORD IntS7;
2251 DWORD IntT8;
2252 DWORD IntT9;
2253 DWORD IntK0;
2254 DWORD IntK1;
2255 DWORD IntGp;
2256 DWORD IntSp;
2257 DWORD IntS8;
2258 DWORD IntRa;
2259 DWORD IntLo;
2260 DWORD IntHi;
2262 /* This section is specified/returned if the ContextFlags word contains */
2263 /* the flag CONTEXT_FLOATING_POINT. */
2265 DWORD Fsr;
2267 /* This section is specified/returned if the ContextFlags word contains */
2268 /* the flag CONTEXT_CONTROL. */
2270 /* N.B. The registers gp, sp, and ra are defined in the integer section, */
2271 /* but are considered part of the control context rather than part of */
2272 /* the integer context. */
2274 DWORD Fir;
2275 DWORD Psr;
2277 /* The flags values within this flag control the contents of */
2278 /* a CONTEXT record. */
2280 /* If the context record is used as an input parameter, then */
2281 /* for each portion of the context record controlled by a flag */
2282 /* whose value is set, it is assumed that that portion of the */
2283 /* context record contains valid context. If the context record */
2284 /* is being used to modify a thread's context, then only that */
2285 /* portion of the threads context will be modified. */
2287 /* If the context record is used as an IN OUT parameter to capture */
2288 /* the context of a thread, then only those portions of the thread's */
2289 /* context corresponding to set flags will be returned. */
2291 /* The context record is never used as an OUT only parameter. */
2293 DWORD ContextFlags;
2295 DWORD Fill[2];
2297 } CONTEXT;
2298 #elif defined(ARM)
2300 /* The following flags control the contents of the CONTEXT structure. */
2302 #define CONTEXT_ARM 0x0000040
2303 #define CONTEXT_CONTROL (CONTEXT_ARM | 0x00000001L)
2304 #define CONTEXT_INTEGER (CONTEXT_ARM | 0x00000002L)
2306 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER)
2308 typedef struct _CONTEXT {
2309 /* The flags values within this flag control the contents of
2310 a CONTEXT record.
2312 If the context record is used as an input parameter, then
2313 for each portion of the context record controlled by a flag
2314 whose value is set, it is assumed that that portion of the
2315 context record contains valid context. If the context record
2316 is being used to modify a thread's context, then only that
2317 portion of the threads context will be modified.
2319 If the context record is used as an IN OUT parameter to capture
2320 the context of a thread, then only those portions of the thread's
2321 context corresponding to set flags will be returned.
2323 The context record is never used as an OUT only parameter. */
2325 ULONG ContextFlags;
2327 /* This section is specified/returned if the ContextFlags word contains
2328 the flag CONTEXT_INTEGER. */
2329 ULONG R0;
2330 ULONG R1;
2331 ULONG R2;
2332 ULONG R3;
2333 ULONG R4;
2334 ULONG R5;
2335 ULONG R6;
2336 ULONG R7;
2337 ULONG R8;
2338 ULONG R9;
2339 ULONG R10;
2340 ULONG R11;
2341 ULONG R12;
2343 ULONG Sp;
2344 ULONG Lr;
2345 ULONG Pc;
2346 ULONG Psr;
2347 } CONTEXT;
2349 #else
2350 #error "undefined processor type"
2351 #endif
2352 typedef CONTEXT *PCONTEXT,*LPCONTEXT;
2353 typedef struct _EXCEPTION_RECORD {
2354 DWORD ExceptionCode;
2355 DWORD ExceptionFlags;
2356 struct _EXCEPTION_RECORD *ExceptionRecord;
2357 PVOID ExceptionAddress;
2358 DWORD NumberParameters;
2359 DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
2360 } EXCEPTION_RECORD,*PEXCEPTION_RECORD,*LPEXCEPTION_RECORD;
2361 typedef struct _EXCEPTION_POINTERS {
2362 PEXCEPTION_RECORD ExceptionRecord;
2363 PCONTEXT ContextRecord;
2364 } EXCEPTION_POINTERS,*PEXCEPTION_POINTERS,*LPEXCEPTION_POINTERS;
2365 typedef union _LARGE_INTEGER {
2366 struct {
2367 DWORD LowPart;
2368 LONG HighPart;
2369 } u;
2370 #if ! defined(NONAMELESSUNION) || defined(__cplusplus)
2371 _ANONYMOUS_STRUCT struct {
2372 DWORD LowPart;
2373 LONG HighPart;
2375 #endif /* NONAMELESSUNION */
2376 LONGLONG QuadPart;
2377 } LARGE_INTEGER, *PLARGE_INTEGER;
2378 typedef union _ULARGE_INTEGER {
2379 struct {
2380 DWORD LowPart;
2381 DWORD HighPart;
2382 } u;
2383 #if ! defined(NONAMELESSUNION) || defined(__cplusplus)
2384 _ANONYMOUS_STRUCT struct {
2385 DWORD LowPart;
2386 DWORD HighPart;
2388 #endif /* NONAMELESSUNION */
2389 ULONGLONG QuadPart;
2390 } ULARGE_INTEGER, *PULARGE_INTEGER;
2391 typedef struct _LUID {
2392 DWORD LowPart;
2393 LONG HighPart;
2394 } LUID, *PLUID;
2395 #pragma pack(push,4)
2396 typedef struct _LUID_AND_ATTRIBUTES {
2397 LUID Luid;
2398 DWORD Attributes;
2399 } LUID_AND_ATTRIBUTES, *PLUID_AND_ATTRIBUTES;
2400 #pragma pack(pop)
2401 typedef LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY];
2402 typedef LUID_AND_ATTRIBUTES_ARRAY *PLUID_AND_ATTRIBUTES_ARRAY;
2403 typedef struct _PRIVILEGE_SET {
2404 DWORD PrivilegeCount;
2405 DWORD Control;
2406 LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY];
2407 } PRIVILEGE_SET,*PPRIVILEGE_SET;
2408 typedef struct _SECURITY_ATTRIBUTES {
2409 DWORD nLength;
2410 LPVOID lpSecurityDescriptor;
2411 BOOL bInheritHandle;
2412 } SECURITY_ATTRIBUTES,*PSECURITY_ATTRIBUTES,*LPSECURITY_ATTRIBUTES;
2413 typedef enum _SECURITY_IMPERSONATION_LEVEL {
2414 SecurityAnonymous,
2415 SecurityIdentification,
2416 SecurityImpersonation,
2417 SecurityDelegation
2418 } SECURITY_IMPERSONATION_LEVEL,*PSECURITY_IMPERSONATION_LEVEL;
2419 typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE,*PSECURITY_CONTEXT_TRACKING_MODE;
2420 typedef struct _SECURITY_QUALITY_OF_SERVICE {
2421 DWORD Length;
2422 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
2423 SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode;
2424 BOOLEAN EffectiveOnly;
2425 } SECURITY_QUALITY_OF_SERVICE,*PSECURITY_QUALITY_OF_SERVICE;
2426 typedef PVOID PACCESS_TOKEN;
2427 typedef struct _SE_IMPERSONATION_STATE {
2428 PACCESS_TOKEN Token;
2429 BOOLEAN CopyOnOpen;
2430 BOOLEAN EffectiveOnly;
2431 SECURITY_IMPERSONATION_LEVEL Level;
2432 } SE_IMPERSONATION_STATE,*PSE_IMPERSONATION_STATE;
2433 typedef struct _SID_IDENTIFIER_AUTHORITY {
2434 BYTE Value[6];
2435 } SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
2436 typedef PVOID PSID;
2437 typedef struct _SID {
2438 BYTE Revision;
2439 BYTE SubAuthorityCount;
2440 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
2441 DWORD SubAuthority[ANYSIZE_ARRAY];
2442 } SID, *PISID;
2443 typedef struct _SID_AND_ATTRIBUTES {
2444 PSID Sid;
2445 DWORD Attributes;
2446 } SID_AND_ATTRIBUTES, *PSID_AND_ATTRIBUTES;
2447 typedef SID_AND_ATTRIBUTES SID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY];
2448 typedef SID_AND_ATTRIBUTES_ARRAY *PSID_AND_ATTRIBUTES_ARRAY;
2449 typedef struct _TOKEN_SOURCE {
2450 CHAR SourceName[TOKEN_SOURCE_LENGTH];
2451 LUID SourceIdentifier;
2452 } TOKEN_SOURCE,*PTOKEN_SOURCE;
2453 typedef struct _TOKEN_CONTROL {
2454 LUID TokenId;
2455 LUID AuthenticationId;
2456 LUID ModifiedId;
2457 TOKEN_SOURCE TokenSource;
2458 } TOKEN_CONTROL,*PTOKEN_CONTROL;
2459 typedef struct _TOKEN_DEFAULT_DACL {
2460 PACL DefaultDacl;
2461 } TOKEN_DEFAULT_DACL,*PTOKEN_DEFAULT_DACL;
2462 typedef struct _TOKEN_GROUPS {
2463 DWORD GroupCount;
2464 SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY];
2465 } TOKEN_GROUPS,*PTOKEN_GROUPS,*LPTOKEN_GROUPS;
2466 typedef struct _TOKEN_OWNER {
2467 PSID Owner;
2468 } TOKEN_OWNER,*PTOKEN_OWNER;
2469 typedef struct _TOKEN_PRIMARY_GROUP {
2470 PSID PrimaryGroup;
2471 } TOKEN_PRIMARY_GROUP,*PTOKEN_PRIMARY_GROUP;
2472 typedef struct _TOKEN_PRIVILEGES {
2473 DWORD PrivilegeCount;
2474 LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY];
2475 } TOKEN_PRIVILEGES,*PTOKEN_PRIVILEGES,*LPTOKEN_PRIVILEGES;
2476 typedef enum tagTOKEN_TYPE {
2477 TokenPrimary = 1,
2478 TokenImpersonation
2479 } TOKEN_TYPE,*PTOKEN_TYPE;
2480 typedef struct _TOKEN_STATISTICS {
2481 LUID TokenId;
2482 LUID AuthenticationId;
2483 LARGE_INTEGER ExpirationTime;
2484 TOKEN_TYPE TokenType;
2485 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
2486 DWORD DynamicCharged;
2487 DWORD DynamicAvailable;
2488 DWORD GroupCount;
2489 DWORD PrivilegeCount;
2490 LUID ModifiedId;
2491 } TOKEN_STATISTICS, *PTOKEN_STATISTICS;
2492 typedef struct _TOKEN_USER {
2493 SID_AND_ATTRIBUTES User;
2494 } TOKEN_USER, *PTOKEN_USER;
2495 typedef DWORD SECURITY_INFORMATION,*PSECURITY_INFORMATION;
2496 typedef WORD SECURITY_DESCRIPTOR_CONTROL,*PSECURITY_DESCRIPTOR_CONTROL;
2497 typedef struct _SECURITY_DESCRIPTOR {
2498 BYTE Revision;
2499 BYTE Sbz1;
2500 SECURITY_DESCRIPTOR_CONTROL Control;
2501 PSID Owner;
2502 PSID Group;
2503 PACL Sacl;
2504 PACL Dacl;
2505 } SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR;
2506 typedef enum _TOKEN_INFORMATION_CLASS {
2507 TokenUser=1,
2508 TokenGroups,
2509 TokenPrivileges,
2510 TokenOwner,
2511 TokenPrimaryGroup,
2512 TokenDefaultDacl,
2513 TokenSource,
2514 TokenType,
2515 TokenImpersonationLevel,
2516 TokenStatistics,
2517 TokenRestrictedSids,
2518 TokenSessionId,
2519 TokenGroupsAndPrivileges,
2520 TokenSessionReference,
2521 TokenSandBoxInert,
2522 TokenAuditPolicy,
2523 TokenOrigin
2524 } TOKEN_INFORMATION_CLASS;
2525 typedef enum _SID_NAME_USE {
2526 SidTypeUser=1,
2527 SidTypeGroup,
2528 SidTypeDomain,
2529 SidTypeAlias,
2530 SidTypeWellKnownGroup,
2531 SidTypeDeletedAccount,
2532 SidTypeInvalid,
2533 SidTypeUnknown,
2534 SidTypeComputer
2535 } SID_NAME_USE,*PSID_NAME_USE;
2536 typedef struct _QUOTA_LIMITS {
2537 SIZE_T PagedPoolLimit;
2538 SIZE_T NonPagedPoolLimit;
2539 SIZE_T MinimumWorkingSetSize;
2540 SIZE_T MaximumWorkingSetSize;
2541 SIZE_T PagefileLimit;
2542 LARGE_INTEGER TimeLimit;
2543 } QUOTA_LIMITS,*PQUOTA_LIMITS;
2544 typedef struct _IO_COUNTERS {
2545 ULONGLONG ReadOperationCount;
2546 ULONGLONG WriteOperationCount;
2547 ULONGLONG OtherOperationCount;
2548 ULONGLONG ReadTransferCount;
2549 ULONGLONG WriteTransferCount;
2550 ULONGLONG OtherTransferCount;
2551 } IO_COUNTERS, *PIO_COUNTERS;
2552 typedef struct _FILE_NOTIFY_INFORMATION {
2553 DWORD NextEntryOffset;
2554 DWORD Action;
2555 DWORD FileNameLength;
2556 WCHAR FileName[1];
2557 } FILE_NOTIFY_INFORMATION,*PFILE_NOTIFY_INFORMATION;
2558 typedef struct _TAPE_ERASE {
2559 DWORD Type;
2560 BOOLEAN Immediate;
2561 } TAPE_ERASE,*PTAPE_ERASE;
2562 typedef struct _TAPE_GET_DRIVE_PARAMETERS {
2563 BOOLEAN ECC;
2564 BOOLEAN Compression;
2565 BOOLEAN DataPadding;
2566 BOOLEAN ReportSetmarks;
2567 DWORD DefaultBlockSize;
2568 DWORD MaximumBlockSize;
2569 DWORD MinimumBlockSize;
2570 DWORD MaximumPartitionCount;
2571 DWORD FeaturesLow;
2572 DWORD FeaturesHigh;
2573 DWORD EOTWarningZoneSize;
2574 } TAPE_GET_DRIVE_PARAMETERS,*PTAPE_GET_DRIVE_PARAMETERS;
2575 typedef struct _TAPE_GET_MEDIA_PARAMETERS {
2576 LARGE_INTEGER Capacity;
2577 LARGE_INTEGER Remaining;
2578 DWORD BlockSize;
2579 DWORD PartitionCount;
2580 BOOLEAN WriteProtected;
2581 } TAPE_GET_MEDIA_PARAMETERS,*PTAPE_GET_MEDIA_PARAMETERS;
2582 typedef struct _TAPE_GET_POSITION {
2583 ULONG Type;
2584 ULONG Partition;
2585 ULONG OffsetLow;
2586 ULONG OffsetHigh;
2587 } TAPE_GET_POSITION,*PTAPE_GET_POSITION;
2588 typedef struct _TAPE_PREPARE {
2589 DWORD Operation;
2590 BOOLEAN Immediate;
2591 } TAPE_PREPARE,*PTAPE_PREPARE;
2592 typedef struct _TAPE_SET_DRIVE_PARAMETERS {
2593 BOOLEAN ECC;
2594 BOOLEAN Compression;
2595 BOOLEAN DataPadding;
2596 BOOLEAN ReportSetmarks;
2597 ULONG EOTWarningZoneSize;
2598 } TAPE_SET_DRIVE_PARAMETERS,*PTAPE_SET_DRIVE_PARAMETERS;
2599 typedef struct _TAPE_SET_MEDIA_PARAMETERS {
2600 ULONG BlockSize;
2601 } TAPE_SET_MEDIA_PARAMETERS,*PTAPE_SET_MEDIA_PARAMETERS;
2602 typedef struct _TAPE_SET_POSITION {
2603 DWORD Method;
2604 DWORD Partition;
2605 LARGE_INTEGER Offset;
2606 BOOLEAN Immediate;
2607 } TAPE_SET_POSITION,*PTAPE_SET_POSITION;
2608 typedef struct _TAPE_WRITE_MARKS {
2609 DWORD Type;
2610 DWORD Count;
2611 BOOLEAN Immediate;
2612 } TAPE_WRITE_MARKS,*PTAPE_WRITE_MARKS;
2613 typedef struct _TAPE_CREATE_PARTITION {
2614 DWORD Method;
2615 DWORD Count;
2616 DWORD Size;
2617 } TAPE_CREATE_PARTITION,*PTAPE_CREATE_PARTITION;
2618 typedef struct _MEMORY_BASIC_INFORMATION {
2619 PVOID BaseAddress;
2620 PVOID AllocationBase;
2621 DWORD AllocationProtect;
2622 DWORD RegionSize;
2623 DWORD State;
2624 DWORD Protect;
2625 DWORD Type;
2626 } MEMORY_BASIC_INFORMATION,*PMEMORY_BASIC_INFORMATION;
2627 typedef struct _MESSAGE_RESOURCE_ENTRY {
2628 WORD Length;
2629 WORD Flags;
2630 BYTE Text[1];
2631 } MESSAGE_RESOURCE_ENTRY,*PMESSAGE_RESOURCE_ENTRY;
2632 typedef struct _MESSAGE_RESOURCE_BLOCK {
2633 DWORD LowId;
2634 DWORD HighId;
2635 DWORD OffsetToEntries;
2636 } MESSAGE_RESOURCE_BLOCK,*PMESSAGE_RESOURCE_BLOCK;
2637 typedef struct _MESSAGE_RESOURCE_DATA {
2638 DWORD NumberOfBlocks;
2639 MESSAGE_RESOURCE_BLOCK Blocks[1];
2640 } MESSAGE_RESOURCE_DATA,*PMESSAGE_RESOURCE_DATA;
2641 typedef struct _LIST_ENTRY {
2642 struct _LIST_ENTRY *Flink;
2643 struct _LIST_ENTRY *Blink;
2644 } LIST_ENTRY,*PLIST_ENTRY;
2645 typedef struct _SINGLE_LIST_ENTRY {
2646 struct _SINGLE_LIST_ENTRY *Next;
2647 } SINGLE_LIST_ENTRY,*PSINGLE_LIST_ENTRY;
2649 #ifndef _SLIST_HEADER_
2650 #define _SLIST_HEADER_
2651 #define SLIST_ENTRY SINGLE_LIST_ENTRY
2652 #define _SLIST_ENTRY _SINGLE_LIST_ENTRY
2653 #define PSLIST_ENTRY PSINGLE_LIST_ENTRY
2654 typedef union _SLIST_HEADER {
2655 ULONGLONG Alignment;
2656 _ANONYMOUS_STRUCT struct {
2657 SLIST_ENTRY Next;
2658 WORD Depth;
2659 WORD Sequence;
2660 } DUMMYSTRUCTNAME;
2661 } SLIST_HEADER,*PSLIST_HEADER;
2662 #endif /* !_SLIST_HEADER_ */
2664 typedef struct _RTL_CRITICAL_SECTION_DEBUG {
2665 WORD Type;
2666 WORD CreatorBackTraceIndex;
2667 struct _RTL_CRITICAL_SECTION *CriticalSection;
2668 LIST_ENTRY ProcessLocksList;
2669 DWORD EntryCount;
2670 DWORD ContentionCount;
2671 DWORD Spare[2];
2672 } RTL_CRITICAL_SECTION_DEBUG,*PRTL_CRITICAL_SECTION_DEBUG;
2673 typedef struct _RTL_CRITICAL_SECTION {
2674 PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
2675 LONG LockCount;
2676 LONG RecursionCount;
2677 HANDLE OwningThread;
2678 HANDLE LockSemaphore;
2679 DWORD Reserved;
2680 } RTL_CRITICAL_SECTION,*PRTL_CRITICAL_SECTION;
2681 typedef struct _EVENTLOGRECORD {
2682 DWORD Length;
2683 DWORD Reserved;
2684 DWORD RecordNumber;
2685 DWORD TimeGenerated;
2686 DWORD TimeWritten;
2687 DWORD EventID;
2688 WORD EventType;
2689 WORD NumStrings;
2690 WORD EventCategory;
2691 WORD ReservedFlags;
2692 DWORD ClosingRecordNumber;
2693 DWORD StringOffset;
2694 DWORD UserSidLength;
2695 DWORD UserSidOffset;
2696 DWORD DataLength;
2697 DWORD DataOffset;
2698 } EVENTLOGRECORD,*PEVENTLOGRECORD;
2699 typedef struct _OSVERSIONINFOA {
2700 DWORD dwOSVersionInfoSize;
2701 DWORD dwMajorVersion;
2702 DWORD dwMinorVersion;
2703 DWORD dwBuildNumber;
2704 DWORD dwPlatformId;
2705 CHAR szCSDVersion[128];
2706 } OSVERSIONINFOA,*POSVERSIONINFOA,*LPOSVERSIONINFOA;
2707 typedef struct _OSVERSIONINFOW {
2708 DWORD dwOSVersionInfoSize;
2709 DWORD dwMajorVersion;
2710 DWORD dwMinorVersion;
2711 DWORD dwBuildNumber;
2712 DWORD dwPlatformId;
2713 WCHAR szCSDVersion[128];
2714 } OSVERSIONINFOW,*POSVERSIONINFOW,*LPOSVERSIONINFOW;
2715 typedef struct _OSVERSIONINFOEXA {
2716 DWORD dwOSVersionInfoSize;
2717 DWORD dwMajorVersion;
2718 DWORD dwMinorVersion;
2719 DWORD dwBuildNumber;
2720 DWORD dwPlatformId;
2721 CHAR szCSDVersion[128];
2722 WORD wServicePackMajor;
2723 WORD wServicePackMinor;
2724 WORD wSuiteMask;
2725 BYTE wProductType;
2726 BYTE wReserved;
2727 } OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA;
2728 typedef struct _OSVERSIONINFOEXW {
2729 DWORD dwOSVersionInfoSize;
2730 DWORD dwMajorVersion;
2731 DWORD dwMinorVersion;
2732 DWORD dwBuildNumber;
2733 DWORD dwPlatformId;
2734 WCHAR szCSDVersion[128];
2735 WORD wServicePackMajor;
2736 WORD wServicePackMinor;
2737 WORD wSuiteMask;
2738 BYTE wProductType;
2739 BYTE wReserved;
2740 } OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW;
2741 #pragma pack(push,2)
2742 typedef struct _IMAGE_VXD_HEADER {
2743 WORD e32_magic;
2744 BYTE e32_border;
2745 BYTE e32_worder;
2746 DWORD e32_level;
2747 WORD e32_cpu;
2748 WORD e32_os;
2749 DWORD e32_ver;
2750 DWORD e32_mflags;
2751 DWORD e32_mpages;
2752 DWORD e32_startobj;
2753 DWORD e32_eip;
2754 DWORD e32_stackobj;
2755 DWORD e32_esp;
2756 DWORD e32_pagesize;
2757 DWORD e32_lastpagesize;
2758 DWORD e32_fixupsize;
2759 DWORD e32_fixupsum;
2760 DWORD e32_ldrsize;
2761 DWORD e32_ldrsum;
2762 DWORD e32_objtab;
2763 DWORD e32_objcnt;
2764 DWORD e32_objmap;
2765 DWORD e32_itermap;
2766 DWORD e32_rsrctab;
2767 DWORD e32_rsrccnt;
2768 DWORD e32_restab;
2769 DWORD e32_enttab;
2770 DWORD e32_dirtab;
2771 DWORD e32_dircnt;
2772 DWORD e32_fpagetab;
2773 DWORD e32_frectab;
2774 DWORD e32_impmod;
2775 DWORD e32_impmodcnt;
2776 DWORD e32_impproc;
2777 DWORD e32_pagesum;
2778 DWORD e32_datapage;
2779 DWORD e32_preload;
2780 DWORD e32_nrestab;
2781 DWORD e32_cbnrestab;
2782 DWORD e32_nressum;
2783 DWORD e32_autodata;
2784 DWORD e32_debuginfo;
2785 DWORD e32_debuglen;
2786 DWORD e32_instpreload;
2787 DWORD e32_instdemand;
2788 DWORD e32_heapsize;
2789 BYTE e32_res3[12];
2790 DWORD e32_winresoff;
2791 DWORD e32_winreslen;
2792 WORD e32_devid;
2793 WORD e32_ddkver;
2794 } IMAGE_VXD_HEADER,*PIMAGE_VXD_HEADER;
2795 #pragma pack(pop)
2796 #pragma pack(push,4)
2797 typedef struct _IMAGE_FILE_HEADER {
2798 WORD Machine;
2799 WORD NumberOfSections;
2800 DWORD TimeDateStamp;
2801 DWORD PointerToSymbolTable;
2802 DWORD NumberOfSymbols;
2803 WORD SizeOfOptionalHeader;
2804 WORD Characteristics;
2805 } IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;
2806 typedef struct _IMAGE_DATA_DIRECTORY {
2807 DWORD VirtualAddress;
2808 DWORD Size;
2809 } IMAGE_DATA_DIRECTORY,*PIMAGE_DATA_DIRECTORY;
2810 typedef struct _IMAGE_OPTIONAL_HEADER {
2811 WORD Magic;
2812 BYTE MajorLinkerVersion;
2813 BYTE MinorLinkerVersion;
2814 DWORD SizeOfCode;
2815 DWORD SizeOfInitializedData;
2816 DWORD SizeOfUninitializedData;
2817 DWORD AddressOfEntryPoint;
2818 DWORD BaseOfCode;
2819 DWORD BaseOfData;
2820 DWORD ImageBase;
2821 DWORD SectionAlignment;
2822 DWORD FileAlignment;
2823 WORD MajorOperatingSystemVersion;
2824 WORD MinorOperatingSystemVersion;
2825 WORD MajorImageVersion;
2826 WORD MinorImageVersion;
2827 WORD MajorSubsystemVersion;
2828 WORD MinorSubsystemVersion;
2829 DWORD Win32VersionValue;
2830 DWORD SizeOfImage;
2831 DWORD SizeOfHeaders;
2832 DWORD CheckSum;
2833 WORD Subsystem;
2834 WORD DllCharacteristics;
2835 DWORD SizeOfStackReserve;
2836 DWORD SizeOfStackCommit;
2837 DWORD SizeOfHeapReserve;
2838 DWORD SizeOfHeapCommit;
2839 DWORD LoaderFlags;
2840 DWORD NumberOfRvaAndSizes;
2841 IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
2842 } IMAGE_OPTIONAL_HEADER32,*PIMAGE_OPTIONAL_HEADER32;
2843 typedef struct _IMAGE_OPTIONAL_HEADER64 {
2844 WORD Magic;
2845 BYTE MajorLinkerVersion;
2846 BYTE MinorLinkerVersion;
2847 DWORD SizeOfCode;
2848 DWORD SizeOfInitializedData;
2849 DWORD SizeOfUninitializedData;
2850 DWORD AddressOfEntryPoint;
2851 DWORD BaseOfCode;
2852 ULONGLONG ImageBase;
2853 DWORD SectionAlignment;
2854 DWORD FileAlignment;
2855 WORD MajorOperatingSystemVersion;
2856 WORD MinorOperatingSystemVersion;
2857 WORD MajorImageVersion;
2858 WORD MinorImageVersion;
2859 WORD MajorSubsystemVersion;
2860 WORD MinorSubsystemVersion;
2861 DWORD Win32VersionValue;
2862 DWORD SizeOfImage;
2863 DWORD SizeOfHeaders;
2864 DWORD CheckSum;
2865 WORD Subsystem;
2866 WORD DllCharacteristics;
2867 ULONGLONG SizeOfStackReserve;
2868 ULONGLONG SizeOfStackCommit;
2869 ULONGLONG SizeOfHeapReserve;
2870 ULONGLONG SizeOfHeapCommit;
2871 DWORD LoaderFlags;
2872 DWORD NumberOfRvaAndSizes;
2873 IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
2874 } IMAGE_OPTIONAL_HEADER64,*PIMAGE_OPTIONAL_HEADER64;
2875 #ifdef _WIN64
2876 typedef IMAGE_OPTIONAL_HEADER64 IMAGE_OPTIONAL_HEADER;
2877 typedef PIMAGE_OPTIONAL_HEADER64 PIMAGE_OPTIONAL_HEADER;
2878 #else
2879 typedef IMAGE_OPTIONAL_HEADER32 IMAGE_OPTIONAL_HEADER;
2880 typedef PIMAGE_OPTIONAL_HEADER32 PIMAGE_OPTIONAL_HEADER;
2881 #endif
2882 typedef struct _IMAGE_ROM_OPTIONAL_HEADER {
2883 WORD Magic;
2884 BYTE MajorLinkerVersion;
2885 BYTE MinorLinkerVersion;
2886 DWORD SizeOfCode;
2887 DWORD SizeOfInitializedData;
2888 DWORD SizeOfUninitializedData;
2889 DWORD AddressOfEntryPoint;
2890 DWORD BaseOfCode;
2891 DWORD BaseOfData;
2892 DWORD BaseOfBss;
2893 DWORD GprMask;
2894 DWORD CprMask[4];
2895 DWORD GpValue;
2896 } IMAGE_ROM_OPTIONAL_HEADER,*PIMAGE_ROM_OPTIONAL_HEADER;
2897 #pragma pack(pop)
2898 #pragma pack(push,2)
2899 typedef struct _IMAGE_DOS_HEADER {
2900 WORD e_magic;
2901 WORD e_cblp;
2902 WORD e_cp;
2903 WORD e_crlc;
2904 WORD e_cparhdr;
2905 WORD e_minalloc;
2906 WORD e_maxalloc;
2907 WORD e_ss;
2908 WORD e_sp;
2909 WORD e_csum;
2910 WORD e_ip;
2911 WORD e_cs;
2912 WORD e_lfarlc;
2913 WORD e_ovno;
2914 WORD e_res[4];
2915 WORD e_oemid;
2916 WORD e_oeminfo;
2917 WORD e_res2[10];
2918 LONG e_lfanew;
2919 } IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER;
2920 typedef struct _IMAGE_OS2_HEADER {
2921 WORD ne_magic;
2922 CHAR ne_ver;
2923 CHAR ne_rev;
2924 WORD ne_enttab;
2925 WORD ne_cbenttab;
2926 LONG ne_crc;
2927 WORD ne_flags;
2928 WORD ne_autodata;
2929 WORD ne_heap;
2930 WORD ne_stack;
2931 LONG ne_csip;
2932 LONG ne_sssp;
2933 WORD ne_cseg;
2934 WORD ne_cmod;
2935 WORD ne_cbnrestab;
2936 WORD ne_segtab;
2937 WORD ne_rsrctab;
2938 WORD ne_restab;
2939 WORD ne_modtab;
2940 WORD ne_imptab;
2941 LONG ne_nrestab;
2942 WORD ne_cmovent;
2943 WORD ne_align;
2944 WORD ne_cres;
2945 BYTE ne_exetyp;
2946 BYTE ne_flagsothers;
2947 WORD ne_pretthunks;
2948 WORD ne_psegrefbytes;
2949 WORD ne_swaparea;
2950 WORD ne_expver;
2951 } IMAGE_OS2_HEADER,*PIMAGE_OS2_HEADER;
2952 #pragma pack(pop)
2953 #pragma pack(push,4)
2954 typedef struct _IMAGE_NT_HEADERS {
2955 DWORD Signature;
2956 IMAGE_FILE_HEADER FileHeader;
2957 IMAGE_OPTIONAL_HEADER OptionalHeader;
2958 } IMAGE_NT_HEADERS32,*PIMAGE_NT_HEADERS32;
2959 typedef struct _IMAGE_NT_HEADERS64 {
2960 DWORD Signature;
2961 IMAGE_FILE_HEADER FileHeader;
2962 IMAGE_OPTIONAL_HEADER OptionalHeader;
2963 } IMAGE_NT_HEADERS64,*PIMAGE_NT_HEADERS64;
2964 #ifdef _WIN64
2965 typedef IMAGE_NT_HEADERS64 IMAGE_NT_HEADERS;
2966 typedef PIMAGE_NT_HEADERS64 PIMAGE_NT_HEADERS;
2967 #else
2968 typedef IMAGE_NT_HEADERS32 IMAGE_NT_HEADERS;
2969 typedef PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS;
2970 #endif
2971 typedef struct _IMAGE_ROM_HEADERS {
2972 IMAGE_FILE_HEADER FileHeader;
2973 IMAGE_ROM_OPTIONAL_HEADER OptionalHeader;
2974 } IMAGE_ROM_HEADERS,*PIMAGE_ROM_HEADERS;
2975 typedef struct _IMAGE_SECTION_HEADER {
2976 BYTE Name[IMAGE_SIZEOF_SHORT_NAME];
2977 union {
2978 DWORD PhysicalAddress;
2979 DWORD VirtualSize;
2980 } Misc;
2981 DWORD VirtualAddress;
2982 DWORD SizeOfRawData;
2983 DWORD PointerToRawData;
2984 DWORD PointerToRelocations;
2985 DWORD PointerToLinenumbers;
2986 WORD NumberOfRelocations;
2987 WORD NumberOfLinenumbers;
2988 DWORD Characteristics;
2989 } IMAGE_SECTION_HEADER,*PIMAGE_SECTION_HEADER;
2990 #pragma pack(pop)
2991 #pragma pack(push,2)
2992 typedef struct _IMAGE_SYMBOL {
2993 union {
2994 BYTE ShortName[8];
2995 struct {
2996 DWORD Short;
2997 DWORD Long;
2998 } Name;
2999 PBYTE LongName[2];
3000 } N;
3001 DWORD Value;
3002 SHORT SectionNumber;
3003 WORD Type;
3004 BYTE StorageClass;
3005 BYTE NumberOfAuxSymbols;
3006 } IMAGE_SYMBOL,*PIMAGE_SYMBOL;
3007 typedef union _IMAGE_AUX_SYMBOL {
3008 struct {
3009 DWORD TagIndex;
3010 union {
3011 struct {
3012 WORD Linenumber;
3013 WORD Size;
3014 } LnSz;
3015 DWORD TotalSize;
3016 } Misc;
3017 union {
3018 struct {
3019 DWORD PointerToLinenumber;
3020 DWORD PointerToNextFunction;
3021 } Function;
3022 struct {
3023 WORD Dimension[4];
3024 } Array;
3025 } FcnAry;
3026 WORD TvIndex;
3027 } Sym;
3028 struct {
3029 BYTE Name[IMAGE_SIZEOF_SYMBOL];
3030 } File;
3031 struct {
3032 DWORD Length;
3033 WORD NumberOfRelocations;
3034 WORD NumberOfLinenumbers;
3035 DWORD CheckSum;
3036 SHORT Number;
3037 BYTE Selection;
3038 } Section;
3039 } IMAGE_AUX_SYMBOL,*PIMAGE_AUX_SYMBOL;
3040 typedef struct _IMAGE_COFF_SYMBOLS_HEADER {
3041 DWORD NumberOfSymbols;
3042 DWORD LvaToFirstSymbol;
3043 DWORD NumberOfLinenumbers;
3044 DWORD LvaToFirstLinenumber;
3045 DWORD RvaToFirstByteOfCode;
3046 DWORD RvaToLastByteOfCode;
3047 DWORD RvaToFirstByteOfData;
3048 DWORD RvaToLastByteOfData;
3049 } IMAGE_COFF_SYMBOLS_HEADER,*PIMAGE_COFF_SYMBOLS_HEADER;
3050 typedef struct _IMAGE_RELOCATION {
3051 _ANONYMOUS_UNION union {
3052 DWORD VirtualAddress;
3053 DWORD RelocCount;
3054 } DUMMYUNIONNAME;
3055 DWORD SymbolTableIndex;
3056 WORD Type;
3057 } IMAGE_RELOCATION,*PIMAGE_RELOCATION;
3058 #pragma pack(pop)
3059 #pragma pack(push,4)
3060 typedef struct _IMAGE_BASE_RELOCATION {
3061 DWORD VirtualAddress;
3062 DWORD SizeOfBlock;
3063 } IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION;
3064 #pragma pack(pop)
3065 #pragma pack(push,2)
3066 typedef struct _IMAGE_LINENUMBER {
3067 union {
3068 DWORD SymbolTableIndex;
3069 DWORD VirtualAddress;
3070 } Type;
3071 WORD Linenumber;
3072 } IMAGE_LINENUMBER,*PIMAGE_LINENUMBER;
3073 #pragma pack(pop)
3074 #pragma pack(push,4)
3075 typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER {
3076 BYTE Name[16];
3077 BYTE Date[12];
3078 BYTE UserID[6];
3079 BYTE GroupID[6];
3080 BYTE Mode[8];
3081 BYTE Size[10];
3082 BYTE EndHeader[2];
3083 } IMAGE_ARCHIVE_MEMBER_HEADER,*PIMAGE_ARCHIVE_MEMBER_HEADER;
3084 typedef struct _IMAGE_EXPORT_DIRECTORY {
3085 DWORD Characteristics;
3086 DWORD TimeDateStamp;
3087 WORD MajorVersion;
3088 WORD MinorVersion;
3089 DWORD Name;
3090 DWORD Base;
3091 DWORD NumberOfFunctions;
3092 DWORD NumberOfNames;
3093 DWORD AddressOfFunctions;
3094 DWORD AddressOfNames;
3095 DWORD AddressOfNameOrdinals;
3096 } IMAGE_EXPORT_DIRECTORY,*PIMAGE_EXPORT_DIRECTORY;
3097 typedef struct _IMAGE_IMPORT_BY_NAME {
3098 WORD Hint;
3099 BYTE Name[1];
3100 } IMAGE_IMPORT_BY_NAME,*PIMAGE_IMPORT_BY_NAME;
3101 typedef struct _IMAGE_THUNK_DATA32 {
3102 union {
3103 DWORD ForwarderString;
3104 DWORD Function;
3105 DWORD Ordinal;
3106 DWORD AddressOfData;
3107 } u1;
3108 } IMAGE_THUNK_DATA32,*PIMAGE_THUNK_DATA32;
3109 typedef struct _IMAGE_THUNK_DATA64 {
3110 union {
3111 ULONGLONG ForwarderString;
3112 ULONGLONG Function;
3113 ULONGLONG Ordinal;
3114 ULONGLONG AddressOfData;
3115 } u1;
3116 } IMAGE_THUNK_DATA64, *PIMAGE_THUNK_DATA64;
3117 #ifdef __WIN64
3118 typedef IMAGE_THUNK_DATA64 IMAGE_THUNK_DATA;
3119 typedef PIMAGE_THUNK_DATA64 PIMAGE_THUNK_DATA;
3120 #else
3121 typedef IMAGE_THUNK_DATA32 IMAGE_THUNK_DATA;
3122 typedef PIMAGE_THUNK_DATA32 PIMAGE_THUNK_DATA;
3123 #endif
3124 typedef struct _IMAGE_IMPORT_DESCRIPTOR {
3125 _ANONYMOUS_UNION union {
3126 DWORD Characteristics;
3127 DWORD OriginalFirstThunk;
3128 } DUMMYUNIONNAME;
3129 DWORD TimeDateStamp;
3130 DWORD ForwarderChain;
3131 DWORD Name;
3132 DWORD FirstThunk;
3133 } IMAGE_IMPORT_DESCRIPTOR,*PIMAGE_IMPORT_DESCRIPTOR;
3134 typedef struct _IMAGE_BOUND_IMPORT_DESCRIPTOR {
3135 DWORD TimeDateStamp;
3136 WORD OffsetModuleName;
3137 WORD NumberOfModuleForwarderRefs;
3138 } IMAGE_BOUND_IMPORT_DESCRIPTOR,*PIMAGE_BOUND_IMPORT_DESCRIPTOR;
3139 typedef struct _IMAGE_BOUND_FORWARDER_REF {
3140 DWORD TimeDateStamp;
3141 WORD OffsetModuleName;
3142 WORD Reserved;
3143 } IMAGE_BOUND_FORWARDER_REF,*PIMAGE_BOUND_FORWARDER_REF;
3144 typedef void(NTAPI *PIMAGE_TLS_CALLBACK)(PVOID,DWORD,PVOID);
3145 typedef struct _IMAGE_TLS_DIRECTORY32 {
3146 DWORD StartAddressOfRawData;
3147 DWORD EndAddressOfRawData;
3148 DWORD AddressOfIndex;
3149 DWORD AddressOfCallBacks;
3150 DWORD SizeOfZeroFill;
3151 DWORD Characteristics;
3152 } IMAGE_TLS_DIRECTORY32,*PIMAGE_TLS_DIRECTORY32;
3153 typedef struct _IMAGE_TLS_DIRECTORY64 {
3154 ULONGLONG StartAddressOfRawData;
3155 ULONGLONG EndAddressOfRawData;
3156 ULONGLONG AddressOfIndex;
3157 ULONGLONG AddressOfCallBacks;
3158 DWORD SizeOfZeroFill;
3159 DWORD Characteristics;
3160 } IMAGE_TLS_DIRECTORY64, *PIMAGE_TLS_DIRECTORY64;
3161 #ifdef __WIN64
3162 typedef IMAGE_TLS_DIRECTORY64 IMAGE_TLS_DIRECTORY;
3163 typedef PIMAGE_TLS_DIRECTORY64 PIMAGE_TLS_DIRECTORY;
3164 #else
3165 typedef IMAGE_TLS_DIRECTORY32 IMAGE_TLS_DIRECTORY;
3166 typedef PIMAGE_TLS_DIRECTORY32 PIMAGE_TLS_DIRECTORY;
3167 #endif
3168 typedef struct _IMAGE_RESOURCE_DIRECTORY {
3169 DWORD Characteristics;
3170 DWORD TimeDateStamp;
3171 WORD MajorVersion;
3172 WORD MinorVersion;
3173 WORD NumberOfNamedEntries;
3174 WORD NumberOfIdEntries;
3175 } IMAGE_RESOURCE_DIRECTORY,*PIMAGE_RESOURCE_DIRECTORY;
3176 _ANONYMOUS_STRUCT typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
3177 _ANONYMOUS_UNION union {
3178 _ANONYMOUS_STRUCT struct {
3179 DWORD NameOffset:31;
3180 DWORD NameIsString:1;
3181 }DUMMYSTRUCTNAME;
3182 DWORD Name;
3183 WORD Id;
3184 } DUMMYUNIONNAME;
3185 _ANONYMOUS_UNION union {
3186 DWORD OffsetToData;
3187 _ANONYMOUS_STRUCT struct {
3188 DWORD OffsetToDirectory:31;
3189 DWORD DataIsDirectory:1;
3190 } DUMMYSTRUCTNAME2;
3191 } DUMMYUNIONNAME2;
3192 } IMAGE_RESOURCE_DIRECTORY_ENTRY,*PIMAGE_RESOURCE_DIRECTORY_ENTRY;
3193 typedef struct _IMAGE_RESOURCE_DIRECTORY_STRING {
3194 WORD Length;
3195 CHAR NameString[1];
3196 } IMAGE_RESOURCE_DIRECTORY_STRING,*PIMAGE_RESOURCE_DIRECTORY_STRING;
3197 typedef struct _IMAGE_RESOURCE_DIR_STRING_U {
3198 WORD Length;
3199 WCHAR NameString[1];
3200 } IMAGE_RESOURCE_DIR_STRING_U,*PIMAGE_RESOURCE_DIR_STRING_U;
3201 typedef struct _IMAGE_RESOURCE_DATA_ENTRY {
3202 DWORD OffsetToData;
3203 DWORD Size;
3204 DWORD CodePage;
3205 DWORD Reserved;
3206 } IMAGE_RESOURCE_DATA_ENTRY,*PIMAGE_RESOURCE_DATA_ENTRY;
3207 typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY {
3208 DWORD Characteristics;
3209 DWORD TimeDateStamp;
3210 WORD MajorVersion;
3211 WORD MinorVersion;
3212 DWORD GlobalFlagsClear;
3213 DWORD GlobalFlagsSet;
3214 DWORD CriticalSectionDefaultTimeout;
3215 DWORD DeCommitFreeBlockThreshold;
3216 DWORD DeCommitTotalFreeThreshold;
3217 PVOID LockPrefixTable;
3218 DWORD MaximumAllocationSize;
3219 DWORD VirtualMemoryThreshold;
3220 DWORD ProcessHeapFlags;
3221 DWORD Reserved[4];
3222 } IMAGE_LOAD_CONFIG_DIRECTORY,*PIMAGE_LOAD_CONFIG_DIRECTORY;
3223 typedef struct {
3224 DWORD Characteristics;
3225 DWORD TimeDateStamp;
3226 WORD MajorVersion;
3227 WORD MinorVersion;
3228 DWORD GlobalFlagsClear;
3229 DWORD GlobalFlagsSet;
3230 DWORD CriticalSectionDefaultTimeout;
3231 ULONGLONG DeCommitFreeBlockThreshold;
3232 ULONGLONG DeCommitTotalFreeThreshold;
3233 ULONGLONG LockPrefixTable;
3234 ULONGLONG MaximumAllocationSize;
3235 ULONGLONG VirtualMemoryThreshold;
3236 ULONGLONG ProcessAffinityMask;
3237 DWORD ProcessHeapFlags;
3238 WORD CSDFlags;
3239 WORD Reserved1;
3240 ULONGLONG EditList;
3241 DWORD Reserved[2];
3242 } IMAGE_LOAD_CONFIG_DIRECTORY64,*PIMAGE_LOAD_CONFIG_DIRECTORY64;
3243 typedef struct _IMAGE_RUNTIME_FUNCTION_ENTRY {
3244 DWORD BeginAddress;
3245 DWORD EndAddress;
3246 PVOID ExceptionHandler;
3247 PVOID HandlerData;
3248 DWORD PrologEndAddress;
3249 } IMAGE_RUNTIME_FUNCTION_ENTRY,*PIMAGE_RUNTIME_FUNCTION_ENTRY;
3250 typedef struct _IMAGE_CE_RUNTIME_FUNCTION_ENTRY {
3251 unsigned int FuncStart:32;
3252 unsigned int PrologLen:8;
3253 unsigned int FuncLen:22;
3254 unsigned int ThirtyTwoBit:1;
3255 unsigned int ExceptionFlag:1;
3256 } IMAGE_CE_RUNTIME_FUNCTION_ENTRY,*PIMAGE_CE_RUNTIME_FUNCTION_ENTRY;
3257 typedef struct _IMAGE_DEBUG_DIRECTORY {
3258 DWORD Characteristics;
3259 DWORD TimeDateStamp;
3260 WORD MajorVersion;
3261 WORD MinorVersion;
3262 DWORD Type;
3263 DWORD SizeOfData;
3264 DWORD AddressOfRawData;
3265 DWORD PointerToRawData;
3266 } IMAGE_DEBUG_DIRECTORY,*PIMAGE_DEBUG_DIRECTORY;
3267 typedef struct _FPO_DATA {
3268 DWORD ulOffStart;
3269 DWORD cbProcSize;
3270 DWORD cdwLocals;
3271 WORD cdwParams;
3272 WORD cbProlog:8;
3273 WORD cbRegs:3;
3274 WORD fHasSEH:1;
3275 WORD fUseBP:1;
3276 WORD reserved:1;
3277 WORD cbFrame:2;
3278 } FPO_DATA,*PFPO_DATA;
3279 typedef struct _IMAGE_DEBUG_MISC {
3280 DWORD DataType;
3281 DWORD Length;
3282 BOOLEAN Unicode;
3283 BYTE Reserved[3];
3284 BYTE Data[1];
3285 } IMAGE_DEBUG_MISC,*PIMAGE_DEBUG_MISC;
3286 typedef struct _IMAGE_FUNCTION_ENTRY {
3287 DWORD StartingAddress;
3288 DWORD EndingAddress;
3289 DWORD EndOfPrologue;
3290 } IMAGE_FUNCTION_ENTRY,*PIMAGE_FUNCTION_ENTRY;
3291 typedef struct _IMAGE_FUNCTION_ENTRY64 {
3292 ULONGLONG StartingAddress;
3293 ULONGLONG EndingAddress;
3294 _ANONYMOUS_UNION union {
3295 ULONGLONG EndOfPrologue;
3296 ULONGLONG UnwindInfoAddress;
3297 } DUMMYUNIONNAME;
3298 } IMAGE_FUNCTION_ENTRY64,*PIMAGE_FUNCTION_ENTRY64;
3299 typedef struct _IMAGE_SEPARATE_DEBUG_HEADER {
3300 WORD Signature;
3301 WORD Flags;
3302 WORD Machine;
3303 WORD Characteristics;
3304 DWORD TimeDateStamp;
3305 DWORD CheckSum;
3306 DWORD ImageBase;
3307 DWORD SizeOfImage;
3308 DWORD NumberOfSections;
3309 DWORD ExportedNamesSize;
3310 DWORD DebugDirectorySize;
3311 DWORD SectionAlignment;
3312 DWORD Reserved[2];
3313 } IMAGE_SEPARATE_DEBUG_HEADER,*PIMAGE_SEPARATE_DEBUG_HEADER;
3314 #pragma pack(pop)
3315 typedef enum _CM_SERVICE_NODE_TYPE {
3316 DriverType=SERVICE_KERNEL_DRIVER,
3317 FileSystemType=SERVICE_FILE_SYSTEM_DRIVER,
3318 Win32ServiceOwnProcess=SERVICE_WIN32_OWN_PROCESS,
3319 Win32ServiceShareProcess=SERVICE_WIN32_SHARE_PROCESS,
3320 AdapterType=SERVICE_ADAPTER,
3321 RecognizerType=SERVICE_RECOGNIZER_DRIVER
3322 } SERVICE_NODE_TYPE;
3323 typedef enum _CM_SERVICE_LOAD_TYPE {
3324 BootLoad=SERVICE_BOOT_START,
3325 SystemLoad=SERVICE_SYSTEM_START,
3326 AutoLoad=SERVICE_AUTO_START,
3327 DemandLoad=SERVICE_DEMAND_START,
3328 DisableLoad=SERVICE_DISABLED
3329 } SERVICE_LOAD_TYPE;
3330 typedef enum _CM_ERROR_CONTROL_TYPE {
3331 IgnoreError=SERVICE_ERROR_IGNORE,
3332 NormalError=SERVICE_ERROR_NORMAL,
3333 SevereError=SERVICE_ERROR_SEVERE,
3334 CriticalError=SERVICE_ERROR_CRITICAL
3335 } SERVICE_ERROR_TYPE;
3336 typedef struct _NT_TIB {
3337 struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;
3338 PVOID StackBase;
3339 PVOID StackLimit;
3340 PVOID SubSystemTib;
3341 _ANONYMOUS_UNION union {
3342 PVOID FiberData;
3343 DWORD Version;
3344 } DUMMYUNIONNAME;
3345 PVOID ArbitraryUserPointer;
3346 struct _NT_TIB *Self;
3347 } NT_TIB,*PNT_TIB;
3348 typedef struct _REPARSE_DATA_BUFFER {
3349 DWORD ReparseTag;
3350 WORD ReparseDataLength;
3351 WORD Reserved;
3352 _ANONYMOUS_UNION union {
3353 struct {
3354 WORD SubstituteNameOffset;
3355 WORD SubstituteNameLength;
3356 WORD PrintNameOffset;
3357 WORD PrintNameLength;
3358 ULONG Flags;
3359 WCHAR PathBuffer[1];
3360 } SymbolicLinkReparseBuffer;
3361 struct {
3362 WORD SubstituteNameOffset;
3363 WORD SubstituteNameLength;
3364 WORD PrintNameOffset;
3365 WORD PrintNameLength;
3366 WCHAR PathBuffer[1];
3367 } MountPointReparseBuffer;
3368 struct {
3369 BYTE DataBuffer[1];
3370 } GenericReparseBuffer;
3371 } DUMMYUNIONNAME;
3372 } REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER;
3373 typedef struct _REPARSE_GUID_DATA_BUFFER {
3374 DWORD ReparseTag;
3375 WORD ReparseDataLength;
3376 WORD Reserved;
3377 GUID ReparseGuid;
3378 struct {
3379 BYTE DataBuffer[1];
3380 } GenericReparseBuffer;
3381 } REPARSE_GUID_DATA_BUFFER, *PREPARSE_GUID_DATA_BUFFER;
3382 typedef struct _REPARSE_POINT_INFORMATION {
3383 WORD ReparseDataLength;
3384 WORD UnparsedNameLength;
3385 } REPARSE_POINT_INFORMATION, *PREPARSE_POINT_INFORMATION;
3387 typedef union _FILE_SEGMENT_ELEMENT {
3388 PVOID64 Buffer;
3389 ULONGLONG Alignment;
3390 }FILE_SEGMENT_ELEMENT, *PFILE_SEGMENT_ELEMENT;
3392 /* JOBOBJECT_BASIC_LIMIT_INFORMATION.LimitFlags constants */
3393 #define JOB_OBJECT_LIMIT_WORKINGSET 0x0001
3394 #define JOB_OBJECT_LIMIT_PROCESS_TIME 0x0002
3395 #define JOB_OBJECT_LIMIT_JOB_TIME 0x0004
3396 #define JOB_OBJECT_LIMIT_ACTIVE_PROCESS 0x0008
3397 #define JOB_OBJECT_LIMIT_AFFINITY 0x0010
3398 #define JOB_OBJECT_LIMIT_PRIORITY_CLASS 0x0020
3399 #define JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME 0x0040
3400 #define JOB_OBJECT_LIMIT_SCHEDULING_CLASS 0x0080
3401 #define JOB_OBJECT_LIMIT_PROCESS_MEMORY 0x0100
3402 #define JOB_OBJECT_LIMIT_JOB_MEMORY 0x0200
3403 #define JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION 0x0400
3404 #define JOB_OBJECT_BREAKAWAY_OK 0x0800
3405 #define JOB_OBJECT_SILENT_BREAKAWAY 0x1000
3407 /* JOBOBJECT_BASIC_UI_RESTRICTIONS.UIRestrictionsClass constants */
3408 #define JOB_OBJECT_UILIMIT_HANDLES 0x0001
3409 #define JOB_OBJECT_UILIMIT_READCLIPBOARD 0x0002
3410 #define JOB_OBJECT_UILIMIT_WRITECLIPBOARD 0x0004
3411 #define JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS 0x0008
3412 #define JOB_OBJECT_UILIMIT_DISPLAYSETTINGS 0x0010
3413 #define JOB_OBJECT_UILIMIT_GLOBALATOMS 0x0020
3414 #define JOB_OBJECT_UILIMIT_DESKTOP 0x0040
3415 #define JOB_OBJECT_UILIMIT_EXITWINDOWS 0x0080
3417 /* JOBOBJECT_SECURITY_LIMIT_INFORMATION.SecurityLimitFlags constants */
3418 #define JOB_OBJECT_SECURITY_NO_ADMIN 0x0001
3419 #define JOB_OBJECT_SECURITY_RESTRICTED_TOKEN 0x0002
3420 #define JOB_OBJECT_SECURITY_ONLY_TOKEN 0x0004
3421 #define JOB_OBJECT_SECURITY_FILTER_TOKENS 0x0008
3423 /* JOBOBJECT_END_OF_JOB_TIME_INFORMATION.EndOfJobTimeAction constants */
3424 #define JOB_OBJECT_TERMINATE_AT_END_OF_JOB 0
3425 #define JOB_OBJECT_POST_AT_END_OF_JOB 1
3427 #define JOB_OBJECT_MSG_END_OF_JOB_TIME 1
3428 #define JOB_OBJECT_MSG_END_OF_PROCESS_TIME 2
3429 #define JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT 3
3430 #define JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO 4
3431 #define JOB_OBJECT_MSG_NEW_PROCESS 6
3432 #define JOB_OBJECT_MSG_EXIT_PROCESS 7
3433 #define JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS 8
3434 #define JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT 9
3435 #define JOB_OBJECT_MSG_JOB_MEMORY_LIMIT 10
3437 typedef enum _JOBOBJECTINFOCLASS {
3438 JobObjectBasicAccountingInformation = 1,
3439 JobObjectBasicLimitInformation,
3440 JobObjectBasicProcessIdList,
3441 JobObjectBasicUIRestrictions,
3442 JobObjectSecurityLimitInformation,
3443 JobObjectEndOfJobTimeInformation,
3444 JobObjectAssociateCompletionPortInformation,
3445 JobObjectBasicAndIoAccountingInformation,
3446 JobObjectExtendedLimitInformation,
3447 JobObjectJobSetInformation,
3448 MaxJobObjectInfoClass
3449 } JOBOBJECTINFOCLASS;
3450 typedef struct _JOBOBJECT_BASIC_ACCOUNTING_INFORMATION {
3451 LARGE_INTEGER TotalUserTime;
3452 LARGE_INTEGER TotalKernelTime;
3453 LARGE_INTEGER ThisPeriodTotalUserTime;
3454 LARGE_INTEGER ThisPeriodTotalKernelTime;
3455 DWORD TotalPageFaultCount;
3456 DWORD TotalProcesses;
3457 DWORD ActiveProcesses;
3458 DWORD TotalTerminatedProcesses;
3459 } JOBOBJECT_BASIC_ACCOUNTING_INFORMATION,*PJOBOBJECT_BASIC_ACCOUNTING_INFORMATION;
3460 typedef struct _JOBOBJECT_BASIC_LIMIT_INFORMATION {
3461 LARGE_INTEGER PerProcessUserTimeLimit;
3462 LARGE_INTEGER PerJobUserTimeLimit;
3463 DWORD LimitFlags;
3464 SIZE_T MinimumWorkingSetSize;
3465 SIZE_T MaximumWorkingSetSize;
3466 DWORD ActiveProcessLimit;
3467 ULONG_PTR Affinity;
3468 DWORD PriorityClass;
3469 DWORD SchedulingClass;
3470 } JOBOBJECT_BASIC_LIMIT_INFORMATION,*PJOBOBJECT_BASIC_LIMIT_INFORMATION;
3471 typedef struct _JOBOBJECT_BASIC_PROCESS_ID_LIST {
3472 DWORD NumberOfAssignedProcesses;
3473 DWORD NumberOfProcessIdsInList;
3474 ULONG_PTR ProcessIdList[1];
3475 } JOBOBJECT_BASIC_PROCESS_ID_LIST, *PJOBOBJECT_BASIC_PROCESS_ID_LIST;
3476 typedef struct _JOBOBJECT_BASIC_UI_RESTRICTIONS {
3477 DWORD UIRestrictionsClass;
3478 } JOBOBJECT_BASIC_UI_RESTRICTIONS,*PJOBOBJECT_BASIC_UI_RESTRICTIONS;
3479 typedef struct _JOBOBJECT_SECURITY_LIMIT_INFORMATION {
3480 DWORD SecurityLimitFlags;
3481 HANDLE JobToken;
3482 PTOKEN_GROUPS SidsToDisable;
3483 PTOKEN_PRIVILEGES PrivilegesToDelete;
3484 PTOKEN_GROUPS RestrictedSids;
3485 } JOBOBJECT_SECURITY_LIMIT_INFORMATION,*PJOBOBJECT_SECURITY_LIMIT_INFORMATION;
3486 typedef struct _JOBOBJECT_END_OF_JOB_TIME_INFORMATION {
3487 DWORD EndOfJobTimeAction;
3488 } JOBOBJECT_END_OF_JOB_TIME_INFORMATION,*PJOBOBJECT_END_OF_JOB_TIME_INFORMATION;
3489 typedef struct _JOBOBJECT_ASSOCIATE_COMPLETION_PORT {
3490 PVOID CompletionKey;
3491 HANDLE CompletionPort;
3492 } JOBOBJECT_ASSOCIATE_COMPLETION_PORT,*PJOBOBJECT_ASSOCIATE_COMPLETION_PORT;
3493 typedef struct _JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION {
3494 JOBOBJECT_BASIC_ACCOUNTING_INFORMATION BasicInfo;
3495 IO_COUNTERS IoInfo;
3496 } JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION,*PJOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION;
3497 typedef struct _JOBOBJECT_EXTENDED_LIMIT_INFORMATION {
3498 JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation;
3499 IO_COUNTERS IoInfo;
3500 SIZE_T ProcessMemoryLimit;
3501 SIZE_T JobMemoryLimit;
3502 SIZE_T PeakProcessMemoryUsed;
3503 SIZE_T PeakJobMemoryUsed;
3504 } JOBOBJECT_EXTENDED_LIMIT_INFORMATION,*PJOBOBJECT_EXTENDED_LIMIT_INFORMATION;
3505 typedef struct _JOBOBJECT_JOBSET_INFORMATION {
3506 DWORD MemberLevel;
3507 } JOBOBJECT_JOBSET_INFORMATION,*PJOBOBJECT_JOBSET_INFORMATION;
3509 /* Fixme: Making these defines conditional on WINVER will break ddk includes */
3510 #if 1 /* (WINVER >= 0x0500) */
3511 #include <pshpack4.h>
3513 #define ES_SYSTEM_REQUIRED 0x00000001
3514 #define ES_DISPLAY_REQUIRED 0x00000002
3515 #define ES_USER_PRESENT 0x00000004
3516 #define ES_CONTINUOUS 0x80000000
3518 typedef enum _LATENCY_TIME {
3519 LT_DONT_CARE,
3520 LT_LOWEST_LATENCY
3521 } LATENCY_TIME, *PLATENCY_TIME;
3523 typedef enum _SYSTEM_POWER_STATE {
3524 PowerSystemUnspecified,
3525 PowerSystemWorking,
3526 PowerSystemSleeping1,
3527 PowerSystemSleeping2,
3528 PowerSystemSleeping3,
3529 PowerSystemHibernate,
3530 PowerSystemShutdown,
3531 PowerSystemMaximum
3532 } SYSTEM_POWER_STATE, *PSYSTEM_POWER_STATE;
3533 #define POWER_SYSTEM_MAXIMUM PowerSystemMaximum
3535 typedef enum {
3536 PowerActionNone,
3537 PowerActionReserved,
3538 PowerActionSleep,
3539 PowerActionHibernate,
3540 PowerActionShutdown,
3541 PowerActionShutdownReset,
3542 PowerActionShutdownOff,
3543 PowerActionWarmEject
3544 } POWER_ACTION, *PPOWER_ACTION;
3546 typedef enum _DEVICE_POWER_STATE {
3547 PowerDeviceUnspecified,
3548 PowerDeviceD0,
3549 PowerDeviceD1,
3550 PowerDeviceD2,
3551 PowerDeviceD3,
3552 PowerDeviceMaximum
3553 } DEVICE_POWER_STATE, *PDEVICE_POWER_STATE;
3555 typedef struct {
3556 DWORD Granularity;
3557 DWORD Capacity;
3558 } BATTERY_REPORTING_SCALE, *PBATTERY_REPORTING_SCALE;
3560 typedef struct _POWER_ACTION_POLICY {
3561 POWER_ACTION Action;
3562 ULONG Flags;
3563 ULONG EventCode;
3564 } POWER_ACTION_POLICY, *PPOWER_ACTION_POLICY;
3566 /* POWER_ACTION_POLICY.Flags constants */
3567 #define POWER_ACTION_QUERY_ALLOWED 0x00000001
3568 #define POWER_ACTION_UI_ALLOWED 0x00000002
3569 #define POWER_ACTION_OVERRIDE_APPS 0x00000004
3570 #define POWER_ACTION_LIGHTEST_FIRST 0x10000000
3571 #define POWER_ACTION_LOCK_CONSOLE 0x20000000
3572 #define POWER_ACTION_DISABLE_WAKES 0x40000000
3573 #define POWER_ACTION_CRITICAL 0x80000000
3575 /* POWER_ACTION_POLICY.EventCode constants */
3576 #define POWER_LEVEL_USER_NOTIFY_TEXT 0x00000001
3577 #define POWER_LEVEL_USER_NOTIFY_SOUND 0x00000002
3578 #define POWER_LEVEL_USER_NOTIFY_EXEC 0x00000004
3579 #define POWER_USER_NOTIFY_BUTTON 0x00000008
3580 #define POWER_USER_NOTIFY_SHUTDOWN 0x00000010
3581 #define POWER_FORCE_TRIGGER_RESET 0x80000000
3583 #define DISCHARGE_POLICY_CRITICAL 0
3584 #define DISCHARGE_POLICY_LOW 1
3585 #define NUM_DISCHARGE_POLICIES 4
3587 #define PO_THROTTLE_NONE 0
3588 #define PO_THROTTLE_CONSTANT 1
3589 #define PO_THROTTLE_DEGRADE 2
3590 #define PO_THROTTLE_ADAPTIVE 3
3591 #define PO_THROTTLE_MAXIMUM 4
3593 typedef struct _SYSTEM_POWER_LEVEL {
3594 BOOLEAN Enable;
3595 UCHAR Spare[3];
3596 ULONG BatteryLevel;
3597 POWER_ACTION_POLICY PowerPolicy;
3598 SYSTEM_POWER_STATE MinSystemState;
3599 } SYSTEM_POWER_LEVEL, *PSYSTEM_POWER_LEVEL;
3601 typedef struct _SYSTEM_POWER_POLICY {
3602 ULONG Revision;
3603 POWER_ACTION_POLICY PowerButton;
3604 POWER_ACTION_POLICY SleepButton;
3605 POWER_ACTION_POLICY LidClose;
3606 SYSTEM_POWER_STATE LidOpenWake;
3607 ULONG Reserved;
3608 POWER_ACTION_POLICY Idle;
3609 ULONG IdleTimeout;
3610 UCHAR IdleSensitivity;
3611 UCHAR DynamicThrottle;
3612 UCHAR Spare2[2];
3613 SYSTEM_POWER_STATE MinSleep;
3614 SYSTEM_POWER_STATE MaxSleep;
3615 SYSTEM_POWER_STATE ReducedLatencySleep;
3616 ULONG WinLogonFlags;
3617 ULONG Spare3;
3618 ULONG DozeS4Timeout;
3619 ULONG BroadcastCapacityResolution;
3620 SYSTEM_POWER_LEVEL DischargePolicy[NUM_DISCHARGE_POLICIES];
3621 ULONG VideoTimeout;
3622 BOOLEAN VideoDimDisplay;
3623 ULONG VideoReserved[3];
3624 ULONG SpindownTimeout;
3625 BOOLEAN OptimizeForPower;
3626 UCHAR FanThrottleTolerance;
3627 UCHAR ForcedThrottle;
3628 UCHAR MinThrottle;
3629 POWER_ACTION_POLICY OverThrottled;
3630 } SYSTEM_POWER_POLICY, *PSYSTEM_POWER_POLICY;
3632 typedef struct _SYSTEM_POWER_CAPABILITIES {
3633 BOOLEAN PowerButtonPresent;
3634 BOOLEAN SleepButtonPresent;
3635 BOOLEAN LidPresent;
3636 BOOLEAN SystemS1;
3637 BOOLEAN SystemS2;
3638 BOOLEAN SystemS3;
3639 BOOLEAN SystemS4;
3640 BOOLEAN SystemS5;
3641 BOOLEAN HiberFilePresent;
3642 BOOLEAN FullWake;
3643 BOOLEAN VideoDimPresent;
3644 BOOLEAN ApmPresent;
3645 BOOLEAN UpsPresent;
3646 BOOLEAN ThermalControl;
3647 BOOLEAN ProcessorThrottle;
3648 UCHAR ProcessorMinThrottle;
3649 UCHAR ProcessorMaxThrottle;
3650 UCHAR spare2[4];
3651 BOOLEAN DiskSpinDown;
3652 UCHAR spare3[8];
3653 BOOLEAN SystemBatteriesPresent;
3654 BOOLEAN BatteriesAreShortTerm;
3655 BATTERY_REPORTING_SCALE BatteryScale[3];
3656 SYSTEM_POWER_STATE AcOnLineWake;
3657 SYSTEM_POWER_STATE SoftLidWake;
3658 SYSTEM_POWER_STATE RtcWake;
3659 SYSTEM_POWER_STATE MinDeviceWakeState;
3660 SYSTEM_POWER_STATE DefaultLowLatencyWake;
3661 } SYSTEM_POWER_CAPABILITIES, *PSYSTEM_POWER_CAPABILITIES;
3663 typedef struct _SYSTEM_BATTERY_STATE {
3664 BOOLEAN AcOnLine;
3665 BOOLEAN BatteryPresent;
3666 BOOLEAN Charging;
3667 BOOLEAN Discharging;
3668 BOOLEAN Spare1[4];
3669 ULONG MaxCapacity;
3670 ULONG RemainingCapacity;
3671 ULONG Rate;
3672 ULONG EstimatedTime;
3673 ULONG DefaultAlert1;
3674 ULONG DefaultAlert2;
3675 } SYSTEM_BATTERY_STATE, *PSYSTEM_BATTERY_STATE;
3677 typedef enum _POWER_INFORMATION_LEVEL {
3678 SystemPowerPolicyAc,
3679 SystemPowerPolicyDc,
3680 VerifySystemPolicyAc,
3681 VerifySystemPolicyDc,
3682 SystemPowerCapabilities,
3683 SystemBatteryState,
3684 SystemPowerStateHandler,
3685 ProcessorStateHandler,
3686 SystemPowerPolicyCurrent,
3687 AdministratorPowerPolicy,
3688 SystemReserveHiberFile,
3689 ProcessorInformation,
3690 SystemPowerInformation,
3691 ProcessorStateHandler2,
3692 LastWakeTime,
3693 LastSleepTime,
3694 SystemExecutionState,
3695 SystemPowerStateNotifyHandler,
3696 ProcessorPowerPolicyAc,
3697 ProcessorPowerPolicyDc,
3698 VerifyProcessorPowerPolicyAc,
3699 VerifyProcessorPowerPolicyDc,
3700 ProcessorPowerPolicyCurrent
3701 } POWER_INFORMATION_LEVEL;
3703 #if (_WIN32_WINNT >= 0x0500)
3704 typedef LONG (WINAPI *PVECTORED_EXCEPTION_HANDLER)(PEXCEPTION_POINTERS);
3705 #endif
3706 #if 1 /* (WIN32_WINNT >= 0x0500) */
3707 typedef struct _SYSTEM_POWER_INFORMATION {
3708 ULONG MaxIdlenessAllowed;
3709 ULONG Idleness;
3710 ULONG TimeRemaining;
3711 UCHAR CoolingMode;
3712 } SYSTEM_POWER_INFORMATION,*PSYSTEM_POWER_INFORMATION;
3713 #endif
3715 #if (_WIN32_WINNT >= 0x0501)
3716 typedef enum _HEAP_INFORMATION_CLASS {
3717 HeapCompatibilityInformation
3718 } HEAP_INFORMATION_CLASS;
3719 typedef enum _ACTIVATION_CONTEXT_INFO_CLASS {
3720 ActivationContextBasicInformation = 1,
3721 ActivationContextDetailedInformation,
3722 AssemblyDetailedInformationInActivationContext,
3723 FileInformationInAssemblyOfAssemblyInActivationContext
3724 } ACTIVATION_CONTEXT_INFO_CLASS;
3725 typedef struct _ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION {
3726 DWORD ulFlags;
3727 DWORD ulEncodedAssemblyIdentityLength;
3728 DWORD ulManifestPathType;
3729 DWORD ulManifestPathLength;
3730 LARGE_INTEGER liManifestLastWriteTime;
3731 DWORD ulPolicyPathType;
3732 DWORD ulPolicyPathLength;
3733 LARGE_INTEGER liPolicyLastWriteTime;
3734 DWORD ulMetadataSatelliteRosterIndex;
3735 DWORD ulManifestVersionMajor;
3736 DWORD ulManifestVersionMinor;
3737 DWORD ulPolicyVersionMajor;
3738 DWORD ulPolicyVersionMinor;
3739 DWORD ulAssemblyDirectoryNameLength;
3740 PCWSTR lpAssemblyEncodedAssemblyIdentity;
3741 PCWSTR lpAssemblyManifestPath;
3742 PCWSTR lpAssemblyPolicyPath;
3743 PCWSTR lpAssemblyDirectoryName;
3744 } ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION,*PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION;
3745 typedef const ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION *PCACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION;
3746 typedef struct _ACTIVATION_CONTEXT_DETAILED_INFORMATION {
3747 DWORD dwFlags;
3748 DWORD ulFormatVersion;
3749 DWORD ulAssemblyCount;
3750 DWORD ulRootManifestPathType;
3751 DWORD ulRootManifestPathChars;
3752 DWORD ulRootConfigurationPathType;
3753 DWORD ulRootConfigurationPathChars;
3754 DWORD ulAppDirPathType;
3755 DWORD ulAppDirPathChars;
3756 PCWSTR lpRootManifestPath;
3757 PCWSTR lpRootConfigurationPath;
3758 PCWSTR lpAppDirPath;
3759 } ACTIVATION_CONTEXT_DETAILED_INFORMATION,*PACTIVATION_CONTEXT_DETAILED_INFORMATION;
3760 typedef const ACTIVATION_CONTEXT_DETAILED_INFORMATION *PCACTIVATION_CONTEXT_DETAILED_INFORMATION;
3761 typedef struct _ACTIVATION_CONTEXT_QUERY_INDEX {
3762 ULONG ulAssemblyIndex;
3763 ULONG ulFileIndexInAssembly;
3764 } ACTIVATION_CONTEXT_QUERY_INDEX,*PACTIVATION_CONTEXT_QUERY_INDEX;
3765 typedef const ACTIVATION_CONTEXT_QUERY_INDEX *PCACTIVATION_CONTEXT_QUERY_INDEX;
3766 typedef struct _ASSEMBLY_FILE_DETAILED_INFORMATION {
3767 DWORD ulFlags;
3768 DWORD ulFilenameLength;
3769 DWORD ulPathLength;
3770 PCWSTR lpFileName;
3771 PCWSTR lpFilePath;
3772 } ASSEMBLY_FILE_DETAILED_INFORMATION,*PASSEMBLY_FILE_DETAILED_INFORMATION;
3773 typedef const ASSEMBLY_FILE_DETAILED_INFORMATION *PCASSEMBLY_FILE_DETAILED_INFORMATION;
3774 #endif /* (WIN32_WINNT >= 0x0501) */
3776 typedef struct _PROCESSOR_POWER_POLICY_INFO {
3777 ULONG TimeCheck;
3778 ULONG DemoteLimit;
3779 ULONG PromoteLimit;
3780 UCHAR DemotePercent;
3781 UCHAR PromotePercent;
3782 UCHAR Spare[2];
3783 ULONG AllowDemotion : 1;
3784 ULONG AllowPromotion : 1;
3785 ULONG Reserved : 30;
3786 } PROCESSOR_POWER_POLICY_INFO, *PPROCESSOR_POWER_POLICY_INFO;
3787 typedef struct _PROCESSOR_POWER_POLICY {
3788 ULONG Revision;
3789 UCHAR DynamicThrottle;
3790 UCHAR Spare[3];
3791 ULONG Reserved;
3792 ULONG PolicyCount;
3793 PROCESSOR_POWER_POLICY_INFO Policy[3];
3794 } PROCESSOR_POWER_POLICY, *PPROCESSOR_POWER_POLICY;
3795 typedef struct _ADMINISTRATOR_POWER_POLICY {
3796 SYSTEM_POWER_STATE MinSleep;
3797 SYSTEM_POWER_STATE MaxSleep;
3798 ULONG MinVideoTimeout;
3799 ULONG MaxVideoTimeout;
3800 ULONG MinSpindownTimeout;
3801 ULONG MaxSpindownTimeout;
3802 } ADMINISTRATOR_POWER_POLICY, *PADMINISTRATOR_POWER_POLICY;
3803 #include <poppack.h>
3804 #endif /* WINVER >= 0x0500 */
3806 #if (_WIN32_WINNT >= 0x0500)
3807 typedef VOID (NTAPI *WAITORTIMERCALLBACKFUNC)(PVOID,BOOLEAN);
3808 #endif
3810 #ifdef UNICODE
3811 typedef OSVERSIONINFOW OSVERSIONINFO,*POSVERSIONINFO,*LPOSVERSIONINFO;
3812 typedef OSVERSIONINFOEXW OSVERSIONINFOEX,*POSVERSIONINFOEX,*LPOSVERSIONINFOEX;
3813 #else
3814 typedef OSVERSIONINFOA OSVERSIONINFO,*POSVERSIONINFO,*LPOSVERSIONINFO;
3815 typedef OSVERSIONINFOEXA OSVERSIONINFOEX,*POSVERSIONINFOEX,*LPOSVERSIONINFOEX;
3816 #endif
3818 #if (_WIN32_WINNT >= 0x0500)
3819 ULONGLONG WINAPI VerSetConditionMask(ULONGLONG,DWORD,BYTE);
3820 #define VER_SET_CONDITION(ConditionMask, TypeBitMask, ComparisonType) \
3821 ((ConditionMask) = VerSetConditionMask((ConditionMask), \
3822 (TypeBitMask), (ComparisonType)))
3823 #endif
3825 #ifdef _X86_
3826 #if defined(__GNUC__)
3827 #if (__GNUC__ >= 3)
3828 /* Support -masm=intel. */
3829 static __inline__ PVOID GetCurrentFiber(void)
3831 void* ret;
3832 __asm__ __volatile__ (
3833 "mov{l} {%%fs:0x10,%0|%0,%%fs:0x10}"
3834 : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */
3836 return ret;
3839 static __inline__ PVOID GetFiberData(void)
3841 void* ret;
3842 __asm__ __volatile__ (
3843 "mov{l} {%%fs:0x10,%0|%0,%%fs:0x10}\n\t"
3844 "mov{l} {(%0),%0|%0,[%0]}"
3845 : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */
3847 return ret;
3850 static __inline__ struct _TEB * NtCurrentTeb(void)
3852 struct _TEB *ret;
3854 __asm__ __volatile__ (
3855 "mov{l} {%%fs:0x18,%0|%0,%%fs:0x18}\n"
3856 : "=r" (ret)
3857 : /* no inputs */
3860 return ret;
3863 #else /* __GNUC__ >= 3 */
3864 static __inline__ PVOID GetCurrentFiber(void)
3866 void* ret;
3867 __asm__ __volatile__ (
3868 "movl %%fs:0x10,%0"
3869 : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */
3871 return ret;
3874 static __inline__ PVOID GetFiberData(void)
3876 void* ret;
3877 __asm__ __volatile__ (
3878 "movl %%fs:0x10,%0\n\t"
3879 "movl (%0),%0"
3880 : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */
3882 return ret;
3885 static __inline__ struct _TEB * NtCurrentTeb(void)
3887 struct _TEB *ret;
3889 __asm__ __volatile__ (
3890 "movl %%fs:0x18, %0\n"
3891 : "=r" (ret)
3892 : /* no inputs */
3894 return ret;
3896 #endif /* __GNUC__ >= 3 */
3898 #else
3900 PVOID GetCurrentFiber(void);
3901 #pragma aux GetCurrentFiber = \
3902 "mov eax, dword ptr fs:0x10" \
3903 value [eax] \
3904 modify [eax];
3906 PVOID GetFiberData(void);
3907 #pragma aux GetFiberData = \
3908 "mov eax, dword ptr fs:0x10" \
3909 "mov eax, [eax]" \
3910 value [eax] \
3911 modify [eax];
3913 struct _TEB * NtCurrentTeb(void);
3914 #pragma aux NtCurrentTeb = \
3915 "mov eax, dword ptr fs:0x18" \
3916 value [eax] \
3917 modify [eax];
3919 #endif /* __GNUC__ */
3920 #endif /* _X86_ */
3922 #endif /* RC_INVOKED */
3924 #ifdef __cplusplus
3926 #endif
3927 #endif