Sie sind auf Seite 1von 62

1 #ifndef _WINNT_H

2 #define _WINNT_H
3 #if __GNUC__ >= 3
4 #pragma GCC system_header
5 #endif
6
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
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 #include <winerror.h>
35
36 #ifndef RC_INVOKED
37 #include <string.h>
38
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
45
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
53
54 #ifndef DECLSPEC_SELECTANY
55 #if (__GNUC__ >= 4)
56 #define DECLSPEC_SELECTANY __attribute__((selectany))
57 #else
58 #define DECLSPEC_SELECTANY
59 #endif
60 #endif
61
62 #ifndef FORCEINLINE
63 #if (__GNUC__ >= 3)
64 #define FORCEINLINE __inline __attribute__((always_inline))
65 #else
66 #define FORCEINLINE __inline
67 #endif
68 #endif
69
70 #ifndef C_ASSERT
71 #define C_ASSERT(expr) typedef char __C_ASSERT__[(expr)?1:-1]
72 #endif
73
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;
85
86 typedef void *PVOID,*LPVOID;
87
88 /* FIXME for __WIN64 */
89 #ifndef __ptr64
90 #define __ptr64
91 #endif
92 typedef void* __ptr64 PVOID64;
93
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
104
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
113 /*
114 * NOTE: This tests UNICODE, which is different from the _UNICODE define
115 * used to differentiate standard C runtime calls.
116 */
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
128 /*
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.
133 */
134 #define __TEXT(q) L##q
135 #else
136 #define __TEXT(q) q
137 #endif
138 /*
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
143 */
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;
190
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
238
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
244
245 #define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
246
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
264
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
269
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
286
287 #define FILE_COPY_STRUCTURED_STORAGE 0x00000041
288 #define FILE_STRUCTURED_STORAGE 0x00000441
289
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
294
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
302
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
323
324 #define FILE_ALL_ACCESS \
325 (STANDARD_RIGHTS_REQUIRED | \
326 SYNCHRONIZE | \
327 0x1FF)
328
329 #define FILE_GENERIC_EXECUTE \
330 (STANDARD_RIGHTS_EXECUTE | \
331 FILE_READ_ATTRIBUTES | \
332 FILE_EXECUTE | \
333 SYNCHRONIZE)
334
335 #define FILE_GENERIC_READ \
336 (STANDARD_RIGHTS_READ | \
337 FILE_READ_DATA | \
338 FILE_READ_ATTRIBUTES | \
339 FILE_READ_EA | \
340 SYNCHRONIZE)
341
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
365
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
380 #define FILE_READ_ONLY_VOLUME 0x00080000
381 #define FILE_SEQUENTIAL_WRITE_ONCE 0x00100000
382 #define FILE_SUPPORTS_TRANSACTIONS 0x00200000
383
384
385 #define IO_COMPLETION_QUERY_STATE 0x0001
386 #define IO_COMPLETION_MODIFY_STATE 0x0002
387 #define IO_COMPLETION_ALL_ACCESS
(STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
388 /* end ntifs.h */
389
390 /* also in ddk/winddk.h */
391 #define DUPLICATE_CLOSE_SOURCE 0x00000001
392 #define DUPLICATE_SAME_ACCESS 0x00000002
393 #define DUPLICATE_SAME_ATTRIBUTES 0x00000004
394 /* end winddk.k */
395
396 #define MAILSLOT_NO_MESSAGE ((DWORD)-1)
397 #define MAILSLOT_WAIT_FOREVER ((DWORD)-1)
398 #define PROCESS_TERMINATE 1
399 #define PROCESS_CREATE_THREAD 2
400 #define PROCESS_SET_SESSIONID 4
401 #define PROCESS_VM_OPERATION 8
402 #define PROCESS_VM_READ 16
403 #define PROCESS_VM_WRITE 32
404 #define PROCESS_DUP_HANDLE 64
405 #define PROCESS_CREATE_PROCESS 128
406 #define PROCESS_SET_QUOTA 256
407 #define PROCESS_SET_INFORMATION 512
408 #define PROCESS_QUERY_INFORMATION 1024
409 #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xFFF)
410 #define THREAD_TERMINATE 1
411 #define THREAD_SUSPEND_RESUME 2
412 #define THREAD_GET_CONTEXT 8
413 #define THREAD_SET_CONTEXT 16
414 #define THREAD_SET_INFORMATION 32
415 #define THREAD_QUERY_INFORMATION 64
416 #define THREAD_SET_THREAD_TOKEN 128
417 #define THREAD_IMPERSONATE 256
418 #define THREAD_DIRECT_IMPERSONATION 0x200
419 #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3FF)
420 #define THREAD_BASE_PRIORITY_LOWRT 15
421 #define THREAD_BASE_PRIORITY_MAX 2
422 #define THREAD_BASE_PRIORITY_MIN (-2)
423 #define THREAD_BASE_PRIORITY_IDLE (-15)
424 #define EXCEPTION_NONCONTINUABLE 1
425 #define EXCEPTION_MAXIMUM_PARAMETERS 15
426 #define MUTANT_QUERY_STATE 0x0001
427 #define MUTANT_ALL_ACCESS
(STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|MUTANT_QUERY_STATE)
428 #define TIMER_QUERY_STATE 0x0001
429 #define TIMER_MODIFY_STATE 0x0002
430 #define TIMER_ALL_ACCESS
(STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|TIMER_QUERY_STATE|TIMER_MODIFY_STATE)
431 /*
432 * To prevent gcc compiler warnings, bracket these defines when
initialising
433 * a SID_IDENTIFIER_AUTHORITY, eg.
434 * SID_IDENTIFIER_AUTHORITY aNullSidAuthority =
{SECURITY_NULL_SID_AUTHORITY};
435 */
436 #define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0}
437 #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
438 #define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2}
439 #define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3}
440 #define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4}
441 #define SECURITY_NT_AUTHORITY {0,0,0,0,0,5}
442 #define SECURITY_MANDATORY_LABEL_AUTHORITY {0,0,0,0,0,16}
443 #define SECURITY_NULL_RID 0
444 #define SECURITY_WORLD_RID (0x00000000L)
445 #define SECURITY_LOCAL_RID 0
446 #define SECURITY_CREATOR_OWNER_RID 0
447 #define SECURITY_CREATOR_GROUP_RID 1
448 #define SECURITY_DIALUP_RID 1
449 #define SECURITY_NETWORK_RID 2
450 #define SECURITY_BATCH_RID 3
451 #define SECURITY_INTERACTIVE_RID 4
452 #define SECURITY_LOGON_IDS_RID 5
453 #define SECURITY_SERVICE_RID 6
454 #define SECURITY_LOCAL_SYSTEM_RID 18
455 #define SECURITY_BUILTIN_DOMAIN_RID 32
456 #define SECURITY_PRINCIPAL_SELF_RID 10
457 #define SECURITY_CREATOR_OWNER_SERVER_RID 0x2
458 #define SECURITY_CREATOR_GROUP_SERVER_RID 0x3
459 #define SECURITY_LOGON_IDS_RID_COUNT 0x3
460 #define SECURITY_ANONYMOUS_LOGON_RID 0x7
461 #define SECURITY_PROXY_RID 0x8
462 #define SECURITY_ENTERPRISE_CONTROLLERS_RID 0x9
463 #define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID
464 #define SECURITY_AUTHENTICATED_USER_RID 0xB
465 #define SECURITY_RESTRICTED_CODE_RID 0xC
466 #define SECURITY_NT_NON_UNIQUE_RID 0x15
467 #define SID_REVISION 1
468 #define DOMAIN_USER_RID_ADMIN 0x1F4L
469 #define DOMAIN_USER_RID_GUEST 0x1F5L
470 #define DOMAIN_GROUP_RID_ADMINS 0x200L
471 #define DOMAIN_GROUP_RID_USERS 0x201L
472 #define DOMAIN_ALIAS_RID_ADMINS 0x220L
473 #define DOMAIN_ALIAS_RID_USERS 0x221L
474 #define DOMAIN_ALIAS_RID_GUESTS 0x222L
475 #define DOMAIN_ALIAS_RID_POWER_USERS 0x223L
476 #define DOMAIN_ALIAS_RID_ACCOUNT_OPS 0x224L
477 #define DOMAIN_ALIAS_RID_SYSTEM_OPS 0x225L
478 #define DOMAIN_ALIAS_RID_PRINT_OPS 0x226L
479 #define DOMAIN_ALIAS_RID_BACKUP_OPS 0x227L
480 #define DOMAIN_ALIAS_RID_REPLICATOR 0x228L
481 #define SECURITY_MANDATORY_UNTRUSTED_RID 0
482 #define SECURITY_MANDATORY_LOW_RID 0x1000
483 #define SECURITY_MANDATORY_MEDIUM_RID 0x2000
484 #define SECURITY_MANDATORY_HIGH_RID 0x3000
485 #define SECURITY_MANDATORY_SYSTEM_RID 0x4000
486 #define SECURITY_MANDATORY_PROTECTED_PROCESS_RID 0x5000
487 #define SECURITY_MANDATORY_MAXIMUM_USER_RID SECURITY_MANDATORY_SYSTEM_RID
488 #define SE_CREATE_TOKEN_NAME TEXT("SeCreateTokenPrivilege")
489 #define SE_ASSIGNPRIMARYTOKEN_NAME TEXT("SeAssignPrimaryTokenPrivilege")
490 #define SE_LOCK_MEMORY_NAME TEXT("SeLockMemoryPrivilege")
491 #define SE_INCREASE_QUOTA_NAME TEXT("SeIncreaseQuotaPrivilege")
492 #define SE_UNSOLICITED_INPUT_NAME TEXT("SeUnsolicitedInputPrivilege")
493 #define SE_MACHINE_ACCOUNT_NAME TEXT("SeMachineAccountPrivilege")
494 #define SE_TCB_NAME TEXT("SeTcbPrivilege")
495 #define SE_SECURITY_NAME TEXT("SeSecurityPrivilege")
496 #define SE_TAKE_OWNERSHIP_NAME TEXT("SeTakeOwnershipPrivilege")
497 #define SE_LOAD_DRIVER_NAME TEXT("SeLoadDriverPrivilege")
498 #define SE_SYSTEM_PROFILE_NAME TEXT("SeSystemProfilePrivilege")
499 #define SE_SYSTEMTIME_NAME TEXT("SeSystemtimePrivilege")
500 #define SE_PROF_SINGLE_PROCESS_NAME TEXT("SeProfileSingleProcessPrivilege")
501 #define SE_INC_BASE_PRIORITY_NAME TEXT("SeIncreaseBasePriorityPrivilege")
502 #define SE_CREATE_PAGEFILE_NAME TEXT("SeCreatePagefilePrivilege")
503 #define SE_CREATE_PERMANENT_NAME TEXT("SeCreatePermanentPrivilege")
504 #define SE_BACKUP_NAME TEXT("SeBackupPrivilege")
505 #define SE_RESTORE_NAME TEXT("SeRestorePrivilege")
506 #define SE_SHUTDOWN_NAME TEXT("SeShutdownPrivilege")
507 #define SE_DEBUG_NAME TEXT("SeDebugPrivilege")
508 #define SE_AUDIT_NAME TEXT("SeAuditPrivilege")
509 #define SE_SYSTEM_ENVIRONMENT_NAME TEXT("SeSystemEnvironmentPrivilege")
510 #define SE_CHANGE_NOTIFY_NAME TEXT("SeChangeNotifyPrivilege")
511 #define SE_REMOTE_SHUTDOWN_NAME TEXT("SeRemoteShutdownPrivilege")
512 #define SE_CREATE_GLOBAL_NAME TEXT("SeCreateGlobalPrivilege")
513 #define SE_UNDOCK_NAME TEXT("SeUndockPrivilege")
514 #define SE_MANAGE_VOLUME_NAME TEXT("SeManageVolumePrivilege")
515 #define SE_IMPERSONATE_NAME TEXT("SeImpersonatePrivilege")
516 #define SE_ENABLE_DELEGATION_NAME TEXT("SeEnableDelegationPrivilege")
517 #define SE_SYNC_AGENT_NAME TEXT("SeSyncAgentPrivilege")
518 #define SE_TRUSTED_CREDMAN_ACCESS_NAME
TEXT("SeTrustedCredManAccessPrivilege")
519 #define SE_RELABEL_NAME TEXT("SeRelabelPrivilege")
520 #define SE_INCREASE_WORKING_SET_NAME TEXT("SeIncreaseWorkingSetPrivilege")
521 #define SE_TIME_ZONE_NAME TEXT("SeTimeZonePrivilege")
522 #define SE_CREATE_SYMBOLIC_LINK_NAME TEXT("SeCreateSymbolicLinkPrivilege")
523 #define SE_GROUP_MANDATORY 1
524 #define SE_GROUP_ENABLED_BY_DEFAULT 2
525 #define SE_GROUP_ENABLED 4
526 #define SE_GROUP_OWNER 8
527 #define SE_GROUP_USE_FOR_DENY_ONLY 16
528 #define SE_GROUP_INTEGRITY 32
529 #define SE_GROUP_INTEGRITY_ENABLED 64
530 #define SE_GROUP_LOGON_ID 3221225472U
531 #define SE_GROUP_RESOURCE 536870912
532 #define LANG_NEUTRAL 0x00
533 #define LANG_ARABIC 0x01
534 #define LANG_BULGARIAN 0x02
535 #define LANG_CATALAN 0x03
536 #define LANG_CHINESE 0x04
537 #define LANG_CZECH 0x05
538 #define LANG_DANISH 0x06
539 #define LANG_GERMAN 0x07
540 #define LANG_GREEK 0x08
541 #define LANG_ENGLISH 0x09
542 #define LANG_SPANISH 0x0a
543 #define LANG_FINNISH 0x0b
544 #define LANG_FRENCH 0x0c
545 #define LANG_HEBREW 0x0d
546 #define LANG_HUNGARIAN 0x0e
547 #define LANG_ICELANDIC 0x0f
548 #define LANG_ITALIAN 0x10
549 #define LANG_JAPANESE 0x11
550 #define LANG_KOREAN 0x12
551 #define LANG_DUTCH 0x13
552 #define LANG_NORWEGIAN 0x14
553 #define LANG_POLISH 0x15
554 #define LANG_PORTUGUESE 0x16
555 #define LANG_ROMANIAN 0x18
556 #define LANG_RUSSIAN 0x19
557 #define LANG_CROATIAN 0x1a
558 #define LANG_SERBIAN 0x1a
559 #define LANG_SERBIAN_NEUTRAL 0x7c1a
560 #define LANG_BOSNIAN 0x1a
561 #define LANG_BOSNIAN_NEUTRAL 0x781a
562 #define LANG_SLOVAK 0x1b
563 #define LANG_ALBANIAN 0x1c
564 #define LANG_SWEDISH 0x1d
565 #define LANG_THAI 0x1e
566 #define LANG_TURKISH 0x1f
567 #define LANG_URDU 0x20
568 #define LANG_INDONESIAN 0x21
569 #define LANG_UKRAINIAN 0x22
570 #define LANG_BELARUSIAN 0x23
571 #define LANG_SLOVENIAN 0x24
572 #define LANG_ESTONIAN 0x25
573 #define LANG_LATVIAN 0x26
574 #define LANG_LITHUANIAN 0x27
575 #define LANG_PERSIAN 0x29
576 #define LANG_FARSI LANG_PERSIAN
577 #define LANG_VIETNAMESE 0x2a
578 #define LANG_ARMENIAN 0x2b
579 #define LANG_AZERI 0x2c
580 #define LANG_BASQUE 0x2d
581 #define LANG_LOWER_SORBIAN 0x2e
582 #define LANG_UPPER_SORBIAN 0x2e
583 #define LANG_MACEDONIAN 0x2f
584 #define LANG_TSWANA 0x32
585 #define LANG_XHOSA 0x34
586 #define LANG_ZULU 0x35
587 #define LANG_AFRIKAANS 0x36
588 #define LANG_GEORGIAN 0x37
589 #define LANG_FAEROESE 0x38
590 #define LANG_HINDI 0x39
591 #define LANG_MALTESE 0x3a
592 #define LANG_SAMI 0x3b
593 #define LANG_IRISH 0x3c
594 #define LANG_MALAY 0x3e
595 #define LANG_KAZAK 0x3f
596 #define LANG_KYRGYZ 0x40
597 #define LANG_SWAHILI 0x41
598 #define LANG_UZBEK 0x43
599 #define LANG_TATAR 0x44
600 #define LANG_BENGALI 0x45
601 #define LANG_PUNJABI 0x46
602 #define LANG_GUJARATI 0x47
603 #define LANG_ORIYA 0x48
604 #define LANG_TAMIL 0x49
605 #define LANG_TELUGU 0x4a
606 #define LANG_KANNADA 0x4b
607 #define LANG_MALAYALAM 0x4c
608 #define LANG_ASSAMESE 0x4d
609 #define LANG_MARATHI 0x4e
610 #define LANG_SANSKRIT 0x4f
611 #define LANG_MONGOLIAN 0x50
612 #define LANG_TIBETAN 0x51
613 #define LANG_WELSH 0x52
614 #define LANG_KHMER 0x53
615 #define LANG_LAO 0x54
616 #define LANG_GALICIAN 0x56
617 #define LANG_KONKANI 0x57
618 #define LANG_MANIPURI 0x58
619 #define LANG_SINDHI 0x59
620 #define LANG_SYRIAC 0x5a
621 #define LANG_SINHALESE 0x5b
622 #define LANG_INUKTITUT 0x5d
623 #define LANG_AMHARIC 0x5e
624 #define LANG_TAMAZIGHT 0x5f
625 #define LANG_KASHMIRI 0x60
626 #define LANG_NEPALI 0x61
627 #define LANG_FRISIAN 0x62
628 #define LANG_PASHTO 0x63
629 #define LANG_FILIPINO 0x64
630 #define LANG_DIVEHI 0x65
631 #define LANG_HAUSA 0x68
632 #define LANG_YORUBA 0x6a
633 #define LANG_QUECHUA 0x6b
634 #define LANG_SOTHO 0x6c
635 #define LANG_BASHKIR 0x6d
636 #define LANG_LUXEMBOURGISH 0x6e
637 #define LANG_GREENLANDIC 0x6f
638 #define LANG_IGBO 0x70
639 #define LANG_TIGRIGNA 0x73
640 #define LANG_YI 0x78
641 #define LANG_MAPUDUNGUN 0x7a
642 #define LANG_MOHAWK 0x7c
643 #define LANG_BRETON 0x7e
644 #define LANG_INVARIANT 0x7f
645 #define LANG_UIGHUR 0x80
646 #define LANG_MAORI 0x81
647 #define LANG_OCCITAN 0x82
648 #define LANG_CORSICAN 0x83
649 #define LANG_ALSATIAN 0x84
650 #define LANG_YAKUT 0x85
651 #define LANG_KICHE 0x86
652 #define LANG_KINYARWANDA 0x87
653 #define LANG_WOLOF 0x88
654 #define LANG_DARI 0x8c
655 #define LANG_MALAGASY 0x8d
656 #define SUBLANG_NEUTRAL 0x00
657 #define SUBLANG_DEFAULT 0x01
658 #define SUBLANG_SYS_DEFAULT 0x02
659 #define SUBLANG_CUSTOM_DEFAULT 0x03
660 #define SUBLANG_CUSTOM_UNSPECIFIED 0x04
661 #define SUBLANG_UI_CUSTOM_DEFAULT 0x03
662 #define SUBLANG_AFRIKAANS_SOUTH_AFRICA 0x01
663 #define SUBLANG_ALBANIAN_ALBANIA 0x01
664 #define SUBLANG_ALSATIAN_FRANCE 0x01
665 #define SUBLANG_AMHARIC_ETHIOPIA 0x01
666 #define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
667 #define SUBLANG_ARABIC_IRAQ 0x02
668 #define SUBLANG_ARABIC_EGYPT 0x03
669 #define SUBLANG_ARABIC_LIBYA 0x04
670 #define SUBLANG_ARABIC_ALGERIA 0x05
671 #define SUBLANG_ARABIC_MOROCCO 0x06
672 #define SUBLANG_ARABIC_TUNISIA 0x07
673 #define SUBLANG_ARABIC_OMAN 0x08
674 #define SUBLANG_ARABIC_YEMEN 0x09
675 #define SUBLANG_ARABIC_SYRIA 0x0a
676 #define SUBLANG_ARABIC_JORDAN 0x0b
677 #define SUBLANG_ARABIC_LEBANON 0x0c
678 #define SUBLANG_ARABIC_KUWAIT 0x0d
679 #define SUBLANG_ARABIC_UAE 0x0e
680 #define SUBLANG_ARABIC_BAHRAIN 0x0f
681 #define SUBLANG_ARABIC_QATAR 0x10
682 #define SUBLANG_ARMENIAN_ARMENIA 0x01
683 #define SUBLANG_ASSAMESE_INDIA 0x01
684 #define SUBLANG_AZERI_LATIN 0x01
685 #define SUBLANG_AZERI_CYRILLIC 0x02
686 #define SUBLANG_BASHKIR_RUSSIA 0x01
687 #define SUBLANG_BASQUE_BASQUE 0x01
688 #define SUBLANG_BELARUSIAN_BELARUS 0x01
689 #define SUBLANG_BENGALI_INDIA 0x00
690 #define SUBLANG_BENGALI_BANGLADESH 0x01
691 #define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN 0x05
692 #define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x08
693 #define SUBLANG_BRETON_FRANCE 0x01
694 #define SUBLANG_BULGARIAN_BULGARIA 0x01
695 #define SUBLANG_CATALAN_CATALAN 0x01
696 #define SUBLANG_CHINESE_TRADITIONAL 0x01
697 #define SUBLANG_CHINESE_SIMPLIFIED 0x02
698 #define SUBLANG_CHINESE_HONGKONG 0x03
699 #define SUBLANG_CHINESE_SINGAPORE 0x04
700 #define SUBLANG_CHINESE_MACAU 0x05
701 #define SUBLANG_CORSICAN_FRANCE 0x01
702 #define SUBLANG_CZECH_CZECH_REPUBLIC 0x01
703 #define SUBLANG_CROATIAN_CROATIA 0x01
704 #define SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN 0x04
705 #define SUBLANG_DANISH_DENMARK 0x01
706 #define SUBLANG_DIVEHI_MALDIVES 0x01
707 #define SUBLANG_DUTCH 0x01
708 #define SUBLANG_DUTCH_BELGIAN 0x02
709 #define SUBLANG_ENGLISH_US 0x01
710 #define SUBLANG_ENGLISH_UK 0x02
711 #define SUBLANG_ENGLISH_AUS 0x03
712 #define SUBLANG_ENGLISH_CAN 0x04
713 #define SUBLANG_ENGLISH_NZ 0x05
714 #if (WINVER >= 0x0600)
715 #define SUBLANG_ENGLISH_IRELAND 0x06
716 #endif
717 #define SUBLANG_ENGLISH_EIRE 0x06
718 #define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07
719 #define SUBLANG_ENGLISH_JAMAICA 0x08
720 #define SUBLANG_ENGLISH_CARIBBEAN 0x09
721 #define SUBLANG_ENGLISH_BELIZE 0x0a
722 #define SUBLANG_ENGLISH_TRINIDAD 0x0b
723 #define SUBLANG_ENGLISH_ZIMBABWE 0x0c
724 #define SUBLANG_ENGLISH_PHILIPPINES 0x0d
725 #define SUBLANG_ENGLISH_INDIA 0x10
726 #define SUBLANG_ENGLISH_MALAYSIA 0x11
727 #define SUBLANG_ENGLISH_SINGAPORE 0x12
728 #define SUBLANG_ESTONIAN_ESTONIA 0x01
729 #define SUBLANG_FAEROESE_FAROE_ISLANDS 0x01
730 #define SUBLANG_FILIPINO_PHILIPPINES 0x01
731 #define SUBLANG_FINNISH_FINLAND 0x01
732 #define SUBLANG_FRENCH 0x01
733 #define SUBLANG_FRENCH_BELGIAN 0x02
734 #define SUBLANG_FRENCH_CANADIAN 0x03
735 #define SUBLANG_FRENCH_SWISS 0x04
736 #define SUBLANG_FRENCH_LUXEMBOURG 0x05
737 #define SUBLANG_FRENCH_MONACO 0x06
738 #define SUBLANG_FRISIAN_NETHERLANDS 0x01
739 #define SUBLANG_GALICIAN_GALICIAN 0x01
740 #define SUBLANG_GEORGIAN_GEORGIA 0x01
741 #define SUBLANG_GERMAN 0x01
742 #define SUBLANG_GERMAN_SWISS 0x02
743 #define SUBLANG_GERMAN_AUSTRIAN 0x03
744 #define SUBLANG_GERMAN_LUXEMBOURG 0x04
745 #define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
746 #define SUBLANG_GREEK_GREECE 0x01
747 #define SUBLANG_GREENLANDIC_GREENLAND 0x01
748 #define SUBLANG_GUJARATI_INDIA 0x01
749 #define SUBLANG_HAUSA_NIGERIA 0x01
750 #define SUBLANG_HEBREW_ISRAEL 0x01
751 #define SUBLANG_HINDI_INDIA 0x01
752 #define SUBLANG_HUNGARIAN_HUNGARY 0x01
753 #define SUBLANG_ICELANDIC_ICELAND 0x01
754 #define SUBLANG_IGBO_NIGERIA 0x01
755 #define SUBLANG_INDONESIAN_INDONESIA 0x01
756 #define SUBLANG_INUKTITUT_CANADA 0x01
757 #define SUBLANG_INUKTITUT_CANADA_LATIN 0x01
758 #define SUBLANG_IRISH_IRELAND 0x01
759 #define SUBLANG_ITALIAN 0x01
760 #define SUBLANG_ITALIAN_SWISS 0x02
761 #define SUBLANG_JAPANESE_JAPAN 0x01
762 #define SUBLANG_KASHMIRI_INDIA 0x02
763 #define SUBLANG_KASHMIRI_SASIA 0x02
764 #define SUBLANG_KAZAK_KAZAKHSTAN 0x01
765 #define SUBLANG_KHMER_CAMBODIA 0x01
766 #define SUBLANG_KICHE_GUATEMALA 0x01
767 #define SUBLANG_KINYARWANDA_RWANDA 0x01
768 #define SUBLANG_KONKANI_INDIA 0x01
769 #define SUBLANG_KOREAN 0x01
770 #define SUBLANG_KYRGYZ_KYRGYZSTAN 0x01
771 #define SUBLANG_LAO_LAO_PDR 0x01
772 #define SUBLANG_LATVIAN_LATVIA 0x01
773 #if (WINVER >= 0x0600)
774 #define SUBLANG_LITHUANIAN_LITHUANIA 0x01
775 #endif
776 #define SUBLANG_LITHUANIAN 0x01
777 #define SUBLANG_LOWER_SORBIAN_GERMANY 0x01
778 #define SUBLANG_LUXEMBOURGISH_LUXEMBOURG 0x01
779 #define SUBLANG_MACEDONIAN_MACEDONIA 0x01
780 #define SUBLANG_MALAY_MALAYSIA 0x01
781 #define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
782 #define SUBLANG_MALAYALAM_INDIA 0x01
783 #define SUBLANG_MALTESE_MALTA 0x01
784 #define SUBLANG_MAORI_NEW_ZEALAND 0x01
785 #define SUBLANG_MAPUDUNGUN_CHILE 0x01
786 #define SUBLANG_MARATHI_INDIA 0x01
787 #define SUBLANG_MOHAWK_MOHAWK 0x01
788 #define SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA 0x01
789 #define SUBLANG_MONGOLIAN_PRC 0x02
790 #define SUBLANG_NEPALI_NEPAL 0x01
791 #define SUBLANG_NEPALI_INDIA 0x02
792 #define SUBLANG_NORWEGIAN_BOKMAL 0x01
793 #define SUBLANG_NORWEGIAN_NYNORSK 0x02
794 #define SUBLANG_OCCITAN_FRANCE 0x01
795 #define SUBLANG_ORIYA_INDIA 0x01
796 #define SUBLANG_PASHTO_AFGHANISTAN 0x01
797 #define SUBLANG_PERSIAN_IRAN 0x01
798 #define SUBLANG_POLISH_POLAND 0x01
799 #define SUBLANG_PORTUGUESE_BRAZILIAN 0x01
800 #if (WINVER >= 0x0600)
801 #define SUBLANG_PORTUGUESE_PORTUGAL 0x02
802 #endif
803 #define SUBLANG_PORTUGUESE 0x02
804 #define SUBLANG_PUNJABI_INDIA 0x00
805 #define SUBLANG_PUNJABI_PAKISTAN 0x01
806 #define SUBLANG_QUECHUA_BOLIVIA 0x01
807 #define SUBLANG_QUECHUA_ECUADOR 0x02
808 #define SUBLANG_QUECHUA_PERU 0x03
809 #define SUBLANG_ROMANIAN_ROMANIA 0x00
810 #define SUBLANG_ROMANIAN_MOLDOVA 0x01
811 #define SUBLANG_ROMANSH_SWITZERLAND 0x01
812 #define SUBLANG_RUSSIAN_RUSSIA 0x01
813 #define SUBLANG_SAMI_NORTHERN_NORWAY 0x01
814 #define SUBLANG_SAMI_NORTHERN_SWEDEN 0x02
815 #define SUBLANG_SAMI_NORTHERN_FINLAND 0x03
816 #define SUBLANG_SAMI_LULE_NORWAY 0x04
817 #define SUBLANG_SAMI_LULE_SWEDEN 0x05
818 #define SUBLANG_SAMI_SOUTHERN_NORWAY 0x06
819 #define SUBLANG_SAMI_SOUTHERN_SWEDEN 0x07
820 #define SUBLANG_SAMI_SKOLT_FINLAND 0x03
821 #define SUBLANG_SAMI_INARI_FINLAND 0x03
822 #define SUBLANG_SANSKRIT_INDIA 0x01
823 #define SUBLANG_SERBIAN_LATIN 0x02
824 #define SUBLANG_SERBIAN_CYRILLIC 0x03
825 #define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN 0x06
826 #define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x07
827 #define SUBLANG_SINDHI_AFGHANISTAN 0x02
828 #define SUBLANG_SINHALESE_SRI_LANKA 0x01
829 #define SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA 0x01
830 #define SUBLANG_SLOVAK_SLOVAKIA 0x01
831 #define SUBLANG_SLOVENIAN_SLOVENIA 0x01
832 #define SUBLANG_SPANISH 0x01
833 #define SUBLANG_SPANISH_MEXICAN 0x02
834 #define SUBLANG_SPANISH_MODERN 0x03
835 #define SUBLANG_SPANISH_GUATEMALA 0x04
836 #define SUBLANG_SPANISH_COSTA_RICA 0x05
837 #define SUBLANG_SPANISH_PANAMA 0x06
838 #define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07
839 #define SUBLANG_SPANISH_VENEZUELA 0x08
840 #define SUBLANG_SPANISH_COLOMBIA 0x09
841 #define SUBLANG_SPANISH_PERU 0x0a
842 #define SUBLANG_SPANISH_ARGENTINA 0x0b
843 #define SUBLANG_SPANISH_ECUADOR 0x0c
844 #define SUBLANG_SPANISH_CHILE 0x0d
845 #define SUBLANG_SPANISH_URUGUAY 0x0e
846 #define SUBLANG_SPANISH_PARAGUAY 0x0f
847 #define SUBLANG_SPANISH_BOLIVIA 0x10
848 #define SUBLANG_SPANISH_EL_SALVADOR 0x11
849 #define SUBLANG_SPANISH_HONDURAS 0x12
850 #define SUBLANG_SPANISH_NICARAGUA 0x13
851 #define SUBLANG_SPANISH_PUERTO_RICO 0x14
852 #define SUBLANG_SPANISH_US 0x15
853 #if (WINVER >= 0x0600)
854 #define SUBLANG_SWEDISH_SWEDEN 0x01
855 #endif
856 #define SUBLANG_SWEDISH 0x01
857 #define SUBLANG_SWEDISH_FINLAND 0x02
858 #define SUBLANG_SYRIAC 0x01
859 #define SUBLANG_TAJIK_TAJIKISTAN 0x01
860 #define SUBLANG_TAMAZIGHT_ALGERIA_LATIN 0x02
861 #define SUBLANG_TAMIL_INDIA 0x01
862 #define SUBLANG_TATAR_RUSSIA 0x01
863 #define SUBLANG_TELUGU_INDIA 0x01
864 #define SUBLANG_THAI_THAILAND 0x01
865 #define SUBLANG_TIBETAN_PRC 0x01
866 #define SUBLANG_TIBETAN_BHUTAN 0x02
867 #define SUBLANG_TIGRIGNA_ERITREA 0x01
868 #define SUBLANG_TSWANA_SOUTH_AFRICA 0x01
869 #define SUBLANG_TURKISH_TURKEY 0x01
870 #define SUBLANG_TURKMEN_TURKMENISTAN 0x01
871 #define SUBLANG_UIGHUR_PRC 0x01
872 #define SUBLANG_UKRAINIAN_UKRAINE 0x01
873 #define SUBLANG_UPPER_SORBIAN_GERMANY 0x01
874 #define SUBLANG_URDU_PAKISTAN 0x01
875 #define SUBLANG_URDU_INDIA 0x02
876 #define SUBLANG_UZBEK_LATIN 0x01
877 #define SUBLANG_UZBEK_CYRILLIC 0x02
878 #define SUBLANG_VIETNAMESE_VIETNAM 0x01
879 #define SUBLANG_WELSH_UNITED_KINGDOM 0x01
880 #define SUBLANG_WOLOF_SENEGAL 0x01
881 #define SUBLANG_YORUBA_NIGERIA 0x01
882 #define SUBLANG_XHOSA_SOUTH_AFRICA 0x01
883 #define SUBLANG_YAKUT_RUSSIA 0x01
884 #define SUBLANG_YI_PRC 0x01
885 #define SUBLANG_ZULU_SOUTH_AFRICA 0x01
886 #define NLS_VALID_LOCALE_MASK 1048575
887 #define SORT_DEFAULT 0
888 #define SORT_JAPANESE_XJIS 0
889 #define SORT_JAPANESE_UNICODE 1
890 #define SORT_CHINESE_BIG5 0
891 #define SORT_CHINESE_PRCP 0
892 #define SORT_CHINESE_UNICODE 1
893 #define SORT_CHINESE_PRC 2
894 #define SORT_CHINESE_BOPOMOFO 3
895 #define SORT_KOREAN_KSC 0
896 #define SORT_KOREAN_UNICODE 1
897 #define SORT_GERMAN_PHONE_BOOK 1
898 #define SORT_HUNGARIAN_DEFAULT 0
899 #define SORT_HUNGARIAN_TECHNICAL 1
900 #define SORT_GEORGIAN_TRADITIONAL 0
901 #define SORT_GEORGIAN_MODERN 1
902 #define MAKELANGID(p,s) ((((WORD)(s))<<10)|(WORD)(p))
903 #define MAKELCID(l,s)
((DWORD)((((DWORD)((WORD)(s)))<<16)|((DWORD)((WORD)(l)))))
904 #define PRIMARYLANGID(l) ((WORD)(l)&0x3ff)
905 #define SORTIDFROMLCID(l)
((WORD)((((DWORD)(l))&NLS_VALID_LOCALE_MASK)>>16))
906 #define SORTVERSIONFROMLCID(l) ((WORD)((((DWORD)(l))>>20)&0xf))
907 #define SUBLANGID(l) ((WORD)(l)>>10)
908 #define LANGIDFROMLCID(l) ((WORD)(l))
909 #define LANG_SYSTEM_DEFAULT MAKELANGID(LANG_NEUTRAL,SUBLANG_SYS_DEFAULT)
910 #define LANG_USER_DEFAULT MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT)
911 #define LOCALE_NEUTRAL
MAKELCID(MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL),SORT_DEFAULT)
912 #define ACL_REVISION 2
913 #define ACL_REVISION_DS 4
914 #define ACL_REVISION1 1
915 #define ACL_REVISION2 2
916 #define ACL_REVISION3 3
917 #define ACL_REVISION4 4
918 #define MIN_ACL_REVISION 2
919 #define MAX_ACL_REVISION 4
920 #define MINCHAR 0x80
921 #define MAXCHAR 0x7f
922 #define MINSHORT 0x8000
923 #define MAXSHORT 0x7fff
924 #define MINLONG 0x80000000
925 #define MAXLONG 0x7fffffff
926 #define MAXBYTE 0xff
927 #define MAXWORD 0xffff
928 #define MAXDWORD 0xffffffff
929 #define PROCESSOR_INTEL_386 386
930 #define PROCESSOR_INTEL_486 486
931 #define PROCESSOR_INTEL_PENTIUM 586
932 #define PROCESSOR_MIPS_R4000 4000
933 #define PROCESSOR_ALPHA_21064 21064
934 #define PROCESSOR_INTEL_IA64 2200
935 #define PROCESSOR_ARCHITECTURE_INTEL 0
936 #define PROCESSOR_ARCHITECTURE_MIPS 1
937 #define PROCESSOR_ARCHITECTURE_ALPHA 2
938 #define PROCESSOR_ARCHITECTURE_PPC 3
939 #define PROCESSOR_ARCHITECTURE_SHX 4
940 #define PROCESSOR_ARCHITECTURE_ARM 5
941 #define PROCESSOR_ARCHITECTURE_IA64 6
942 #define PROCESSOR_ARCHITECTURE_ALPHA64 7
943 #define PROCESSOR_ARCHITECTURE_MSIL 8
944 #define PROCESSOR_ARCHITECTURE_AMD64 9
945 #define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 10
946 #define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
947 #define PF_FLOATING_POINT_PRECISION_ERRATA 0
948 #define PF_FLOATING_POINT_EMULATED 1
949 #define PF_COMPARE_EXCHANGE_DOUBLE 2
950 #define PF_MMX_INSTRUCTIONS_AVAILABLE 3
951 #define PF_PPC_MOVEMEM_64BIT_OK 4
952 #define PF_ALPHA_BYTE_INSTRUCTIONS 5
953 #define PF_XMMI_INSTRUCTIONS_AVAILABLE 6
954 #define PF_3DNOW_INSTRUCTIONS_AVAILABLE 7
955 #define PF_RDTSC_INSTRUCTION_AVAILABLE 8
956 #define PF_PAE_ENABLED 9
957 #define PF_XMMI64_INSTRUCTIONS_AVAILABLE 10
958 /* also in ddk/ntifs.h */
959 #define FILE_ACTION_ADDED 0x00000001
960 #define FILE_ACTION_REMOVED 0x00000002
961 #define FILE_ACTION_MODIFIED 0x00000003
962 #define FILE_ACTION_RENAMED_OLD_NAME 0x00000004
963 #define FILE_ACTION_RENAMED_NEW_NAME 0x00000005
964 #define FILE_ACTION_ADDED_STREAM 0x00000006
965 #define FILE_ACTION_REMOVED_STREAM 0x00000007
966 #define FILE_ACTION_MODIFIED_STREAM 0x00000008
967 #define FILE_ACTION_REMOVED_BY_DELETE 0x00000009
968 #define FILE_ACTION_ID_NOT_TUNNELLED 0x0000000A
969 #define FILE_ACTION_TUNNELLED_ID_COLLISION 0x0000000B
970 /* end ntifs.h */
971 #define HEAP_NO_SERIALIZE 1
972 #define HEAP_GROWABLE 2
973 #define HEAP_GENERATE_EXCEPTIONS 4
974 #define HEAP_ZERO_MEMORY 8
975 #define HEAP_REALLOC_IN_PLACE_ONLY 16
976 #define HEAP_TAIL_CHECKING_ENABLED 32
977 #define HEAP_FREE_CHECKING_ENABLED 64
978 #define HEAP_DISABLE_COALESCE_ON_FREE 128
979 #define HEAP_CREATE_ALIGN_16 0x0000
980 #define HEAP_CREATE_ENABLE_TRACING 0x20000
981 #define HEAP_MAXIMUM_TAG 0xFFF
982 #define HEAP_PSEUDO_TAG_FLAG 0x8000
983 #define HEAP_TAG_SHIFT 16
984 #define HEAP_MAKE_TAG_FLAGS(b,o) ((DWORD)((b)+(o)<<16)))
985 #define KEY_QUERY_VALUE 1
986 #define KEY_SET_VALUE 2
987 #define KEY_CREATE_SUB_KEY 4
988 #define KEY_ENUMERATE_SUB_KEYS 8
989 #define KEY_NOTIFY 16
990 #define KEY_CREATE_LINK 32
991 #define KEY_WRITE 0x20006
992 #define KEY_EXECUTE 0x20019
993 #define KEY_READ 0x20019
994 #if (_WIN32_WINNT >= 0x0502)
995 #define KEY_WOW64_64KEY 0x0100
996 #define KEY_WOW64_32KEY 0x0200
997 #endif
998 #define KEY_ALL_ACCESS 0xf003f
999 #define REG_WHOLE_HIVE_VOLATILE 1
1000 #define REG_REFRESH_HIVE 2
1001 #define REG_NO_LAZY_FLUSH 4
1002 #define REG_OPTION_RESERVED 0
1003 #define REG_OPTION_NON_VOLATILE 0
1004 #define REG_OPTION_VOLATILE 1
1005 #define REG_OPTION_CREATE_LINK 2
1006 #define REG_OPTION_BACKUP_RESTORE 4
1007 #define REG_OPTION_OPEN_LINK 8
1008 #define REG_LEGAL_OPTION 15
1009 #define OWNER_SECURITY_INFORMATION 0x00000001
1010 #define GROUP_SECURITY_INFORMATION 0x00000002
1011 #define DACL_SECURITY_INFORMATION 0x00000004
1012 #define SACL_SECURITY_INFORMATION 0x00000008
1013 #define LABEL_SECURITY_INFORMATION 0x00000010
1014 #define UNPROTECTED_SACL_SECURITY_INFORMATION 0x10000000
1015 #define UNPROTECTED_DACL_SECURITY_INFORMATION 0x20000000
1016 #define PROTECTED_SACL_SECURITY_INFORMATION 0x40000000
1017 #define PROTECTED_DACL_SECURITY_INFORMATION 0x80000000
1018 #define MAXIMUM_PROCESSORS 32
1019 #define PAGE_NOACCESS 0x0001
1020 #define PAGE_READONLY 0x0002
1021 #define PAGE_READWRITE 0x0004
1022 #define PAGE_WRITECOPY 0x0008
1023 #define PAGE_EXECUTE 0x0010
1024 #define PAGE_EXECUTE_READ 0x0020
1025 #define PAGE_EXECUTE_READWRITE 0x0040
1026 #define PAGE_EXECUTE_WRITECOPY 0x0080
1027 #define PAGE_GUARD 0x0100
1028 #define PAGE_NOCACHE 0x0200
1029 #define MEM_COMMIT 0x1000
1030 #define MEM_RESERVE 0x2000
1031 #define MEM_DECOMMIT 0x4000
1032 #define MEM_RELEASE 0x8000
1033 #define MEM_FREE 0x10000
1034 #define MEM_PRIVATE 0x20000
1035 #define MEM_MAPPED 0x40000
1036 #define MEM_RESET 0x80000
1037 #define MEM_TOP_DOWN 0x100000
1038 #define MEM_WRITE_WATCH 0x200000 /* 98/Me */
1039 #define MEM_PHYSICAL 0x400000
1040 #define MEM_4MB_PAGES 0x80000000
1041 /* also in ddk/ntifs.h */
1042 #define MEM_IMAGE SEC_IMAGE
1043 #define SEC_BASED 0x00200000
1044 #define SEC_NO_CHANGE 0x00400000
1045 #define SEC_FILE 0x00800000
1046 #define SEC_IMAGE 0x01000000
1047 #define SEC_VLM 0x02000000
1048 #define SEC_RESERVE 0x04000000
1049 #define SEC_COMMIT 0x08000000
1050 #define SEC_NOCACHE 0x10000000
1051 /* end ntifs.h */
1052 #define SECTION_EXTEND_SIZE 16
1053 #define SECTION_MAP_READ 4
1054 #define SECTION_MAP_WRITE 2
1055 #define SECTION_QUERY 1
1056 #define SECTION_MAP_EXECUTE 8
1057 #define SECTION_ALL_ACCESS 0xf001f
1058 #define MESSAGE_RESOURCE_UNICODE 1
1059 #define RTL_CRITSECT_TYPE 0
1060 #define RTL_RESOURCE_TYPE 1
1061 /* Also in winddk.h */
1062 #define FIELD_OFFSET(t,f) ((LONG)&(((t*)0)->f))
1063 #ifndef CONTAINING_RECORD
1064 #define CONTAINING_RECORD(address, type, field) \
1065 ((type*)((PCHAR)(address) - (PCHAR)(&((type *)0)->field)))
1066 #endif
1067 /* end winddk.h */
1068 #define IMAGE_SIZEOF_FILE_HEADER 20
1069 #define IMAGE_FILE_RELOCS_STRIPPED 1
1070 #define IMAGE_FILE_EXECUTABLE_IMAGE 2
1071 #define IMAGE_FILE_LINE_NUMS_STRIPPED 4
1072 #define IMAGE_FILE_LOCAL_SYMS_STRIPPED 8
1073 #define IMAGE_FILE_AGGRESIVE_WS_TRIM 16
1074 #define IMAGE_FILE_LARGE_ADDRESS_AWARE 32
1075 #define IMAGE_FILE_BYTES_REVERSED_LO 128
1076 #define IMAGE_FILE_32BIT_MACHINE 256
1077 #define IMAGE_FILE_DEBUG_STRIPPED 512
1078 #define IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP 1024
1079 #define IMAGE_FILE_NET_RUN_FROM_SWAP 2048
1080 #define IMAGE_FILE_SYSTEM 4096
1081 #define IMAGE_FILE_DLL 8192
1082 #define IMAGE_FILE_UP_SYSTEM_ONLY 16384
1083 #define IMAGE_FILE_BYTES_REVERSED_HI 32768
1084
1085 #define IMAGE_FILE_MACHINE_UNKNOWN 0x0000
1086 #define IMAGE_FILE_MACHINE_AM33 0x01d3 /* Matsushita AM33 */
1087 #define IMAGE_FILE_MACHINE_AMD64 0x8664 /* x64 */
1088 #define IMAGE_FILE_MACHINE_ARM 0x01c0 /* ARM little endian */
1089 #define IMAGE_FILE_MACHINE_EBC 0x0ebc /* EFI byte code */
1090 #define IMAGE_FILE_MACHINE_I386 0x014c /* Intel 386 or later processors

1091 and compatible processors */


1092 #define IMAGE_FILE_MACHINE_IA64 0x0200 /* Intel Itanium processor
family */
1093 #define IMAGE_FILE_MACHINE_M32R 0x9041 /* Mitsubishi M32R little endian
*/
1094 #define IMAGE_FILE_MACHINE_MIPS16 0x0266 /* MIPS16 */
1095 #define IMAGE_FILE_MACHINE_MIPSFPU 0x0366 /* MIPS with FPU */
1096 #define IMAGE_FILE_MACHINE_MIPSFPU16 0x0466 /* MIPS16 with FPU */
1097 #define IMAGE_FILE_MACHINE_POWERPC 0x01f0 /* Power PC little endian */
1098 #define IMAGE_FILE_MACHINE_POWERPCFP 0x01f1 /* Power PC with floating
point support */
1099 #define IMAGE_FILE_MACHINE_R4000 0x0166 /* MIPS little endian */
1100 #define IMAGE_FILE_MACHINE_SH3 0x01a2 /* Hitachi SH3 */
1101 #define IMAGE_FILE_MACHINE_SH3DSP 0x01a3 /* Hitachi SH3 DSP */
1102 #define IMAGE_FILE_MACHINE_SH4 0x01a6 /* Hitachi SH4 */
1103 #define IMAGE_FILE_MACHINE_SH5 0x01a8 /* Hitachi SH5 */
1104 #define IMAGE_FILE_MACHINE_THUMB 0x01c2 /* Thumb */
1105 #define IMAGE_FILE_MACHINE_WCEMIPSV2 0x0169 /* MIPS little-endian WCE v2
*/
1106
1107 #define IMAGE_DOS_SIGNATURE 0x5A4D
1108 #define IMAGE_OS2_SIGNATURE 0x454E
1109 #define IMAGE_OS2_SIGNATURE_LE 0x454C
1110 #define IMAGE_VXD_SIGNATURE 0x454C
1111 #define IMAGE_NT_SIGNATURE 0x00004550
1112 #define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b
1113 #define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
1114 #ifdef _WIN64
1115 #define IMAGE_NT_OPTIONAL_HDR_MAGIC IMAGE_NT_OPTIONAL_HDR64_MAGIC
1116 #else
1117 #define IMAGE_NT_OPTIONAL_HDR_MAGIC IMAGE_NT_OPTIONAL_HDR32_MAGIC
1118 #endif
1119 #define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
1120 #define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944
1121 #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
1122 #define IMAGE_SIZEOF_ROM_OPTIONAL_HEADER 56
1123 #define IMAGE_SIZEOF_STD_OPTIONAL_HEADER 28
1124 #define IMAGE_SIZEOF_NT_OPTIONAL_HEADER 224
1125 #define IMAGE_SIZEOF_SHORT_NAME 8
1126 #define IMAGE_SIZEOF_SECTION_HEADER 40
1127 #define IMAGE_SIZEOF_SYMBOL 18
1128 #define IMAGE_SIZEOF_AUX_SYMBOL 18
1129 #define IMAGE_SIZEOF_RELOCATION 10
1130 #define IMAGE_SIZEOF_BASE_RELOCATION 8
1131 #define IMAGE_SIZEOF_LINENUMBER 6
1132 #define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
1133 #define SIZEOF_RFPO_DATA 16
1134
1135 #define IMAGE_SUBSYSTEM_UNKNOWN 0
1136 #define IMAGE_SUBSYSTEM_NATIVE 1
1137 #define IMAGE_SUBSYSTEM_WINDOWS_GUI 2
1138 #define IMAGE_SUBSYSTEM_WINDOWS_CUI 3
1139 #define IMAGE_SUBSYSTEM_OS2_CUI 5 /* Not in PECOFF v8 spec */
1140 #define IMAGE_SUBSYSTEM_POSIX_CUI 7
1141 #define IMAGE_SUBSYSTEM_NATIVE_WINDOWS 8 /* Not in PECOFF v8 spec */
1142 #define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9
1143 #define IMAGE_SUBSYSTEM_EFI_APPLICATION 10
1144 #define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
1145 #define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
1146 #define IMAGE_SUBSYSTEM_EFI_ROM 13
1147 #define IMAGE_SUBSYSTEM_XBOX 14
1148
1149 #define IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE 0x0040
1150 #define IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY 0x0080
1151 #define IMAGE_DLL_CHARACTERISTICS_NX_COMPAT 0x0100
1152 #define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION 0x0200
1153 #define IMAGE_DLLCHARACTERISTICS_NO_SEH 0x0400
1154 #define IMAGE_DLLCHARACTERISTICS_NO_BIND 0x0800
1155 #define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000
1156 #define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000
1157
1158 #define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER)
((DWORD)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEADERS)(h))-
>FileHeader.SizeOfOptionalHeader))
1159 #define IMAGE_DIRECTORY_ENTRY_EXPORT 0
1160 #define IMAGE_DIRECTORY_ENTRY_IMPORT 1
1161 #define IMAGE_DIRECTORY_ENTRY_RESOURCE 2
1162 #define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3
1163 #define IMAGE_DIRECTORY_ENTRY_SECURITY 4
1164 #define IMAGE_DIRECTORY_ENTRY_BASERELOC 5
1165 #define IMAGE_DIRECTORY_ENTRY_DEBUG 6
1166 #define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7
1167 #define IMAGE_DIRECTORY_ENTRY_ARCHITECTURE 7
1168 #define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8
1169 #define IMAGE_DIRECTORY_ENTRY_TLS 9
1170 #define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10
1171 #define IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT 11
1172 #define IMAGE_DIRECTORY_ENTRY_IAT 12
1173 #define IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT 13
1174 #define IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR 14
1175 #define IMAGE_SCN_TYPE_REG 0
1176 #define IMAGE_SCN_TYPE_DSECT 1
1177 #define IMAGE_SCN_TYPE_NOLOAD 2
1178 #define IMAGE_SCN_TYPE_GROUP 4
1179 #define IMAGE_SCN_TYPE_NO_PAD 8
1180 #define IMAGE_SCN_TYPE_COPY 16
1181 #define IMAGE_SCN_CNT_CODE 32
1182 #define IMAGE_SCN_CNT_INITIALIZED_DATA 64
1183 #define IMAGE_SCN_CNT_UNINITIALIZED_DATA 128
1184 #define IMAGE_SCN_LNK_OTHER 256
1185 #define IMAGE_SCN_LNK_INFO 512
1186 #define IMAGE_SCN_TYPE_OVER 1024
1187 #define IMAGE_SCN_LNK_REMOVE 2048
1188 #define IMAGE_SCN_LNK_COMDAT 4096
1189 #define IMAGE_SCN_GPREL 0x8000 /* Valid only for IA64 */
1190 #define IMAGE_SCN_MEM_FARDATA 0x8000 /* Not in PECOFF v8 spec */
1191 #define IMAGE_SCN_MEM_PURGEABLE 0x20000
1192 #define IMAGE_SCN_MEM_16BIT 0x20000
1193 #define IMAGE_SCN_MEM_LOCKED 0x40000
1194 #define IMAGE_SCN_MEM_PRELOAD 0x80000
1195 #define IMAGE_SCN_ALIGN_1BYTES 0x100000
1196 #define IMAGE_SCN_ALIGN_2BYTES 0x200000
1197 #define IMAGE_SCN_ALIGN_4BYTES 0x300000
1198 #define IMAGE_SCN_ALIGN_8BYTES 0x400000
1199 #define IMAGE_SCN_ALIGN_16BYTES 0x500000
1200 #define IMAGE_SCN_ALIGN_32BYTES 0x600000
1201 #define IMAGE_SCN_ALIGN_64BYTES 0x700000
1202 #define IMAGE_SCN_ALIGN_128BYTES 0x800000
1203 #define IMAGE_SCN_ALIGN_256BYTES 0x900000
1204 #define IMAGE_SCN_ALIGN_512BYTES 0xa00000
1205 #define IMAGE_SCN_ALIGN_1024BYTES 0xb00000
1206 #define IMAGE_SCN_ALIGN_2048BYTES 0xc00000
1207 #define IMAGE_SCN_ALIGN_4096BYTES 0xd00000
1208 #define IMAGE_SCN_ALIGN_8192BYTES 0xe00000
1209 #define IMAGE_SCN_LNK_NRELOC_OVFL 0x1000000
1210 #define IMAGE_SCN_MEM_DISCARDABLE 0x2000000
1211 #define IMAGE_SCN_MEM_NOT_CACHED 0x4000000
1212 #define IMAGE_SCN_MEM_NOT_PAGED 0x8000000
1213 #define IMAGE_SCN_MEM_SHARED 0x10000000
1214 #define IMAGE_SCN_MEM_EXECUTE 0x20000000
1215 #define IMAGE_SCN_MEM_READ 0x40000000
1216 #define IMAGE_SCN_MEM_WRITE 0x80000000
1217 #define IMAGE_SYM_UNDEFINED 0
1218 #define IMAGE_SYM_ABSOLUTE (-1)
1219 #define IMAGE_SYM_DEBUG (-2)
1220 #define IMAGE_SYM_TYPE_NULL 0
1221 #define IMAGE_SYM_TYPE_VOID 1
1222 #define IMAGE_SYM_TYPE_CHAR 2
1223 #define IMAGE_SYM_TYPE_SHORT 3
1224 #define IMAGE_SYM_TYPE_INT 4
1225 #define IMAGE_SYM_TYPE_LONG 5
1226 #define IMAGE_SYM_TYPE_FLOAT 6
1227 #define IMAGE_SYM_TYPE_DOUBLE 7
1228 #define IMAGE_SYM_TYPE_STRUCT 8
1229 #define IMAGE_SYM_TYPE_UNION 9
1230 #define IMAGE_SYM_TYPE_ENUM 10
1231 #define IMAGE_SYM_TYPE_MOE 11
1232 #define IMAGE_SYM_TYPE_BYTE 12
1233 #define IMAGE_SYM_TYPE_WORD 13
1234 #define IMAGE_SYM_TYPE_UINT 14
1235 #define IMAGE_SYM_TYPE_DWORD 15
1236 #define IMAGE_SYM_TYPE_PCODE 32768
1237 #define IMAGE_SYM_DTYPE_NULL 0
1238 #define IMAGE_SYM_DTYPE_POINTER 1
1239 #define IMAGE_SYM_DTYPE_FUNCTION 2
1240 #define IMAGE_SYM_DTYPE_ARRAY 3
1241 #define IMAGE_SYM_CLASS_END_OF_FUNCTION (-1)
1242 #define IMAGE_SYM_CLASS_NULL 0
1243 #define IMAGE_SYM_CLASS_AUTOMATIC 1
1244 #define IMAGE_SYM_CLASS_EXTERNAL 2
1245 #define IMAGE_SYM_CLASS_STATIC 3
1246 #define IMAGE_SYM_CLASS_REGISTER 4
1247 #define IMAGE_SYM_CLASS_EXTERNAL_DEF 5
1248 #define IMAGE_SYM_CLASS_LABEL 6
1249 #define IMAGE_SYM_CLASS_UNDEFINED_LABEL 7
1250 #define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 8
1251 #define IMAGE_SYM_CLASS_ARGUMENT 9
1252 #define IMAGE_SYM_CLASS_STRUCT_TAG 10
1253 #define IMAGE_SYM_CLASS_MEMBER_OF_UNION 11
1254 #define IMAGE_SYM_CLASS_UNION_TAG 12
1255 #define IMAGE_SYM_CLASS_TYPE_DEFINITION 13
1256 #define IMAGE_SYM_CLASS_UNDEFINED_STATIC 14
1257 #define IMAGE_SYM_CLASS_ENUM_TAG 15
1258 #define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 16
1259 #define IMAGE_SYM_CLASS_REGISTER_PARAM 17
1260 #define IMAGE_SYM_CLASS_BIT_FIELD 18
1261 #define IMAGE_SYM_CLASS_FAR_EXTERNAL 68 /* Not in PECOFF v8 spec */
1262 #define IMAGE_SYM_CLASS_BLOCK 100
1263 #define IMAGE_SYM_CLASS_FUNCTION 101
1264 #define IMAGE_SYM_CLASS_END_OF_STRUCT 102
1265 #define IMAGE_SYM_CLASS_FILE 103
1266 #define IMAGE_SYM_CLASS_SECTION 104
1267 #define IMAGE_SYM_CLASS_WEAK_EXTERNAL 105
1268 #define IMAGE_SYM_CLASS_CLR_TOKEN 107
1269
1270 #define IMAGE_COMDAT_SELECT_NODUPLICATES 1
1271 #define IMAGE_COMDAT_SELECT_ANY 2
1272 #define IMAGE_COMDAT_SELECT_SAME_SIZE 3
1273 #define IMAGE_COMDAT_SELECT_EXACT_MATCH 4
1274 #define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
1275 #define IMAGE_COMDAT_SELECT_LARGEST 6
1276 #define IMAGE_COMDAT_SELECT_NEWEST 7 /* Not in PECOFF v8 spec */
1277
1278 #define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
1279 #define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
1280 #define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
1281
1282 #define IMAGE_REL_I386_ABSOLUTE 0x0000
1283 #define IMAGE_REL_I386_DIR16 0x0001
1284 #define IMAGE_REL_I386_REL16 0x0002
1285 #define IMAGE_REL_I386_DIR32 0x0006
1286 #define IMAGE_REL_I386_DIR32NB 0x0007
1287 #define IMAGE_REL_I386_SEG12 0x0009
1288 #define IMAGE_REL_I386_SECTION 0x000A
1289 #define IMAGE_REL_I386_SECREL 0x000B
1290 #define IMAGE_REL_I386_TOKEN 0x000C
1291 #define IMAGE_REL_I386_SECREL7 0x000D
1292 #define IMAGE_REL_I386_REL32 0x0014
1293
1294 #define IMAGE_REL_AMD64_ABSOLUTE 0x0000
1295 #define IMAGE_REL_AMD64_ADDR64 0x0001
1296 #define IMAGE_REL_AMD64_ADDR32 0x0002
1297 #define IMAGE_REL_AMD64_ADDR32NB 0x0003
1298 #define IMAGE_REL_AMD64_REL32 0x0004
1299 #define IMAGE_REL_AMD64_REL32_1 0x0005
1300 #define IMAGE_REL_AMD64_REL32_2 0x0006
1301 #define IMAGE_REL_AMD64_REL32_3 0x0007
1302 #define IMAGE_REL_AMD64_REL32_4 0x0008
1303 #define IMAGE_REL_AMD64_REL32_5 0x0009
1304 #define IMAGE_REL_AMD64_SECTION 0x000A
1305 #define IMAGE_REL_AMD64_SECREL 0x000B
1306 #define IMAGE_REL_AMD64_SECREL7 0x000C
1307 #define IMAGE_REL_AMD64_TOKEN 0x000D
1308 #define IMAGE_REL_AMD64_SREL32 0x000E
1309 #define IMAGE_REL_AMD64_PAIR 0x000F
1310 #define IMAGE_REL_AMD64_SSPAN32 0x0010
1311
1312 #define IMAGE_REL_IA64_ABSOLUTE 0x0000
1313 #define IMAGE_REL_IA64_IMM14 0x0001
1314 #define IMAGE_REL_IA64_IMM22 0x0002
1315 #define IMAGE_REL_IA64_IMM64 0x0003
1316 #define IMAGE_REL_IA64_DIR32 0x0004
1317 #define IMAGE_REL_IA64_DIR64 0x0005
1318 #define IMAGE_REL_IA64_PCREL21B 0x0006
1319 #define IMAGE_REL_IA64_PCREL21M 0x0007
1320 #define IMAGE_REL_IA64_PCREL21F 0x0008
1321 #define IMAGE_REL_IA64_GPREL22 0x0009
1322 #define IMAGE_REL_IA64_LTOFF22 0x000A
1323 #define IMAGE_REL_IA64_SECTION 0x000B
1324 #define IMAGE_REL_IA64_SECREL22 0x000C
1325 #define IMAGE_REL_IA64_SECREL64I 0x000D
1326 #define IMAGE_REL_IA64_SECREL32 0x000E
1327 #define IMAGE_REL_IA64_DIR32NB 0x0010
1328 #define IMAGE_REL_IA64_SREL14 0x0011
1329 #define IMAGE_REL_IA64_SREL22 0x0012
1330 #define IMAGE_REL_IA64_SREL32 0x0013
1331 #define IMAGE_REL_IA64_UREL32 0x0014
1332 #define IMAGE_REL_IA64_PCREL60X 0x0015
1333 #define IMAGE_REL_IA64_PCREL60B 0x0016
1334 #define IMAGE_REL_IA64_PCREL60F 0x0017
1335 #define IMAGE_REL_IA64_PCREL60I 0x0018
1336 #define IMAGE_REL_IA64_PCREL60M 0x0019
1337 #define IMAGE_REL_IA64_IMMGPREL64 0x001a
1338 #define IMAGE_REL_IA64_TOKEN 0x001b
1339 #define IMAGE_REL_IA64_GPREL32 0x001c
1340 #define IMAGE_REL_IA64_ADDEND 0x001F
1341
1342 #define IMAGE_REL_SH3_ABSOLUTE 0x0000
1343 #define IMAGE_REL_SH3_DIRECT16 0x0001
1344 #define IMAGE_REL_SH3_DIRECT32 0x0002
1345 #define IMAGE_REL_SH3_DIRECT8 0x0003
1346 #define IMAGE_REL_SH3_DIRECT8_WORD 0x0004
1347 #define IMAGE_REL_SH3_DIRECT8_LONG 0x0005
1348 #define IMAGE_REL_SH3_DIRECT4 0x0006
1349 #define IMAGE_REL_SH3_DIRECT4_WORD 0x0007
1350 #define IMAGE_REL_SH3_DIRECT4_LONG 0x0008
1351 #define IMAGE_REL_SH3_PCREL8_WORD 0x0009
1352 #define IMAGE_REL_SH3_PCREL8_LONG 0x000A
1353 #define IMAGE_REL_SH3_PCREL12_WORD 0x000B
1354 #define IMAGE_REL_SH3_STARTOF_SECTION 0x000C
1355 #define IMAGE_REL_SH3_SIZEOF_SECTION 0x000D
1356 #define IMAGE_REL_SH3_SECTION 0x000E
1357 #define IMAGE_REL_SH3_SECREL 0x000F
1358 #define IMAGE_REL_SH3_DIRECT32_NB 0x0010
1359 #define IMAGE_REL_SH3_GPREL4_LONG 0x0011
1360 #define IMAGE_REL_SH3_TOKEN 0x0012
1361 #define IMAGE_REL_SHM_PCRELPT 0x0013
1362 #define IMAGE_REL_SHM_REFLO 0x0014
1363 #define IMAGE_REL_SHM_REFHALF 0x0015
1364 #define IMAGE_REL_SHM_RELLO 0x0016
1365 #define IMAGE_REL_SHM_RELHALF 0x0017
1366 #define IMAGE_REL_SHM_PAIR 0x0018
1367 #define IMAGE_REL_SHM_NOMODE 0x8000
1368
1369 #define IMAGE_REL_M32R_ABSOLUTE 0x0000
1370 #define IMAGE_REL_M32R_ADDR32 0x0001
1371 #define IMAGE_REL_M32R_ADDR32NB 0x0002
1372 #define IMAGE_REL_M32R_ADDR24 0x0003
1373 #define IMAGE_REL_M32R_GPREL16 0x0004
1374 #define IMAGE_REL_M32R_PCREL24 0x0005
1375 #define IMAGE_REL_M32R_PCREL16 0x0006
1376 #define IMAGE_REL_M32R_PCREL8 0x0007
1377 #define IMAGE_REL_M32R_REFHALF 0x0008
1378 #define IMAGE_REL_M32R_REFHI 0x0009
1379 #define IMAGE_REL_M32R_REFLO 0x000A
1380 #define IMAGE_REL_M32R_PAIR 0x000B
1381 #define IMAGE_REL_M32R_SECTION 0x000C
1382 #define IMAGE_REL_M32R_SECREL 0x000D
1383 #define IMAGE_REL_M32R_TOKEN 0x000E
1384
1385 #define IMAGE_REL_MIPS_ABSOLUTE 0x0000
1386 #define IMAGE_REL_MIPS_REFHALF 0x0001
1387 #define IMAGE_REL_MIPS_REFWORD 0x0002
1388 #define IMAGE_REL_MIPS_JMPADDR 0x0003
1389 #define IMAGE_REL_MIPS_REFHI 0x0004
1390 #define IMAGE_REL_MIPS_REFLO 0x0005
1391 #define IMAGE_REL_MIPS_GPREL 0x0006
1392 #define IMAGE_REL_MIPS_LITERAL 0x0007
1393 #define IMAGE_REL_MIPS_SECTION 0x000A
1394 #define IMAGE_REL_MIPS_SECREL 0x000B
1395 #define IMAGE_REL_MIPS_SECRELLO 0x000C
1396 #define IMAGE_REL_MIPS_SECRELHI 0x000D
1397 #define IMAGE_REL_MIPS_JMPADDR16 0x0010
1398 #define IMAGE_REL_MIPS_REFWORDNB 0x0022
1399 #define IMAGE_REL_MIPS_PAIR 0x0025
1400
1401 #define IMAGE_REL_ALPHA_ABSOLUTE 0
1402 #define IMAGE_REL_ALPHA_REFLONG 1
1403 #define IMAGE_REL_ALPHA_REFQUAD 2
1404 #define IMAGE_REL_ALPHA_GPREL32 3
1405 #define IMAGE_REL_ALPHA_LITERAL 4
1406 #define IMAGE_REL_ALPHA_LITUSE 5
1407 #define IMAGE_REL_ALPHA_GPDISP 6
1408 #define IMAGE_REL_ALPHA_BRADDR 7
1409 #define IMAGE_REL_ALPHA_HINT 8
1410 #define IMAGE_REL_ALPHA_INLINE_REFLONG 9
1411 #define IMAGE_REL_ALPHA_REFHI 10
1412 #define IMAGE_REL_ALPHA_REFLO 11
1413 #define IMAGE_REL_ALPHA_PAIR 12
1414 #define IMAGE_REL_ALPHA_MATCH 13
1415 #define IMAGE_REL_ALPHA_SECTION 14
1416 #define IMAGE_REL_ALPHA_SECREL 15
1417 #define IMAGE_REL_ALPHA_REFLONGNB 16
1418 #define IMAGE_REL_ALPHA_SECRELLO 17
1419 #define IMAGE_REL_ALPHA_SECRELHI 18
1420 #define IMAGE_REL_PPC_ABSOLUTE 0
1421 #define IMAGE_REL_PPC_ADDR64 1
1422 #define IMAGE_REL_PPC_ADDR32 2
1423 #define IMAGE_REL_PPC_ADDR24 3
1424 #define IMAGE_REL_PPC_ADDR16 4
1425 #define IMAGE_REL_PPC_ADDR14 5
1426 #define IMAGE_REL_PPC_REL24 6
1427 #define IMAGE_REL_PPC_REL14 7
1428 #define IMAGE_REL_PPC_TOCREL16 8
1429 #define IMAGE_REL_PPC_TOCREL14 9
1430 #define IMAGE_REL_PPC_ADDR32NB 10
1431 #define IMAGE_REL_PPC_SECREL 11
1432 #define IMAGE_REL_PPC_SECTION 12
1433 #define IMAGE_REL_PPC_IFGLUE 13
1434 #define IMAGE_REL_PPC_IMGLUE 14
1435 #define IMAGE_REL_PPC_SECREL16 15
1436 #define IMAGE_REL_PPC_REFHI 16
1437 #define IMAGE_REL_PPC_REFLO 17
1438 #define IMAGE_REL_PPC_PAIR 18
1439 #define IMAGE_REL_PPC_TYPEMASK 255
1440 #define IMAGE_REL_PPC_NEG 256
1441 #define IMAGE_REL_PPC_BRTAKEN 512
1442 #define IMAGE_REL_PPC_BRNTAKEN 1024
1443 #define IMAGE_REL_PPC_TOCDEFN 2048
1444 #define IMAGE_REL_BASED_ABSOLUTE 0
1445 #define IMAGE_REL_BASED_HIGH 1
1446 #define IMAGE_REL_BASED_LOW 2
1447 #define IMAGE_REL_BASED_HIGHLOW 3
1448 #define IMAGE_REL_BASED_HIGHADJ 4
1449 #define IMAGE_REL_BASED_MIPS_JMPADDR 5
1450 #define IMAGE_ARCHIVE_START_SIZE 8
1451 #define IMAGE_ARCHIVE_START "!<arch>\n"
1452 #define IMAGE_ARCHIVE_END "`\n"
1453 #define IMAGE_ARCHIVE_PAD "\n"
1454 #define IMAGE_ARCHIVE_LINKER_MEMBER "/ "
1455 #define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
1456 #define IMAGE_ORDINAL_FLAG32 0x80000000
1457 #define IMAGE_SNAP_BY_ORDINAL32(o) ((o&IMAGE_ORDINAL_FLAG32)!=0)
1458 #define IMAGE_ORDINAL32(o) (o&0xffff)
1459 #define IMAGE_ORDINAL_FLAG64 0x8000000000000000ULL
1460 #define IMAGE_SNAP_BY_ORDINAL64(o) ((o&IMAGE_ORDINAL_FLAG64)!=0)
1461 #define IMAGE_ORDINAL64(o) (o&0xffff)
1462 #ifdef _WIN64
1463 #define IMAGE_ORDINAL_FLAG IMAGE_ORDINAL_FLAG64
1464 #define IMAGE_SNAP_BY_ORDINAL(o) IMAGE_SNAP_BY_ORDINAL64(o)
1465 #define IMAGE_ORDINAL(o) IMAGE_ORDINAL64(o)
1466 #else
1467 #define IMAGE_ORDINAL_FLAG IMAGE_ORDINAL_FLAG32
1468 #define IMAGE_SNAP_BY_ORDINAL(o) IMAGE_SNAP_BY_ORDINAL32(o)
1469 #define IMAGE_ORDINAL(o) IMAGE_ORDINAL32(o)
1470 #endif
1471 #define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000
1472 #define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000
1473 #define IMAGE_DEBUG_TYPE_UNKNOWN 0
1474 #define IMAGE_DEBUG_TYPE_COFF 1
1475 #define IMAGE_DEBUG_TYPE_CODEVIEW 2
1476 #define IMAGE_DEBUG_TYPE_FPO 3
1477 #define IMAGE_DEBUG_TYPE_MISC 4
1478 #define IMAGE_DEBUG_TYPE_EXCEPTION 5
1479 #define IMAGE_DEBUG_TYPE_FIXUP 6
1480 #define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7
1481 #define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8
1482 #define IMAGE_DEBUG_TYPE_BORLAND 9
1483 #define FRAME_FPO 0
1484 #define FRAME_TRAP 1
1485 #define FRAME_TSS 2
1486 #define FRAME_NONFPO 3
1487 #define IMAGE_DEBUG_MISC_EXENAME 1
1488 #define N_BTMASK 0x000F
1489 #define N_TMASK 0x0030
1490 #define N_TMASK1 0x00C0
1491 #define N_TMASK2 0x00F0
1492 #define N_BTSHFT 4
1493 #define N_TSHIFT 2
1494 #define IS_TEXT_UNICODE_ASCII16 1
1495 #define IS_TEXT_UNICODE_REVERSE_ASCII16 16
1496 #define IS_TEXT_UNICODE_STATISTICS 2
1497 #define IS_TEXT_UNICODE_REVERSE_STATISTICS 32
1498 #define IS_TEXT_UNICODE_CONTROLS 4
1499 #define IS_TEXT_UNICODE_REVERSE_CONTROLS 64
1500 #define IS_TEXT_UNICODE_SIGNATURE 8
1501 #define IS_TEXT_UNICODE_REVERSE_SIGNATURE 128
1502 #define IS_TEXT_UNICODE_ILLEGAL_CHARS 256
1503 #define IS_TEXT_UNICODE_ODD_LENGTH 512
1504 #define IS_TEXT_UNICODE_NULL_BYTES 4096
1505 #define IS_TEXT_UNICODE_UNICODE_MASK 15
1506 #define IS_TEXT_UNICODE_REVERSE_MASK 240
1507 #define IS_TEXT_UNICODE_NOT_UNICODE_MASK 3840
1508 #define IS_TEXT_UNICODE_NOT_ASCII_MASK 61440
1509 #define SERVICE_KERNEL_DRIVER 1
1510 #define SERVICE_FILE_SYSTEM_DRIVER 2
1511 #define SERVICE_ADAPTER 4
1512 #define SERVICE_RECOGNIZER_DRIVER 8
1513 #define SERVICE_DRIVER
(SERVICE_KERNEL_DRIVER|SERVICE_FILE_SYSTEM_DRIVER|SERVICE_RECOGNIZER_DRIVER)
1514 #define SERVICE_WIN32_OWN_PROCESS 16
1515 #define SERVICE_WIN32_SHARE_PROCESS 32
1516 #define SERVICE_WIN32
(SERVICE_WIN32_OWN_PROCESS|SERVICE_WIN32_SHARE_PROCESS)
1517 #define SERVICE_INTERACTIVE_PROCESS 256
1518 #define SERVICE_TYPE_ALL
(SERVICE_WIN32|SERVICE_ADAPTER|SERVICE_DRIVER|SERVICE_INTERACTIVE_PROCESS)
1519 #define SERVICE_BOOT_START 0
1520 #define SERVICE_SYSTEM_START 1
1521 #define SERVICE_AUTO_START 2
1522 #define SERVICE_DEMAND_START 3
1523 #define SERVICE_DISABLED 4
1524 #define SERVICE_ERROR_IGNORE 0
1525 #define SERVICE_ERROR_NORMAL 1
1526 #define SERVICE_ERROR_SEVERE 2
1527 #define SERVICE_ERROR_CRITICAL 3
1528 #define SE_OWNER_DEFAULTED 1
1529 #define SE_GROUP_DEFAULTED 2
1530 #define SE_DACL_PRESENT 4
1531 #define SE_DACL_DEFAULTED 8
1532 #define SE_SACL_PRESENT 16
1533 #define SE_SACL_DEFAULTED 32
1534 #define SE_DACL_AUTO_INHERIT_REQ 256
1535 #define SE_SACL_AUTO_INHERIT_REQ 512
1536 #define SE_DACL_AUTO_INHERITED 1024
1537 #define SE_SACL_AUTO_INHERITED 2048
1538 #define SE_DACL_PROTECTED 4096
1539 #define SE_SACL_PROTECTED 8192
1540 #define SE_SELF_RELATIVE 0x8000
1541 #define SECURITY_DESCRIPTOR_MIN_LENGTH 20
1542 #define SECURITY_DESCRIPTOR_REVISION 1
1543 #define SECURITY_DESCRIPTOR_REVISION1 1
1544 #define SE_PRIVILEGE_ENABLED_BY_DEFAULT 1
1545 #define SE_PRIVILEGE_ENABLED 2
1546 #define SE_PRIVILEGE_USED_FOR_ACCESS 0x80000000
1547 #define PRIVILEGE_SET_ALL_NECESSARY 1
1548 #define SECURITY_MAX_IMPERSONATION_LEVEL SecurityDelegation
1549 #define DEFAULT_IMPERSONATION_LEVEL SecurityImpersonation
1550 #define SECURITY_DYNAMIC_TRACKING TRUE
1551 #define SECURITY_STATIC_TRACKING FALSE
1552 /* also in ddk/ntifs.h */
1553 #define TOKEN_ASSIGN_PRIMARY (0x0001)
1554 #define TOKEN_DUPLICATE (0x0002)
1555 #define TOKEN_IMPERSONATE (0x0004)
1556 #define TOKEN_QUERY (0x0008)
1557 #define TOKEN_QUERY_SOURCE (0x0010)
1558 #define TOKEN_ADJUST_PRIVILEGES (0x0020)
1559 #define TOKEN_ADJUST_GROUPS (0x0040)
1560 #define TOKEN_ADJUST_DEFAULT (0x0080)
1561 #define TOKEN_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\
1562 TOKEN_ASSIGN_PRIMARY |\
1563 TOKEN_DUPLICATE |\
1564 TOKEN_IMPERSONATE |\
1565 TOKEN_QUERY |\
1566 TOKEN_QUERY_SOURCE |\
1567 TOKEN_ADJUST_PRIVILEGES |\
1568 TOKEN_ADJUST_GROUPS |\
1569 TOKEN_ADJUST_DEFAULT)
1570 #define TOKEN_READ (STANDARD_RIGHTS_READ |\
1571 TOKEN_QUERY)
1572 #define TOKEN_WRITE (STANDARD_RIGHTS_WRITE |\
1573 TOKEN_ADJUST_PRIVILEGES |\
1574 TOKEN_ADJUST_GROUPS |\
1575 TOKEN_ADJUST_DEFAULT)
1576
1577 #define TOKEN_EXECUTE (STANDARD_RIGHTS_EXECUTE)
1578 #define TOKEN_SOURCE_LENGTH 8
1579 /* end ddk/ntifs.h */
1580 #define DLL_PROCESS_DETACH 0
1581 #define DLL_PROCESS_ATTACH 1
1582 #define DLL_THREAD_ATTACH 2
1583 #define DLL_THREAD_DETACH 3
1584 #define DBG_CONTINUE 0x10002
1585 #define DBG_TERMINATE_THREAD 0x40010003
1586 #define DBG_TERMINATE_PROCESS 0x40010004
1587 #define DBG_CONTROL_C 0x40010005
1588 #define DBG_CONTROL_BREAK 0x40010008
1589 #define DBG_EXCEPTION_NOT_HANDLED 0x80010001
1590 #define TAPE_ABSOLUTE_POSITION 0
1591 #define TAPE_LOGICAL_POSITION 1
1592 #define TAPE_PSEUDO_LOGICAL_POSITION 2
1593 #define TAPE_REWIND 0
1594 #define TAPE_ABSOLUTE_BLOCK 1
1595 #define TAPE_LOGICAL_BLOCK 2
1596 #define TAPE_PSEUDO_LOGICAL_BLOCK 3
1597 #define TAPE_SPACE_END_OF_DATA 4
1598 #define TAPE_SPACE_RELATIVE_BLOCKS 5
1599 #define TAPE_SPACE_FILEMARKS 6
1600 #define TAPE_SPACE_SEQUENTIAL_FMKS 7
1601 #define TAPE_SPACE_SETMARKS 8
1602 #define TAPE_SPACE_SEQUENTIAL_SMKS 9
1603 #define TAPE_DRIVE_FIXED 1
1604 #define TAPE_DRIVE_SELECT 2
1605 #define TAPE_DRIVE_INITIATOR 4
1606 #define TAPE_DRIVE_ERASE_SHORT 16
1607 #define TAPE_DRIVE_ERASE_LONG 32
1608 #define TAPE_DRIVE_ERASE_BOP_ONLY 64
1609 #define TAPE_DRIVE_ERASE_IMMEDIATE 128
1610 #define TAPE_DRIVE_TAPE_CAPACITY 256
1611 #define TAPE_DRIVE_TAPE_REMAINING 512
1612 #define TAPE_DRIVE_FIXED_BLOCK 1024
1613 #define TAPE_DRIVE_VARIABLE_BLOCK 2048
1614 #define TAPE_DRIVE_WRITE_PROTECT 4096
1615 #define TAPE_DRIVE_EOT_WZ_SIZE 8192
1616 #define TAPE_DRIVE_ECC 0x10000
1617 #define TAPE_DRIVE_COMPRESSION 0x20000
1618 #define TAPE_DRIVE_PADDING 0x40000
1619 #define TAPE_DRIVE_REPORT_SMKS 0x80000
1620 #define TAPE_DRIVE_GET_ABSOLUTE_BLK 0x100000
1621 #define TAPE_DRIVE_GET_LOGICAL_BLK 0x200000
1622 #define TAPE_DRIVE_SET_EOT_WZ_SIZE 0x400000
1623 #define TAPE_DRIVE_EJECT_MEDIA 0x1000000
1624 #define TAPE_DRIVE_CLEAN_REQUESTS 0x2000000
1625 #define TAPE_DRIVE_SET_CMP_BOP_ONLY 0x4000000
1626 #define TAPE_DRIVE_RESERVED_BIT 0x80000000
1627 #define TAPE_DRIVE_LOAD_UNLOAD 0x80000001
1628 #define TAPE_DRIVE_TENSION 0x80000002
1629 #define TAPE_DRIVE_LOCK_UNLOCK 0x80000004
1630 #define TAPE_DRIVE_REWIND_IMMEDIATE 0x80000008
1631 #define TAPE_DRIVE_SET_BLOCK_SIZE 0x80000010
1632 #define TAPE_DRIVE_LOAD_UNLD_IMMED 0x80000020
1633 #define TAPE_DRIVE_TENSION_IMMED 0x80000040
1634 #define TAPE_DRIVE_LOCK_UNLK_IMMED 0x80000080
1635 #define TAPE_DRIVE_SET_ECC 0x80000100
1636 #define TAPE_DRIVE_SET_COMPRESSION 0x80000200
1637 #define TAPE_DRIVE_SET_PADDING 0x80000400
1638 #define TAPE_DRIVE_SET_REPORT_SMKS 0x80000800
1639 #define TAPE_DRIVE_ABSOLUTE_BLK 0x80001000
1640 #define TAPE_DRIVE_ABS_BLK_IMMED 0x80002000
1641 #define TAPE_DRIVE_LOGICAL_BLK 0x80004000
1642 #define TAPE_DRIVE_LOG_BLK_IMMED 0x80008000
1643 #define TAPE_DRIVE_END_OF_DATA 0x80010000
1644 #define TAPE_DRIVE_RELATIVE_BLKS 0x80020000
1645 #define TAPE_DRIVE_FILEMARKS 0x80040000
1646 #define TAPE_DRIVE_SEQUENTIAL_FMKS 0x80080000
1647 #define TAPE_DRIVE_SETMARKS 0x80100000
1648 #define TAPE_DRIVE_SEQUENTIAL_SMKS 0x80200000
1649 #define TAPE_DRIVE_REVERSE_POSITION 0x80400000
1650 #define TAPE_DRIVE_SPACE_IMMEDIATE 0x80800000
1651 #define TAPE_DRIVE_WRITE_SETMARKS 0x81000000
1652 #define TAPE_DRIVE_WRITE_FILEMARKS 0x82000000
1653 #define TAPE_DRIVE_WRITE_SHORT_FMKS 0x84000000
1654 #define TAPE_DRIVE_WRITE_LONG_FMKS 0x88000000
1655 #define TAPE_DRIVE_WRITE_MARK_IMMED 0x90000000
1656 #define TAPE_DRIVE_FORMAT 0xA0000000
1657 #define TAPE_DRIVE_FORMAT_IMMEDIATE 0xC0000000
1658 #define TAPE_DRIVE_HIGH_FEATURES 0x80000000
1659 #define TAPE_FIXED_PARTITIONS 0
1660 #define TAPE_INITIATOR_PARTITIONS 2
1661 #define TAPE_SELECT_PARTITIONS 1
1662 #define TAPE_FILEMARKS 1
1663 #define TAPE_LONG_FILEMARKS 3
1664 #define TAPE_SETMARKS 0
1665 #define TAPE_SHORT_FILEMARKS 2
1666 #define TAPE_ERASE_LONG 1
1667 #define TAPE_ERASE_SHORT 0
1668 #define TAPE_LOAD 0
1669 #define TAPE_UNLOAD 1
1670 #define TAPE_TENSION 2
1671 #define TAPE_LOCK 3
1672 #define TAPE_UNLOCK 4
1673 #define TAPE_FORMAT 5
1674 #if (_WIN32_WINNT >= 0x0500)
1675 #define VER_MINORVERSION 0x0000001
1676 #define VER_MAJORVERSION 0x0000002
1677 #define VER_BUILDNUMBER 0x0000004
1678 #define VER_PLATFORMID 0x0000008
1679 #define VER_SERVICEPACKMINOR 0x0000010
1680 #define VER_SERVICEPACKMAJOR 0x0000020
1681 #define VER_SUITENAME 0x0000040
1682 #define VER_PRODUCT_TYPE 0x0000080
1683 #define VER_EQUAL 1
1684 #define VER_GREATER 2
1685 #define VER_GREATER_EQUAL 3
1686 #define VER_LESS 4
1687 #define VER_LESS_EQUAL 5
1688 #define VER_AND 6
1689 #define VER_OR 7
1690 #endif
1691 #define VER_PLATFORM_WIN32s 0
1692 #define VER_PLATFORM_WIN32_WINDOWS 1
1693 #define VER_PLATFORM_WIN32_NT 2
1694 #define VER_NT_WORKSTATION 1
1695 #define VER_NT_DOMAIN_CONTROLLER 2
1696 #define VER_NT_SERVER 3
1697 #define VER_SUITE_SMALLBUSINESS 1
1698 #define VER_SUITE_ENTERPRISE 2
1699 #define VER_SUITE_BACKOFFICE 4
1700 #define VER_SUITE_TERMINAL 16
1701 #define VER_SUITE_SMALLBUSINESS_RESTRICTED 32
1702 #define VER_SUITE_EMBEDDEDNT 64
1703 #define VER_SUITE_DATACENTER 128
1704 #define VER_SUITE_SINGLEUSERTS 256
1705 #define VER_SUITE_PERSONAL 512
1706 #define VER_SUITE_BLADE 1024
1707 #define VER_SUITE_STORAGE_SERVER 8192
1708 #define VER_SUITE_COMPUTE_SERVER 16384
1709 #define WT_EXECUTEDEFAULT 0x00000000
1710 #define WT_EXECUTEINIOTHREAD 0x00000001
1711 #define WT_EXECUTEINWAITTHREAD 0x00000004
1712 #define WT_EXECUTEONLYONCE 0x00000008
1713 #define WT_EXECUTELONGFUNCTION 0x00000010
1714 #define WT_EXECUTEINTIMERTHREAD 0x00000020
1715 #define WT_EXECUTEINPERSISTENTTHREAD 0x00000080
1716 #define WT_TRANSFER_IMPERSONATION 0x00000100
1717 #if (_WIN32_WINNT >= 0x0501)
1718 #define ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION 1
1719 #define ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION 2
1720 #define ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION 3
1721 #define ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION 4
1722 #define ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION 5
1723 #define ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION 6
1724 #define ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION 7
1725 #define ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES 9
1726 #endif /* (_WIN32_WINNT >= 0x0501) */
1727 #define BTYPE(x) ((x)&N_BTMASK)
1728 #define ISPTR(x) (((x)&N_TMASK)==(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT))
1729 #define ISFCN(x) (((x)&N_TMASK)==(IMAGE_SYM_DTYPE_FUNCTION<<N_BTSHFT))
1730 #define ISARY(x) (((x)&N_TMASK)==(IMAGE_SYM_DTYPE_ARRAY<<N_BTSHFT))
1731 #define ISTAG(x)
((x)==IMAGE_SYM_CLASS_STRUCT_TAG||(x)==IMAGE_SYM_CLASS_UNION_TAG||(x)==IMAGE_SYM_
CLASS_ENUM_TAG)
1732 #define INCREF(x)
((((x)&~N_BTMASK)<<N_TSHIFT)|(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT)|((x)&N_BTMASK))
1733 #define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
1734 #define TLS_MINIMUM_AVAILABLE 64
1735 #define REPARSE_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(REPARSE_DATA_BUFFER,
GenericReparseBuffer)
1736 #define REPARSE_GUID_DATA_BUFFER_HEADER_SIZE
FIELD_OFFSET(REPARSE_GUID_DATA_BUFFER, GenericReparseBuffer)
1737 #define MAXIMUM_REPARSE_DATA_BUFFER_SIZE 16384
1738 #define IO_REPARSE_TAG_RESERVED_ZERO 0
1739 #define IO_REPARSE_TAG_RESERVED_ONE 1
1740 #define IO_REPARSE_TAG_RESERVED_RANGE IO_REPARSE_TAG_RESERVED_ONE
1741 #define IsReparseTagMicrosoft(x) ((x)&0x80000000)
1742 #define IsReparseTagHighLatency(x) ((x)&0x40000000)
1743 #define IsReparseTagNameSurrogate(x) ((x)&0x20000000)
1744 #define IO_REPARSE_TAG_VALID_VALUES 0xE000FFFF
1745 #define IsReparseTagValid(x)
(!((x)&~IO_REPARSE_TAG_VALID_VALUES)&&((x)>IO_REPARSE_TAG_RESERVED_RANGE))
1746 #define IO_REPARSE_TAG_SYMBOLIC_LINK IO_REPARSE_TAG_RESERVED_ZERO
1747 #define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003
1748 #define IO_REPARSE_TAG_SYMLINK 0xA000000C
1749 #define WT_SET_MAX_THREADPOOL_THREADS(Flags,Limit) ((Flags)|=(Limit)<<16)
1750 #ifndef RC_INVOKED
1751 typedef DWORD ACCESS_MASK, *PACCESS_MASK;
1752
1753 #ifdef _GUID_DEFINED
1754 # warning _GUID_DEFINED is deprecated, use GUID_DEFINED instead
1755 #endif
1756
1757 #if ! (defined _GUID_DEFINED || defined GUID_DEFINED) /* also defined in
basetyps.h */
1758 #define GUID_DEFINED
1759 typedef struct _GUID {
1760 unsigned long Data1;
1761 unsigned short Data2;
1762 unsigned short Data3;
1763 unsigned char Data4[8];
1764 } GUID, *REFGUID, *LPGUID;
1765 #define SYSTEM_LUID { 0x3e7, 0x0 }
1766 #endif /* GUID_DEFINED */
1767 typedef struct _GENERIC_MAPPING {
1768 ACCESS_MASK GenericRead;
1769 ACCESS_MASK GenericWrite;
1770 ACCESS_MASK GenericExecute;
1771 ACCESS_MASK GenericAll;
1772 } GENERIC_MAPPING, *PGENERIC_MAPPING;
1773 typedef struct _ACE_HEADER {
1774 BYTE AceType;
1775 BYTE AceFlags;
1776 WORD AceSize;
1777 } ACE_HEADER, *PACE_HEADER;
1778 typedef struct _ACCESS_ALLOWED_ACE {
1779 ACE_HEADER Header;
1780 ACCESS_MASK Mask;
1781 DWORD SidStart;
1782 } ACCESS_ALLOWED_ACE, *PACCESS_ALLOWED_ACE;
1783 typedef struct _ACCESS_DENIED_ACE {
1784 ACE_HEADER Header;
1785 ACCESS_MASK Mask;
1786 DWORD SidStart;
1787 } ACCESS_DENIED_ACE, *PACCESS_DENIED_ACE;
1788 typedef struct _SYSTEM_AUDIT_ACE {
1789 ACE_HEADER Header;
1790 ACCESS_MASK Mask;
1791 DWORD SidStart;
1792 } SYSTEM_AUDIT_ACE;
1793 typedef SYSTEM_AUDIT_ACE *PSYSTEM_AUDIT_ACE;
1794 typedef struct _SYSTEM_ALARM_ACE {
1795 ACE_HEADER Header;
1796 ACCESS_MASK Mask;
1797 DWORD SidStart;
1798 } SYSTEM_ALARM_ACE,*PSYSTEM_ALARM_ACE;
1799 typedef struct _ACCESS_ALLOWED_OBJECT_ACE {
1800 ACE_HEADER Header;
1801 ACCESS_MASK Mask;
1802 DWORD Flags;
1803 GUID ObjectType;
1804 GUID InheritedObjectType;
1805 DWORD SidStart;
1806 } ACCESS_ALLOWED_OBJECT_ACE,*PACCESS_ALLOWED_OBJECT_ACE;
1807 typedef struct _ACCESS_DENIED_OBJECT_ACE {
1808 ACE_HEADER Header;
1809 ACCESS_MASK Mask;
1810 DWORD Flags;
1811 GUID ObjectType;
1812 GUID InheritedObjectType;
1813 DWORD SidStart;
1814 } ACCESS_DENIED_OBJECT_ACE,*PACCESS_DENIED_OBJECT_ACE;
1815 typedef struct _SYSTEM_AUDIT_OBJECT_ACE {
1816 ACE_HEADER Header;
1817 ACCESS_MASK Mask;
1818 DWORD Flags;
1819 GUID ObjectType;
1820 GUID InheritedObjectType;
1821 DWORD SidStart;
1822 } SYSTEM_AUDIT_OBJECT_ACE,*PSYSTEM_AUDIT_OBJECT_ACE;
1823 typedef struct _SYSTEM_ALARM_OBJECT_ACE {
1824 ACE_HEADER Header;
1825 ACCESS_MASK Mask;
1826 DWORD Flags;
1827 GUID ObjectType;
1828 GUID InheritedObjectType;
1829 DWORD SidStart;
1830 } SYSTEM_ALARM_OBJECT_ACE,*PSYSTEM_ALARM_OBJECT_ACE;
1831 typedef struct _ACL {
1832 BYTE AclRevision;
1833 BYTE Sbz1;
1834 WORD AclSize;
1835 WORD AceCount;
1836 WORD Sbz2;
1837 } ACL,*PACL;
1838 typedef struct _ACL_REVISION_INFORMATION {
1839 DWORD AclRevision;
1840 } ACL_REVISION_INFORMATION;
1841 typedef struct _ACL_SIZE_INFORMATION {
1842 DWORD AceCount;
1843 DWORD AclBytesInUse;
1844 DWORD AclBytesFree;
1845 } ACL_SIZE_INFORMATION;
1846
1847 /* FIXME: add more machines */
1848 #ifdef _X86_
1849 #define SIZE_OF_80387_REGISTERS 80
1850 #define CONTEXT_i386 0x10000
1851 #define CONTEXT_i486 0x10000
1852 #define CONTEXT_CONTROL (CONTEXT_i386|0x00000001L)
1853 #define CONTEXT_INTEGER (CONTEXT_i386|0x00000002L)
1854 #define CONTEXT_SEGMENTS (CONTEXT_i386|0x00000004L)
1855 #define CONTEXT_FLOATING_POINT (CONTEXT_i386|0x00000008L)
1856 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386|0x00000010L)
1857 #define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386|0x00000020L)
1858 #define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_SEGMENTS)
1859 #define MAXIMUM_SUPPORTED_EXTENSION 512
1860 typedef struct _FLOATING_SAVE_AREA {
1861 DWORD ControlWord;
1862 DWORD StatusWord;
1863 DWORD TagWord;
1864 DWORD ErrorOffset;
1865 DWORD ErrorSelector;
1866 DWORD DataOffset;
1867 DWORD DataSelector;
1868 BYTE RegisterArea[80];
1869 DWORD Cr0NpxState;
1870 } FLOATING_SAVE_AREA;
1871 typedef struct _CONTEXT {
1872 DWORD ContextFlags;
1873 DWORD Dr0;
1874 DWORD Dr1;
1875 DWORD Dr2;
1876 DWORD Dr3;
1877 DWORD Dr6;
1878 DWORD Dr7;
1879 FLOATING_SAVE_AREA FloatSave;
1880 DWORD SegGs;
1881 DWORD SegFs;
1882 DWORD SegEs;
1883 DWORD SegDs;
1884 DWORD Edi;
1885 DWORD Esi;
1886 DWORD Ebx;
1887 DWORD Edx;
1888 DWORD Ecx;
1889 DWORD Eax;
1890 DWORD Ebp;
1891 DWORD Eip;
1892 DWORD SegCs;
1893 DWORD EFlags;
1894 DWORD Esp;
1895 DWORD SegSs;
1896 BYTE ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];
1897 } CONTEXT;
1898 #elif defined(_PPC_)
1899 #define CONTEXT_CONTROL 1L
1900 #define CONTEXT_FLOATING_POINT 2L
1901 #define CONTEXT_INTEGER 4L
1902 #define CONTEXT_DEBUG_REGISTERS 8L
1903 #define CONTEXT_FULL
(CONTEXT_CONTROL|CONTEXT_FLOATING_POINT|CONTEXT_INTEGER)
1904 typedef struct {
1905 double Fpr0;
1906 double Fpr1;
1907 double Fpr2;
1908 double Fpr3;
1909 double Fpr4;
1910 double Fpr5;
1911 double Fpr6;
1912 double Fpr7;
1913 double Fpr8;
1914 double Fpr9;
1915 double Fpr10;
1916 double Fpr11;
1917 double Fpr12;
1918 double Fpr13;
1919 double Fpr14;
1920 double Fpr15;
1921 double Fpr16;
1922 double Fpr17;
1923 double Fpr18;
1924 double Fpr19;
1925 double Fpr20;
1926 double Fpr21;
1927 double Fpr22;
1928 double Fpr23;
1929 double Fpr24;
1930 double Fpr25;
1931 double Fpr26;
1932 double Fpr27;
1933 double Fpr28;
1934 double Fpr29;
1935 double Fpr30;
1936 double Fpr31;
1937 double Fpscr;
1938 DWORD Gpr0;
1939 DWORD Gpr1;
1940 DWORD Gpr2;
1941 DWORD Gpr3;
1942 DWORD Gpr4;
1943 DWORD Gpr5;
1944 DWORD Gpr6;
1945 DWORD Gpr7;
1946 DWORD Gpr8;
1947 DWORD Gpr9;
1948 DWORD Gpr10;
1949 DWORD Gpr11;
1950 DWORD Gpr12;
1951 DWORD Gpr13;
1952 DWORD Gpr14;
1953 DWORD Gpr15;
1954 DWORD Gpr16;
1955 DWORD Gpr17;
1956 DWORD Gpr18;
1957 DWORD Gpr19;
1958 DWORD Gpr20;
1959 DWORD Gpr21;
1960 DWORD Gpr22;
1961 DWORD Gpr23;
1962 DWORD Gpr24;
1963 DWORD Gpr25;
1964 DWORD Gpr26;
1965 DWORD Gpr27;
1966 DWORD Gpr28;
1967 DWORD Gpr29;
1968 DWORD Gpr30;
1969 DWORD Gpr31;
1970 DWORD Cr;
1971 DWORD Xer;
1972 DWORD Msr;
1973 DWORD Iar;
1974 DWORD Lr;
1975 DWORD Ctr;
1976 DWORD ContextFlags;
1977 DWORD Fill[3];
1978 DWORD Dr0;
1979 DWORD Dr1;
1980 DWORD Dr2;
1981 DWORD Dr3;
1982 DWORD Dr4;
1983 DWORD Dr5;
1984 DWORD Dr6;
1985 DWORD Dr7;
1986 } CONTEXT;
1987 #elif defined(_ALPHA_)
1988 #define CONTEXT_ALPHA 0x20000
1989 #define CONTEXT_CONTROL (CONTEXT_ALPHA|1L)
1990 #define CONTEXT_FLOATING_POINT (CONTEXT_ALPHA|2L)
1991 #define CONTEXT_INTEGER (CONTEXT_ALPHA|4L)
1992 #define CONTEXT_FULL
(CONTEXT_CONTROL|CONTEXT_FLOATING_POINT|CONTEXT_INTEGER)
1993 typedef struct _CONTEXT {
1994 ULONGLONG FltF0;
1995 ULONGLONG FltF1;
1996 ULONGLONG FltF2;
1997 ULONGLONG FltF3;
1998 ULONGLONG FltF4;
1999 ULONGLONG FltF5;
2000 ULONGLONG FltF6;
2001 ULONGLONG FltF7;
2002 ULONGLONG FltF8;
2003 ULONGLONG FltF9;
2004 ULONGLONG FltF10;
2005 ULONGLONG FltF11;
2006 ULONGLONG FltF12;
2007 ULONGLONG FltF13;
2008 ULONGLONG FltF14;
2009 ULONGLONG FltF15;
2010 ULONGLONG FltF16;
2011 ULONGLONG FltF17;
2012 ULONGLONG FltF18;
2013 ULONGLONG FltF19;
2014 ULONGLONG FltF20;
2015 ULONGLONG FltF21;
2016 ULONGLONG FltF22;
2017 ULONGLONG FltF23;
2018 ULONGLONG FltF24;
2019 ULONGLONG FltF25;
2020 ULONGLONG FltF26;
2021 ULONGLONG FltF27;
2022 ULONGLONG FltF28;
2023 ULONGLONG FltF29;
2024 ULONGLONG FltF30;
2025 ULONGLONG FltF31;
2026 ULONGLONG IntV0;
2027 ULONGLONG IntT0;
2028 ULONGLONG IntT1;
2029 ULONGLONG IntT2;
2030 ULONGLONG IntT3;
2031 ULONGLONG IntT4;
2032 ULONGLONG IntT5;
2033 ULONGLONG IntT6;
2034 ULONGLONG IntT7;
2035 ULONGLONG IntS0;
2036 ULONGLONG IntS1;
2037 ULONGLONG IntS2;
2038 ULONGLONG IntS3;
2039 ULONGLONG IntS4;
2040 ULONGLONG IntS5;
2041 ULONGLONG IntFp;
2042 ULONGLONG IntA0;
2043 ULONGLONG IntA1;
2044 ULONGLONG IntA2;
2045 ULONGLONG IntA3;
2046 ULONGLONG IntA4;
2047 ULONGLONG IntA5;
2048 ULONGLONG IntT8;
2049 ULONGLONG IntT9;
2050 ULONGLONG IntT10;
2051 ULONGLONG IntT11;
2052 ULONGLONG IntRa;
2053 ULONGLONG IntT12;
2054 ULONGLONG IntAt;
2055 ULONGLONG IntGp;
2056 ULONGLONG IntSp;
2057 ULONGLONG IntZero;
2058 ULONGLONG Fpcr;
2059 ULONGLONG SoftFpcr;
2060 ULONGLONG Fir;
2061 DWORD Psr;
2062 DWORD ContextFlags;
2063 DWORD Fill[4];
2064 } CONTEXT;
2065 #elif defined(SHx)
2066
2067 /* These are the debug or break registers on the SH3 */
2068 typedef struct _DEBUG_REGISTERS {
2069 ULONG BarA;
2070 UCHAR BasrA;
2071 UCHAR BamrA;
2072 USHORT BbrA;
2073 ULONG BarB;
2074 UCHAR BasrB;
2075 UCHAR BamrB;
2076 USHORT BbrB;
2077 ULONG BdrB;
2078 ULONG BdmrB;
2079 USHORT Brcr;
2080 USHORT Align;
2081 } DEBUG_REGISTERS, *PDEBUG_REGISTERS;
2082
2083 /* The following flags control the contents of the CONTEXT structure. */
2084
2085 #define CONTEXT_SH3 0x00000040
2086 #define CONTEXT_SH4 0x000000c0 /* CONTEXT_SH3 | 0x80 - must contain
the SH3 bits */
2087
2088 #ifdef SH3
2089 #define CONTEXT_CONTROL (CONTEXT_SH3 | 0x00000001L)
2090 #define CONTEXT_INTEGER (CONTEXT_SH3 | 0x00000002L)
2091 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_SH3 | 0x00000008L)
2092 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER |
CONTEXT_DEBUG_REGISTERS)
2093 #else /* SH4 */
2094 #define CONTEXT_CONTROL (CONTEXT_SH4 | 0x00000001L)
2095 #define CONTEXT_INTEGER (CONTEXT_SH4 | 0x00000002L)
2096 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_SH4 | 0x00000008L)
2097 #define CONTEXT_FLOATING_POINT (CONTEXT_SH4 | 0x00000004L)
2098 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER |
CONTEXT_DEBUG_REGISTERS | CONTEXT_FLOATING_POINT)
2099 #endif
2100
2101 /* Context Frame */
2102
2103 /* This frame is used to store a limited processor context into the */
2104 /* Thread structure for CPUs which have no floating point support. */
2105
2106 typedef struct _CONTEXT {
2107 /* The flags values within this flag control the contents of */
2108 /* a CONTEXT record. */
2109
2110 /* If the context record is used as an input parameter, then */
2111 /* for each portion of the context record controlled by a flag */
2112 /* whose value is set, it is assumed that that portion of the */
2113 /* context record contains valid context. If the context record */
2114 /* is being used to modify a thread's context, then only that */
2115 /* portion of the threads context will be modified. */
2116
2117 /* If the context record is used as an IN OUT parameter to capture */
2118 /* the context of a thread, then only those portions of the thread's */
2119 /* context corresponding to set flags will be returned. */
2120
2121 /* The context record is never used as an OUT only parameter. */
2122
2123
2124 ULONG ContextFlags;
2125
2126 /* This section is specified/returned if the ContextFlags word contains
*/
2127 /* the flag CONTEXT_INTEGER. */
2128
2129 /* N.B. The registers RA and R15 are defined in this section, but are
*/
2130 /* considered part of the control context rather than part of the
integer */
2131 /* context. */
2132
2133 ULONG PR;
2134 ULONG MACH;
2135 ULONG MACL;
2136 ULONG GBR;
2137 ULONG R0;
2138 ULONG R1;
2139 ULONG R2;
2140 ULONG R3;
2141 ULONG R4;
2142 ULONG R5;
2143 ULONG R6;
2144 ULONG R7;
2145 ULONG R8;
2146 ULONG R9;
2147 ULONG R10;
2148 ULONG R11;
2149 ULONG R12;
2150 ULONG R13;
2151 ULONG R14;
2152 ULONG R15;
2153
2154 /* This section is specified/returned if the ContextFlags word contains
*/
2155 /* the flag CONTEXT_CONTROL. */
2156
2157 /* N.B. The registers r15 and ra are defined in the integer section, */
2158 /* but are considered part of the control context rather than part of
*/
2159 /* the integer context. */
2160
2161 ULONG Fir;
2162 ULONG Psr;
2163
2164 #if !defined(SH3e) && !defined(SH4)
2165 ULONG OldStuff[2];
2166 DEBUG_REGISTERS DebugRegisters;
2167 #else
2168 ULONG Fpscr;
2169 ULONG Fpul;
2170 ULONG FRegs[16];
2171 #if defined(SH4)
2172 ULONG xFRegs[16];
2173 #endif
2174 #endif
2175 } CONTEXT;
2176
2177 #elif defined(MIPS)
2178
2179 /* The following flags control the contents of the CONTEXT structure. */
2180
2181 #define CONTEXT_R4000 0x00010000 /* r4000 context */
2182
2183 #define CONTEXT_CONTROL (CONTEXT_R4000 | 0x00000001L)
2184 #define CONTEXT_FLOATING_POINT (CONTEXT_R4000 | 0x00000002L)
2185 #define CONTEXT_INTEGER (CONTEXT_R4000 | 0x00000004L)
2186
2187 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT |
CONTEXT_INTEGER)
2188
2189 /* Context Frame */
2190
2191 /* N.B. This frame must be exactly a multiple of 16 bytes in length. */
2192
2193 /* This frame has a several purposes: 1) it is used as an argument to */
2194 /* NtContinue, 2) it is used to constuct a call frame for APC delivery, */
2195 /* 3) it is used to construct a call frame for exception dispatching */
2196 /* in user mode, and 4) it is used in the user level thread creation */
2197 /* routines. */
2198
2199 /* The layout of the record conforms to a standard call frame. */
2200
2201
2202 typedef struct _CONTEXT {
2203
2204 /* This section is always present and is used as an argument build */
2205 /* area. */
2206
2207 DWORD Argument[4];
2208
2209 /* This section is specified/returned if the ContextFlags word contains
*/
2210 /* the flag CONTEXT_FLOATING_POINT. */
2211
2212 DWORD FltF0;
2213 DWORD FltF1;
2214 DWORD FltF2;
2215 DWORD FltF3;
2216 DWORD FltF4;
2217 DWORD FltF5;
2218 DWORD FltF6;
2219 DWORD FltF7;
2220 DWORD FltF8;
2221 DWORD FltF9;
2222 DWORD FltF10;
2223 DWORD FltF11;
2224 DWORD FltF12;
2225 DWORD FltF13;
2226 DWORD FltF14;
2227 DWORD FltF15;
2228 DWORD FltF16;
2229 DWORD FltF17;
2230 DWORD FltF18;
2231 DWORD FltF19;
2232 DWORD FltF20;
2233 DWORD FltF21;
2234 DWORD FltF22;
2235 DWORD FltF23;
2236 DWORD FltF24;
2237 DWORD FltF25;
2238 DWORD FltF26;
2239 DWORD FltF27;
2240 DWORD FltF28;
2241 DWORD FltF29;
2242 DWORD FltF30;
2243 DWORD FltF31;
2244
2245 /* This section is specified/returned if the ContextFlags word contains
*/
2246 /* the flag CONTEXT_INTEGER. */
2247
2248 /* N.B. The registers gp, sp, and ra are defined in this section, but
are */
2249 /* considered part of the control context rather than part of the
integer */
2250 /* context. */
2251
2252 /* N.B. Register zero is not stored in the frame. */
2253
2254 DWORD IntZero;
2255 DWORD IntAt;
2256 DWORD IntV0;
2257 DWORD IntV1;
2258 DWORD IntA0;
2259 DWORD IntA1;
2260 DWORD IntA2;
2261 DWORD IntA3;
2262 DWORD IntT0;
2263 DWORD IntT1;
2264 DWORD IntT2;
2265 DWORD IntT3;
2266 DWORD IntT4;
2267 DWORD IntT5;
2268 DWORD IntT6;
2269 DWORD IntT7;
2270 DWORD IntS0;
2271 DWORD IntS1;
2272 DWORD IntS2;
2273 DWORD IntS3;
2274 DWORD IntS4;
2275 DWORD IntS5;
2276 DWORD IntS6;
2277 DWORD IntS7;
2278 DWORD IntT8;
2279 DWORD IntT9;
2280 DWORD IntK0;
2281 DWORD IntK1;
2282 DWORD IntGp;
2283 DWORD IntSp;
2284 DWORD IntS8;
2285 DWORD IntRa;
2286 DWORD IntLo;
2287 DWORD IntHi;
2288
2289 /* This section is specified/returned if the ContextFlags word contains
*/
2290 /* the flag CONTEXT_FLOATING_POINT. */
2291
2292 DWORD Fsr;
2293
2294 /* This section is specified/returned if the ContextFlags word contains
*/
2295 /* the flag CONTEXT_CONTROL. */
2296
2297 /* N.B. The registers gp, sp, and ra are defined in the integer
section, */
2298 /* but are considered part of the control context rather than part of
*/
2299 /* the integer context. */
2300
2301 DWORD Fir;
2302 DWORD Psr;
2303
2304 /* The flags values within this flag control the contents of */
2305 /* a CONTEXT record. */
2306
2307 /* If the context record is used as an input parameter, then */
2308 /* for each portion of the context record controlled by a flag */
2309 /* whose value is set, it is assumed that that portion of the */
2310 /* context record contains valid context. If the context record */
2311 /* is being used to modify a thread's context, then only that */
2312 /* portion of the threads context will be modified. */
2313
2314 /* If the context record is used as an IN OUT parameter to capture */
2315 /* the context of a thread, then only those portions of the thread's */
2316 /* context corresponding to set flags will be returned. */
2317
2318 /* The context record is never used as an OUT only parameter. */
2319
2320 DWORD ContextFlags;
2321
2322 DWORD Fill[2];
2323
2324 } CONTEXT;
2325 #elif defined(ARM)
2326
2327 /* The following flags control the contents of the CONTEXT structure. */
2328
2329 #define CONTEXT_ARM 0x0000040
2330 #define CONTEXT_CONTROL (CONTEXT_ARM | 0x00000001L)
2331 #define CONTEXT_INTEGER (CONTEXT_ARM | 0x00000002L)
2332
2333 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER)
2334
2335 typedef struct _CONTEXT {
2336 /* The flags values within this flag control the contents of
2337 a CONTEXT record.
2338
2339 If the context record is used as an input parameter, then
2340 for each portion of the context record controlled by a flag
2341 whose value is set, it is assumed that that portion of the
2342 context record contains valid context. If the context record
2343 is being used to modify a thread's context, then only that
2344 portion of the threads context will be modified.
2345
2346 If the context record is used as an IN OUT parameter to capture
2347 the context of a thread, then only those portions of the thread's
2348 context corresponding to set flags will be returned.
2349
2350 The context record is never used as an OUT only parameter. */
2351
2352 ULONG ContextFlags;
2353
2354 /* This section is specified/returned if the ContextFlags word contains
2355 the flag CONTEXT_INTEGER. */
2356 ULONG R0;
2357 ULONG R1;
2358 ULONG R2;
2359 ULONG R3;
2360 ULONG R4;
2361 ULONG R5;
2362 ULONG R6;
2363 ULONG R7;
2364 ULONG R8;
2365 ULONG R9;
2366 ULONG R10;
2367 ULONG R11;
2368 ULONG R12;
2369
2370 ULONG Sp;
2371 ULONG Lr;
2372 ULONG Pc;
2373 ULONG Psr;
2374 } CONTEXT;
2375
2376 #else
2377 #error "undefined processor type"
2378 #endif
2379 typedef CONTEXT *PCONTEXT,*LPCONTEXT;
2380 typedef struct _EXCEPTION_RECORD {
2381 DWORD ExceptionCode;
2382 DWORD ExceptionFlags;
2383 struct _EXCEPTION_RECORD *ExceptionRecord;
2384 PVOID ExceptionAddress;
2385 DWORD NumberParameters;
2386 DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
2387 } EXCEPTION_RECORD,*PEXCEPTION_RECORD,*LPEXCEPTION_RECORD;
2388 typedef struct _EXCEPTION_POINTERS {
2389 PEXCEPTION_RECORD ExceptionRecord;
2390 PCONTEXT ContextRecord;
2391 } EXCEPTION_POINTERS,*PEXCEPTION_POINTERS,*LPEXCEPTION_POINTERS;
2392 typedef union _LARGE_INTEGER {
2393 struct {
2394 DWORD LowPart;
2395 LONG HighPart;
2396 } u;
2397 #if ! defined(NONAMELESSUNION) || defined(__cplusplus)
2398 _ANONYMOUS_STRUCT struct {
2399 DWORD LowPart;
2400 LONG HighPart;
2401 };
2402 #endif /* NONAMELESSUNION */
2403 LONGLONG QuadPart;
2404 } LARGE_INTEGER, *PLARGE_INTEGER;
2405 typedef union _ULARGE_INTEGER {
2406 struct {
2407 DWORD LowPart;
2408 DWORD HighPart;
2409 } u;
2410 #if ! defined(NONAMELESSUNION) || defined(__cplusplus)
2411 _ANONYMOUS_STRUCT struct {
2412 DWORD LowPart;
2413 DWORD HighPart;
2414 };
2415 #endif /* NONAMELESSUNION */
2416 ULONGLONG QuadPart;
2417 } ULARGE_INTEGER, *PULARGE_INTEGER;
2418 typedef struct _LUID {
2419 DWORD LowPart;
2420 LONG HighPart;
2421 } LUID, *PLUID;
2422 #pragma pack(push,4)
2423 typedef struct _LUID_AND_ATTRIBUTES {
2424 LUID Luid;
2425 DWORD Attributes;
2426 } LUID_AND_ATTRIBUTES, *PLUID_AND_ATTRIBUTES;
2427 #pragma pack(pop)
2428 typedef LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY];
2429 typedef LUID_AND_ATTRIBUTES_ARRAY *PLUID_AND_ATTRIBUTES_ARRAY;
2430 typedef struct _PRIVILEGE_SET {
2431 DWORD PrivilegeCount;
2432 DWORD Control;
2433 LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY];
2434 } PRIVILEGE_SET,*PPRIVILEGE_SET;
2435 typedef struct _SECURITY_ATTRIBUTES {
2436 DWORD nLength;
2437 LPVOID lpSecurityDescriptor;
2438 BOOL bInheritHandle;
2439 } SECURITY_ATTRIBUTES,*PSECURITY_ATTRIBUTES,*LPSECURITY_ATTRIBUTES;
2440 typedef enum _SECURITY_IMPERSONATION_LEVEL {
2441 SecurityAnonymous,
2442 SecurityIdentification,
2443 SecurityImpersonation,
2444 SecurityDelegation
2445 } SECURITY_IMPERSONATION_LEVEL,*PSECURITY_IMPERSONATION_LEVEL;
2446 typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE,*
PSECURITY_CONTEXT_TRACKING_MODE;
2447 typedef struct _SECURITY_QUALITY_OF_SERVICE {
2448 DWORD Length;
2449 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
2450 SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode;
2451 BOOLEAN EffectiveOnly;
2452 } SECURITY_QUALITY_OF_SERVICE,*PSECURITY_QUALITY_OF_SERVICE;
2453 typedef PVOID PACCESS_TOKEN;
2454 typedef struct _SE_IMPERSONATION_STATE {
2455 PACCESS_TOKEN Token;
2456 BOOLEAN CopyOnOpen;
2457 BOOLEAN EffectiveOnly;
2458 SECURITY_IMPERSONATION_LEVEL Level;
2459 } SE_IMPERSONATION_STATE,*PSE_IMPERSONATION_STATE;
2460 typedef struct _SID_IDENTIFIER_AUTHORITY {
2461 BYTE Value[6];
2462 } SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*
LPSID_IDENTIFIER_AUTHORITY;
2463 typedef PVOID PSID;
2464 typedef struct _SID {
2465 BYTE Revision;
2466 BYTE SubAuthorityCount;
2467 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
2468 DWORD SubAuthority[ANYSIZE_ARRAY];
2469 } SID, *PISID;
2470 typedef struct _SID_AND_ATTRIBUTES {
2471 PSID Sid;
2472 DWORD Attributes;
2473 } SID_AND_ATTRIBUTES, *PSID_AND_ATTRIBUTES;
2474 typedef SID_AND_ATTRIBUTES SID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY];
2475 typedef SID_AND_ATTRIBUTES_ARRAY *PSID_AND_ATTRIBUTES_ARRAY;
2476 typedef struct _TOKEN_SOURCE {
2477 CHAR SourceName[TOKEN_SOURCE_LENGTH];
2478 LUID SourceIdentifier;
2479 } TOKEN_SOURCE,*PTOKEN_SOURCE;
2480 typedef struct _TOKEN_CONTROL {
2481 LUID TokenId;
2482 LUID AuthenticationId;
2483 LUID ModifiedId;
2484 TOKEN_SOURCE TokenSource;
2485 } TOKEN_CONTROL,*PTOKEN_CONTROL;
2486 typedef struct _TOKEN_DEFAULT_DACL {
2487 PACL DefaultDacl;
2488 } TOKEN_DEFAULT_DACL,*PTOKEN_DEFAULT_DACL;
2489 typedef struct _TOKEN_GROUPS {
2490 DWORD GroupCount;
2491 SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY];
2492 } TOKEN_GROUPS,*PTOKEN_GROUPS,*LPTOKEN_GROUPS;
2493 typedef struct _TOKEN_OWNER {
2494 PSID Owner;
2495 } TOKEN_OWNER,*PTOKEN_OWNER;
2496 typedef struct _TOKEN_PRIMARY_GROUP {
2497 PSID PrimaryGroup;
2498 } TOKEN_PRIMARY_GROUP,*PTOKEN_PRIMARY_GROUP;
2499 typedef struct _TOKEN_PRIVILEGES {
2500 DWORD PrivilegeCount;
2501 LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY];
2502 } TOKEN_PRIVILEGES,*PTOKEN_PRIVILEGES,*LPTOKEN_PRIVILEGES;
2503 typedef enum tagTOKEN_TYPE {
2504 TokenPrimary = 1,
2505 TokenImpersonation
2506 } TOKEN_TYPE,*PTOKEN_TYPE;
2507 typedef struct _TOKEN_STATISTICS {
2508 LUID TokenId;
2509 LUID AuthenticationId;
2510 LARGE_INTEGER ExpirationTime;
2511 TOKEN_TYPE TokenType;
2512 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
2513 DWORD DynamicCharged;
2514 DWORD DynamicAvailable;
2515 DWORD GroupCount;
2516 DWORD PrivilegeCount;
2517 LUID ModifiedId;
2518 } TOKEN_STATISTICS, *PTOKEN_STATISTICS;
2519 typedef struct _TOKEN_USER {
2520 SID_AND_ATTRIBUTES User;
2521 } TOKEN_USER, *PTOKEN_USER;
2522 typedef DWORD SECURITY_INFORMATION,*PSECURITY_INFORMATION;
2523 typedef WORD SECURITY_DESCRIPTOR_CONTROL,*PSECURITY_DESCRIPTOR_CONTROL;
2524 typedef struct _SECURITY_DESCRIPTOR {
2525 BYTE Revision;
2526 BYTE Sbz1;
2527 SECURITY_DESCRIPTOR_CONTROL Control;
2528 PSID Owner;
2529 PSID Group;
2530 PACL Sacl;
2531 PACL Dacl;
2532 } SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR;
2533 typedef enum _TOKEN_INFORMATION_CLASS {
2534 TokenUser=1,
2535 TokenGroups,
2536 TokenPrivileges,
2537 TokenOwner,
2538 TokenPrimaryGroup,
2539 TokenDefaultDacl,
2540 TokenSource,
2541 TokenType,
2542 TokenImpersonationLevel,
2543 TokenStatistics,
2544 TokenRestrictedSids,
2545 TokenSessionId,
2546 TokenGroupsAndPrivileges,
2547 TokenSessionReference,
2548 TokenSandBoxInert,
2549 TokenAuditPolicy,
2550 TokenOrigin
2551 } TOKEN_INFORMATION_CLASS;
2552 typedef enum _SID_NAME_USE {
2553 SidTypeUser=1,
2554 SidTypeGroup,
2555 SidTypeDomain,
2556 SidTypeAlias,
2557 SidTypeWellKnownGroup,
2558 SidTypeDeletedAccount,
2559 SidTypeInvalid,
2560 SidTypeUnknown,
2561 SidTypeComputer
2562 } SID_NAME_USE,*PSID_NAME_USE;
2563 typedef struct _QUOTA_LIMITS {
2564 SIZE_T PagedPoolLimit;
2565 SIZE_T NonPagedPoolLimit;
2566 SIZE_T MinimumWorkingSetSize;
2567 SIZE_T MaximumWorkingSetSize;
2568 SIZE_T PagefileLimit;
2569 LARGE_INTEGER TimeLimit;
2570 } QUOTA_LIMITS,*PQUOTA_LIMITS;
2571 typedef struct _IO_COUNTERS {
2572 ULONGLONG ReadOperationCount;
2573 ULONGLONG WriteOperationCount;
2574 ULONGLONG OtherOperationCount;
2575 ULONGLONG ReadTransferCount;
2576 ULONGLONG WriteTransferCount;
2577 ULONGLONG OtherTransferCount;
2578 } IO_COUNTERS, *PIO_COUNTERS;
2579 typedef struct _FILE_NOTIFY_INFORMATION {
2580 DWORD NextEntryOffset;
2581 DWORD Action;
2582 DWORD FileNameLength;
2583 WCHAR FileName[1];
2584 } FILE_NOTIFY_INFORMATION,*PFILE_NOTIFY_INFORMATION;
2585 typedef struct _TAPE_ERASE {
2586 DWORD Type;
2587 BOOLEAN Immediate;
2588 } TAPE_ERASE,*PTAPE_ERASE;
2589 typedef struct _TAPE_GET_DRIVE_PARAMETERS {
2590 BOOLEAN ECC;
2591 BOOLEAN Compression;
2592 BOOLEAN DataPadding;
2593 BOOLEAN ReportSetmarks;
2594 DWORD DefaultBlockSize;
2595 DWORD MaximumBlockSize;
2596 DWORD MinimumBlockSize;
2597 DWORD MaximumPartitionCount;
2598 DWORD FeaturesLow;
2599 DWORD FeaturesHigh;
2600 DWORD EOTWarningZoneSize;
2601 } TAPE_GET_DRIVE_PARAMETERS,*PTAPE_GET_DRIVE_PARAMETERS;
2602 typedef struct _TAPE_GET_MEDIA_PARAMETERS {
2603 LARGE_INTEGER Capacity;
2604 LARGE_INTEGER Remaining;
2605 DWORD BlockSize;
2606 DWORD PartitionCount;
2607 BOOLEAN WriteProtected;
2608 } TAPE_GET_MEDIA_PARAMETERS,*PTAPE_GET_MEDIA_PARAMETERS;
2609 typedef struct _TAPE_GET_POSITION {
2610 ULONG Type;
2611 ULONG Partition;
2612 ULONG OffsetLow;
2613 ULONG OffsetHigh;
2614 } TAPE_GET_POSITION,*PTAPE_GET_POSITION;
2615 typedef struct _TAPE_PREPARE {
2616 DWORD Operation;
2617 BOOLEAN Immediate;
2618 } TAPE_PREPARE,*PTAPE_PREPARE;
2619 typedef struct _TAPE_SET_DRIVE_PARAMETERS {
2620 BOOLEAN ECC;
2621 BOOLEAN Compression;
2622 BOOLEAN DataPadding;
2623 BOOLEAN ReportSetmarks;
2624 ULONG EOTWarningZoneSize;
2625 } TAPE_SET_DRIVE_PARAMETERS,*PTAPE_SET_DRIVE_PARAMETERS;
2626 typedef struct _TAPE_SET_MEDIA_PARAMETERS {
2627 ULONG BlockSize;
2628 } TAPE_SET_MEDIA_PARAMETERS,*PTAPE_SET_MEDIA_PARAMETERS;
2629 typedef struct _TAPE_SET_POSITION {
2630 DWORD Method;
2631 DWORD Partition;
2632 LARGE_INTEGER Offset;
2633 BOOLEAN Immediate;
2634 } TAPE_SET_POSITION,*PTAPE_SET_POSITION;
2635 typedef struct _TAPE_WRITE_MARKS {
2636 DWORD Type;
2637 DWORD Count;
2638 BOOLEAN Immediate;
2639 } TAPE_WRITE_MARKS,*PTAPE_WRITE_MARKS;
2640 typedef struct _TAPE_CREATE_PARTITION {
2641 DWORD Method;
2642 DWORD Count;
2643 DWORD Size;
2644 } TAPE_CREATE_PARTITION,*PTAPE_CREATE_PARTITION;
2645 typedef struct _MEMORY_BASIC_INFORMATION {
2646 PVOID BaseAddress;
2647 PVOID AllocationBase;
2648 DWORD AllocationProtect;
2649 DWORD RegionSize;
2650 DWORD State;
2651 DWORD Protect;
2652 DWORD Type;
2653 } MEMORY_BASIC_INFORMATION,*PMEMORY_BASIC_INFORMATION;
2654 typedef struct _MESSAGE_RESOURCE_ENTRY {
2655 WORD Length;
2656 WORD Flags;
2657 BYTE Text[1];
2658 } MESSAGE_RESOURCE_ENTRY,*PMESSAGE_RESOURCE_ENTRY;
2659 typedef struct _MESSAGE_RESOURCE_BLOCK {
2660 DWORD LowId;
2661 DWORD HighId;
2662 DWORD OffsetToEntries;
2663 } MESSAGE_RESOURCE_BLOCK,*PMESSAGE_RESOURCE_BLOCK;
2664 typedef struct _MESSAGE_RESOURCE_DATA {
2665 DWORD NumberOfBlocks;
2666 MESSAGE_RESOURCE_BLOCK Blocks[1];
2667 } MESSAGE_RESOURCE_DATA,*PMESSAGE_RESOURCE_DATA;
2668 typedef struct _LIST_ENTRY {
2669 struct _LIST_ENTRY *Flink;
2670 struct _LIST_ENTRY *Blink;
2671 } LIST_ENTRY,*PLIST_ENTRY;
2672 typedef struct _SINGLE_LIST_ENTRY {
2673 struct _SINGLE_LIST_ENTRY *Next;
2674 } SINGLE_LIST_ENTRY,*PSINGLE_LIST_ENTRY;
2675
2676 #ifndef _SLIST_HEADER_
2677 #define _SLIST_HEADER_
2678 #define SLIST_ENTRY SINGLE_LIST_ENTRY
2679 #define _SLIST_ENTRY _SINGLE_LIST_ENTRY
2680 #define PSLIST_ENTRY PSINGLE_LIST_ENTRY
2681 typedef union _SLIST_HEADER {
2682 ULONGLONG Alignment;
2683 _ANONYMOUS_STRUCT struct {
2684 SLIST_ENTRY Next;
2685 WORD Depth;
2686 WORD Sequence;
2687 } DUMMYSTRUCTNAME;
2688 } SLIST_HEADER,*PSLIST_HEADER;
2689 #endif /* !_SLIST_HEADER_ */
2690
2691 typedef struct _RTL_CRITICAL_SECTION_DEBUG {
2692 WORD Type;
2693 WORD CreatorBackTraceIndex;
2694 struct _RTL_CRITICAL_SECTION *CriticalSection;
2695 LIST_ENTRY ProcessLocksList;
2696 DWORD EntryCount;
2697 DWORD ContentionCount;
2698 DWORD Spare[2];
2699 } RTL_CRITICAL_SECTION_DEBUG,*PRTL_CRITICAL_SECTION_DEBUG;
2700 typedef struct _RTL_CRITICAL_SECTION {
2701 PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
2702 LONG LockCount;
2703 LONG RecursionCount;
2704 HANDLE OwningThread;
2705 HANDLE LockSemaphore;
2706 DWORD Reserved;
2707 } RTL_CRITICAL_SECTION,*PRTL_CRITICAL_SECTION;
2708 typedef struct _EVENTLOGRECORD {
2709 DWORD Length;
2710 DWORD Reserved;
2711 DWORD RecordNumber;
2712 DWORD TimeGenerated;
2713 DWORD TimeWritten;
2714 DWORD EventID;
2715 WORD EventType;
2716 WORD NumStrings;
2717 WORD EventCategory;
2718 WORD ReservedFlags;
2719 DWORD ClosingRecordNumber;
2720 DWORD StringOffset;
2721 DWORD UserSidLength;
2722 DWORD UserSidOffset;
2723 DWORD DataLength;
2724 DWORD DataOffset;
2725 } EVENTLOGRECORD,*PEVENTLOGRECORD;
2726 typedef struct _OSVERSIONINFOA {
2727 DWORD dwOSVersionInfoSize;
2728 DWORD dwMajorVersion;
2729 DWORD dwMinorVersion;
2730 DWORD dwBuildNumber;
2731 DWORD dwPlatformId;
2732 CHAR szCSDVersion[128];
2733 } OSVERSIONINFOA,*POSVERSIONINFOA,*LPOSVERSIONINFOA;
2734 typedef struct _OSVERSIONINFOW {
2735 DWORD dwOSVersionInfoSize;
2736 DWORD dwMajorVersion;
2737 DWORD dwMinorVersion;
2738 DWORD dwBuildNumber;
2739 DWORD dwPlatformId;
2740 WCHAR szCSDVersion[128];
2741 } OSVERSIONINFOW,*POSVERSIONINFOW,*LPOSVERSIONINFOW;
2742 typedef struct _OSVERSIONINFOEXA {
2743 DWORD dwOSVersionInfoSize;
2744 DWORD dwMajorVersion;
2745 DWORD dwMinorVersion;
2746 DWORD dwBuildNumber;
2747 DWORD dwPlatformId;
2748 CHAR szCSDVersion[128];
2749 WORD wServicePackMajor;
2750 WORD wServicePackMinor;
2751 WORD wSuiteMask;
2752 BYTE wProductType;
2753 BYTE wReserved;
2754 } OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA;
2755 typedef struct _OSVERSIONINFOEXW {
2756 DWORD dwOSVersionInfoSize;
2757 DWORD dwMajorVersion;
2758 DWORD dwMinorVersion;
2759 DWORD dwBuildNumber;
2760 DWORD dwPlatformId;
2761 WCHAR szCSDVersion[128];
2762 WORD wServicePackMajor;
2763 WORD wServicePackMinor;
2764 WORD wSuiteMask;
2765 BYTE wProductType;
2766 BYTE wReserved;
2767 } OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW;
2768 #pragma pack(push,2)
2769 typedef struct _IMAGE_VXD_HEADER {
2770 WORD e32_magic;
2771 BYTE e32_border;
2772 BYTE e32_worder;
2773 DWORD e32_level;
2774 WORD e32_cpu;
2775 WORD e32_os;
2776 DWORD e32_ver;
2777 DWORD e32_mflags;
2778 DWORD e32_mpages;
2779 DWORD e32_startobj;
2780 DWORD e32_eip;
2781 DWORD e32_stackobj;
2782 DWORD e32_esp;
2783 DWORD e32_pagesize;
2784 DWORD e32_lastpagesize;
2785 DWORD e32_fixupsize;
2786 DWORD e32_fixupsum;
2787 DWORD e32_ldrsize;
2788 DWORD e32_ldrsum;
2789 DWORD e32_objtab;
2790 DWORD e32_objcnt;
2791 DWORD e32_objmap;
2792 DWORD e32_itermap;
2793 DWORD e32_rsrctab;
2794 DWORD e32_rsrccnt;
2795 DWORD e32_restab;
2796 DWORD e32_enttab;
2797 DWORD e32_dirtab;
2798 DWORD e32_dircnt;
2799 DWORD e32_fpagetab;
2800 DWORD e32_frectab;
2801 DWORD e32_impmod;
2802 DWORD e32_impmodcnt;
2803 DWORD e32_impproc;
2804 DWORD e32_pagesum;
2805 DWORD e32_datapage;
2806 DWORD e32_preload;
2807 DWORD e32_nrestab;
2808 DWORD e32_cbnrestab;
2809 DWORD e32_nressum;
2810 DWORD e32_autodata;
2811 DWORD e32_debuginfo;
2812 DWORD e32_debuglen;
2813 DWORD e32_instpreload;
2814 DWORD e32_instdemand;
2815 DWORD e32_heapsize;
2816 BYTE e32_res3[12];
2817 DWORD e32_winresoff;
2818 DWORD e32_winreslen;
2819 WORD e32_devid;
2820 WORD e32_ddkver;
2821 } IMAGE_VXD_HEADER,*PIMAGE_VXD_HEADER;
2822 #pragma pack(pop)
2823 #pragma pack(push,4)
2824 typedef struct _IMAGE_FILE_HEADER {
2825 WORD Machine;
2826 WORD NumberOfSections;
2827 DWORD TimeDateStamp;
2828 DWORD PointerToSymbolTable;
2829 DWORD NumberOfSymbols;
2830 WORD SizeOfOptionalHeader;
2831 WORD Characteristics;
2832 } IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;
2833 typedef struct _IMAGE_DATA_DIRECTORY {
2834 DWORD VirtualAddress;
2835 DWORD Size;
2836 } IMAGE_DATA_DIRECTORY,*PIMAGE_DATA_DIRECTORY;
2837 typedef struct _IMAGE_OPTIONAL_HEADER {
2838 WORD Magic;
2839 BYTE MajorLinkerVersion;
2840 BYTE MinorLinkerVersion;
2841 DWORD SizeOfCode;
2842 DWORD SizeOfInitializedData;
2843 DWORD SizeOfUninitializedData;
2844 DWORD AddressOfEntryPoint;
2845 DWORD BaseOfCode;
2846 DWORD BaseOfData;
2847 DWORD ImageBase;
2848 DWORD SectionAlignment;
2849 DWORD FileAlignment;
2850 WORD MajorOperatingSystemVersion;
2851 WORD MinorOperatingSystemVersion;
2852 WORD MajorImageVersion;
2853 WORD MinorImageVersion;
2854 WORD MajorSubsystemVersion;
2855 WORD MinorSubsystemVersion;
2856 DWORD Win32VersionValue;
2857 DWORD SizeOfImage;
2858 DWORD SizeOfHeaders;
2859 DWORD CheckSum;
2860 WORD Subsystem;
2861 WORD DllCharacteristics;
2862 DWORD SizeOfStackReserve;
2863 DWORD SizeOfStackCommit;
2864 DWORD SizeOfHeapReserve;
2865 DWORD SizeOfHeapCommit;
2866 DWORD LoaderFlags;
2867 DWORD NumberOfRvaAndSizes;
2868 IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
2869 } IMAGE_OPTIONAL_HEADER32,*PIMAGE_OPTIONAL_HEADER32;
2870 typedef struct _IMAGE_OPTIONAL_HEADER64 {
2871 WORD Magic;
2872 BYTE MajorLinkerVersion;
2873 BYTE MinorLinkerVersion;
2874 DWORD SizeOfCode;
2875 DWORD SizeOfInitializedData;
2876 DWORD SizeOfUninitializedData;
2877 DWORD AddressOfEntryPoint;
2878 DWORD BaseOfCode;
2879 ULONGLONG ImageBase;
2880 DWORD SectionAlignment;
2881 DWORD FileAlignment;
2882 WORD MajorOperatingSystemVersion;
2883 WORD MinorOperatingSystemVersion;
2884 WORD MajorImageVersion;
2885 WORD MinorImageVersion;
2886 WORD MajorSubsystemVersion;
2887 WORD MinorSubsystemVersion;
2888 DWORD Win32VersionValue;
2889 DWORD SizeOfImage;
2890 DWORD SizeOfHeaders;
2891 DWORD CheckSum;
2892 WORD Subsystem;
2893 WORD DllCharacteristics;
2894 ULONGLONG SizeOfStackReserve;
2895 ULONGLONG SizeOfStackCommit;
2896 ULONGLONG SizeOfHeapReserve;
2897 ULONGLONG SizeOfHeapCommit;
2898 DWORD LoaderFlags;
2899 DWORD NumberOfRvaAndSizes;
2900 IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
2901 } IMAGE_OPTIONAL_HEADER64,*PIMAGE_OPTIONAL_HEADER64;
2902 #ifdef _WIN64
2903 typedef IMAGE_OPTIONAL_HEADER64 IMAGE_OPTIONAL_HEADER;
2904 typedef PIMAGE_OPTIONAL_HEADER64 PIMAGE_OPTIONAL_HEADER;
2905 #else
2906 typedef IMAGE_OPTIONAL_HEADER32 IMAGE_OPTIONAL_HEADER;
2907 typedef PIMAGE_OPTIONAL_HEADER32 PIMAGE_OPTIONAL_HEADER;
2908 #endif
2909 typedef struct _IMAGE_ROM_OPTIONAL_HEADER {
2910 WORD Magic;
2911 BYTE MajorLinkerVersion;
2912 BYTE MinorLinkerVersion;
2913 DWORD SizeOfCode;
2914 DWORD SizeOfInitializedData;
2915 DWORD SizeOfUninitializedData;
2916 DWORD AddressOfEntryPoint;
2917 DWORD BaseOfCode;
2918 DWORD BaseOfData;
2919 DWORD BaseOfBss;
2920 DWORD GprMask;
2921 DWORD CprMask[4];
2922 DWORD GpValue;
2923 } IMAGE_ROM_OPTIONAL_HEADER,*PIMAGE_ROM_OPTIONAL_HEADER;
2924 #pragma pack(pop)
2925 #pragma pack(push,2)
2926 typedef struct _IMAGE_DOS_HEADER {
2927 WORD e_magic;
2928 WORD e_cblp;
2929 WORD e_cp;
2930 WORD e_crlc;
2931 WORD e_cparhdr;
2932 WORD e_minalloc;
2933 WORD e_maxalloc;
2934 WORD e_ss;
2935 WORD e_sp;
2936 WORD e_csum;
2937 WORD e_ip;
2938 WORD e_cs;
2939 WORD e_lfarlc;
2940 WORD e_ovno;
2941 WORD e_res[4];
2942 WORD e_oemid;
2943 WORD e_oeminfo;
2944 WORD e_res2[10];
2945 LONG e_lfanew;
2946 } IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER;
2947 typedef struct _IMAGE_OS2_HEADER {
2948 WORD ne_magic;
2949 CHAR ne_ver;
2950 CHAR ne_rev;
2951 WORD ne_enttab;
2952 WORD ne_cbenttab;
2953 LONG ne_crc;
2954 WORD ne_flags;
2955 WORD ne_autodata;
2956 WORD ne_heap;
2957 WORD ne_stack;
2958 LONG ne_csip;
2959 LONG ne_sssp;
2960 WORD ne_cseg;
2961 WORD ne_cmod;
2962 WORD ne_cbnrestab;
2963 WORD ne_segtab;
2964 WORD ne_rsrctab;
2965 WORD ne_restab;
2966 WORD ne_modtab;
2967 WORD ne_imptab;
2968 LONG ne_nrestab;
2969 WORD ne_cmovent;
2970 WORD ne_align;
2971 WORD ne_cres;
2972 BYTE ne_exetyp;
2973 BYTE ne_flagsothers;
2974 WORD ne_pretthunks;
2975 WORD ne_psegrefbytes;
2976 WORD ne_swaparea;
2977 WORD ne_expver;
2978 } IMAGE_OS2_HEADER,*PIMAGE_OS2_HEADER;
2979 #pragma pack(pop)
2980 #pragma pack(push,4)
2981 typedef struct _IMAGE_NT_HEADERS {
2982 DWORD Signature;
2983 IMAGE_FILE_HEADER FileHeader;
2984 IMAGE_OPTIONAL_HEADER OptionalHeader;
2985 } IMAGE_NT_HEADERS32,*PIMAGE_NT_HEADERS32;
2986 typedef struct _IMAGE_NT_HEADERS64 {
2987 DWORD Signature;
2988 IMAGE_FILE_HEADER FileHeader;
2989 IMAGE_OPTIONAL_HEADER OptionalHeader;
2990 } IMAGE_NT_HEADERS64,*PIMAGE_NT_HEADERS64;
2991 #ifdef _WIN64
2992 typedef IMAGE_NT_HEADERS64 IMAGE_NT_HEADERS;
2993 typedef PIMAGE_NT_HEADERS64 PIMAGE_NT_HEADERS;
2994 #else
2995 typedef IMAGE_NT_HEADERS32 IMAGE_NT_HEADERS;
2996 typedef PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS;
2997 #endif
2998 typedef struct _IMAGE_ROM_HEADERS {
2999 IMAGE_FILE_HEADER FileHeader;
3000 IMAGE_ROM_OPTIONAL_HEADER OptionalHeader;
3001 } IMAGE_ROM_HEADERS,*PIMAGE_ROM_HEADERS;
3002 typedef struct _IMAGE_SECTION_HEADER {
3003 BYTE Name[IMAGE_SIZEOF_SHORT_NAME];
3004 union {
3005 DWORD PhysicalAddress;
3006 DWORD VirtualSize;
3007 } Misc;
3008 DWORD VirtualAddress;
3009 DWORD SizeOfRawData;
3010 DWORD PointerToRawData;
3011 DWORD PointerToRelocations;
3012 DWORD PointerToLinenumbers;
3013 WORD NumberOfRelocations;
3014 WORD NumberOfLinenumbers;
3015 DWORD Characteristics;
3016 } IMAGE_SECTION_HEADER,*PIMAGE_SECTION_HEADER;
3017 #pragma pack(pop)
3018 #pragma pack(push,2)
3019 typedef struct _IMAGE_SYMBOL {
3020 union {
3021 BYTE ShortName[8];
3022 struct {
3023 DWORD Short;
3024 DWORD Long;
3025 } Name;
3026 PBYTE LongName[2];
3027 } N;
3028 DWORD Value;
3029 SHORT SectionNumber;
3030 WORD Type;
3031 BYTE StorageClass;
3032 BYTE NumberOfAuxSymbols;
3033 } IMAGE_SYMBOL,*PIMAGE_SYMBOL;
3034 typedef union _IMAGE_AUX_SYMBOL {
3035 struct {
3036 DWORD TagIndex;
3037 union {
3038 struct {
3039 WORD Linenumber;
3040 WORD Size;
3041 } LnSz;
3042 DWORD TotalSize;
3043 } Misc;
3044 union {
3045 struct {
3046 DWORD PointerToLinenumber;
3047 DWORD PointerToNextFunction;
3048 } Function;
3049 struct {
3050 WORD Dimension[4];
3051 } Array;
3052 } FcnAry;
3053 WORD TvIndex;
3054 } Sym;
3055 struct {
3056 BYTE Name[IMAGE_SIZEOF_SYMBOL];
3057 } File;
3058 struct {
3059 DWORD Length;
3060 WORD NumberOfRelocations;
3061 WORD NumberOfLinenumbers;
3062 DWORD CheckSum;
3063 SHORT Number;
3064 BYTE Selection;
3065 } Section;
3066 } IMAGE_AUX_SYMBOL,*PIMAGE_AUX_SYMBOL;
3067 typedef struct _IMAGE_COFF_SYMBOLS_HEADER {
3068 DWORD NumberOfSymbols;
3069 DWORD LvaToFirstSymbol;
3070 DWORD NumberOfLinenumbers;
3071 DWORD LvaToFirstLinenumber;
3072 DWORD RvaToFirstByteOfCode;
3073 DWORD RvaToLastByteOfCode;
3074 DWORD RvaToFirstByteOfData;
3075 DWORD RvaToLastByteOfData;
3076 } IMAGE_COFF_SYMBOLS_HEADER,*PIMAGE_COFF_SYMBOLS_HEADER;
3077 typedef struct _IMAGE_RELOCATION {
3078 _ANONYMOUS_UNION union {
3079 DWORD VirtualAddress;
3080 DWORD RelocCount;
3081 } DUMMYUNIONNAME;
3082 DWORD SymbolTableIndex;
3083 WORD Type;
3084 } IMAGE_RELOCATION,*PIMAGE_RELOCATION;
3085 #pragma pack(pop)
3086 #pragma pack(push,4)
3087 typedef struct _IMAGE_BASE_RELOCATION {
3088 DWORD VirtualAddress;
3089 DWORD SizeOfBlock;
3090 } IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION;
3091 #pragma pack(pop)
3092 #pragma pack(push,2)
3093 typedef struct _IMAGE_LINENUMBER {
3094 union {
3095 DWORD SymbolTableIndex;
3096 DWORD VirtualAddress;
3097 } Type;
3098 WORD Linenumber;
3099 } IMAGE_LINENUMBER,*PIMAGE_LINENUMBER;
3100 #pragma pack(pop)
3101 #pragma pack(push,4)
3102 typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER {
3103 BYTE Name[16];
3104 BYTE Date[12];
3105 BYTE UserID[6];
3106 BYTE GroupID[6];
3107 BYTE Mode[8];
3108 BYTE Size[10];
3109 BYTE EndHeader[2];
3110 } IMAGE_ARCHIVE_MEMBER_HEADER,*PIMAGE_ARCHIVE_MEMBER_HEADER;
3111 typedef struct _IMAGE_EXPORT_DIRECTORY {
3112 DWORD Characteristics;
3113 DWORD TimeDateStamp;
3114 WORD MajorVersion;
3115 WORD MinorVersion;
3116 DWORD Name;
3117 DWORD Base;
3118 DWORD NumberOfFunctions;
3119 DWORD NumberOfNames;
3120 DWORD AddressOfFunctions;
3121 DWORD AddressOfNames;
3122 DWORD AddressOfNameOrdinals;
3123 } IMAGE_EXPORT_DIRECTORY,*PIMAGE_EXPORT_DIRECTORY;
3124 typedef struct _IMAGE_IMPORT_BY_NAME {
3125 WORD Hint;
3126 BYTE Name[1];
3127 } IMAGE_IMPORT_BY_NAME,*PIMAGE_IMPORT_BY_NAME;
3128 typedef struct _IMAGE_THUNK_DATA32 {
3129 union {
3130 DWORD ForwarderString;
3131 DWORD Function;
3132 DWORD Ordinal;
3133 DWORD AddressOfData;
3134 } u1;
3135 } IMAGE_THUNK_DATA32,*PIMAGE_THUNK_DATA32;
3136 typedef struct _IMAGE_THUNK_DATA64 {
3137 union {
3138 ULONGLONG ForwarderString;
3139 ULONGLONG Function;
3140 ULONGLONG Ordinal;
3141 ULONGLONG AddressOfData;
3142 } u1;
3143 } IMAGE_THUNK_DATA64, *PIMAGE_THUNK_DATA64;
3144 #ifdef __WIN64
3145 typedef IMAGE_THUNK_DATA64 IMAGE_THUNK_DATA;
3146 typedef PIMAGE_THUNK_DATA64 PIMAGE_THUNK_DATA;
3147 #else
3148 typedef IMAGE_THUNK_DATA32 IMAGE_THUNK_DATA;
3149 typedef PIMAGE_THUNK_DATA32 PIMAGE_THUNK_DATA;
3150 #endif
3151 typedef struct _IMAGE_IMPORT_DESCRIPTOR {
3152 _ANONYMOUS_UNION union {
3153 DWORD Characteristics;
3154 DWORD OriginalFirstThunk;
3155 } DUMMYUNIONNAME;
3156 DWORD TimeDateStamp;
3157 DWORD ForwarderChain;
3158 DWORD Name;
3159 DWORD FirstThunk;
3160 } IMAGE_IMPORT_DESCRIPTOR,*PIMAGE_IMPORT_DESCRIPTOR;
3161 typedef struct _IMAGE_BOUND_IMPORT_DESCRIPTOR {
3162 DWORD TimeDateStamp;
3163 WORD OffsetModuleName;
3164 WORD NumberOfModuleForwarderRefs;
3165 } IMAGE_BOUND_IMPORT_DESCRIPTOR,*PIMAGE_BOUND_IMPORT_DESCRIPTOR;
3166 typedef struct _IMAGE_BOUND_FORWARDER_REF {
3167 DWORD TimeDateStamp;
3168 WORD OffsetModuleName;
3169 WORD Reserved;
3170 } IMAGE_BOUND_FORWARDER_REF,*PIMAGE_BOUND_FORWARDER_REF;
3171 typedef void(NTAPI *PIMAGE_TLS_CALLBACK)(PVOID,DWORD,PVOID);
3172 typedef struct _IMAGE_TLS_DIRECTORY32 {
3173 DWORD StartAddressOfRawData;
3174 DWORD EndAddressOfRawData;
3175 DWORD AddressOfIndex;
3176 DWORD AddressOfCallBacks;
3177 DWORD SizeOfZeroFill;
3178 DWORD Characteristics;
3179 } IMAGE_TLS_DIRECTORY32,*PIMAGE_TLS_DIRECTORY32;
3180 typedef struct _IMAGE_TLS_DIRECTORY64 {
3181 ULONGLONG StartAddressOfRawData;
3182 ULONGLONG EndAddressOfRawData;
3183 ULONGLONG AddressOfIndex;
3184 ULONGLONG AddressOfCallBacks;
3185 DWORD SizeOfZeroFill;
3186 DWORD Characteristics;
3187 } IMAGE_TLS_DIRECTORY64, *PIMAGE_TLS_DIRECTORY64;
3188 #ifdef __WIN64
3189 typedef IMAGE_TLS_DIRECTORY64 IMAGE_TLS_DIRECTORY;
3190 typedef PIMAGE_TLS_DIRECTORY64 PIMAGE_TLS_DIRECTORY;
3191 #else
3192 typedef IMAGE_TLS_DIRECTORY32 IMAGE_TLS_DIRECTORY;
3193 typedef PIMAGE_TLS_DIRECTORY32 PIMAGE_TLS_DIRECTORY;
3194 #endif
3195 typedef struct _IMAGE_RESOURCE_DIRECTORY {
3196 DWORD Characteristics;
3197 DWORD TimeDateStamp;
3198 WORD MajorVersion;
3199 WORD MinorVersion;
3200 WORD NumberOfNamedEntries;
3201 WORD NumberOfIdEntries;
3202 } IMAGE_RESOURCE_DIRECTORY,*PIMAGE_RESOURCE_DIRECTORY;
3203 _ANONYMOUS_STRUCT typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
3204 _ANONYMOUS_UNION union {
3205 _ANONYMOUS_STRUCT struct {
3206 DWORD NameOffset:31;
3207 DWORD NameIsString:1;
3208 }DUMMYSTRUCTNAME;
3209 DWORD Name;
3210 WORD Id;
3211 } DUMMYUNIONNAME;
3212 _ANONYMOUS_UNION union {
3213 DWORD OffsetToData;
3214 _ANONYMOUS_STRUCT struct {
3215 DWORD OffsetToDirectory:31;
3216 DWORD DataIsDirectory:1;
3217 } DUMMYSTRUCTNAME2;
3218 } DUMMYUNIONNAME2;
3219 } IMAGE_RESOURCE_DIRECTORY_ENTRY,*PIMAGE_RESOURCE_DIRECTORY_ENTRY;
3220 typedef struct _IMAGE_RESOURCE_DIRECTORY_STRING {
3221 WORD Length;
3222 CHAR NameString[1];
3223 } IMAGE_RESOURCE_DIRECTORY_STRING,*PIMAGE_RESOURCE_DIRECTORY_STRING;
3224 typedef struct _IMAGE_RESOURCE_DIR_STRING_U {
3225 WORD Length;
3226 WCHAR NameString[1];
3227 } IMAGE_RESOURCE_DIR_STRING_U,*PIMAGE_RESOURCE_DIR_STRING_U;
3228 typedef struct _IMAGE_RESOURCE_DATA_ENTRY {
3229 DWORD OffsetToData;
3230 DWORD Size;
3231 DWORD CodePage;
3232 DWORD Reserved;
3233 } IMAGE_RESOURCE_DATA_ENTRY,*PIMAGE_RESOURCE_DATA_ENTRY;
3234 typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY {
3235 DWORD Characteristics;
3236 DWORD TimeDateStamp;
3237 WORD MajorVersion;
3238 WORD MinorVersion;
3239 DWORD GlobalFlagsClear;
3240 DWORD GlobalFlagsSet;
3241 DWORD CriticalSectionDefaultTimeout;
3242 DWORD DeCommitFreeBlockThreshold;
3243 DWORD DeCommitTotalFreeThreshold;
3244 PVOID LockPrefixTable;
3245 DWORD MaximumAllocationSize;
3246 DWORD VirtualMemoryThreshold;
3247 DWORD ProcessHeapFlags;
3248 DWORD Reserved[4];
3249 } IMAGE_LOAD_CONFIG_DIRECTORY,*PIMAGE_LOAD_CONFIG_DIRECTORY;
3250 typedef struct {
3251 DWORD Characteristics;
3252 DWORD TimeDateStamp;
3253 WORD MajorVersion;
3254 WORD MinorVersion;
3255 DWORD GlobalFlagsClear;
3256 DWORD GlobalFlagsSet;
3257 DWORD CriticalSectionDefaultTimeout;
3258 ULONGLONG DeCommitFreeBlockThreshold;
3259 ULONGLONG DeCommitTotalFreeThreshold;
3260 ULONGLONG LockPrefixTable;
3261 ULONGLONG MaximumAllocationSize;
3262 ULONGLONG VirtualMemoryThreshold;
3263 ULONGLONG ProcessAffinityMask;
3264 DWORD ProcessHeapFlags;
3265 WORD CSDFlags;
3266 WORD Reserved1;
3267 ULONGLONG EditList;
3268 DWORD Reserved[2];
3269 } IMAGE_LOAD_CONFIG_DIRECTORY64,*PIMAGE_LOAD_CONFIG_DIRECTORY64;
3270 typedef struct _IMAGE_RUNTIME_FUNCTION_ENTRY {
3271 DWORD BeginAddress;
3272 DWORD EndAddress;
3273 PVOID ExceptionHandler;
3274 PVOID HandlerData;
3275 DWORD PrologEndAddress;
3276 } IMAGE_RUNTIME_FUNCTION_ENTRY,*PIMAGE_RUNTIME_FUNCTION_ENTRY;
3277 typedef struct _IMAGE_CE_RUNTIME_FUNCTION_ENTRY {
3278 unsigned int FuncStart:32;
3279 unsigned int PrologLen:8;
3280 unsigned int FuncLen:22;
3281 unsigned int ThirtyTwoBit:1;
3282 unsigned int ExceptionFlag:1;
3283 } IMAGE_CE_RUNTIME_FUNCTION_ENTRY,*PIMAGE_CE_RUNTIME_FUNCTION_ENTRY;
3284 typedef struct _IMAGE_DEBUG_DIRECTORY {
3285 DWORD Characteristics;
3286 DWORD TimeDateStamp;
3287 WORD MajorVersion;
3288 WORD MinorVersion;
3289 DWORD Type;
3290 DWORD SizeOfData;
3291 DWORD AddressOfRawData;
3292 DWORD PointerToRawData;
3293 } IMAGE_DEBUG_DIRECTORY,*PIMAGE_DEBUG_DIRECTORY;
3294 typedef struct _FPO_DATA {
3295 DWORD ulOffStart;
3296 DWORD cbProcSize;
3297 DWORD cdwLocals;
3298 WORD cdwParams;
3299 WORD cbProlog:8;
3300 WORD cbRegs:3;
3301 WORD fHasSEH:1;
3302 WORD fUseBP:1;
3303 WORD reserved:1;
3304 WORD cbFrame:2;
3305 } FPO_DATA,*PFPO_DATA;
3306 typedef struct _IMAGE_DEBUG_MISC {
3307 DWORD DataType;
3308 DWORD Length;
3309 BOOLEAN Unicode;
3310 BYTE Reserved[3];
3311 BYTE Data[1];
3312 } IMAGE_DEBUG_MISC,*PIMAGE_DEBUG_MISC;
3313 typedef struct _IMAGE_FUNCTION_ENTRY {
3314 DWORD StartingAddress;
3315 DWORD EndingAddress;
3316 DWORD EndOfPrologue;
3317 } IMAGE_FUNCTION_ENTRY,*PIMAGE_FUNCTION_ENTRY;
3318 typedef struct _IMAGE_FUNCTION_ENTRY64 {
3319 ULONGLONG StartingAddress;
3320 ULONGLONG EndingAddress;
3321 _ANONYMOUS_UNION union {
3322 ULONGLONG EndOfPrologue;
3323 ULONGLONG UnwindInfoAddress;
3324 } DUMMYUNIONNAME;
3325 } IMAGE_FUNCTION_ENTRY64,*PIMAGE_FUNCTION_ENTRY64;
3326 typedef struct _IMAGE_SEPARATE_DEBUG_HEADER {
3327 WORD Signature;
3328 WORD Flags;
3329 WORD Machine;
3330 WORD Characteristics;
3331 DWORD TimeDateStamp;
3332 DWORD CheckSum;
3333 DWORD ImageBase;
3334 DWORD SizeOfImage;
3335 DWORD NumberOfSections;
3336 DWORD ExportedNamesSize;
3337 DWORD DebugDirectorySize;
3338 DWORD SectionAlignment;
3339 DWORD Reserved[2];
3340 } IMAGE_SEPARATE_DEBUG_HEADER,*PIMAGE_SEPARATE_DEBUG_HEADER;
3341 #pragma pack(pop)
3342 typedef enum _CM_SERVICE_NODE_TYPE {
3343 DriverType=SERVICE_KERNEL_DRIVER,
3344 FileSystemType=SERVICE_FILE_SYSTEM_DRIVER,
3345 Win32ServiceOwnProcess=SERVICE_WIN32_OWN_PROCESS,
3346 Win32ServiceShareProcess=SERVICE_WIN32_SHARE_PROCESS,
3347 AdapterType=SERVICE_ADAPTER,
3348 RecognizerType=SERVICE_RECOGNIZER_DRIVER
3349 } SERVICE_NODE_TYPE;
3350 typedef enum _CM_SERVICE_LOAD_TYPE {
3351 BootLoad=SERVICE_BOOT_START,
3352 SystemLoad=SERVICE_SYSTEM_START,
3353 AutoLoad=SERVICE_AUTO_START,
3354 DemandLoad=SERVICE_DEMAND_START,
3355 DisableLoad=SERVICE_DISABLED
3356 } SERVICE_LOAD_TYPE;
3357 typedef enum _CM_ERROR_CONTROL_TYPE {
3358 IgnoreError=SERVICE_ERROR_IGNORE,
3359 NormalError=SERVICE_ERROR_NORMAL,
3360 SevereError=SERVICE_ERROR_SEVERE,
3361 CriticalError=SERVICE_ERROR_CRITICAL
3362 } SERVICE_ERROR_TYPE;
3363 typedef struct _NT_TIB {
3364 struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;
3365 PVOID StackBase;
3366 PVOID StackLimit;
3367 PVOID SubSystemTib;
3368 _ANONYMOUS_UNION union {
3369 PVOID FiberData;
3370 DWORD Version;
3371 } DUMMYUNIONNAME;
3372 PVOID ArbitraryUserPointer;
3373 struct _NT_TIB *Self;
3374 } NT_TIB,*PNT_TIB;
3375 typedef struct _REPARSE_DATA_BUFFER {
3376 DWORD ReparseTag;
3377 WORD ReparseDataLength;
3378 WORD Reserved;
3379 _ANONYMOUS_UNION union {
3380 struct {
3381 WORD SubstituteNameOffset;
3382 WORD SubstituteNameLength;
3383 WORD PrintNameOffset;
3384 WORD PrintNameLength;
3385 ULONG Flags;
3386 WCHAR PathBuffer[1];
3387 } SymbolicLinkReparseBuffer;
3388 struct {
3389 WORD SubstituteNameOffset;
3390 WORD SubstituteNameLength;
3391 WORD PrintNameOffset;
3392 WORD PrintNameLength;
3393 WCHAR PathBuffer[1];
3394 } MountPointReparseBuffer;
3395 struct {
3396 BYTE DataBuffer[1];
3397 } GenericReparseBuffer;
3398 } DUMMYUNIONNAME;
3399 } REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER;
3400 typedef struct _REPARSE_GUID_DATA_BUFFER {
3401 DWORD ReparseTag;
3402 WORD ReparseDataLength;
3403 WORD Reserved;
3404 GUID ReparseGuid;
3405 struct {
3406 BYTE DataBuffer[1];
3407 } GenericReparseBuffer;
3408 } REPARSE_GUID_DATA_BUFFER, *PREPARSE_GUID_DATA_BUFFER;
3409 typedef struct _REPARSE_POINT_INFORMATION {
3410 WORD ReparseDataLength;
3411 WORD UnparsedNameLength;
3412 } REPARSE_POINT_INFORMATION, *PREPARSE_POINT_INFORMATION;
3413
3414 typedef union _FILE_SEGMENT_ELEMENT {
3415 PVOID64 Buffer;
3416 ULONGLONG Alignment;
3417 }FILE_SEGMENT_ELEMENT, *PFILE_SEGMENT_ELEMENT;
3418
3419 /* JOBOBJECT_BASIC_LIMIT_INFORMATION.LimitFlags constants */
3420 #define JOB_OBJECT_LIMIT_WORKINGSET 0x0001
3421 #define JOB_OBJECT_LIMIT_PROCESS_TIME 0x0002
3422 #define JOB_OBJECT_LIMIT_JOB_TIME 0x0004
3423 #define JOB_OBJECT_LIMIT_ACTIVE_PROCESS 0x0008
3424 #define JOB_OBJECT_LIMIT_AFFINITY 0x0010
3425 #define JOB_OBJECT_LIMIT_PRIORITY_CLASS 0x0020
3426 #define JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME 0x0040
3427 #define JOB_OBJECT_LIMIT_SCHEDULING_CLASS 0x0080
3428 #define JOB_OBJECT_LIMIT_PROCESS_MEMORY 0x0100
3429 #define JOB_OBJECT_LIMIT_JOB_MEMORY 0x0200
3430 #define JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION 0x0400
3431 #define JOB_OBJECT_BREAKAWAY_OK 0x0800
3432 #define JOB_OBJECT_SILENT_BREAKAWAY 0x1000
3433
3434 /* JOBOBJECT_BASIC_UI_RESTRICTIONS.UIRestrictionsClass constants */
3435 #define JOB_OBJECT_UILIMIT_HANDLES 0x0001
3436 #define JOB_OBJECT_UILIMIT_READCLIPBOARD 0x0002
3437 #define JOB_OBJECT_UILIMIT_WRITECLIPBOARD 0x0004
3438 #define JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS 0x0008
3439 #define JOB_OBJECT_UILIMIT_DISPLAYSETTINGS 0x0010
3440 #define JOB_OBJECT_UILIMIT_GLOBALATOMS 0x0020
3441 #define JOB_OBJECT_UILIMIT_DESKTOP 0x0040
3442 #define JOB_OBJECT_UILIMIT_EXITWINDOWS 0x0080
3443
3444 /* JOBOBJECT_SECURITY_LIMIT_INFORMATION.SecurityLimitFlags constants */
3445 #define JOB_OBJECT_SECURITY_NO_ADMIN 0x0001
3446 #define JOB_OBJECT_SECURITY_RESTRICTED_TOKEN 0x0002
3447 #define JOB_OBJECT_SECURITY_ONLY_TOKEN 0x0004
3448 #define JOB_OBJECT_SECURITY_FILTER_TOKENS 0x0008
3449
3450 /* JOBOBJECT_END_OF_JOB_TIME_INFORMATION.EndOfJobTimeAction constants */
3451 #define JOB_OBJECT_TERMINATE_AT_END_OF_JOB 0
3452 #define JOB_OBJECT_POST_AT_END_OF_JOB 1
3453
3454 #define JOB_OBJECT_MSG_END_OF_JOB_TIME 1
3455 #define JOB_OBJECT_MSG_END_OF_PROCESS_TIME 2
3456 #define JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT 3
3457 #define JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO 4
3458 #define JOB_OBJECT_MSG_NEW_PROCESS 6
3459 #define JOB_OBJECT_MSG_EXIT_PROCESS 7
3460 #define JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS 8
3461 #define JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT 9
3462 #define JOB_OBJECT_MSG_JOB_MEMORY_LIMIT 10
3463
3464 typedef enum _JOBOBJECTINFOCLASS {
3465 JobObjectBasicAccountingInformation = 1,
3466 JobObjectBasicLimitInformation,
3467 JobObjectBasicProcessIdList,
3468 JobObjectBasicUIRestrictions,
3469 JobObjectSecurityLimitInformation,
3470 JobObjectEndOfJobTimeInformation,
3471 JobObjectAssociateCompletionPortInformation,
3472 JobObjectBasicAndIoAccountingInformation,
3473 JobObjectExtendedLimitInformation,
3474 JobObjectJobSetInformation,
3475 MaxJobObjectInfoClass
3476 } JOBOBJECTINFOCLASS;
3477 typedef struct _JOBOBJECT_BASIC_ACCOUNTING_INFORMATION {
3478 LARGE_INTEGER TotalUserTime;
3479 LARGE_INTEGER TotalKernelTime;
3480 LARGE_INTEGER ThisPeriodTotalUserTime;
3481 LARGE_INTEGER ThisPeriodTotalKernelTime;
3482 DWORD TotalPageFaultCount;
3483 DWORD TotalProcesses;
3484 DWORD ActiveProcesses;
3485 DWORD TotalTerminatedProcesses;
3486 } JOBOBJECT_BASIC_ACCOUNTING_INFORMATION,*
PJOBOBJECT_BASIC_ACCOUNTING_INFORMATION;
3487 typedef struct _JOBOBJECT_BASIC_LIMIT_INFORMATION {
3488 LARGE_INTEGER PerProcessUserTimeLimit;
3489 LARGE_INTEGER PerJobUserTimeLimit;
3490 DWORD LimitFlags;
3491 SIZE_T MinimumWorkingSetSize;
3492 SIZE_T MaximumWorkingSetSize;
3493 DWORD ActiveProcessLimit;
3494 ULONG_PTR Affinity;
3495 DWORD PriorityClass;
3496 DWORD SchedulingClass;
3497 } JOBOBJECT_BASIC_LIMIT_INFORMATION,*PJOBOBJECT_BASIC_LIMIT_INFORMATION;
3498 typedef struct _JOBOBJECT_BASIC_PROCESS_ID_LIST {
3499 DWORD NumberOfAssignedProcesses;
3500 DWORD NumberOfProcessIdsInList;
3501 ULONG_PTR ProcessIdList[1];
3502 } JOBOBJECT_BASIC_PROCESS_ID_LIST, *PJOBOBJECT_BASIC_PROCESS_ID_LIST;
3503 typedef struct _JOBOBJECT_BASIC_UI_RESTRICTIONS {
3504 DWORD UIRestrictionsClass;
3505 } JOBOBJECT_BASIC_UI_RESTRICTIONS,*PJOBOBJECT_BASIC_UI_RESTRICTIONS;
3506 typedef struct _JOBOBJECT_SECURITY_LIMIT_INFORMATION {
3507 DWORD SecurityLimitFlags;
3508 HANDLE JobToken;
3509 PTOKEN_GROUPS SidsToDisable;
3510 PTOKEN_PRIVILEGES PrivilegesToDelete;
3511 PTOKEN_GROUPS RestrictedSids;
3512 } JOBOBJECT_SECURITY_LIMIT_INFORMATION,*
PJOBOBJECT_SECURITY_LIMIT_INFORMATION;
3513 typedef struct _JOBOBJECT_END_OF_JOB_TIME_INFORMATION {
3514 DWORD EndOfJobTimeAction;
3515 } JOBOBJECT_END_OF_JOB_TIME_INFORMATION,*
PJOBOBJECT_END_OF_JOB_TIME_INFORMATION;
3516 typedef struct _JOBOBJECT_ASSOCIATE_COMPLETION_PORT {
3517 PVOID CompletionKey;
3518 HANDLE CompletionPort;
3519 } JOBOBJECT_ASSOCIATE_COMPLETION_PORT,*PJOBOBJECT_ASSOCIATE_COMPLETION_PORT
;
3520 typedef struct _JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION {
3521 JOBOBJECT_BASIC_ACCOUNTING_INFORMATION BasicInfo;
3522 IO_COUNTERS IoInfo;
3523 } JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION,*
PJOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION;
3524 typedef struct _JOBOBJECT_EXTENDED_LIMIT_INFORMATION {
3525 JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation;
3526 IO_COUNTERS IoInfo;
3527 SIZE_T ProcessMemoryLimit;
3528 SIZE_T JobMemoryLimit;
3529 SIZE_T PeakProcessMemoryUsed;
3530 SIZE_T PeakJobMemoryUsed;
3531 } JOBOBJECT_EXTENDED_LIMIT_INFORMATION,*
PJOBOBJECT_EXTENDED_LIMIT_INFORMATION;
3532 typedef struct _JOBOBJECT_JOBSET_INFORMATION {
3533 DWORD MemberLevel;
3534 } JOBOBJECT_JOBSET_INFORMATION,*PJOBOBJECT_JOBSET_INFORMATION;
3535
3536 /* Fixme: Making these defines conditional on WINVER will break ddk
includes */
3537 #if 1 /* (WINVER >= 0x0500) */
3538 #include <pshpack4.h>
3539
3540 #define ES_SYSTEM_REQUIRED 0x00000001
3541 #define ES_DISPLAY_REQUIRED 0x00000002
3542 #define ES_USER_PRESENT 0x00000004
3543 #define ES_CONTINUOUS 0x80000000
3544
3545 typedef enum _LATENCY_TIME {
3546 LT_DONT_CARE,
3547 LT_LOWEST_LATENCY
3548 } LATENCY_TIME, *PLATENCY_TIME;
3549
3550 typedef enum _SYSTEM_POWER_STATE {
3551 PowerSystemUnspecified,
3552 PowerSystemWorking,
3553 PowerSystemSleeping1,
3554 PowerSystemSleeping2,
3555 PowerSystemSleeping3,
3556 PowerSystemHibernate,
3557 PowerSystemShutdown,
3558 PowerSystemMaximum
3559 } SYSTEM_POWER_STATE, *PSYSTEM_POWER_STATE;
3560 #define POWER_SYSTEM_MAXIMUM PowerSystemMaximum
3561
3562 typedef enum {
3563 PowerActionNone,
3564 PowerActionReserved,
3565 PowerActionSleep,
3566 PowerActionHibernate,
3567 PowerActionShutdown,
3568 PowerActionShutdownReset,
3569 PowerActionShutdownOff,
3570 PowerActionWarmEject
3571 } POWER_ACTION, *PPOWER_ACTION;
3572
3573 #if (_WIN32_WINNT >= 0x0600)
3574 typedef enum {
3575 PoAc = 0,
3576 PoDc = 1,
3577 PoHot = 2,
3578 PoConditionMaximum = 3
3579 } SYSTEM_POWER_CONDITION, *PSYSTEM_POWER_CONDITION;
3580 #endif
3581
3582 typedef enum _DEVICE_POWER_STATE {
3583 PowerDeviceUnspecified,
3584 PowerDeviceD0,
3585 PowerDeviceD1,
3586 PowerDeviceD2,
3587 PowerDeviceD3,
3588 PowerDeviceMaximum
3589 } DEVICE_POWER_STATE, *PDEVICE_POWER_STATE;
3590
3591 typedef struct {
3592 DWORD Granularity;
3593 DWORD Capacity;
3594 } BATTERY_REPORTING_SCALE, *PBATTERY_REPORTING_SCALE;
3595
3596 typedef struct _POWER_ACTION_POLICY {
3597 POWER_ACTION Action;
3598 ULONG Flags;
3599 ULONG EventCode;
3600 } POWER_ACTION_POLICY, *PPOWER_ACTION_POLICY;
3601
3602 /* POWER_ACTION_POLICY.Flags constants */
3603 #define POWER_ACTION_QUERY_ALLOWED 0x00000001
3604 #define POWER_ACTION_UI_ALLOWED 0x00000002
3605 #define POWER_ACTION_OVERRIDE_APPS 0x00000004
3606 #define POWER_ACTION_LIGHTEST_FIRST 0x10000000
3607 #define POWER_ACTION_LOCK_CONSOLE 0x20000000
3608 #define POWER_ACTION_DISABLE_WAKES 0x40000000
3609 #define POWER_ACTION_CRITICAL 0x80000000
3610
3611 /* POWER_ACTION_POLICY.EventCode constants */
3612 #define POWER_LEVEL_USER_NOTIFY_TEXT 0x00000001
3613 #define POWER_LEVEL_USER_NOTIFY_SOUND 0x00000002
3614 #define POWER_LEVEL_USER_NOTIFY_EXEC 0x00000004
3615 #define POWER_USER_NOTIFY_BUTTON 0x00000008
3616 #define POWER_USER_NOTIFY_SHUTDOWN 0x00000010
3617 #define POWER_FORCE_TRIGGER_RESET 0x80000000
3618
3619 #define DISCHARGE_POLICY_CRITICAL 0
3620 #define DISCHARGE_POLICY_LOW 1
3621 #define NUM_DISCHARGE_POLICIES 4
3622
3623 #define PO_THROTTLE_NONE 0
3624 #define PO_THROTTLE_CONSTANT 1
3625 #define PO_THROTTLE_DEGRADE 2
3626 #define PO_THROTTLE_ADAPTIVE 3
3627 #define PO_THROTTLE_MAXIMUM 4
3628
3629 typedef struct _SYSTEM_POWER_LEVEL {
3630 BOOLEAN Enable;
3631 UCHAR Spare[3];
3632 ULONG BatteryLevel;
3633 POWER_ACTION_POLICY PowerPolicy;
3634 SYSTEM_POWER_STATE MinSystemState;
3635 } SYSTEM_POWER_LEVEL, *PSYSTEM_POWER_LEVEL;
3636
3637 typedef struct _SYSTEM_POWER_POLICY {
3638 ULONG Revision;
3639 POWER_ACTION_POLICY PowerButton;
3640 POWER_ACTION_POLICY SleepButton;
3641 POWER_ACTION_POLICY LidClose;
3642 SYSTEM_POWER_STATE LidOpenWake;
3643 ULONG Reserved;
3644 POWER_ACTION_POLICY Idle;
3645 ULONG IdleTimeout;
3646 UCHAR IdleSensitivity;
3647 UCHAR DynamicThrottle;
3648 UCHAR Spare2[2];
3649 SYSTEM_POWER_STATE MinSleep;
3650 SYSTEM_POWER_STATE MaxSleep;
3651 SYSTEM_POWER_STATE ReducedLatencySleep;
3652 ULONG WinLogonFlags;
3653 ULONG Spare3;
3654 ULONG DozeS4Timeout;
3655 ULONG BroadcastCapacityResolution;
3656 SYSTEM_POWER_LEVEL DischargePolicy[NUM_DISCHARGE_POLICIES];
3657 ULONG VideoTimeout;
3658 BOOLEAN VideoDimDisplay;
3659 ULONG VideoReserved[3];
3660 ULONG SpindownTimeout;
3661 BOOLEAN OptimizeForPower;
3662 UCHAR FanThrottleTolerance;
3663 UCHAR ForcedThrottle;
3664 UCHAR MinThrottle;
3665 POWER_ACTION_POLICY OverThrottled;
3666 } SYSTEM_POWER_POLICY, *PSYSTEM_POWER_POLICY;
3667
3668 typedef struct _SYSTEM_POWER_CAPABILITIES {
3669 BOOLEAN PowerButtonPresent;
3670 BOOLEAN SleepButtonPresent;
3671 BOOLEAN LidPresent;
3672 BOOLEAN SystemS1;
3673 BOOLEAN SystemS2;
3674 BOOLEAN SystemS3;
3675 BOOLEAN SystemS4;
3676 BOOLEAN SystemS5;
3677 BOOLEAN HiberFilePresent;
3678 BOOLEAN FullWake;
3679 BOOLEAN VideoDimPresent;
3680 BOOLEAN ApmPresent;
3681 BOOLEAN UpsPresent;
3682 BOOLEAN ThermalControl;
3683 BOOLEAN ProcessorThrottle;
3684 UCHAR ProcessorMinThrottle;
3685 UCHAR ProcessorMaxThrottle;
3686 UCHAR spare2[4];
3687 BOOLEAN DiskSpinDown;
3688 UCHAR spare3[8];
3689 BOOLEAN SystemBatteriesPresent;
3690 BOOLEAN BatteriesAreShortTerm;
3691 BATTERY_REPORTING_SCALE BatteryScale[3];
3692 SYSTEM_POWER_STATE AcOnLineWake;
3693 SYSTEM_POWER_STATE SoftLidWake;
3694 SYSTEM_POWER_STATE RtcWake;
3695 SYSTEM_POWER_STATE MinDeviceWakeState;
3696 SYSTEM_POWER_STATE DefaultLowLatencyWake;
3697 } SYSTEM_POWER_CAPABILITIES, *PSYSTEM_POWER_CAPABILITIES;
3698
3699 typedef struct _SYSTEM_BATTERY_STATE {
3700 BOOLEAN AcOnLine;
3701 BOOLEAN BatteryPresent;
3702 BOOLEAN Charging;
3703 BOOLEAN Discharging;
3704 BOOLEAN Spare1[4];
3705 ULONG MaxCapacity;
3706 ULONG RemainingCapacity;
3707 ULONG Rate;
3708 ULONG EstimatedTime;
3709 ULONG DefaultAlert1;
3710 ULONG DefaultAlert2;
3711 } SYSTEM_BATTERY_STATE, *PSYSTEM_BATTERY_STATE;
3712
3713 typedef enum _POWER_INFORMATION_LEVEL {
3714 SystemPowerPolicyAc,
3715 SystemPowerPolicyDc,
3716 VerifySystemPolicyAc,
3717 VerifySystemPolicyDc,
3718 SystemPowerCapabilities,
3719 SystemBatteryState,
3720 SystemPowerStateHandler,
3721 ProcessorStateHandler,
3722 SystemPowerPolicyCurrent,
3723 AdministratorPowerPolicy,
3724 SystemReserveHiberFile,
3725 ProcessorInformation,
3726 SystemPowerInformation,
3727 ProcessorStateHandler2,
3728 LastWakeTime,
3729 LastSleepTime,
3730 SystemExecutionState,
3731 SystemPowerStateNotifyHandler,
3732 ProcessorPowerPolicyAc,
3733 ProcessorPowerPolicyDc,
3734 VerifyProcessorPowerPolicyAc,
3735 VerifyProcessorPowerPolicyDc,
3736 ProcessorPowerPolicyCurrent
3737 } POWER_INFORMATION_LEVEL;
3738
3739 #if (_WIN32_WINNT >= 0x0500)
3740 typedef LONG (WINAPI *PVECTORED_EXCEPTION_HANDLER)(PEXCEPTION_POINTERS);
3741 #endif
3742 #if 1 /* (WIN32_WINNT >= 0x0500) */
3743 typedef struct _SYSTEM_POWER_INFORMATION {
3744 ULONG MaxIdlenessAllowed;
3745 ULONG Idleness;
3746 ULONG TimeRemaining;
3747 UCHAR CoolingMode;
3748 } SYSTEM_POWER_INFORMATION,*PSYSTEM_POWER_INFORMATION;
3749 #endif
3750
3751 #if (_WIN32_WINNT >= 0x0501)
3752 typedef enum _HEAP_INFORMATION_CLASS {
3753 HeapCompatibilityInformation
3754 } HEAP_INFORMATION_CLASS;
3755 typedef enum _ACTIVATION_CONTEXT_INFO_CLASS {
3756 ActivationContextBasicInformation = 1,
3757 ActivationContextDetailedInformation,
3758 AssemblyDetailedInformationInActivationContext,
3759 FileInformationInAssemblyOfAssemblyInActivationContext
3760 } ACTIVATION_CONTEXT_INFO_CLASS;
3761 typedef struct _ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION {
3762 DWORD ulFlags;
3763 DWORD ulEncodedAssemblyIdentityLength;
3764 DWORD ulManifestPathType;
3765 DWORD ulManifestPathLength;
3766 LARGE_INTEGER liManifestLastWriteTime;
3767 DWORD ulPolicyPathType;
3768 DWORD ulPolicyPathLength;
3769 LARGE_INTEGER liPolicyLastWriteTime;
3770 DWORD ulMetadataSatelliteRosterIndex;
3771 DWORD ulManifestVersionMajor;
3772 DWORD ulManifestVersionMinor;
3773 DWORD ulPolicyVersionMajor;
3774 DWORD ulPolicyVersionMinor;
3775 DWORD ulAssemblyDirectoryNameLength;
3776 PCWSTR lpAssemblyEncodedAssemblyIdentity;
3777 PCWSTR lpAssemblyManifestPath;
3778 PCWSTR lpAssemblyPolicyPath;
3779 PCWSTR lpAssemblyDirectoryName;
3780 } ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION,*
PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION;
3781 typedef const ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION *
PCACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION;
3782 typedef struct _ACTIVATION_CONTEXT_DETAILED_INFORMATION {
3783 DWORD dwFlags;
3784 DWORD ulFormatVersion;
3785 DWORD ulAssemblyCount;
3786 DWORD ulRootManifestPathType;
3787 DWORD ulRootManifestPathChars;
3788 DWORD ulRootConfigurationPathType;
3789 DWORD ulRootConfigurationPathChars;
3790 DWORD ulAppDirPathType;
3791 DWORD ulAppDirPathChars;
3792 PCWSTR lpRootManifestPath;
3793 PCWSTR lpRootConfigurationPath;
3794 PCWSTR lpAppDirPath;
3795 } ACTIVATION_CONTEXT_DETAILED_INFORMATION,*
PACTIVATION_CONTEXT_DETAILED_INFORMATION;
3796 typedef const ACTIVATION_CONTEXT_DETAILED_INFORMATION *
PCACTIVATION_CONTEXT_DETAILED_INFORMATION;
3797 typedef struct _ACTIVATION_CONTEXT_QUERY_INDEX {
3798 ULONG ulAssemblyIndex;
3799 ULONG ulFileIndexInAssembly;
3800 } ACTIVATION_CONTEXT_QUERY_INDEX,*PACTIVATION_CONTEXT_QUERY_INDEX;
3801 typedef const ACTIVATION_CONTEXT_QUERY_INDEX *
PCACTIVATION_CONTEXT_QUERY_INDEX;
3802 typedef struct _ASSEMBLY_FILE_DETAILED_INFORMATION {
3803 DWORD ulFlags;
3804 DWORD ulFilenameLength;
3805 DWORD ulPathLength;
3806 PCWSTR lpFileName;
3807 PCWSTR lpFilePath;
3808 } ASSEMBLY_FILE_DETAILED_INFORMATION,*PASSEMBLY_FILE_DETAILED_INFORMATION;
3809 typedef const ASSEMBLY_FILE_DETAILED_INFORMATION *
PCASSEMBLY_FILE_DETAILED_INFORMATION;
3810 #endif /* (WIN32_WINNT >= 0x0501) */
3811
3812 typedef struct _PROCESSOR_POWER_POLICY_INFO {
3813 ULONG TimeCheck;
3814 ULONG DemoteLimit;
3815 ULONG PromoteLimit;
3816 UCHAR DemotePercent;
3817 UCHAR PromotePercent;
3818 UCHAR Spare[2];
3819 ULONG AllowDemotion : 1;
3820 ULONG AllowPromotion : 1;
3821 ULONG Reserved : 30;
3822 } PROCESSOR_POWER_POLICY_INFO, *PPROCESSOR_POWER_POLICY_INFO;
3823 typedef struct _PROCESSOR_POWER_POLICY {
3824 ULONG Revision;
3825 UCHAR DynamicThrottle;
3826 UCHAR Spare[3];
3827 ULONG Reserved;
3828 ULONG PolicyCount;
3829 PROCESSOR_POWER_POLICY_INFO Policy[3];
3830 } PROCESSOR_POWER_POLICY, *PPROCESSOR_POWER_POLICY;
3831 typedef struct _ADMINISTRATOR_POWER_POLICY {
3832 SYSTEM_POWER_STATE MinSleep;
3833 SYSTEM_POWER_STATE MaxSleep;
3834 ULONG MinVideoTimeout;
3835 ULONG MaxVideoTimeout;
3836 ULONG MinSpindownTimeout;
3837 ULONG MaxSpindownTimeout;
3838 } ADMINISTRATOR_POWER_POLICY, *PADMINISTRATOR_POWER_POLICY;
3839 #include <poppack.h>
3840 #endif /* WINVER >= 0x0500 */
3841
3842 #if (_WIN32_WINNT >= 0x0500)
3843 typedef VOID (NTAPI *WAITORTIMERCALLBACKFUNC)(PVOID,BOOLEAN);
3844 #endif
3845
3846 #ifdef UNICODE
3847 typedef OSVERSIONINFOW OSVERSIONINFO,*POSVERSIONINFO,*LPOSVERSIONINFO;
3848 typedef OSVERSIONINFOEXW OSVERSIONINFOEX,*POSVERSIONINFOEX,*
LPOSVERSIONINFOEX;
3849 #else
3850 typedef OSVERSIONINFOA OSVERSIONINFO,*POSVERSIONINFO,*LPOSVERSIONINFO;
3851 typedef OSVERSIONINFOEXA OSVERSIONINFOEX,*POSVERSIONINFOEX,*
LPOSVERSIONINFOEX;
3852 #endif
3853
3854 #if (_WIN32_WINNT >= 0x0500)
3855 ULONGLONG WINAPI VerSetConditionMask(ULONGLONG,DWORD,BYTE);
3856 #define VER_SET_CONDITION(ConditionMask, TypeBitMask, ComparisonType) \
3857 ((ConditionMask) = VerSetConditionMask((ConditionMask), \
3858 (TypeBitMask), (ComparisonType)))
3859 #endif
3860
3861 #ifdef _X86_
3862 #if defined(__GNUC__)
3863 #if (__GNUC__ >= 3)
3864 /* Support -masm=intel. */
3865 static __inline__ PVOID GetCurrentFiber(void)
3866 {
3867 void* ret;
3868 __asm__ __volatile__ (
3869 "mov{l} {%%fs:0x10,%0|%0,%%fs:0x10}"
3870 : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */
3871 );
3872 return ret;
3873 }
3874
3875 static __inline__ PVOID GetFiberData(void)
3876 {
3877 void* ret;
3878 __asm__ __volatile__ (
3879 "mov{l} {%%fs:0x10,%0|%0,%%fs:0x10}\n\t"
3880 "mov{l} {(%0),%0|%0,[%0]}"
3881 : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */
3882 );
3883 return ret;
3884 }
3885
3886 static __inline__ struct _TEB * NtCurrentTeb(void)
3887 {
3888 struct _TEB *ret;
3889
3890 __asm__ __volatile__ (
3891 "mov{l} {%%fs:0x18,%0|%0,%%fs:0x18}\n"
3892 : "=r" (ret)
3893 : /* no inputs */
3894 );
3895
3896 return ret;
3897 }
3898
3899 #else /* __GNUC__ >= 3 */
3900 static __inline__ PVOID GetCurrentFiber(void)
3901 {
3902 void* ret;
3903 __asm__ __volatile__ (
3904 "movl %%fs:0x10,%0"
3905 : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */
3906 );
3907 return ret;
3908 }
3909
3910 static __inline__ PVOID GetFiberData(void)
3911 {
3912 void* ret;
3913 __asm__ __volatile__ (
3914 "movl %%fs:0x10,%0\n\t"
3915 "movl (%0),%0"
3916 : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */
3917 );
3918 return ret;
3919 }
3920
3921 static __inline__ struct _TEB * NtCurrentTeb(void)
3922 {
3923 struct _TEB *ret;
3924
3925 __asm__ __volatile__ (
3926 "movl %%fs:0x18, %0\n"
3927 : "=r" (ret)
3928 : /* no inputs */
3929 );
3930 return ret;
3931 }
3932 #endif /* __GNUC__ >= 3 */
3933
3934 #else
3935
3936 PVOID GetCurrentFiber(void);
3937 #pragma aux GetCurrentFiber = \
3938 "mov eax, dword ptr fs:0x10" \
3939 value [eax] \
3940 modify [eax];
3941
3942 PVOID GetFiberData(void);
3943 #pragma aux GetFiberData = \
3944 "mov eax, dword ptr fs:0x10" \
3945 "mov eax, [eax]" \
3946 value [eax] \
3947 modify [eax];
3948
3949 struct _TEB * NtCurrentTeb(void);
3950 #pragma aux NtCurrentTeb = \
3951 "mov eax, dword ptr fs:0x18" \
3952 value [eax] \
3953 modify [eax];
3954
3955 #endif /* __GNUC__ */
3956 #endif /* _X86_ */
3957
3958 #endif /* RC_INVOKED */
3959
3960 #ifdef __cplusplus
3961 }
3962 #endif
3963 #endif

Bewerten