user32/tests: Store thread ID of thread we're watching for winevents.
[wine.git] / include / winternl.h
blob2b8acc624b5e582025a1acc31a78fc2159b3d7e9
1 /*
2 * Internal NT APIs and data structures
4 * Copyright (C) the Wine project
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_WINTERNL_H
22 #define __WINE_WINTERNL_H
24 #include <ntdef.h>
25 #include <windef.h>
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* defined(__cplusplus) */
32 /**********************************************************************
33 * Fundamental types and data structures
36 #ifndef WINE_NTSTATUS_DECLARED
37 #define WINE_NTSTATUS_DECLARED
38 typedef LONG NTSTATUS;
39 #endif
41 typedef const char *PCSZ;
43 typedef short CSHORT;
44 typedef CSHORT *PCSHORT;
46 #ifndef __STRING_DEFINED__
47 #define __STRING_DEFINED__
48 typedef struct _STRING {
49 USHORT Length;
50 USHORT MaximumLength;
51 PCHAR Buffer;
52 } STRING, *PSTRING;
53 #endif
55 typedef STRING ANSI_STRING;
56 typedef PSTRING PANSI_STRING;
57 typedef const STRING *PCANSI_STRING;
59 typedef STRING OEM_STRING;
60 typedef PSTRING POEM_STRING;
61 typedef const STRING *PCOEM_STRING;
63 #ifndef __UNICODE_STRING_DEFINED__
64 #define __UNICODE_STRING_DEFINED__
65 typedef struct _UNICODE_STRING {
66 USHORT Length; /* bytes */
67 USHORT MaximumLength; /* bytes */
68 PWSTR Buffer;
69 } UNICODE_STRING, *PUNICODE_STRING;
70 #endif
72 typedef const UNICODE_STRING *PCUNICODE_STRING;
74 #ifndef _FILETIME_
75 #define _FILETIME_
76 /* 64 bit number of 100 nanoseconds intervals since January 1, 1601 */
77 typedef struct _FILETIME
79 #ifdef WORDS_BIGENDIAN
80 DWORD dwHighDateTime;
81 DWORD dwLowDateTime;
82 #else
83 DWORD dwLowDateTime;
84 DWORD dwHighDateTime;
85 #endif
86 } FILETIME, *PFILETIME, *LPFILETIME;
87 #endif /* _FILETIME_ */
90 * RTL_SYSTEM_TIME and RTL_TIME_ZONE_INFORMATION are the same as
91 * the SYSTEMTIME and TIME_ZONE_INFORMATION structures defined
92 * in winbase.h, however we need to define them separately so
93 * winternl.h doesn't depend on winbase.h. They are used by
94 * RtlQueryTimeZoneInformation and RtlSetTimeZoneInformation.
95 * The names are guessed; if anybody knows the real names, let me know.
97 typedef struct _RTL_SYSTEM_TIME {
98 WORD wYear;
99 WORD wMonth;
100 WORD wDayOfWeek;
101 WORD wDay;
102 WORD wHour;
103 WORD wMinute;
104 WORD wSecond;
105 WORD wMilliseconds;
106 } RTL_SYSTEM_TIME, *PRTL_SYSTEM_TIME;
108 typedef struct _RTL_TIME_ZONE_INFORMATION {
109 LONG Bias;
110 WCHAR StandardName[32];
111 RTL_SYSTEM_TIME StandardDate;
112 LONG StandardBias;
113 WCHAR DaylightName[32];
114 RTL_SYSTEM_TIME DaylightDate;
115 LONG DaylightBias;
116 } RTL_TIME_ZONE_INFORMATION, *PRTL_TIME_ZONE_INFORMATION;
118 typedef struct _RTL_TIME_DYNAMIC_ZONE_INFORMATION
120 LONG Bias;
121 WCHAR StandardName[32];
122 RTL_SYSTEM_TIME StandardDate;
123 LONG StandardBias;
124 WCHAR DaylightName[32];
125 RTL_SYSTEM_TIME DaylightDate;
126 LONG DaylightBias;
127 WCHAR TimeZoneKeyName[128];
128 BOOLEAN DynamicDaylightTimeDisabled;
129 } RTL_DYNAMIC_TIME_ZONE_INFORMATION, *PRTL_DYNAMIC_TIME_ZONE_INFORMATION;
131 typedef struct _CLIENT_ID
133 HANDLE UniqueProcess;
134 HANDLE UniqueThread;
135 } CLIENT_ID, *PCLIENT_ID;
137 typedef struct _CURDIR
139 UNICODE_STRING DosPath;
140 PVOID Handle;
141 } CURDIR, *PCURDIR;
143 typedef struct RTL_DRIVE_LETTER_CURDIR
145 USHORT Flags;
146 USHORT Length;
147 ULONG TimeStamp;
148 UNICODE_STRING DosPath;
149 } RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
151 typedef struct _RTL_RELATIVE_NAME
153 UNICODE_STRING RelativeName;
154 HANDLE ContainerDirectory;
155 void *CurDirRef;
156 } RTL_RELATIVE_NAME, *PRTL_RELATIVE_NAME;
158 typedef struct tagRTL_BITMAP {
159 ULONG SizeOfBitMap; /* Number of bits in the bitmap */
160 PULONG Buffer; /* Bitmap data, assumed sized to a DWORD boundary */
161 } RTL_BITMAP, *PRTL_BITMAP;
163 typedef const RTL_BITMAP *PCRTL_BITMAP;
165 typedef struct tagRTL_BITMAP_RUN {
166 ULONG StartingIndex; /* Bit position at which run starts */
167 ULONG NumberOfBits; /* Size of the run in bits */
168 } RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
170 typedef const RTL_BITMAP_RUN *PCRTL_BITMAP_RUN;
172 typedef struct _RTL_USER_PROCESS_PARAMETERS
174 ULONG AllocationSize;
175 ULONG Size;
176 ULONG Flags;
177 ULONG DebugFlags;
178 HANDLE ConsoleHandle;
179 ULONG ConsoleFlags;
180 HANDLE hStdInput;
181 HANDLE hStdOutput;
182 HANDLE hStdError;
183 CURDIR CurrentDirectory;
184 UNICODE_STRING DllPath;
185 UNICODE_STRING ImagePathName;
186 UNICODE_STRING CommandLine;
187 PWSTR Environment;
188 ULONG dwX;
189 ULONG dwY;
190 ULONG dwXSize;
191 ULONG dwYSize;
192 ULONG dwXCountChars;
193 ULONG dwYCountChars;
194 ULONG dwFillAttribute;
195 ULONG dwFlags;
196 ULONG wShowWindow;
197 UNICODE_STRING WindowTitle;
198 UNICODE_STRING Desktop;
199 UNICODE_STRING ShellInfo;
200 UNICODE_STRING RuntimeInfo;
201 RTL_DRIVE_LETTER_CURDIR DLCurrentDirectory[0x20];
202 ULONG_PTR EnvironmentSize;
203 ULONG_PTR EnvironmentVersion;
204 PVOID PackageDependencyData;
205 ULONG ProcessGroupId;
206 ULONG LoaderThreads;
207 } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
209 /* value for Flags field (FIXME: not the correct name) */
210 #define PROCESS_PARAMS_FLAG_NORMALIZED 1
212 typedef struct _PEB_LDR_DATA
214 ULONG Length;
215 BOOLEAN Initialized;
216 PVOID SsHandle;
217 LIST_ENTRY InLoadOrderModuleList;
218 LIST_ENTRY InMemoryOrderModuleList;
219 LIST_ENTRY InInitializationOrderModuleList;
220 PVOID EntryInProgress;
221 BOOLEAN ShutdownInProgress;
222 HANDLE ShutdownThreadId;
223 } PEB_LDR_DATA, *PPEB_LDR_DATA;
225 typedef struct _GDI_TEB_BATCH
227 ULONG Offset;
228 HANDLE HDC;
229 ULONG Buffer[0x136];
230 } GDI_TEB_BATCH;
232 typedef struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME
234 struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME *Previous;
235 struct _ACTIVATION_CONTEXT *ActivationContext;
236 ULONG Flags;
237 } RTL_ACTIVATION_CONTEXT_STACK_FRAME, *PRTL_ACTIVATION_CONTEXT_STACK_FRAME;
239 typedef struct _ACTIVATION_CONTEXT_STACK
241 RTL_ACTIVATION_CONTEXT_STACK_FRAME *ActiveFrame;
242 LIST_ENTRY FrameListCache;
243 ULONG Flags;
244 ULONG NextCookieSequenceNumber;
245 ULONG_PTR StackId;
246 } ACTIVATION_CONTEXT_STACK, *PACTIVATION_CONTEXT_STACK;
248 typedef struct _TEB_ACTIVE_FRAME_CONTEXT
250 ULONG Flags;
251 const char *FrameName;
252 } TEB_ACTIVE_FRAME_CONTEXT, *PTEB_ACTIVE_FRAME_CONTEXT;
254 typedef struct _TEB_ACTIVE_FRAME_CONTEXT_EX
256 TEB_ACTIVE_FRAME_CONTEXT BasicContext;
257 const char *SourceLocation;
258 } TEB_ACTIVE_FRAME_CONTEXT_EX, *PTEB_ACTIVE_FRAME_CONTEXT_EX;
260 typedef struct _TEB_ACTIVE_FRAME
262 ULONG Flags;
263 struct _TEB_ACTIVE_FRAME *Previous;
264 TEB_ACTIVE_FRAME_CONTEXT *Context;
265 } TEB_ACTIVE_FRAME, *PTEB_ACTIVE_FRAME;
267 typedef struct _TEB_ACTIVE_FRAME_EX
269 TEB_ACTIVE_FRAME BasicFrame;
270 void *ExtensionIdentifier;
271 } TEB_ACTIVE_FRAME_EX, *PTEB_ACTIVE_FRAME_EX;
273 typedef struct _FLS_CALLBACK
275 void *unknown;
276 PFLS_CALLBACK_FUNCTION callback; /* ~0 if NULL callback is set, NULL if FLS index is free. */
277 } FLS_CALLBACK, *PFLS_CALLBACK;
279 typedef struct _FLS_INFO_CHUNK
281 ULONG count; /* number of allocated FLS indexes in the chunk. */
282 FLS_CALLBACK callbacks[1]; /* the size is 0x10 for chunk 0 and is twice as
283 * the previous chunk size for the rest. */
284 } FLS_INFO_CHUNK, *PFLS_INFO_CHUNK;
286 typedef struct _GLOBAL_FLS_DATA
288 FLS_INFO_CHUNK *fls_callback_chunks[8];
289 LIST_ENTRY fls_list_head;
290 ULONG fls_high_index;
291 } GLOBAL_FLS_DATA, *PGLOBAL_FLS_DATA;
293 typedef struct _TEB_FLS_DATA
295 LIST_ENTRY fls_list_entry;
296 void **fls_data_chunks[8];
297 } TEB_FLS_DATA, *PTEB_FLS_DATA;
299 #define TEB_ACTIVE_FRAME_CONTEXT_FLAG_EXTENDED 0x00000001
300 #define TEB_ACTIVE_FRAME_FLAG_EXTENDED 0x00000001
302 /***********************************************************************
303 * PEB data structure
305 typedef struct _PEB
306 { /* win32/win64 */
307 BOOLEAN InheritedAddressSpace; /* 000/000 */
308 BOOLEAN ReadImageFileExecOptions; /* 001/001 */
309 BOOLEAN BeingDebugged; /* 002/002 */
310 BOOLEAN SpareBool; /* 003/003 */
311 HANDLE Mutant; /* 004/008 */
312 HMODULE ImageBaseAddress; /* 008/010 */
313 PPEB_LDR_DATA LdrData; /* 00c/018 */
314 RTL_USER_PROCESS_PARAMETERS *ProcessParameters; /* 010/020 */
315 PVOID SubSystemData; /* 014/028 */
316 HANDLE ProcessHeap; /* 018/030 */
317 PRTL_CRITICAL_SECTION FastPebLock; /* 01c/038 */
318 PVOID /*PPEBLOCKROUTINE*/ FastPebLockRoutine; /* 020/040 */
319 PVOID /*PPEBLOCKROUTINE*/ FastPebUnlockRoutine; /* 024/048 */
320 ULONG EnvironmentUpdateCount; /* 028/050 */
321 PVOID KernelCallbackTable; /* 02c/058 */
322 ULONG Reserved; /* 030/060 */
323 ULONG AtlThunkSListPtr32; /* 034/064 */
324 PVOID /*PPEB_FREE_BLOCK*/ FreeList; /* 038/068 */
325 ULONG TlsExpansionCounter; /* 03c/070 */
326 PRTL_BITMAP TlsBitmap; /* 040/078 */
327 ULONG TlsBitmapBits[2]; /* 044/080 */
328 PVOID ReadOnlySharedMemoryBase; /* 04c/088 */
329 PVOID ReadOnlySharedMemoryHeap; /* 050/090 */
330 PVOID *ReadOnlyStaticServerData; /* 054/098 */
331 PVOID AnsiCodePageData; /* 058/0a0 */
332 PVOID OemCodePageData; /* 05c/0a8 */
333 PVOID UnicodeCaseTableData; /* 060/0b0 */
334 ULONG NumberOfProcessors; /* 064/0b8 */
335 ULONG NtGlobalFlag; /* 068/0bc */
336 LARGE_INTEGER CriticalSectionTimeout; /* 070/0c0 */
337 SIZE_T HeapSegmentReserve; /* 078/0c8 */
338 SIZE_T HeapSegmentCommit; /* 07c/0d0 */
339 SIZE_T HeapDeCommitTotalFreeThreshold; /* 080/0d8 */
340 SIZE_T HeapDeCommitFreeBlockThreshold; /* 084/0e0 */
341 ULONG NumberOfHeaps; /* 088/0e8 */
342 ULONG MaximumNumberOfHeaps; /* 08c/0ec */
343 PVOID *ProcessHeaps; /* 090/0f0 */
344 PVOID GdiSharedHandleTable; /* 094/0f8 */
345 PVOID ProcessStarterHelper; /* 098/100 */
346 PVOID GdiDCAttributeList; /* 09c/108 */
347 PVOID LoaderLock; /* 0a0/110 */
348 ULONG OSMajorVersion; /* 0a4/118 */
349 ULONG OSMinorVersion; /* 0a8/11c */
350 ULONG OSBuildNumber; /* 0ac/120 */
351 ULONG OSPlatformId; /* 0b0/124 */
352 ULONG ImageSubSystem; /* 0b4/128 */
353 ULONG ImageSubSystemMajorVersion; /* 0b8/12c */
354 ULONG ImageSubSystemMinorVersion; /* 0bc/130 */
355 ULONG ImageProcessAffinityMask; /* 0c0/134 */
356 HANDLE GdiHandleBuffer[28]; /* 0c4/138 */
357 ULONG unknown[6]; /* 134/218 */
358 PVOID PostProcessInitRoutine; /* 14c/230 */
359 PRTL_BITMAP TlsExpansionBitmap; /* 150/238 */
360 ULONG TlsExpansionBitmapBits[32]; /* 154/240 */
361 ULONG SessionId; /* 1d4/2c0 */
362 ULARGE_INTEGER AppCompatFlags; /* 1d8/2c8 */
363 ULARGE_INTEGER AppCompatFlagsUser; /* 1e0/2d0 */
364 PVOID ShimData; /* 1e8/2d8 */
365 PVOID AppCompatInfo; /* 1ec/2e0 */
366 UNICODE_STRING CSDVersion; /* 1f0/2e8 */
367 PVOID ActivationContextData; /* 1f8/2f8 */
368 PVOID ProcessAssemblyStorageMap; /* 1fc/300 */
369 PVOID SystemDefaultActivationData; /* 200/308 */
370 PVOID SystemAssemblyStorageMap; /* 204/310 */
371 SIZE_T MinimumStackCommit; /* 208/318 */
372 PVOID *FlsCallback; /* 20c/320 */
373 LIST_ENTRY FlsListHead; /* 210/328 */
374 PRTL_BITMAP FlsBitmap; /* 218/338 */
375 ULONG FlsBitmapBits[4]; /* 21c/340 */
376 ULONG FlsHighIndex; /* 22c/350 */
377 PVOID WerRegistrationData; /* 230/358 */
378 PVOID WerShipAssertPtr; /* 234/360 */
379 PVOID pUnused; /* 238/368 */
380 PVOID pImageHeaderHash; /* 23c/370 */
381 ULONG TracingFlags; /* 240/378 */
382 ULONGLONG CsrServerReadOnlySharedMemoryBase; /* 248/380 */
383 ULONG TppWorkerpListLock; /* 250/388 */
384 LIST_ENTRY TppWorkerpList; /* 254/390 */
385 PVOID WaitOnAddressHashTable [0x80]; /* 25c/3a0 */
386 PVOID TelemetryCoverageHeader; /* 45c/7a0 */
387 ULONG CloudFileFlags; /* 460/7a8 */
388 ULONG CloudFileDiagFlags; /* 464/7ac */
389 CHAR PlaceholderCompatibilityMode; /* 468/7b0 */
390 CHAR PlaceholderCompatibilityModeReserved[7]; /* 469/7b1 */
391 PVOID LeapSecondData; /* 470/7b8 */
392 ULONG LeapSecondFlags; /* 474/7c0 */
393 ULONG NtGlobalFlag2; /* 478/7c4 */
394 } PEB, *PPEB;
397 /***********************************************************************
398 * TEB data structure
400 typedef struct _TEB
401 { /* win32/win64 */
402 NT_TIB Tib; /* 000/0000 */
403 PVOID EnvironmentPointer; /* 01c/0038 */
404 CLIENT_ID ClientId; /* 020/0040 */
405 PVOID ActiveRpcHandle; /* 028/0050 */
406 PVOID ThreadLocalStoragePointer; /* 02c/0058 */
407 PPEB Peb; /* 030/0060 */
408 ULONG LastErrorValue; /* 034/0068 */
409 ULONG CountOfOwnedCriticalSections; /* 038/006c */
410 PVOID CsrClientThread; /* 03c/0070 */
411 PVOID Win32ThreadInfo; /* 040/0078 */
412 ULONG User32Reserved[26]; /* 044/0080 */
413 ULONG UserReserved[5]; /* 0ac/00e8 */
414 PVOID WOW32Reserved; /* 0c0/0100 */
415 ULONG CurrentLocale; /* 0c4/0108 */
416 ULONG FpSoftwareStatusRegister; /* 0c8/010c */
417 PVOID ReservedForDebuggerInstrumentation[16]; /* 0cc/0110 */
418 #ifdef _WIN64
419 PVOID SystemReserved1[30]; /* /0190 */
420 #else
421 PVOID SystemReserved1[26]; /* 10c/ used for krnl386 private data in Wine */
422 #endif
423 char PlaceholderCompatibilityMode; /* 174/0280 */
424 char PlaceholderReserved[11]; /* 175/0281 */
425 DWORD ProxiedProcessId; /* 180/028c */
426 ACTIVATION_CONTEXT_STACK ActivationContextStack; /* 184/0290 */
427 UCHAR WorkingOnBehalfOfTicket[8]; /* 19c/02b8 */
428 LONG ExceptionCode; /* 1a4/02c0 */
429 ACTIVATION_CONTEXT_STACK *ActivationContextStackPointer; /* 1a8/02c8 */
430 ULONG_PTR InstrumentationCallbackSp; /* 1ac/02d0 */
431 ULONG_PTR InstrumentationCallbackPreviousPc; /* 1b0/02d8 */
432 ULONG_PTR InstrumentationCallbackPreviousSp; /* 1b4/02e0 */
433 #ifdef _WIN64
434 ULONG TxFsContext; /* /02e8 */
435 BOOLEAN InstrumentationCallbackDisabled; /* /02ec */
436 #else
437 BOOLEAN InstrumentationCallbackDisabled; /* 1b8/ */
438 BYTE SpareBytes1[23]; /* 1b9/ */
439 ULONG TxFsContext; /* 1d0/ */
440 #endif
441 GDI_TEB_BATCH GdiTebBatch; /* 1d4/02f0 used for ntdll private data in Wine */
442 CLIENT_ID RealClientId; /* 6b4/07d8 */
443 HANDLE GdiCachedProcessHandle; /* 6bc/07e8 */
444 ULONG GdiClientPID; /* 6c0/07f0 */
445 ULONG GdiClientTID; /* 6c4/07f4 */
446 PVOID GdiThreadLocaleInfo; /* 6c8/07f8 */
447 ULONG_PTR Win32ClientInfo[62]; /* 6cc/0800 used for user32 private data in Wine */
448 PVOID glDispatchTable[233]; /* 7c4/09f0 */
449 PVOID glReserved1[29]; /* b68/1138 */
450 PVOID glReserved2; /* bdc/1220 */
451 PVOID glSectionInfo; /* be0/1228 */
452 PVOID glSection; /* be4/1230 */
453 PVOID glTable; /* be8/1238 */
454 PVOID glCurrentRC; /* bec/1240 */
455 PVOID glContext; /* bf0/1248 */
456 ULONG LastStatusValue; /* bf4/1250 */
457 UNICODE_STRING StaticUnicodeString; /* bf8/1258 */
458 WCHAR StaticUnicodeBuffer[261]; /* c00/1268 */
459 PVOID DeallocationStack; /* e0c/1478 */
460 PVOID TlsSlots[64]; /* e10/1480 */
461 LIST_ENTRY TlsLinks; /* f10/1680 */
462 PVOID Vdm; /* f18/1690 */
463 PVOID ReservedForNtRpc; /* f1c/1698 */
464 PVOID DbgSsReserved[2]; /* f20/16a0 */
465 ULONG HardErrorDisabled; /* f28/16b0 */
466 PVOID Instrumentation[16]; /* f2c/16b8 */
467 PVOID WinSockData; /* f6c/1738 */
468 ULONG GdiBatchCount; /* f70/1740 */
469 ULONG Spare2; /* f74/1744 */
470 ULONG GuaranteedStackBytes; /* f78/1748 */
471 PVOID ReservedForPerf; /* f7c/1750 */
472 PVOID ReservedForOle; /* f80/1758 */
473 ULONG WaitingOnLoaderLock; /* f84/1760 */
474 PVOID Reserved5[3]; /* f88/1768 */
475 PVOID *TlsExpansionSlots; /* f94/1780 */
476 #ifdef _WIN64
477 PVOID DeallocationBStore; /* /1788 */
478 PVOID BStoreLimit; /* /1790 */
479 #endif
480 ULONG ImpersonationLocale; /* f98/1798 */
481 ULONG IsImpersonating; /* f9c/179c */
482 PVOID NlsCache; /* fa0/17a0 */
483 PVOID ShimData; /* fa4/17a8 */
484 ULONG HeapVirtualAffinity; /* fa8/17b0 */
485 PVOID CurrentTransactionHandle; /* fac/17b8 */
486 TEB_ACTIVE_FRAME *ActiveFrame; /* fb0/17c0 */
487 TEB_FLS_DATA *FlsSlots; /* fb4/17c8 */
488 PVOID PreferredLanguages; /* fb8/17d0 */
489 PVOID UserPrefLanguages; /* fbc/17d8 */
490 PVOID MergedPrefLanguages; /* fc0/17e0 */
491 ULONG MuiImpersonation; /* fc4/17e8 */
492 USHORT CrossTebFlags; /* fc8/17ec */
493 USHORT SameTebFlags; /* fca/17ee */
494 PVOID TxnScopeEnterCallback; /* fcc/17f0 */
495 PVOID TxnScopeExitCallback; /* fd0/17f8 */
496 PVOID TxnScopeContext; /* fd4/1800 */
497 ULONG LockCount; /* fd8/1808 */
498 LONG WowTebOffset; /* fdc/180c */
499 PVOID ResourceRetValue; /* fe0/1810 */
500 PVOID ReservedForWdf; /* fe4/1818 */
501 ULONGLONG ReservedForCrt; /* fe8/1820 */
502 GUID EffectiveContainerId; /* ff0/1828 */
503 } TEB, *PTEB;
506 /***********************************************************************
507 * The 32-bit/64-bit version of the PEB and TEB for WoW64
509 typedef struct _NT_TIB32
511 ULONG ExceptionList; /* 0000 */
512 ULONG StackBase; /* 0004 */
513 ULONG StackLimit; /* 0008 */
514 ULONG SubSystemTib; /* 000c */
515 ULONG FiberData; /* 0010 */
516 ULONG ArbitraryUserPointer; /* 0014 */
517 ULONG Self; /* 0018 */
518 } NT_TIB32;
520 typedef struct _NT_TIB64
522 ULONG64 ExceptionList; /* 0000 */
523 ULONG64 StackBase; /* 0008 */
524 ULONG64 StackLimit; /* 0010 */
525 ULONG64 SubSystemTib; /* 0018 */
526 ULONG64 FiberData; /* 0020 */
527 ULONG64 ArbitraryUserPointer; /* 0028 */
528 ULONG64 Self; /* 0030 */
529 } NT_TIB64;
531 typedef struct _CLIENT_ID32
533 ULONG UniqueProcess;
534 ULONG UniqueThread;
535 } CLIENT_ID32;
537 typedef struct _CLIENT_ID64
539 ULONG64 UniqueProcess;
540 ULONG64 UniqueThread;
541 } CLIENT_ID64;
543 typedef struct _LIST_ENTRY32
545 ULONG Flink;
546 ULONG Blink;
547 } LIST_ENTRY32;
549 typedef struct _LIST_ENTRY64
551 ULONG64 Flink;
552 ULONG64 Blink;
553 } LIST_ENTRY64;
555 typedef struct _UNICODE_STRING32
557 USHORT Length;
558 USHORT MaximumLength;
559 ULONG Buffer;
560 } UNICODE_STRING32;
562 typedef struct _UNICODE_STRING64
564 USHORT Length;
565 USHORT MaximumLength;
566 ULONG64 Buffer;
567 } UNICODE_STRING64;
569 typedef struct _ACTIVATION_CONTEXT_STACK32
571 ULONG ActiveFrame;
572 LIST_ENTRY32 FrameListCache;
573 ULONG Flags;
574 ULONG NextCookieSequenceNumber;
575 ULONG32 StackId;
576 } ACTIVATION_CONTEXT_STACK32;
578 typedef struct _ACTIVATION_CONTEXT_STACK64
580 ULONG64 ActiveFrame;
581 LIST_ENTRY64 FrameListCache;
582 ULONG Flags;
583 ULONG NextCookieSequenceNumber;
584 ULONG64 StackId;
585 } ACTIVATION_CONTEXT_STACK64;
587 typedef struct _CURDIR32
589 UNICODE_STRING32 DosPath;
590 ULONG Handle;
591 } CURDIR32;
593 typedef struct _CURDIR64
595 UNICODE_STRING64 DosPath;
596 ULONG64 Handle;
597 } CURDIR64;
599 typedef struct RTL_DRIVE_LETTER_CURDIR32
601 USHORT Flags;
602 USHORT Length;
603 ULONG TimeStamp;
604 UNICODE_STRING32 DosPath;
605 } RTL_DRIVE_LETTER_CURDIR32;
607 typedef struct RTL_DRIVE_LETTER_CURDIR64
609 USHORT Flags;
610 USHORT Length;
611 ULONG TimeStamp;
612 UNICODE_STRING64 DosPath;
613 } RTL_DRIVE_LETTER_CURDIR64;
615 typedef struct _RTL_USER_PROCESS_PARAMETERS32
617 ULONG AllocationSize;
618 ULONG Size;
619 ULONG Flags;
620 ULONG DebugFlags;
621 ULONG ConsoleHandle;
622 ULONG ConsoleFlags;
623 ULONG hStdInput;
624 ULONG hStdOutput;
625 ULONG hStdError;
626 CURDIR32 CurrentDirectory;
627 UNICODE_STRING32 DllPath;
628 UNICODE_STRING32 ImagePathName;
629 UNICODE_STRING32 CommandLine;
630 ULONG Environment;
631 ULONG dwX;
632 ULONG dwY;
633 ULONG dwXSize;
634 ULONG dwYSize;
635 ULONG dwXCountChars;
636 ULONG dwYCountChars;
637 ULONG dwFillAttribute;
638 ULONG dwFlags;
639 ULONG wShowWindow;
640 UNICODE_STRING32 WindowTitle;
641 UNICODE_STRING32 Desktop;
642 UNICODE_STRING32 ShellInfo;
643 UNICODE_STRING32 RuntimeInfo;
644 RTL_DRIVE_LETTER_CURDIR32 DLCurrentDirectory[0x20];
645 ULONG EnvironmentSize;
646 ULONG EnvironmentVersion;
647 ULONG PackageDependencyData;
648 ULONG ProcessGroupId;
649 ULONG LoaderThreads;
650 } RTL_USER_PROCESS_PARAMETERS32;
652 typedef struct _RTL_USER_PROCESS_PARAMETERS64
654 ULONG AllocationSize;
655 ULONG Size;
656 ULONG Flags;
657 ULONG DebugFlags;
658 ULONG64 ConsoleHandle;
659 ULONG ConsoleFlags;
660 ULONG64 hStdInput;
661 ULONG64 hStdOutput;
662 ULONG64 hStdError;
663 CURDIR64 CurrentDirectory;
664 UNICODE_STRING64 DllPath;
665 UNICODE_STRING64 ImagePathName;
666 UNICODE_STRING64 CommandLine;
667 ULONG64 Environment;
668 ULONG dwX;
669 ULONG dwY;
670 ULONG dwXSize;
671 ULONG dwYSize;
672 ULONG dwXCountChars;
673 ULONG dwYCountChars;
674 ULONG dwFillAttribute;
675 ULONG dwFlags;
676 ULONG wShowWindow;
677 UNICODE_STRING64 WindowTitle;
678 UNICODE_STRING64 Desktop;
679 UNICODE_STRING64 ShellInfo;
680 UNICODE_STRING64 RuntimeInfo;
681 RTL_DRIVE_LETTER_CURDIR64 DLCurrentDirectory[0x20];
682 ULONG64 EnvironmentSize;
683 ULONG64 EnvironmentVersion;
684 ULONG64 PackageDependencyData;
685 ULONG ProcessGroupId;
686 ULONG LoaderThreads;
687 } RTL_USER_PROCESS_PARAMETERS64;
689 typedef struct _PEB_LDR_DATA32
691 ULONG Length;
692 BOOLEAN Initialized;
693 ULONG SsHandle;
694 LIST_ENTRY32 InLoadOrderModuleList;
695 LIST_ENTRY32 InMemoryOrderModuleList;
696 LIST_ENTRY32 InInitializationOrderModuleList;
697 ULONG EntryInProgress;
698 BOOLEAN ShutdownInProgress;
699 ULONG ShutdownThreadId;
700 } PEB_LDR_DATA32, *PPEB_LDR_DATA32;
702 typedef struct _PEB_LDR_DATA64
704 ULONG Length;
705 BOOLEAN Initialized;
706 ULONG64 SsHandle;
707 LIST_ENTRY64 InLoadOrderModuleList;
708 LIST_ENTRY64 InMemoryOrderModuleList;
709 LIST_ENTRY64 InInitializationOrderModuleList;
710 ULONG64 EntryInProgress;
711 BOOLEAN ShutdownInProgress;
712 ULONG64 ShutdownThreadId;
713 } PEB_LDR_DATA64, *PPEB_LDR_DATA64;
715 typedef struct _PEB32
717 BOOLEAN InheritedAddressSpace; /* 0000 */
718 BOOLEAN ReadImageFileExecOptions; /* 0001 */
719 BOOLEAN BeingDebugged; /* 0002 */
720 BOOLEAN SpareBool; /* 0003 */
721 ULONG Mutant; /* 0004 */
722 ULONG ImageBaseAddress; /* 0008 */
723 ULONG LdrData; /* 000c */
724 ULONG ProcessParameters; /* 0010 */
725 ULONG SubSystemData; /* 0014 */
726 ULONG ProcessHeap; /* 0018 */
727 ULONG FastPebLock; /* 001c */
728 ULONG FastPebLockRoutine; /* 0020 */
729 ULONG FastPebUnlockRoutine; /* 0024 */
730 ULONG EnvironmentUpdateCount; /* 0028 */
731 ULONG KernelCallbackTable; /* 002c */
732 ULONG Reserved; /* 0030 */
733 ULONG AtlThunkSListPtr32; /* 0034 */
734 ULONG FreeList; /* 0038 */
735 ULONG TlsExpansionCounter; /* 003c */
736 ULONG TlsBitmap; /* 0040 */
737 ULONG TlsBitmapBits[2]; /* 0044 */
738 ULONG ReadOnlySharedMemoryBase; /* 004c */
739 ULONG ReadOnlySharedMemoryHeap; /* 0050 */
740 ULONG ReadOnlyStaticServerData; /* 0054 */
741 ULONG AnsiCodePageData; /* 0058 */
742 ULONG OemCodePageData; /* 005c */
743 ULONG UnicodeCaseTableData; /* 0060 */
744 ULONG NumberOfProcessors; /* 0064 */
745 ULONG NtGlobalFlag; /* 0068 */
746 LARGE_INTEGER CriticalSectionTimeout; /* 0070 */
747 ULONG HeapSegmentReserve; /* 0078 */
748 ULONG HeapSegmentCommit; /* 007c */
749 ULONG HeapDeCommitTotalFreeThreshold; /* 0080 */
750 ULONG HeapDeCommitFreeBlockThreshold; /* 0084 */
751 ULONG NumberOfHeaps; /* 0088 */
752 ULONG MaximumNumberOfHeaps; /* 008c */
753 ULONG ProcessHeaps; /* 0090 */
754 ULONG GdiSharedHandleTable; /* 0094 */
755 ULONG ProcessStarterHelper; /* 0098 */
756 ULONG GdiDCAttributeList; /* 009c */
757 ULONG LoaderLock; /* 00a0 */
758 ULONG OSMajorVersion; /* 00a4 */
759 ULONG OSMinorVersion; /* 00a8 */
760 ULONG OSBuildNumber; /* 00ac */
761 ULONG OSPlatformId; /* 00b0 */
762 ULONG ImageSubSystem; /* 00b4 */
763 ULONG ImageSubSystemMajorVersion; /* 00b8 */
764 ULONG ImageSubSystemMinorVersion; /* 00bc */
765 ULONG ImageProcessAffinityMask; /* 00c0 */
766 ULONG GdiHandleBuffer[28]; /* 00c4 */
767 ULONG unknown[6]; /* 0134 */
768 ULONG PostProcessInitRoutine; /* 014c */
769 ULONG TlsExpansionBitmap; /* 0150 */
770 ULONG TlsExpansionBitmapBits[32]; /* 0154 */
771 ULONG SessionId; /* 01d4 */
772 ULARGE_INTEGER AppCompatFlags; /* 01d8 */
773 ULARGE_INTEGER AppCompatFlagsUser; /* 01e0 */
774 ULONG ShimData; /* 01e8 */
775 ULONG AppCompatInfo; /* 01ec */
776 UNICODE_STRING CSDVersion; /* 01f0 */
777 ULONG ActivationContextData; /* 01f8 */
778 ULONG ProcessAssemblyStorageMap; /* 01fc */
779 ULONG SystemDefaultActivationData; /* 0200 */
780 ULONG SystemAssemblyStorageMap; /* 0204 */
781 ULONG MinimumStackCommit; /* 0208 */
782 ULONG FlsCallback; /* 020c */
783 LIST_ENTRY FlsListHead; /* 0210 */
784 ULONG FlsBitmap; /* 0218 */
785 ULONG FlsBitmapBits[4]; /* 021c */
786 ULONG FlsHighIndex; /* 022c */
787 ULONG WerRegistrationData; /* 0230 */
788 ULONG WerShipAssertPtr; /* 0234 */
789 ULONG pUnused; /* 0238 */
790 ULONG pImageHeaderHash; /* 023c */
791 ULONG TracingFlags; /* 0240 */
792 ULONGLONG CsrServerReadOnlySharedMemoryBase; /* 0248 */
793 ULONG TppWorkerpListLock; /* 0250 */
794 LIST_ENTRY TppWorkerpList; /* 0254 */
795 ULONG WaitOnAddressHashTable [0x80]; /* 025c */
796 ULONG TelemetryCoverageHeader; /* 045c */
797 ULONG CloudFileFlags; /* 0460 */
798 ULONG CloudFileDiagFlags; /* 0464 */
799 CHAR PlaceholderCompatibilityMode; /* 0468 */
800 CHAR PlaceholderCompatibilityModeReserved[7]; /* 0469 */
801 ULONG LeapSecondData; /* 0470 */
802 ULONG LeapSecondFlags; /* 0474 */
803 ULONG NtGlobalFlag2; /* 0478 */
804 } PEB32;
806 typedef struct _PEB64
808 BOOLEAN InheritedAddressSpace; /* 0000 */
809 BOOLEAN ReadImageFileExecOptions; /* 0001 */
810 BOOLEAN BeingDebugged; /* 0002 */
811 BOOLEAN SpareBool; /* 0003 */
812 ULONG64 Mutant; /* 0008 */
813 ULONG64 ImageBaseAddress; /* 0010 */
814 ULONG64 LdrData; /* 0018 */
815 ULONG64 ProcessParameters; /* 0020 */
816 ULONG64 SubSystemData; /* 0028 */
817 ULONG64 ProcessHeap; /* 0030 */
818 ULONG64 FastPebLock; /* 0038 */
819 ULONG64 FastPebLockRoutine; /* 0040 */
820 ULONG64 FastPebUnlockRoutine; /* 0048 */
821 ULONG EnvironmentUpdateCount; /* 0050 */
822 ULONG64 KernelCallbackTable; /* 0058 */
823 ULONG Reserved; /* 0060 */
824 ULONG AtlThunkSListPtr32; /* 0064 */
825 ULONG64 FreeList; /* 0068 */
826 ULONG TlsExpansionCounter; /* 0070 */
827 ULONG64 TlsBitmap; /* 0078 */
828 ULONG TlsBitmapBits[2]; /* 0080 */
829 ULONG64 ReadOnlySharedMemoryBase; /* 0088 */
830 ULONG64 ReadOnlySharedMemoryHeap; /* 0090 */
831 ULONG64 ReadOnlyStaticServerData; /* 0098 */
832 ULONG64 AnsiCodePageData; /* 00a0 */
833 ULONG64 OemCodePageData; /* 00a8 */
834 ULONG64 UnicodeCaseTableData; /* 00b0 */
835 ULONG NumberOfProcessors; /* 00b8 */
836 ULONG NtGlobalFlag; /* 00bc */
837 LARGE_INTEGER CriticalSectionTimeout; /* 00c0 */
838 ULONG64 HeapSegmentReserve; /* 00c8 */
839 ULONG64 HeapSegmentCommit; /* 00d0 */
840 ULONG64 HeapDeCommitTotalFreeThreshold; /* 00d8 */
841 ULONG64 HeapDeCommitFreeBlockThreshold; /* 00e0 */
842 ULONG NumberOfHeaps; /* 00e8 */
843 ULONG MaximumNumberOfHeaps; /* 00ec */
844 ULONG64 ProcessHeaps; /* 00f0 */
845 ULONG64 GdiSharedHandleTable; /* 00f8 */
846 ULONG64 ProcessStarterHelper; /* 0100 */
847 ULONG64 GdiDCAttributeList; /* 0108 */
848 ULONG64 LoaderLock; /* 0110 */
849 ULONG OSMajorVersion; /* 0118 */
850 ULONG OSMinorVersion; /* 011c */
851 ULONG OSBuildNumber; /* 0120 */
852 ULONG OSPlatformId; /* 0124 */
853 ULONG ImageSubSystem; /* 0128 */
854 ULONG ImageSubSystemMajorVersion; /* 012c */
855 ULONG ImageSubSystemMinorVersion; /* 0130 */
856 ULONG ImageProcessAffinityMask; /* 0134 */
857 ULONG64 GdiHandleBuffer[28]; /* 0138 */
858 ULONG unknown[6]; /* 0218 */
859 ULONG64 PostProcessInitRoutine; /* 0230 */
860 ULONG64 TlsExpansionBitmap; /* 0238 */
861 ULONG TlsExpansionBitmapBits[32]; /* 0240 */
862 ULONG SessionId; /* 02c0 */
863 ULARGE_INTEGER AppCompatFlags; /* 02c8 */
864 ULARGE_INTEGER AppCompatFlagsUser; /* 02d0 */
865 ULONG64 ShimData; /* 02d8 */
866 ULONG64 AppCompatInfo; /* 02e0 */
867 UNICODE_STRING64 CSDVersion; /* 02e8 */
868 ULONG64 ActivationContextData; /* 02f8 */
869 ULONG64 ProcessAssemblyStorageMap; /* 0300 */
870 ULONG64 SystemDefaultActivationData; /* 0308 */
871 ULONG64 SystemAssemblyStorageMap; /* 0310 */
872 ULONG64 MinimumStackCommit; /* 0318 */
873 ULONG64 FlsCallback; /* 0320 */
874 LIST_ENTRY64 FlsListHead; /* 0328 */
875 ULONG64 FlsBitmap; /* 0338 */
876 ULONG FlsBitmapBits[4]; /* 0340 */
877 ULONG FlsHighIndex; /* 0350 */
878 ULONG64 WerRegistrationData; /* 0358 */
879 ULONG64 WerShipAssertPtr; /* 0360 */
880 ULONG64 pUnused; /* 0368 */
881 ULONG64 pImageHeaderHash; /* 0370 */
882 ULONG TracingFlags; /* 0378 */
883 ULONGLONG CsrServerReadOnlySharedMemoryBase; /* 0380 */
884 ULONG TppWorkerpListLock; /* 0388 */
885 LIST_ENTRY64 TppWorkerpList; /* 0390 */
886 ULONG64 WaitOnAddressHashTable [0x80]; /* 03a0 */
887 ULONG64 TelemetryCoverageHeader; /* 07a0 */
888 ULONG CloudFileFlags; /* 07a8 */
889 ULONG CloudFileDiagFlags; /* 07ac */
890 CHAR PlaceholderCompatibilityMode; /* 07b0 */
891 CHAR PlaceholderCompatibilityModeReserved[7]; /* 07b1 */
892 ULONG64 LeapSecondData; /* 07b8 */
893 ULONG LeapSecondFlags; /* 07c0 */
894 ULONG NtGlobalFlag2; /* 07c4 */
895 } PEB64;
897 typedef struct _TEB32
899 NT_TIB32 Tib; /* 0000 */
900 ULONG EnvironmentPointer; /* 001c */
901 CLIENT_ID32 ClientId; /* 0020 */
902 ULONG ActiveRpcHandle; /* 0028 */
903 ULONG ThreadLocalStoragePointer; /* 002c */
904 ULONG Peb; /* 0030 */
905 ULONG LastErrorValue; /* 0034 */
906 ULONG CountOfOwnedCriticalSections; /* 0038 */
907 ULONG CsrClientThread; /* 003c */
908 ULONG Win32ThreadInfo; /* 0040 */
909 ULONG User32Reserved[26]; /* 0044 */
910 ULONG UserReserved[5]; /* 00ac */
911 ULONG WOW32Reserved; /* 00c0 */
912 ULONG CurrentLocale; /* 00c4 */
913 ULONG FpSoftwareStatusRegister; /* 00c8 */
914 ULONG ReservedForDebuggerInstrumentation[16]; /* 00cc */
915 ULONG SystemReserved1[26]; /* 010c */
916 char PlaceholderCompatibilityMode; /* 0174 */
917 char PlaceholderReserved[11]; /* 0175 */
918 DWORD ProxiedProcessId; /* 0180 */
919 ACTIVATION_CONTEXT_STACK32 ActivationContextStack; /* 0184 */
920 UCHAR WorkingOnBehalfOfTicket[8]; /* 019c */
921 LONG ExceptionCode; /* 01a4 */
922 ULONG ActivationContextStackPointer; /* 01a8 */
923 ULONG InstrumentationCallbackSp; /* 01ac */
924 ULONG InstrumentationCallbackPreviousPc; /* 01b0 */
925 ULONG InstrumentationCallbackPreviousSp; /* 01b4 */
926 BOOLEAN InstrumentationCallbackDisabled; /* 01b8 */
927 BYTE SpareBytes1[23]; /* 01b9 */
928 ULONG TxFsContext; /* 01d0 */
929 ULONG GdiTebBatch[0x138]; /* 01d4 */
930 CLIENT_ID32 RealClientId; /* 06b4 */
931 ULONG GdiCachedProcessHandle; /* 06bc */
932 ULONG GdiClientPID; /* 06c0 */
933 ULONG GdiClientTID; /* 06c4 */
934 ULONG GdiThreadLocaleInfo; /* 06c8 */
935 ULONG Win32ClientInfo[62]; /* 06cc */
936 ULONG glDispatchTable[233]; /* 07c4 */
937 ULONG glReserved1[29]; /* 0b68 */
938 ULONG glReserved2; /* 0bdc */
939 ULONG glSectionInfo; /* 0be0 */
940 ULONG glSection; /* 0be4 */
941 ULONG glTable; /* 0be8 */
942 ULONG glCurrentRC; /* 0bec */
943 ULONG glContext; /* 0bf0 */
944 ULONG LastStatusValue; /* 0bf4 */
945 UNICODE_STRING32 StaticUnicodeString; /* 0bf8 */
946 WCHAR StaticUnicodeBuffer[261]; /* 0c00 */
947 ULONG DeallocationStack; /* 0e0c */
948 ULONG TlsSlots[64]; /* 0e10 */
949 LIST_ENTRY32 TlsLinks; /* 0f10 */
950 ULONG Vdm; /* 0f18 */
951 ULONG ReservedForNtRpc; /* 0f1c */
952 ULONG DbgSsReserved[2]; /* 0f20 */
953 ULONG HardErrorDisabled; /* 0f28 */
954 ULONG Instrumentation[16]; /* 0f2c */
955 ULONG WinSockData; /* 0f6c */
956 ULONG GdiBatchCount; /* 0f70 */
957 ULONG Spare2; /* 0f74 */
958 ULONG GuaranteedStackBytes; /* 0f78 */
959 ULONG ReservedForPerf; /* 0f7c */
960 ULONG ReservedForOle; /* 0f80 */
961 ULONG WaitingOnLoaderLock; /* 0f84 */
962 ULONG Reserved5[3]; /* 0f88 */
963 ULONG TlsExpansionSlots; /* 0f94 */
964 ULONG ImpersonationLocale; /* 0f98 */
965 ULONG IsImpersonating; /* 0f9c */
966 ULONG NlsCache; /* 0fa0 */
967 ULONG ShimData; /* 0fa4 */
968 ULONG HeapVirtualAffinity; /* 0fa8 */
969 ULONG CurrentTransactionHandle; /* 0fac */
970 ULONG ActiveFrame; /* 0fb0 */
971 ULONG FlsSlots; /* 0fb4 */
972 ULONG PreferredLanguages; /* 0fb8 */
973 ULONG UserPrefLanguages; /* 0fbc */
974 ULONG MergedPrefLanguages; /* 0fc0 */
975 ULONG MuiImpersonation; /* 0fc4 */
976 USHORT CrossTebFlags; /* 0fc8 */
977 USHORT SameTebFlags; /* 0fca */
978 ULONG TxnScopeEnterCallback; /* 0fcc */
979 ULONG TxnScopeExitCallback; /* 0fd0 */
980 ULONG TxnScopeContext; /* 0fd4 */
981 ULONG LockCount; /* 0fd8 */
982 LONG WowTebOffset; /* 0fdc */
983 ULONG ResourceRetValue; /* 0fe0 */
984 ULONG ReservedForWdf; /* 0fe4 */
985 ULONGLONG ReservedForCrt; /* 0fe8 */
986 GUID EffectiveContainerId; /* 0ff0 */
987 } TEB32;
989 typedef struct _TEB64
991 NT_TIB64 Tib; /* 0000 */
992 ULONG64 EnvironmentPointer; /* 0038 */
993 CLIENT_ID64 ClientId; /* 0040 */
994 ULONG64 ActiveRpcHandle; /* 0050 */
995 ULONG64 ThreadLocalStoragePointer; /* 0058 */
996 ULONG64 Peb; /* 0060 */
997 ULONG LastErrorValue; /* 0068 */
998 ULONG CountOfOwnedCriticalSections; /* 006c */
999 ULONG64 CsrClientThread; /* 0070 */
1000 ULONG64 Win32ThreadInfo; /* 0078 */
1001 ULONG User32Reserved[26]; /* 0080 */
1002 ULONG UserReserved[5]; /* 00e8 */
1003 ULONG64 WOW32Reserved; /* 0100 */
1004 ULONG CurrentLocale; /* 0108 */
1005 ULONG FpSoftwareStatusRegister; /* 010c */
1006 ULONG64 ReservedForDebuggerInstrumentation[16]; /* 0110 */
1007 ULONG64 SystemReserved1[30]; /* 0190 */
1008 char PlaceholderCompatibilityMode; /* 0280 */
1009 char PlaceholderReserved[11]; /* 0281 */
1010 DWORD ProxiedProcessId; /* 028c */
1011 ACTIVATION_CONTEXT_STACK64 ActivationContextStack; /* 0290 */
1012 UCHAR WorkingOnBehalfOfTicket[8]; /* 02b8 */
1013 LONG ExceptionCode; /* 02c0 */
1014 ULONG64 ActivationContextStackPointer; /* 02c8 */
1015 ULONG64 InstrumentationCallbackSp; /* 02d0 */
1016 ULONG64 InstrumentationCallbackPreviousPc; /* 02d8 */
1017 ULONG64 InstrumentationCallbackPreviousSp; /* 02e0 */
1018 ULONG TxFsContext; /* 02e8 */
1019 BOOLEAN InstrumentationCallbackDisabled; /* 02ec */
1020 ULONG64 GdiTebBatch[0x9d]; /* 02f0 */
1021 CLIENT_ID64 RealClientId; /* 07d8 */
1022 ULONG64 GdiCachedProcessHandle; /* 07e8 */
1023 ULONG GdiClientPID; /* 07f0 */
1024 ULONG GdiClientTID; /* 07f4 */
1025 ULONG64 GdiThreadLocaleInfo; /* 07f8 */
1026 ULONG64 Win32ClientInfo[62]; /* 0800 */
1027 ULONG64 glDispatchTable[233]; /* 09f0 */
1028 ULONG64 glReserved1[29]; /* 1138 */
1029 ULONG64 glReserved2; /* 1220 */
1030 ULONG64 glSectionInfo; /* 1228 */
1031 ULONG64 glSection; /* 1230 */
1032 ULONG64 glTable; /* 1238 */
1033 ULONG64 glCurrentRC; /* 1240 */
1034 ULONG64 glContext; /* 1248 */
1035 ULONG LastStatusValue; /* 1250 */
1036 UNICODE_STRING64 StaticUnicodeString; /* 1258 */
1037 WCHAR StaticUnicodeBuffer[261]; /* 1268 */
1038 ULONG64 DeallocationStack; /* 1478 */
1039 ULONG64 TlsSlots[64]; /* 1480 */
1040 LIST_ENTRY64 TlsLinks; /* 1680 */
1041 ULONG64 Vdm; /* 1690 */
1042 ULONG64 ReservedForNtRpc; /* 1698 */
1043 ULONG64 DbgSsReserved[2]; /* 16a0 */
1044 ULONG HardErrorDisabled; /* 16b0 */
1045 ULONG64 Instrumentation[16]; /* 16b8 */
1046 ULONG64 WinSockData; /* 1738 */
1047 ULONG GdiBatchCount; /* 1740 */
1048 ULONG Spare2; /* 1744 */
1049 ULONG GuaranteedStackBytes; /* 1748 */
1050 ULONG64 ReservedForPerf; /* 1750 */
1051 ULONG64 ReservedForOle; /* 1758 */
1052 ULONG WaitingOnLoaderLock; /* 1760 */
1053 ULONG64 Reserved5[3]; /* 1768 */
1054 ULONG64 TlsExpansionSlots; /* 1780 */
1055 ULONG64 DeallocationBStore; /* 1788 */
1056 ULONG64 BStoreLimit; /* 1790 */
1057 ULONG ImpersonationLocale; /* 1798 */
1058 ULONG IsImpersonating; /* 179c */
1059 ULONG64 NlsCache; /* 17a0 */
1060 ULONG64 ShimData; /* 17a8 */
1061 ULONG HeapVirtualAffinity; /* 17b0 */
1062 ULONG64 CurrentTransactionHandle; /* 17b8 */
1063 ULONG64 ActiveFrame; /* 17c0 */
1064 ULONG64 FlsSlots; /* 17c8 */
1065 ULONG64 PreferredLanguages; /* 17d0 */
1066 ULONG64 UserPrefLanguages; /* 17d8 */
1067 ULONG64 MergedPrefLanguages; /* 17e0 */
1068 ULONG MuiImpersonation; /* 17e8 */
1069 USHORT CrossTebFlags; /* 17ec */
1070 USHORT SameTebFlags; /* 17ee */
1071 ULONG64 TxnScopeEnterCallback; /* 17f0 */
1072 ULONG64 TxnScopeExitCallback; /* 17f8 */
1073 ULONG64 TxnScopeContext; /* 1800 */
1074 ULONG LockCount; /* 1808 */
1075 LONG WowTebOffset; /* 180c */
1076 ULONG64 ResourceRetValue; /* 1810 */
1077 ULONG64 ReservedForWdf; /* 1818 */
1078 ULONGLONG ReservedForCrt; /* 1820 */
1079 GUID EffectiveContainerId; /* 1828 */
1080 } TEB64;
1082 /* reserved TEB64 TLS slots for Wow64 */
1083 #define WOW64_TLS_CPURESERVED 1
1084 #define WOW64_TLS_TEMPLIST 3
1085 #define WOW64_TLS_FILESYSREDIR 8
1088 /***********************************************************************
1089 * Enums
1092 typedef enum _FILE_INFORMATION_CLASS {
1093 FileDirectoryInformation = 1,
1094 FileFullDirectoryInformation,
1095 FileBothDirectoryInformation,
1096 FileBasicInformation,
1097 FileStandardInformation,
1098 FileInternalInformation,
1099 FileEaInformation,
1100 FileAccessInformation,
1101 FileNameInformation,
1102 FileRenameInformation,
1103 FileLinkInformation,
1104 FileNamesInformation,
1105 FileDispositionInformation,
1106 FilePositionInformation,
1107 FileFullEaInformation,
1108 FileModeInformation,
1109 FileAlignmentInformation,
1110 FileAllInformation,
1111 FileAllocationInformation,
1112 FileEndOfFileInformation,
1113 FileAlternateNameInformation,
1114 FileStreamInformation,
1115 FilePipeInformation,
1116 FilePipeLocalInformation,
1117 FilePipeRemoteInformation,
1118 FileMailslotQueryInformation,
1119 FileMailslotSetInformation,
1120 FileCompressionInformation,
1121 FileObjectIdInformation,
1122 FileCompletionInformation,
1123 FileMoveClusterInformation,
1124 FileQuotaInformation,
1125 FileReparsePointInformation,
1126 FileNetworkOpenInformation,
1127 FileAttributeTagInformation,
1128 FileTrackingInformation,
1129 FileIdBothDirectoryInformation,
1130 FileIdFullDirectoryInformation,
1131 FileValidDataLengthInformation,
1132 FileShortNameInformation,
1133 FileIoCompletionNotificationInformation,
1134 FileIoStatusBlockRangeInformation,
1135 FileIoPriorityHintInformation,
1136 FileSfioReserveInformation,
1137 FileSfioVolumeInformation,
1138 FileHardLinkInformation,
1139 FileProcessIdsUsingFileInformation,
1140 FileNormalizedNameInformation,
1141 FileNetworkPhysicalNameInformation,
1142 FileIdGlobalTxDirectoryInformation,
1143 FileIsRemoteDeviceInformation,
1144 FileAttributeCacheInformation,
1145 FileNumaNodeInformation,
1146 FileStandardLinkInformation,
1147 FileRemoteProtocolInformation,
1148 FileRenameInformationBypassAccessCheck,
1149 FileLinkInformationBypassAccessCheck,
1150 FileVolumeNameInformation,
1151 FileIdInformation,
1152 FileIdExtdDirectoryInformation,
1153 FileReplaceCompletionInformation,
1154 FileHardLinkFullIdInformation,
1155 FileIdExtdBothDirectoryInformation,
1156 FileMaximumInformation
1157 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
1159 typedef struct _FILE_DIRECTORY_INFORMATION {
1160 ULONG NextEntryOffset;
1161 ULONG FileIndex;
1162 LARGE_INTEGER CreationTime;
1163 LARGE_INTEGER LastAccessTime;
1164 LARGE_INTEGER LastWriteTime;
1165 LARGE_INTEGER ChangeTime;
1166 LARGE_INTEGER EndOfFile;
1167 LARGE_INTEGER AllocationSize;
1168 ULONG FileAttributes;
1169 ULONG FileNameLength;
1170 WCHAR FileName[ANYSIZE_ARRAY];
1171 } FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
1173 typedef struct _FILE_FULL_DIRECTORY_INFORMATION {
1174 ULONG NextEntryOffset;
1175 ULONG FileIndex;
1176 LARGE_INTEGER CreationTime;
1177 LARGE_INTEGER LastAccessTime;
1178 LARGE_INTEGER LastWriteTime;
1179 LARGE_INTEGER ChangeTime;
1180 LARGE_INTEGER EndOfFile;
1181 LARGE_INTEGER AllocationSize;
1182 ULONG FileAttributes;
1183 ULONG FileNameLength;
1184 ULONG EaSize;
1185 WCHAR FileName[ANYSIZE_ARRAY];
1186 } FILE_FULL_DIRECTORY_INFORMATION, *PFILE_FULL_DIRECTORY_INFORMATION,
1187 FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION;
1189 typedef struct _FILE_ID_FULL_DIRECTORY_INFORMATION {
1190 ULONG NextEntryOffset;
1191 ULONG FileIndex;
1192 LARGE_INTEGER CreationTime;
1193 LARGE_INTEGER LastAccessTime;
1194 LARGE_INTEGER LastWriteTime;
1195 LARGE_INTEGER ChangeTime;
1196 LARGE_INTEGER EndOfFile;
1197 LARGE_INTEGER AllocationSize;
1198 ULONG FileAttributes;
1199 ULONG FileNameLength;
1200 ULONG EaSize;
1201 LARGE_INTEGER FileId;
1202 WCHAR FileName[ANYSIZE_ARRAY];
1203 } FILE_ID_FULL_DIRECTORY_INFORMATION, *PFILE_ID_FULL_DIRECTORY_INFORMATION;
1205 typedef struct _FILE_BOTH_DIRECTORY_INFORMATION {
1206 ULONG NextEntryOffset;
1207 ULONG FileIndex;
1208 LARGE_INTEGER CreationTime;
1209 LARGE_INTEGER LastAccessTime;
1210 LARGE_INTEGER LastWriteTime;
1211 LARGE_INTEGER ChangeTime;
1212 LARGE_INTEGER EndOfFile;
1213 LARGE_INTEGER AllocationSize;
1214 ULONG FileAttributes;
1215 ULONG FileNameLength;
1216 ULONG EaSize;
1217 CHAR ShortNameLength;
1218 WCHAR ShortName[12];
1219 WCHAR FileName[ANYSIZE_ARRAY];
1220 } FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION,
1221 FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
1223 typedef struct _FILE_ID_BOTH_DIRECTORY_INFORMATION {
1224 ULONG NextEntryOffset;
1225 ULONG FileIndex;
1226 LARGE_INTEGER CreationTime;
1227 LARGE_INTEGER LastAccessTime;
1228 LARGE_INTEGER LastWriteTime;
1229 LARGE_INTEGER ChangeTime;
1230 LARGE_INTEGER EndOfFile;
1231 LARGE_INTEGER AllocationSize;
1232 ULONG FileAttributes;
1233 ULONG FileNameLength;
1234 ULONG EaSize;
1235 CHAR ShortNameLength;
1236 WCHAR ShortName[12];
1237 LARGE_INTEGER FileId;
1238 WCHAR FileName[ANYSIZE_ARRAY];
1239 } FILE_ID_BOTH_DIRECTORY_INFORMATION, *PFILE_ID_BOTH_DIRECTORY_INFORMATION;
1241 typedef struct _FILE_ID_GLOBAL_TX_DIR_INFORMATION {
1242 ULONG NextEntryOffset;
1243 ULONG FileIndex;
1244 LARGE_INTEGER CreationTime;
1245 LARGE_INTEGER LastAccessTime;
1246 LARGE_INTEGER LastWriteTime;
1247 LARGE_INTEGER ChangeTime;
1248 LARGE_INTEGER EndOfFile;
1249 LARGE_INTEGER AllocationSize;
1250 ULONG FileAttributes;
1251 ULONG FileNameLength;
1252 LARGE_INTEGER FileId;
1253 GUID LockingTransactionId;
1254 ULONG TxInfoFlags;
1255 WCHAR FileName[ANYSIZE_ARRAY];
1256 } FILE_ID_GLOBAL_TX_DIR_INFORMATION, *PFILE_ID_GLOBAL_TX_DIR_INFORMATION;
1258 typedef struct _FILE_BASIC_INFORMATION {
1259 LARGE_INTEGER CreationTime;
1260 LARGE_INTEGER LastAccessTime;
1261 LARGE_INTEGER LastWriteTime;
1262 LARGE_INTEGER ChangeTime;
1263 ULONG FileAttributes;
1264 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
1266 typedef struct _FILE_STANDARD_INFORMATION {
1267 LARGE_INTEGER AllocationSize;
1268 LARGE_INTEGER EndOfFile;
1269 ULONG NumberOfLinks;
1270 BOOLEAN DeletePending;
1271 BOOLEAN Directory;
1272 } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
1274 typedef struct _FILE_INTERNAL_INFORMATION {
1275 LARGE_INTEGER IndexNumber;
1276 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
1278 typedef struct _FILE_ID_128 {
1279 UCHAR Identifier[16];
1280 } FILE_ID_128, *PFILE_ID_128;
1282 typedef struct _FILE_ID_INFORMATION {
1283 ULONGLONG VolumeSerialNumber;
1284 FILE_ID_128 FileId;
1285 } FILE_ID_INFORMATION, *PFILE_ID_INFORMATION;
1287 typedef struct _FILE_EA_INFORMATION {
1288 ULONG EaSize;
1289 } FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
1291 typedef struct _FILE_ACCESS_INFORMATION {
1292 ACCESS_MASK AccessFlags;
1293 } FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
1295 typedef struct _FILE_NAME_INFORMATION {
1296 ULONG FileNameLength;
1297 WCHAR FileName[1];
1298 } FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
1300 typedef struct _FILE_RENAME_INFORMATION {
1301 BOOLEAN ReplaceIfExists;
1302 HANDLE RootDirectory;
1303 ULONG FileNameLength;
1304 WCHAR FileName[1];
1305 } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
1307 typedef struct _FILE_LINK_INFORMATION {
1308 BOOLEAN ReplaceIfExists;
1309 HANDLE RootDirectory;
1310 ULONG FileNameLength;
1311 WCHAR FileName[1];
1312 } FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION;
1314 typedef struct _FILE_NAMES_INFORMATION {
1315 ULONG NextEntryOffset;
1316 ULONG FileIndex;
1317 ULONG FileNameLength;
1318 WCHAR FileName[1];
1319 } FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
1321 typedef struct _FILE_DISPOSITION_INFORMATION {
1322 BOOLEAN DoDeleteFile;
1323 } FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
1325 typedef struct _FILE_POSITION_INFORMATION {
1326 LARGE_INTEGER CurrentByteOffset;
1327 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
1329 typedef struct _FILE_ALIGNMENT_INFORMATION {
1330 ULONG AlignmentRequirement;
1331 } FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION;
1333 typedef struct _FILE_ALLOCATION_INFORMATION {
1334 LARGE_INTEGER AllocationSize;
1335 } FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
1337 typedef struct _FILE_END_OF_FILE_INFORMATION {
1338 LARGE_INTEGER EndOfFile;
1339 } FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
1341 typedef struct _FILE_NETWORK_OPEN_INFORMATION {
1342 LARGE_INTEGER CreationTime;
1343 LARGE_INTEGER LastAccessTime;
1344 LARGE_INTEGER LastWriteTime;
1345 LARGE_INTEGER ChangeTime;
1346 LARGE_INTEGER AllocationSize;
1347 LARGE_INTEGER EndOfFile;
1348 ULONG FileAttributes;
1349 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
1351 typedef struct _FILE_FULL_EA_INFORMATION {
1352 ULONG NextEntryOffset;
1353 UCHAR Flags;
1354 UCHAR EaNameLength;
1355 USHORT EaValueLength;
1356 CHAR EaName[1];
1357 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
1359 typedef struct _FILE_MODE_INFORMATION {
1360 ULONG Mode;
1361 } FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION;
1363 typedef struct _FILE_STREAM_INFORMATION
1365 ULONG NextEntryOffset;
1366 ULONG StreamNameLength;
1367 LARGE_INTEGER StreamSize;
1368 LARGE_INTEGER StreamAllocationSize;
1369 WCHAR StreamName[1];
1370 } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
1372 typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION
1374 ULONG FileAttributes;
1375 ULONG ReparseTag;
1376 } FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
1378 typedef struct _FILE_MAILSLOT_QUERY_INFORMATION {
1379 ULONG MaximumMessageSize;
1380 ULONG MailslotQuota;
1381 ULONG NextMessageSize;
1382 ULONG MessagesAvailable;
1383 LARGE_INTEGER ReadTimeout;
1384 } FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION;
1386 typedef struct _FILE_MAILSLOT_SET_INFORMATION {
1387 LARGE_INTEGER ReadTimeout;
1388 } FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
1390 typedef struct _FILE_PIPE_INFORMATION {
1391 ULONG ReadMode;
1392 ULONG CompletionMode;
1393 } FILE_PIPE_INFORMATION, *PFILE_PIPE_INFORMATION;
1395 typedef struct _FILE_PIPE_LOCAL_INFORMATION {
1396 ULONG NamedPipeType;
1397 ULONG NamedPipeConfiguration;
1398 ULONG MaximumInstances;
1399 ULONG CurrentInstances;
1400 ULONG InboundQuota;
1401 ULONG ReadDataAvailable;
1402 ULONG OutboundQuota;
1403 ULONG WriteQuotaAvailable;
1404 ULONG NamedPipeState;
1405 ULONG NamedPipeEnd;
1406 } FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
1408 #define FILE_PIPE_DISCONNECTED_STATE 0x00000001
1409 #define FILE_PIPE_LISTENING_STATE 0x00000002
1410 #define FILE_PIPE_CONNECTED_STATE 0x00000003
1411 #define FILE_PIPE_CLOSING_STATE 0x00000004
1413 typedef struct _FILE_OBJECTID_BUFFER
1415 BYTE ObjectId[16];
1416 union
1418 struct
1420 BYTE BirthVolumeId[16];
1421 BYTE BirthObjectId[16];
1422 BYTE DomainId[16];
1423 } DUMMYSTRUCTNAME;
1424 BYTE ExtendedInfo[48];
1425 } DUMMYUNIONNAME;
1426 } FILE_OBJECTID_BUFFER, *PFILE_OBJECTID_BUFFER;
1428 typedef struct _FILE_OBJECTID_INFORMATION {
1429 LONGLONG FileReference;
1430 UCHAR ObjectId[16];
1431 union {
1432 struct {
1433 UCHAR BirthVolumeId[16];
1434 UCHAR BirthObjectId[16];
1435 UCHAR DomainId[16];
1436 } DUMMYSTRUCTNAME;
1437 UCHAR ExtendedInfo[48];
1438 } DUMMYUNIONNAME;
1439 } FILE_OBJECTID_INFORMATION, *PFILE_OBJECTID_INFORMATION;
1441 typedef struct _FILE_QUOTA_INFORMATION {
1442 ULONG NextEntryOffset;
1443 ULONG SidLength;
1444 LARGE_INTEGER ChangeTime;
1445 LARGE_INTEGER QuotaUsed;
1446 LARGE_INTEGER QuotaThreshold;
1447 LARGE_INTEGER QuotaLimit;
1448 SID Sid;
1449 } FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION;
1451 typedef struct _FILE_REPARSE_POINT_INFORMATION {
1452 LONGLONG FileReference;
1453 ULONG Tag;
1454 } FILE_REPARSE_POINT_INFORMATION, *PFILE_REPARSE_POINT_INFORMATION;
1456 typedef struct _FILE_ALL_INFORMATION {
1457 FILE_BASIC_INFORMATION BasicInformation;
1458 FILE_STANDARD_INFORMATION StandardInformation;
1459 FILE_INTERNAL_INFORMATION InternalInformation;
1460 FILE_EA_INFORMATION EaInformation;
1461 FILE_ACCESS_INFORMATION AccessInformation;
1462 FILE_POSITION_INFORMATION PositionInformation;
1463 FILE_MODE_INFORMATION ModeInformation;
1464 FILE_ALIGNMENT_INFORMATION AlignmentInformation;
1465 FILE_NAME_INFORMATION NameInformation;
1466 } FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION;
1468 typedef struct _FILE_IO_COMPLETION_NOTIFICATION_INFORMATION {
1469 ULONG Flags;
1470 } FILE_IO_COMPLETION_NOTIFICATION_INFORMATION, *PFILE_IO_COMPLETION_NOTIFICATION_INFORMATION;
1472 #define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS 0x1
1473 #define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2
1474 #define FILE_SKIP_SET_USER_EVENT_ON_FAST_IO 0x4
1476 typedef struct _PROCESS_INSTRUMENTATION_CALLBACK_INFORMATION
1478 ULONG Version;
1479 ULONG Reserved;
1480 VOID *Callback;
1481 } PROCESS_INSTRUMENTATION_CALLBACK_INFORMATION, *PPROCESS_INSTRUMENTATION_CALLBACK_INFORMATION;
1483 typedef enum _FSINFOCLASS {
1484 FileFsVolumeInformation = 1,
1485 FileFsLabelInformation,
1486 FileFsSizeInformation,
1487 FileFsDeviceInformation,
1488 FileFsAttributeInformation,
1489 FileFsControlInformation,
1490 FileFsFullSizeInformation,
1491 FileFsObjectIdInformation,
1492 FileFsMaximumInformation
1493 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
1495 typedef enum _KEY_INFORMATION_CLASS {
1496 KeyBasicInformation,
1497 KeyNodeInformation,
1498 KeyFullInformation,
1499 KeyNameInformation,
1500 KeyCachedInformation,
1501 KeyFlagsInformation,
1502 KeyVirtualizationInformation,
1503 KeyHandleTagsInformation,
1504 MaxKeyInfoClass
1505 } KEY_INFORMATION_CLASS;
1507 typedef enum _KEY_VALUE_INFORMATION_CLASS {
1508 KeyValueBasicInformation,
1509 KeyValueFullInformation,
1510 KeyValuePartialInformation,
1511 KeyValueFullInformationAlign64,
1512 KeyValuePartialInformationAlign64
1513 } KEY_VALUE_INFORMATION_CLASS;
1515 typedef enum _OBJECT_INFORMATION_CLASS {
1516 ObjectBasicInformation,
1517 ObjectNameInformation,
1518 ObjectTypeInformation,
1519 ObjectTypesInformation,
1520 ObjectDataInformation
1521 } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
1523 typedef enum _PROCESSINFOCLASS {
1524 ProcessBasicInformation = 0,
1525 ProcessQuotaLimits = 1,
1526 ProcessIoCounters = 2,
1527 ProcessVmCounters = 3,
1528 ProcessTimes = 4,
1529 ProcessBasePriority = 5,
1530 ProcessRaisePriority = 6,
1531 ProcessDebugPort = 7,
1532 ProcessExceptionPort = 8,
1533 ProcessAccessToken = 9,
1534 ProcessLdtInformation = 10,
1535 ProcessLdtSize = 11,
1536 ProcessDefaultHardErrorMode = 12,
1537 ProcessIoPortHandlers = 13,
1538 ProcessPooledUsageAndLimits = 14,
1539 ProcessWorkingSetWatch = 15,
1540 ProcessUserModeIOPL = 16,
1541 ProcessEnableAlignmentFaultFixup = 17,
1542 ProcessPriorityClass = 18,
1543 ProcessWx86Information = 19,
1544 ProcessHandleCount = 20,
1545 ProcessAffinityMask = 21,
1546 ProcessPriorityBoost = 22,
1547 ProcessDeviceMap = 23,
1548 ProcessSessionInformation = 24,
1549 ProcessForegroundInformation = 25,
1550 ProcessWow64Information = 26,
1551 ProcessImageFileName = 27,
1552 ProcessLUIDDeviceMapsEnabled = 28,
1553 ProcessBreakOnTermination = 29,
1554 ProcessDebugObjectHandle = 30,
1555 ProcessDebugFlags = 31,
1556 ProcessHandleTracing = 32,
1557 ProcessIoPriority = 33,
1558 ProcessExecuteFlags = 34,
1559 ProcessTlsInformation = 35,
1560 ProcessCookie = 36,
1561 ProcessImageInformation = 37,
1562 ProcessCycleTime = 38,
1563 ProcessPagePriority = 39,
1564 ProcessInstrumentationCallback = 40,
1565 ProcessThreadStackAllocation = 41,
1566 ProcessWorkingSetWatchEx = 42,
1567 ProcessImageFileNameWin32 = 43,
1568 MaxProcessInfoClass,
1569 #ifdef __WINESRC__
1570 ProcessWineMakeProcessSystem = 1000,
1571 #endif
1572 } PROCESSINFOCLASS, PROCESS_INFORMATION_CLASS;
1574 #define MEM_EXECUTE_OPTION_DISABLE 0x01
1575 #define MEM_EXECUTE_OPTION_ENABLE 0x02
1576 #define MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION 0x04
1577 #define MEM_EXECUTE_OPTION_PERMANENT 0x08
1579 typedef enum _SECTION_INHERIT {
1580 ViewShare = 1,
1581 ViewUnmap = 2
1582 } SECTION_INHERIT;
1584 typedef enum _SYSTEM_INFORMATION_CLASS {
1585 SystemBasicInformation = 0,
1586 SystemCpuInformation = 1,
1587 SystemPerformanceInformation = 2,
1588 SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
1589 SystemPathInformation = 4,
1590 SystemProcessInformation = 5,
1591 SystemCallCountInformation = 6,
1592 SystemDeviceInformation = 7,
1593 SystemProcessorPerformanceInformation = 8,
1594 SystemFlagsInformation = 9,
1595 SystemCallTimeInformation = 10,
1596 SystemModuleInformation = 11,
1597 SystemLocksInformation = 12,
1598 SystemStackTraceInformation = 13,
1599 SystemPagedPoolInformation = 14,
1600 SystemNonPagedPoolInformation = 15,
1601 SystemHandleInformation = 16,
1602 SystemObjectInformation = 17,
1603 SystemPageFileInformation = 18,
1604 SystemVdmInstemulInformation = 19,
1605 SystemVdmBopInformation = 20,
1606 SystemFileCacheInformation = 21,
1607 SystemPoolTagInformation = 22,
1608 SystemInterruptInformation = 23,
1609 SystemDpcBehaviorInformation = 24,
1610 SystemFullMemoryInformation = 25,
1611 SystemNotImplemented6 = 25,
1612 SystemLoadGdiDriverInformation = 26,
1613 SystemUnloadGdiDriverInformation = 27,
1614 SystemTimeAdjustmentInformation = 28,
1615 SystemTimeAdjustment = 28,
1616 SystemSummaryMemoryInformation = 29,
1617 SystemMirrorMemoryInformation = 30,
1618 SystemPerformanceTraceInformation = 31,
1619 SystemObsolete0 = 32,
1620 SystemExceptionInformation = 33,
1621 SystemCrashDumpStateInformation = 34,
1622 SystemKernelDebuggerInformation = 35,
1623 SystemContextSwitchInformation = 36,
1624 SystemRegistryQuotaInformation = 37,
1625 SystemExtendServiceTableInformation = 38,
1626 SystemPrioritySeperation = 39,
1627 SystemVerifierAddDriverInformation = 40,
1628 SystemVerifierRemoveDriverInformation = 41,
1629 SystemProcessorIdleInformation = 42,
1630 SystemLegacyDriverInformation = 43,
1631 SystemCurrentTimeZoneInformation = 44,
1632 SystemLookasideInformation = 45,
1633 SystemTimeSlipNotification = 46,
1634 SystemSessionCreate = 47,
1635 SystemSessionDetach = 48,
1636 SystemSessionInformation = 49,
1637 SystemRangeStartInformation = 50,
1638 SystemVerifierInformation = 51,
1639 SystemVerifierThunkExtend = 52,
1640 SystemSessionProcessesInformation = 53,
1641 SystemLoadGdiDriverInSystemSpace = 54,
1642 SystemNumaProcessorMap = 55,
1643 SystemPrefetcherInformation = 56,
1644 SystemExtendedProcessInformation = 57,
1645 SystemRecommendedSharedDataAlignment = 58,
1646 SystemComPlusPackage = 59,
1647 SystemNumaAvailableMemory = 60,
1648 SystemProcessorPowerInformation = 61,
1649 SystemEmulationBasicInformation = 62,
1650 SystemEmulationProcessorInformation = 63,
1651 SystemExtendedHandleInformation = 64,
1652 SystemLostDelayedWriteInformation = 65,
1653 SystemBigPoolInformation = 66,
1654 SystemSessionPoolTagInformation = 67,
1655 SystemSessionMappedViewInformation = 68,
1656 SystemHotpatchInformation = 69,
1657 SystemObjectSecurityMode = 70,
1658 SystemWatchdogTimerHandler = 71,
1659 SystemWatchdogTimerInformation = 72,
1660 SystemLogicalProcessorInformation = 73,
1661 SystemWow64SharedInformationObsolete = 74,
1662 SystemRegisterFirmwareTableInformationHandler = 75,
1663 SystemFirmwareTableInformation = 76,
1664 SystemModuleInformationEx = 77,
1665 SystemVerifierTriageInformation = 78,
1666 SystemSuperfetchInformation = 79,
1667 SystemMemoryListInformation = 80,
1668 SystemFileCacheInformationEx = 81,
1669 SystemThreadPriorityClientIdInformation = 82,
1670 SystemProcessorIdleCycleTimeInformation = 83,
1671 SystemVerifierCancellationInformation = 84,
1672 SystemProcessorPowerInformationEx = 85,
1673 SystemRefTraceInformation = 86,
1674 SystemSpecialPoolInformation = 87,
1675 SystemProcessIdInformation = 88,
1676 SystemErrorPortInformation = 89,
1677 SystemBootEnvironmentInformation = 90,
1678 SystemHypervisorInformation = 91,
1679 SystemVerifierInformationEx = 92,
1680 SystemTimeZoneInformation = 93,
1681 SystemImageFileExecutionOptionsInformation = 94,
1682 SystemCoverageInformation = 95,
1683 SystemPrefetchPatchInformation = 96,
1684 SystemVerifierFaultsInformation = 97,
1685 SystemSystemPartitionInformation = 98,
1686 SystemSystemDiskInformation = 99,
1687 SystemProcessorPerformanceDistribution = 100,
1688 SystemNumaProximityNodeInformation = 101,
1689 SystemDynamicTimeZoneInformation = 102,
1690 SystemCodeIntegrityInformation = 103,
1691 SystemProcessorMicrocodeUpdateInformation = 104,
1692 SystemProcessorBrandString = 105,
1693 SystemVirtualAddressInformation = 106,
1694 SystemLogicalProcessorInformationEx = 107,
1695 SystemProcessorCycleTimeInformation = 108,
1696 SystemStoreInformation = 109,
1697 SystemRegistryAppendString = 110,
1698 SystemAitSamplingValue = 111,
1699 SystemVhdBootInformation = 112,
1700 SystemCpuQuotaInformation = 113,
1701 SystemNativeBasicInformation = 114,
1702 SystemErrorPortTimeouts = 115,
1703 SystemLowPriorityIoInformation = 116,
1704 SystemTpmBootEntropyInformation = 117,
1705 SystemVerifierCountersInformation = 118,
1706 SystemPagedPoolInformationEx = 119,
1707 SystemSystemPtesInformationEx = 120,
1708 SystemNodeDistanceInformation = 121,
1709 SystemAcpiAuditInformation = 122,
1710 SystemBasicPerformanceInformation = 123,
1711 SystemQueryPerformanceCounterInformation = 124,
1712 SystemSessionBigPoolInformation = 125,
1713 SystemBootGraphicsInformation = 126,
1714 SystemScrubPhysicalMemoryInformation = 127,
1715 SystemBadPageInformation = 128,
1716 SystemProcessorProfileControlArea = 129,
1717 SystemCombinePhysicalMemoryInformation = 130,
1718 SystemEntropyInterruptTimingInformation = 131,
1719 SystemConsoleInformation = 132,
1720 SystemPlatformBinaryInformation = 133,
1721 SystemPolicyInformation = 134,
1722 SystemHypervisorProcessorCountInformation = 135,
1723 SystemDeviceDataInformation = 136,
1724 SystemDeviceDataEnumerationInformation = 137,
1725 SystemMemoryTopologyInformation = 138,
1726 SystemMemoryChannelInformation = 139,
1727 SystemBootLogoInformation = 140,
1728 SystemProcessorPerformanceInformationEx = 141,
1729 SystemCriticalProcessErrorLogInformation = 142,
1730 SystemSecureBootPolicyInformation = 143,
1731 SystemPageFileInformationEx = 144,
1732 SystemSecureBootInformation = 145,
1733 SystemEntropyInterruptTimingRawInformation = 146,
1734 SystemPortableWorkspaceEfiLauncherInformation = 147,
1735 SystemFullProcessInformation = 148,
1736 SystemKernelDebuggerInformationEx = 149,
1737 SystemBootMetadataInformation = 150,
1738 SystemSoftRebootInformation = 151,
1739 SystemElamCertificateInformation = 152,
1740 SystemOfflineDumpConfigInformation = 153,
1741 SystemProcessorFeaturesInformation = 154,
1742 SystemRegistryReconciliationInformation = 155,
1743 SystemEdidInformation = 156,
1744 SystemManufacturingInformation = 157,
1745 SystemEnergyEstimationConfigInformation = 158,
1746 SystemHypervisorDetailInformation = 159,
1747 SystemProcessorCycleStatsInformation = 160,
1748 SystemVmGenerationCountInformation = 161,
1749 SystemTrustedPlatformModuleInformation = 162,
1750 SystemKernelDebuggerFlags = 163,
1751 SystemCodeIntegrityPolicyInformation = 164,
1752 SystemIsolatedUserModeInformation = 165,
1753 SystemHardwareSecurityTestInterfaceResultsInformation = 166,
1754 SystemSingleModuleInformation = 167,
1755 SystemAllowedCpuSetsInformation = 168,
1756 SystemVsmProtectionInformation = 169,
1757 SystemInterruptCpuSetsInformation = 170,
1758 SystemSecureBootPolicyFullInformation = 171,
1759 SystemCodeIntegrityPolicyFullInformation = 172,
1760 SystemAffinitizedInterruptProcessorInformation = 173,
1761 SystemRootSiloInformation = 174,
1762 SystemCpuSetInformation = 175,
1763 SystemCpuSetTagInformation = 176,
1764 SystemWin32WerStartCallout = 177,
1765 SystemSecureKernelProfileInformation = 178,
1766 SystemCodeIntegrityPlatformManifestInformation = 179,
1767 SystemInterruptSteeringInformation = 180,
1768 SystemSupportedProcessorArchitectures = 181,
1769 SystemMemoryUsageInformation = 182,
1770 SystemCodeIntegrityCertificateInformation = 183,
1771 SystemPhysicalMemoryInformation = 184,
1772 SystemControlFlowTransition = 185,
1773 SystemKernelDebuggingAllowed = 186,
1774 SystemActivityModerationExeState = 187,
1775 SystemActivityModerationUserSettings = 188,
1776 SystemCodeIntegrityPoliciesFullInformation = 189,
1777 SystemCodeIntegrityUnlockInformation = 190,
1778 SystemIntegrityQuotaInformation = 191,
1779 SystemFlushInformation = 192,
1780 SystemProcessorIdleMaskInformation = 193,
1781 SystemSecureDumpEncryptionInformation = 194,
1782 SystemWriteConstraintInformation = 195,
1783 SystemKernelVaShadowInformation = 196,
1784 SystemHypervisorSharedPageInformation = 197,
1785 SystemFirmwareBootPerformanceInformation = 198,
1786 SystemCodeIntegrityVerificationInformation = 199,
1787 SystemFirmwarePartitionInformation = 200,
1788 SystemSpeculationControlInformation = 201,
1789 SystemDmaGuardPolicyInformation = 202,
1790 SystemEnclaveLaunchControlInformation = 203,
1791 SystemWorkloadAllowedCpuSetsInformation = 204,
1792 SystemCodeIntegrityUnlockModeInformation = 205,
1793 SystemLeapSecondInformation = 206,
1794 SystemFlags2Information = 207,
1795 SystemSecurityModelInformation = 208,
1796 SystemCodeIntegritySyntheticCacheInformation = 209,
1797 SystemFeatureConfigurationInformation = 210,
1798 SystemFeatureConfigurationSectionInformation = 211,
1799 SystemFeatureUsageSubscriptionInformation = 212,
1800 SystemSecureSpeculationControlInformation = 213,
1801 SystemSpacesBootInformation = 214,
1802 SystemFwRamdiskInformation = 215,
1803 SystemWheaIpmiHardwareInformation = 216,
1804 SystemDifSetRuleClassInformation = 217,
1805 SystemDifClearRuleClassInformation = 218,
1806 SystemDifApplyPluginVerificationOnDriver = 219,
1807 SystemDifRemovePluginVerificationOnDriver = 220,
1808 SystemShadowStackInformation = 221,
1809 SystemBuildVersionInformation = 222,
1810 #ifdef __WINESRC__
1811 SystemWineVersionInformation = 1000,
1812 #endif
1813 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
1815 typedef struct _SYSTEM_CODEINTEGRITY_INFORMATION
1817 ULONG Length;
1818 ULONG CodeIntegrityOptions;
1819 } SYSTEM_CODEINTEGRITY_INFORMATION, *PSYSTEM_CODEINTEGRITY_INFORMATION;
1821 #define CODEINTEGRITY_OPTION_ENABLED 0x0001
1822 #define CODEINTEGRITY_OPTION_TESTSIGN 0x0002
1823 #define CODEINTEGRITY_OPTION_UMCI_ENABLED 0x0004
1824 #define CODEINTEGRITY_OPTION_UMCI_AUDITMODE_ENABLED 0x0008
1825 #define CODEINTEGRITY_OPTION_UMCI_EXCLUSIONPATHS_ENABLED 0x0010
1826 #define CODEINTEGRITY_OPTION_TEST_BUILD 0x0020
1827 #define CODEINTEGRITY_OPTION_PREPRODUCTION_BUILD 0x0040
1828 #define CODEINTEGRITY_OPTION_DEBUGMODE_ENABLED 0x0080
1829 #define CODEINTEGRITY_OPTION_FLIGHT_BUILD 0x0100
1830 #define CODEINTEGRITY_OPTION_FLIGHTING_ENABLED 0x0200
1831 #define CODEINTEGRITY_OPTION_HVCI_KMCI_ENABLED 0x0400
1832 #define CODEINTEGRITY_OPTION_HVCI_KMCI_AUDITMODE_ENABLED 0x0800
1833 #define CODEINTEGRITY_OPTION_HVCI_KMCI_STRICTMODE_ENABLED 0x1000
1834 #define CODEINTEGRITY_OPTION_HVCI_IUM_ENABLED 0x2000
1836 typedef enum _THREADINFOCLASS {
1837 ThreadBasicInformation = 0,
1838 ThreadTimes,
1839 ThreadPriority,
1840 ThreadBasePriority,
1841 ThreadAffinityMask,
1842 ThreadImpersonationToken,
1843 ThreadDescriptorTableEntry,
1844 ThreadEnableAlignmentFaultFixup,
1845 ThreadEventPair_Reusable,
1846 ThreadQuerySetWin32StartAddress,
1847 ThreadZeroTlsCell,
1848 ThreadPerformanceCount,
1849 ThreadAmILastThread,
1850 ThreadIdealProcessor,
1851 ThreadPriorityBoost,
1852 ThreadSetTlsArrayAddress,
1853 ThreadIsIoPending,
1854 ThreadHideFromDebugger,
1855 ThreadBreakOnTermination,
1856 ThreadSwitchLegacyState,
1857 ThreadIsTerminated,
1858 ThreadLastSystemCall,
1859 ThreadIoPriority,
1860 ThreadCycleTime,
1861 ThreadPagePriority,
1862 ThreadActualBasePriority,
1863 ThreadTebInformation,
1864 ThreadCSwitchMon,
1865 ThreadCSwitchPmu,
1866 ThreadWow64Context,
1867 ThreadGroupInformation,
1868 ThreadUmsInformation,
1869 ThreadCounterProfiling,
1870 ThreadIdealProcessorEx,
1871 ThreadSuspendCount = 35,
1872 ThreadDescription = 38,
1873 MaxThreadInfoClass
1874 } THREADINFOCLASS;
1876 typedef struct _THREAD_BASIC_INFORMATION
1878 NTSTATUS ExitStatus;
1879 PVOID TebBaseAddress;
1880 CLIENT_ID ClientId;
1881 ULONG_PTR AffinityMask;
1882 LONG Priority;
1883 LONG BasePriority;
1884 } THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
1886 typedef struct _THREAD_DESCRIPTOR_INFORMATION
1888 DWORD Selector;
1889 LDT_ENTRY Entry;
1890 } THREAD_DESCRIPTOR_INFORMATION, *PTHREAD_DESCRIPTOR_INFORMATION;
1892 typedef struct _THREAD_DESCRIPTION_INFORMATION
1894 UNICODE_STRING Description;
1895 } THREAD_DESCRIPTION_INFORMATION, *PTHREAD_DESCRIPTION_INFORMATION;
1897 typedef struct _KERNEL_USER_TIMES {
1898 LARGE_INTEGER CreateTime;
1899 LARGE_INTEGER ExitTime;
1900 LARGE_INTEGER KernelTime;
1901 LARGE_INTEGER UserTime;
1902 } KERNEL_USER_TIMES, *PKERNEL_USER_TIMES;
1904 typedef enum _WINSTATIONINFOCLASS {
1905 WinStationInformation = 8
1906 } WINSTATIONINFOCLASS;
1908 typedef enum _MEMORY_INFORMATION_CLASS {
1909 MemoryBasicInformation,
1910 MemoryWorkingSetInformation,
1911 MemoryMappedFilenameInformation,
1912 MemoryRegionInformation,
1913 MemoryWorkingSetExInformation,
1914 MemorySharedCommitInformation,
1915 MemoryImageInformation,
1916 MemoryRegionInformationEx,
1917 MemoryPrivilegedBasicInformation,
1918 MemoryEnclaveImageInformation,
1919 MemoryBasicInformationCapped,
1920 MemoryPhysicalContiguityInformation,
1921 #ifdef __WINESRC__
1922 MemoryWineUnixFuncs = 1000,
1923 MemoryWineUnixWow64Funcs,
1924 #endif
1925 } MEMORY_INFORMATION_CLASS;
1927 typedef struct _MEMORY_SECTION_NAME
1929 UNICODE_STRING SectionFileName;
1930 } MEMORY_SECTION_NAME, *PMEMORY_SECTION_NAME;
1932 typedef union _MEMORY_WORKING_SET_EX_BLOCK {
1933 ULONG_PTR Flags;
1934 struct {
1935 ULONG_PTR Valid : 1;
1936 ULONG_PTR ShareCount : 3;
1937 ULONG_PTR Win32Protection : 11;
1938 ULONG_PTR Shared : 1;
1939 ULONG_PTR Node : 6;
1940 ULONG_PTR Locked : 1;
1941 ULONG_PTR LargePage : 1;
1942 } DUMMYSTRUCTNAME;
1943 } MEMORY_WORKING_SET_EX_BLOCK, *PMEMORY_WORKING_SET_EX_BLOCK;
1945 typedef struct _MEMORY_WORKING_SET_EX_INFORMATION {
1946 PVOID VirtualAddress;
1947 MEMORY_WORKING_SET_EX_BLOCK VirtualAttributes;
1948 } MEMORY_WORKING_SET_EX_INFORMATION, *PMEMORY_WORKING_SET_EX_INFORMATION;
1950 typedef enum _MUTANT_INFORMATION_CLASS
1952 MutantBasicInformation
1953 } MUTANT_INFORMATION_CLASS, *PMUTANT_INFORMATION_CLASS;
1955 typedef struct _MUTANT_BASIC_INFORMATION {
1956 LONG CurrentCount;
1957 BOOLEAN OwnedByCaller;
1958 BOOLEAN AbandonedState;
1959 } MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION;
1961 typedef enum _TIMER_INFORMATION_CLASS
1963 TimerBasicInformation = 0
1964 } TIMER_INFORMATION_CLASS;
1966 typedef struct _TIMER_BASIC_INFORMATION
1968 LARGE_INTEGER RemainingTime;
1969 BOOLEAN TimerState;
1970 } TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION;
1973 /* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
1974 typedef enum
1976 INVALID_PATH = 0,
1977 UNC_PATH, /* "//foo" */
1978 ABSOLUTE_DRIVE_PATH, /* "c:/foo" */
1979 RELATIVE_DRIVE_PATH, /* "c:foo" */
1980 ABSOLUTE_PATH, /* "/foo" */
1981 RELATIVE_PATH, /* "foo" */
1982 DEVICE_PATH, /* "//./foo" */
1983 UNC_DOT_PATH /* "//." */
1984 } DOS_PATHNAME_TYPE;
1987 /***********************************************************************
1988 * Types and data structures
1991 /* This is used by NtQuerySystemInformation */
1992 typedef struct _SYSTEM_THREAD_INFORMATION
1993 { /* win32/win64 */
1994 LARGE_INTEGER KernelTime; /* 00/00 */
1995 LARGE_INTEGER UserTime; /* 08/08 */
1996 LARGE_INTEGER CreateTime; /* 10/10 */
1997 DWORD dwTickCount; /* 18/18 */
1998 LPVOID StartAddress; /* 1c/20 */
1999 CLIENT_ID ClientId; /* 20/28 */
2000 DWORD dwCurrentPriority; /* 28/38 */
2001 DWORD dwBasePriority; /* 2c/3c */
2002 DWORD dwContextSwitches; /* 30/40 */
2003 DWORD dwThreadState; /* 34/44 */
2004 DWORD dwWaitReason; /* 38/48 */
2005 DWORD dwUnknown; /* 3c/4c */
2006 } SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION;
2008 typedef struct _IO_STATUS_BLOCK {
2009 union {
2010 NTSTATUS Status;
2011 PVOID Pointer;
2012 } DUMMYUNIONNAME;
2014 ULONG_PTR Information;
2015 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
2017 typedef void (WINAPI * PIO_APC_ROUTINE)(PVOID,PIO_STATUS_BLOCK,ULONG);
2019 typedef struct _KEY_BASIC_INFORMATION {
2020 LARGE_INTEGER LastWriteTime;
2021 ULONG TitleIndex;
2022 ULONG NameLength;
2023 WCHAR Name[1];
2024 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
2026 typedef struct _KEY_NODE_INFORMATION
2028 LARGE_INTEGER LastWriteTime;
2029 ULONG TitleIndex;
2030 ULONG ClassOffset;
2031 ULONG ClassLength;
2032 ULONG NameLength;
2033 WCHAR Name[1];
2034 /* Class[1]; */
2035 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
2037 typedef struct _KEY_FULL_INFORMATION
2039 LARGE_INTEGER LastWriteTime;
2040 ULONG TitleIndex;
2041 ULONG ClassOffset;
2042 ULONG ClassLength;
2043 ULONG SubKeys;
2044 ULONG MaxNameLen;
2045 ULONG MaxClassLen;
2046 ULONG Values;
2047 ULONG MaxValueNameLen;
2048 ULONG MaxValueDataLen;
2049 WCHAR Class[1];
2050 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
2052 typedef struct _KEY_NAME_INFORMATION {
2053 ULONG NameLength;
2054 WCHAR Name[1];
2055 } KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION;
2057 typedef struct _KEY_CACHED_INFORMATION
2059 LARGE_INTEGER LastWriteTime;
2060 ULONG TitleIndex;
2061 ULONG SubKeys;
2062 ULONG MaxNameLen;
2063 ULONG Values;
2064 ULONG MaxValueNameLen;
2065 ULONG MaxValueDataLen;
2066 ULONG NameLength;
2067 } KEY_CACHED_INFORMATION, *PKEY_CACHED_INFORMATION;
2069 typedef struct _KEY_VALUE_ENTRY
2071 PUNICODE_STRING ValueName;
2072 ULONG DataLength;
2073 ULONG DataOffset;
2074 ULONG Type;
2075 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
2077 typedef struct _KEY_VALUE_BASIC_INFORMATION {
2078 ULONG TitleIndex;
2079 ULONG Type;
2080 ULONG NameLength;
2081 WCHAR Name[1];
2082 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
2084 typedef struct _KEY_VALUE_FULL_INFORMATION {
2085 ULONG TitleIndex;
2086 ULONG Type;
2087 ULONG DataOffset;
2088 ULONG DataLength;
2089 ULONG NameLength;
2090 WCHAR Name[1];
2091 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
2093 typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
2094 ULONG TitleIndex;
2095 ULONG Type;
2096 ULONG DataLength;
2097 UCHAR Data[1];
2098 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
2100 #ifndef __OBJECT_ATTRIBUTES_DEFINED__
2101 #define __OBJECT_ATTRIBUTES_DEFINED__
2102 typedef struct _OBJECT_ATTRIBUTES {
2103 ULONG Length;
2104 HANDLE RootDirectory;
2105 PUNICODE_STRING ObjectName;
2106 ULONG Attributes;
2107 PVOID SecurityDescriptor; /* type SECURITY_DESCRIPTOR */
2108 PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
2109 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
2110 #endif
2112 typedef struct _OBJECT_DATA_INFORMATION {
2113 BOOLEAN InheritHandle;
2114 BOOLEAN ProtectFromClose;
2115 } OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION;
2117 typedef struct _OBJECT_BASIC_INFORMATION {
2118 ULONG Attributes;
2119 ACCESS_MASK GrantedAccess;
2120 ULONG HandleCount;
2121 ULONG PointerCount;
2122 ULONG PagedPoolUsage;
2123 ULONG NonPagedPoolUsage;
2124 ULONG Reserved[3];
2125 ULONG NameInformationLength;
2126 ULONG TypeInformationLength;
2127 ULONG SecurityDescriptorLength;
2128 LARGE_INTEGER CreateTime;
2129 } OBJECT_BASIC_INFORMATION, *POBJECT_BASIC_INFORMATION;
2131 typedef struct _OBJECT_NAME_INFORMATION {
2132 UNICODE_STRING Name;
2133 } OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;
2135 typedef struct __OBJECT_TYPE_INFORMATION {
2136 UNICODE_STRING TypeName;
2137 ULONG TotalNumberOfObjects;
2138 ULONG TotalNumberOfHandles;
2139 ULONG TotalPagedPoolUsage;
2140 ULONG TotalNonPagedPoolUsage;
2141 ULONG TotalNamePoolUsage;
2142 ULONG TotalHandleTableUsage;
2143 ULONG HighWaterNumberOfObjects;
2144 ULONG HighWaterNumberOfHandles;
2145 ULONG HighWaterPagedPoolUsage;
2146 ULONG HighWaterNonPagedPoolUsage;
2147 ULONG HighWaterNamePoolUsage;
2148 ULONG HighWaterHandleTableUsage;
2149 ULONG InvalidAttributes;
2150 GENERIC_MAPPING GenericMapping;
2151 ULONG ValidAccessMask;
2152 BOOLEAN SecurityRequired;
2153 BOOLEAN MaintainHandleCount;
2154 UCHAR TypeIndex;
2155 CHAR ReservedByte;
2156 ULONG PoolType;
2157 ULONG DefaultPagedPoolCharge;
2158 ULONG DefaultNonPagedPoolCharge;
2159 } OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION;
2161 typedef struct _OBJECT_TYPES_INFORMATION
2163 ULONG NumberOfTypes;
2164 } OBJECT_TYPES_INFORMATION, *POBJECT_TYPES_INFORMATION;
2166 typedef struct _PROCESS_BASIC_INFORMATION {
2167 #ifdef __WINESRC__
2168 NTSTATUS ExitStatus;
2169 PEB *PebBaseAddress;
2170 ULONG_PTR AffinityMask;
2171 LONG BasePriority;
2172 ULONG_PTR UniqueProcessId;
2173 ULONG_PTR InheritedFromUniqueProcessId;
2174 #else
2175 PVOID Reserved1;
2176 PPEB PebBaseAddress;
2177 PVOID Reserved2[2];
2178 ULONG_PTR UniqueProcessId;
2179 PVOID Reserved3;
2180 #endif
2181 } PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION;
2183 #define PROCESS_PRIOCLASS_IDLE 1
2184 #define PROCESS_PRIOCLASS_NORMAL 2
2185 #define PROCESS_PRIOCLASS_HIGH 3
2186 #define PROCESS_PRIOCLASS_REALTIME 4
2187 #define PROCESS_PRIOCLASS_BELOW_NORMAL 5
2188 #define PROCESS_PRIOCLASS_ABOVE_NORMAL 6
2190 typedef struct _PROCESS_PRIORITY_CLASS {
2191 BOOLEAN Foreground;
2192 UCHAR PriorityClass;
2193 } PROCESS_PRIORITY_CLASS, *PPROCESS_PRIORITY_CLASS;
2195 typedef struct _PROCESS_STACK_ALLOCATION_INFORMATION
2197 SIZE_T ReserveSize;
2198 SIZE_T ZeroBits;
2199 PVOID StackBase;
2200 } PROCESS_STACK_ALLOCATION_INFORMATION, *PPROCESS_STACK_ALLOCATION_INFORMATION;
2202 typedef struct _PROCESS_STACK_ALLOCATION_INFORMATION_EX
2204 ULONG PreferredNode;
2205 ULONG Reserved0;
2206 ULONG Reserved1;
2207 ULONG Reserved2;
2208 PROCESS_STACK_ALLOCATION_INFORMATION AllocInfo;
2209 } PROCESS_STACK_ALLOCATION_INFORMATION_EX, *PPROCESS_STACK_ALLOCATION_INFORMATION_EX;
2211 typedef struct _RTL_HEAP_DEFINITION {
2212 ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
2214 ULONG Unknown[11];
2215 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
2217 typedef struct _RTL_RWLOCK {
2218 RTL_CRITICAL_SECTION rtlCS;
2220 HANDLE hSharedReleaseSemaphore;
2221 UINT uSharedWaiters;
2223 HANDLE hExclusiveReleaseSemaphore;
2224 UINT uExclusiveWaiters;
2226 INT iNumberActive;
2227 HANDLE hOwningThreadId;
2228 DWORD dwTimeoutBoost;
2229 PVOID pDebugInfo;
2230 } RTL_RWLOCK, *LPRTL_RWLOCK;
2232 /* System Information Class 0x00 */
2234 typedef struct _SYSTEM_BASIC_INFORMATION {
2235 #ifdef __WINESRC__
2236 DWORD unknown;
2237 ULONG KeMaximumIncrement;
2238 ULONG PageSize;
2239 ULONG MmNumberOfPhysicalPages;
2240 ULONG MmLowestPhysicalPage;
2241 ULONG MmHighestPhysicalPage;
2242 ULONG_PTR AllocationGranularity;
2243 PVOID LowestUserAddress;
2244 PVOID HighestUserAddress;
2245 ULONG_PTR ActiveProcessorsAffinityMask;
2246 BYTE NumberOfProcessors;
2247 #else
2248 BYTE Reserved1[24];
2249 PVOID Reserved2[4];
2250 CCHAR NumberOfProcessors;
2251 #endif
2252 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
2254 /* System Information Class 0x01 */
2256 typedef struct _SYSTEM_CPU_INFORMATION {
2257 USHORT ProcessorArchitecture;
2258 USHORT ProcessorLevel;
2259 USHORT ProcessorRevision;
2260 USHORT MaximumProcessors;
2261 ULONG ProcessorFeatureBits;
2262 } SYSTEM_CPU_INFORMATION, *PSYSTEM_CPU_INFORMATION;
2264 /* definitions of bits in the Feature set for the x86 processors */
2265 #define CPU_FEATURE_VME 0x00000005 /* Virtual 86 Mode Extensions */
2266 #define CPU_FEATURE_TSC 0x00000002 /* Time Stamp Counter available */
2267 #define CPU_FEATURE_CMOV 0x00000008 /* Conditional Move instruction*/
2268 #define CPU_FEATURE_PGE 0x00000014 /* Page table Entry Global bit */
2269 #define CPU_FEATURE_PSE 0x00000024 /* Page Size Extension */
2270 #define CPU_FEATURE_MTRR 0x00000040 /* Memory Type Range Registers */
2271 #define CPU_FEATURE_CX8 0x00000080 /* Compare and eXchange 8 byte instr. */
2272 #define CPU_FEATURE_MMX 0x00000100 /* Multi Media eXtensions */
2273 #define CPU_FEATURE_X86 0x00000200 /* seems to be always ON, on the '86 */
2274 #define CPU_FEATURE_PAT 0x00000400 /* Page Attribute Table */
2275 #define CPU_FEATURE_FXSR 0x00000800 /* FXSAVE and FXSTORE instructions */
2276 #define CPU_FEATURE_SEP 0x00001000 /* SYSENTER and SYSEXIT instructions */
2277 #define CPU_FEATURE_SSE 0x00002000 /* SSE extensions (ext. MMX) */
2278 #define CPU_FEATURE_3DNOW 0x00004000 /* 3DNOW instructions available */
2279 #define CPU_FEATURE_SSE2 0x00010000 /* SSE2 extensions (XMMI64) */
2280 #define CPU_FEATURE_DS 0x00020000 /* Debug Store */
2281 #define CPU_FEATURE_HTT 0x00040000 /* Hyper Threading Technology */
2282 #define CPU_FEATURE_SSE3 0x00080000 /* SSE3 extensions */
2283 #define CPU_FEATURE_CX128 0x00100000 /* cmpxchg16b instruction */
2284 #define CPU_FEATURE_XSAVE 0x00800000 /* XSAVE instructions */
2285 #define CPU_FEATURE_2NDLEV 0x04000000 /* Second-level address translation */
2286 #define CPU_FEATURE_VIRT 0x08000000 /* Virtualization support */
2287 #define CPU_FEATURE_RDFS 0x10000000 /* RDFSBASE etc. instructions */
2288 #define CPU_FEATURE_NX 0x20000000 /* Data execution prevention */
2290 /* FIXME: following values are made up, actual flags are unknown */
2291 #define CPU_FEATURE_SSSE3 0x00008000 /* SSSE3 instructions */
2292 #define CPU_FEATURE_SSE41 0x01000000 /* SSE41 instructions */
2293 #define CPU_FEATURE_SSE42 0x02000000 /* SSE42 instructions */
2294 #define CPU_FEATURE_AVX 0x40000000 /* AVX instructions */
2295 #define CPU_FEATURE_AVX2 0x80000000 /* AVX2 instructions */
2296 #define CPU_FEATURE_PAE 0x00200000
2297 #define CPU_FEATURE_DAZ 0x00400000
2299 #define CPU_FEATURE_ARM_VFP_32 0x00000001
2300 #define CPU_FEATURE_ARM_NEON 0x00000002
2301 #define CPU_FEATURE_ARM_V8_CRC32 0x00000004
2302 #define CPU_FEATURE_ARM_V8_CRYPTO 0x00000008
2304 /* System Information Class 0x02 */
2306 /* Documented in "Windows NT/2000 Native API Reference" by Gary Nebbett. */
2307 typedef struct _SYSTEM_PERFORMANCE_INFORMATION {
2308 LARGE_INTEGER IdleTime;
2309 LARGE_INTEGER ReadTransferCount;
2310 LARGE_INTEGER WriteTransferCount;
2311 LARGE_INTEGER OtherTransferCount;
2312 ULONG ReadOperationCount;
2313 ULONG WriteOperationCount;
2314 ULONG OtherOperationCount;
2315 ULONG AvailablePages;
2316 ULONG TotalCommittedPages;
2317 ULONG TotalCommitLimit;
2318 ULONG PeakCommitment;
2319 ULONG PageFaults;
2320 ULONG WriteCopyFaults;
2321 ULONG TransitionFaults;
2322 ULONG Reserved1;
2323 ULONG DemandZeroFaults;
2324 ULONG PagesRead;
2325 ULONG PageReadIos;
2326 ULONG Reserved2[2];
2327 ULONG PagefilePagesWritten;
2328 ULONG PagefilePageWriteIos;
2329 ULONG MappedFilePagesWritten;
2330 ULONG MappedFilePageWriteIos;
2331 ULONG PagedPoolUsage;
2332 ULONG NonPagedPoolUsage;
2333 ULONG PagedPoolAllocs;
2334 ULONG PagedPoolFrees;
2335 ULONG NonPagedPoolAllocs;
2336 ULONG NonPagedPoolFrees;
2337 ULONG TotalFreeSystemPtes;
2338 ULONG SystemCodePage;
2339 ULONG TotalSystemDriverPages;
2340 ULONG TotalSystemCodePages;
2341 ULONG SmallNonPagedLookasideListAllocateHits;
2342 ULONG SmallPagedLookasideListAllocateHits;
2343 ULONG Reserved3;
2344 ULONG MmSystemCachePage;
2345 ULONG PagedPoolPage;
2346 ULONG SystemDriverPage;
2347 ULONG FastReadNoWait;
2348 ULONG FastReadWait;
2349 ULONG FastReadResourceMiss;
2350 ULONG FastReadNotPossible;
2351 ULONG FastMdlReadNoWait;
2352 ULONG FastMdlReadWait;
2353 ULONG FastMdlReadResourceMiss;
2354 ULONG FastMdlReadNotPossible;
2355 ULONG MapDataNoWait;
2356 ULONG MapDataWait;
2357 ULONG MapDataNoWaitMiss;
2358 ULONG MapDataWaitMiss;
2359 ULONG PinMappedDataCount;
2360 ULONG PinReadNoWait;
2361 ULONG PinReadWait;
2362 ULONG PinReadNoWaitMiss;
2363 ULONG PinReadWaitMiss;
2364 ULONG CopyReadNoWait;
2365 ULONG CopyReadWait;
2366 ULONG CopyReadNoWaitMiss;
2367 ULONG CopyReadWaitMiss;
2368 ULONG MdlReadNoWait;
2369 ULONG MdlReadWait;
2370 ULONG MdlReadNoWaitMiss;
2371 ULONG MdlReadWaitMiss;
2372 ULONG ReadAheadIos;
2373 ULONG LazyWriteIos;
2374 ULONG LazyWritePages;
2375 ULONG DataFlushes;
2376 ULONG DataPages;
2377 ULONG ContextSwitches;
2378 ULONG FirstLevelTbFills;
2379 ULONG SecondLevelTbFills;
2380 ULONG SystemCalls;
2381 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
2383 /* System Information Class 0x03 */
2385 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
2386 #ifdef __WINESRC__
2387 LARGE_INTEGER BootTime;
2388 LARGE_INTEGER SystemTime;
2389 LARGE_INTEGER TimeZoneBias;
2390 ULONG TimeZoneId;
2391 ULONG Reserved;
2392 ULONGLONG BootTimeBias;
2393 ULONGLONG SleepTimeBias;
2394 #else
2395 BYTE Reserved1[48];
2396 #endif
2397 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; /* was SYSTEM_TIME_INFORMATION */
2399 /* System Information Class 0x08 */
2401 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
2402 LARGE_INTEGER IdleTime;
2403 LARGE_INTEGER KernelTime;
2404 LARGE_INTEGER UserTime;
2405 LARGE_INTEGER Reserved1[2];
2406 ULONG Reserved2;
2407 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
2409 /* System Information Class 0x0b */
2411 typedef struct _SYSTEM_DRIVER_INFORMATION {
2412 PVOID pvAddress;
2413 DWORD dwUnknown1;
2414 DWORD dwUnknown2;
2415 DWORD dwEntryIndex;
2416 DWORD dwUnknown3;
2417 char szName[MAX_PATH + 1];
2418 } SYSTEM_DRIVER_INFORMATION, *PSYSTEM_DRIVER_INFORMATION;
2420 /* System Information Class 0x10 */
2422 typedef struct _SYSTEM_HANDLE_ENTRY {
2423 ULONG OwnerPid;
2424 BYTE ObjectType;
2425 BYTE HandleFlags;
2426 USHORT HandleValue;
2427 PVOID ObjectPointer;
2428 ULONG AccessMask;
2429 } SYSTEM_HANDLE_ENTRY, *PSYSTEM_HANDLE_ENTRY;
2431 typedef struct _SYSTEM_HANDLE_INFORMATION {
2432 ULONG Count;
2433 SYSTEM_HANDLE_ENTRY Handle[1];
2434 } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
2436 typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX
2438 void *Object;
2439 ULONG_PTR UniqueProcessId;
2440 ULONG_PTR HandleValue;
2441 ULONG GrantedAccess;
2442 USHORT CreatorBackTraceIndex;
2443 USHORT ObjectTypeIndex;
2444 ULONG HandleAttributes;
2445 ULONG Reserved;
2446 } SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX;
2448 typedef struct _SYSTEM_HANDLE_INFORMATION_EX
2450 ULONG_PTR NumberOfHandles;
2451 ULONG_PTR Reserved;
2452 SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX Handles[1];
2453 } SYSTEM_HANDLE_INFORMATION_EX;
2455 /* System Information Class 0x15 */
2457 typedef struct _SYSTEM_CACHE_INFORMATION {
2458 SIZE_T CurrentSize;
2459 SIZE_T PeakSize;
2460 ULONG PageFaultCount;
2461 SIZE_T MinimumWorkingSet;
2462 SIZE_T MaximumWorkingSet;
2463 SIZE_T CurrentSizeIncludingTransitionInPages;
2464 SIZE_T PeakSizeIncludingTransitionInPages;
2465 ULONG TransitionRePurposeCount;
2466 ULONG Flags;
2467 } SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION;
2469 /* System Information Class 0x17 */
2471 typedef struct _SYSTEM_INTERRUPT_INFORMATION {
2472 BYTE Reserved1[24];
2473 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
2475 typedef struct _SYSTEM_CONFIGURATION_INFO {
2476 union {
2477 ULONG OemId;
2478 struct {
2479 WORD ProcessorArchitecture;
2480 WORD Reserved;
2481 } tag1;
2482 } tag2;
2483 ULONG PageSize;
2484 PVOID MinimumApplicationAddress;
2485 PVOID MaximumApplicationAddress;
2486 ULONG ActiveProcessorMask;
2487 ULONG NumberOfProcessors;
2488 ULONG ProcessorType;
2489 ULONG AllocationGranularity;
2490 WORD ProcessorLevel;
2491 WORD ProcessorRevision;
2492 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
2494 typedef struct _SYSTEM_EXCEPTION_INFORMATION {
2495 BYTE Reserved1[16];
2496 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
2498 typedef struct _SYSTEM_LOOKASIDE_INFORMATION {
2499 BYTE Reserved1[32];
2500 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
2502 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION {
2503 BOOLEAN DebuggerEnabled;
2504 BOOLEAN DebuggerNotPresent;
2505 } SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
2507 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION_EX {
2508 BOOLEAN DebuggerAllowed;
2509 BOOLEAN DebuggerEnabled;
2510 BOOLEAN DebuggerPresent;
2511 } SYSTEM_KERNEL_DEBUGGER_INFORMATION_EX, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION_EX;
2513 typedef struct _VM_COUNTERS
2515 SIZE_T PeakVirtualSize;
2516 SIZE_T VirtualSize;
2517 ULONG PageFaultCount;
2518 SIZE_T PeakWorkingSetSize;
2519 SIZE_T WorkingSetSize;
2520 SIZE_T QuotaPeakPagedPoolUsage;
2521 SIZE_T QuotaPagedPoolUsage;
2522 SIZE_T QuotaPeakNonPagedPoolUsage;
2523 SIZE_T QuotaNonPagedPoolUsage;
2524 SIZE_T PagefileUsage;
2525 SIZE_T PeakPagefileUsage;
2526 } VM_COUNTERS, *PVM_COUNTERS;
2528 typedef struct _VM_COUNTERS_EX
2530 SIZE_T PeakVirtualSize;
2531 SIZE_T VirtualSize;
2532 ULONG PageFaultCount;
2533 SIZE_T PeakWorkingSetSize;
2534 SIZE_T WorkingSetSize;
2535 SIZE_T QuotaPeakPagedPoolUsage;
2536 SIZE_T QuotaPagedPoolUsage;
2537 SIZE_T QuotaPeakNonPagedPoolUsage;
2538 SIZE_T QuotaNonPagedPoolUsage;
2539 SIZE_T PagefileUsage;
2540 SIZE_T PeakPagefileUsage;
2541 SIZE_T PrivateUsage;
2542 } VM_COUNTERS_EX, *PVM_COUNTERS_EX;
2544 typedef struct _SYSTEM_PROCESS_INFORMATION {
2545 #ifdef __WINESRC__ /* win32/win64 */
2546 ULONG NextEntryOffset; /* 00/00 */
2547 DWORD dwThreadCount; /* 04/04 */
2548 DWORD dwUnknown1[6]; /* 08/08 */
2549 LARGE_INTEGER CreationTime; /* 20/20 */
2550 LARGE_INTEGER UserTime; /* 28/28 */
2551 LARGE_INTEGER KernelTime; /* 30/30 */
2552 UNICODE_STRING ProcessName; /* 38/38 */
2553 DWORD dwBasePriority; /* 40/48 */
2554 HANDLE UniqueProcessId; /* 44/50 */
2555 HANDLE ParentProcessId; /* 48/58 */
2556 ULONG HandleCount; /* 4c/60 */
2557 ULONG SessionId; /* 50/64 */
2558 DWORD dwUnknown4; /* 54/68 */
2559 VM_COUNTERS_EX vmCounters; /* 58/70 */
2560 IO_COUNTERS ioCounters; /* 88/d0 */
2561 SYSTEM_THREAD_INFORMATION ti[1]; /* b8/100 */
2562 #else
2563 ULONG NextEntryOffset; /* 00/00 */
2564 BYTE Reserved1[52]; /* 04/04 */
2565 PVOID Reserved2[3]; /* 38/38 */
2566 HANDLE UniqueProcessId; /* 44/50 */
2567 PVOID Reserved3; /* 48/58 */
2568 ULONG HandleCount; /* 4c/60 */
2569 BYTE Reserved4[4]; /* 50/64 */
2570 PVOID Reserved5[11]; /* 54/68 */
2571 SIZE_T PeakPagefileUsage; /* 80/c0 */
2572 SIZE_T PrivatePageCount; /* 84/c8 */
2573 LARGE_INTEGER Reserved6[6]; /* 88/d0 */
2574 #endif
2575 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
2577 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION {
2578 ULONG RegistryQuotaAllowed;
2579 ULONG RegistryQuotaUsed;
2580 PVOID Reserved1;
2581 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
2583 typedef struct _SYSTEM_TIME_ADJUSTMENT_QUERY {
2584 ULONG TimeAdjustment;
2585 ULONG TimeIncrement;
2586 BOOLEAN TimeAdjustmentDisabled;
2587 } SYSTEM_TIME_ADJUSTMENT_QUERY, *PSYSTEM_TIME_ADJUSTMENT_QUERY;
2589 typedef struct _SYSTEM_TIME_ADJUSTMENT {
2590 ULONG TimeAdjustment;
2591 BOOLEAN TimeAdjustmentDisabled;
2592 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
2594 typedef enum _SYSTEM_FIRMWARE_TABLE_ACTION
2596 SystemFirmwareTable_Enumerate = 0,
2597 SystemFirmwareTable_Get = 1
2598 } SYSTEM_FIRMWARE_TABLE_ACTION, *PSYSTEM_FIRMWARE_TABLE_ACTION;
2600 /* System Information Class 0x4C */
2602 typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
2604 ULONG ProviderSignature;
2605 SYSTEM_FIRMWARE_TABLE_ACTION Action;
2606 ULONG TableID;
2607 ULONG TableBufferLength;
2608 UCHAR TableBuffer[1];
2609 } SYSTEM_FIRMWARE_TABLE_INFORMATION, *PSYSTEM_FIRMWARE_TABLE_INFORMATION;
2611 typedef struct _TIME_FIELDS
2612 { CSHORT Year;
2613 CSHORT Month;
2614 CSHORT Day;
2615 CSHORT Hour;
2616 CSHORT Minute;
2617 CSHORT Second;
2618 CSHORT Milliseconds;
2619 CSHORT Weekday;
2620 } TIME_FIELDS, *PTIME_FIELDS;
2622 typedef struct _WINSTATIONINFORMATIONW {
2623 BYTE Reserved2[70];
2624 ULONG LogonId;
2625 BYTE Reserved3[1140];
2626 } WINSTATIONINFORMATIONW, *PWINSTATIONINFORMATIONW;
2628 typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONW)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
2630 typedef struct _LDR_RESOURCE_INFO
2632 ULONG_PTR Type;
2633 ULONG_PTR Name;
2634 ULONG Language;
2635 } LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO;
2638 /* debug buffer definitions */
2640 typedef struct _DEBUG_BUFFER {
2641 HANDLE SectionHandle;
2642 PVOID SectionBase;
2643 PVOID RemoteSectionBase;
2644 ULONG SectionBaseDelta;
2645 HANDLE EventPairHandle;
2646 ULONG Unknown[2];
2647 HANDLE RemoteThreadHandle;
2648 ULONG InfoClassMask;
2649 ULONG SizeOfInfo;
2650 ULONG AllocatedSize;
2651 ULONG SectionSize;
2652 PVOID ModuleInformation;
2653 PVOID BackTraceInformation;
2654 PVOID HeapInformation;
2655 PVOID LockInformation;
2656 PVOID Reserved[8];
2657 } DEBUG_BUFFER, *PDEBUG_BUFFER;
2659 #define PDI_MODULES 0x01
2660 #define PDI_BACKTRACE 0x02
2661 #define PDI_HEAPS 0x04
2662 #define PDI_HEAP_TAGS 0x08
2663 #define PDI_HEAP_BLOCKS 0x10
2664 #define PDI_LOCKS 0x20
2666 typedef struct _DEBUG_MODULE_INFORMATION {
2667 ULONG Reserved[2];
2668 ULONG Base;
2669 ULONG Size;
2670 ULONG Flags;
2671 USHORT Index;
2672 USHORT Unknown;
2673 USHORT LoadCount;
2674 USHORT ModuleNameOffset;
2675 CHAR ImageName[256];
2676 } DEBUG_MODULE_INFORMATION, *PDEBUG_MODULE_INFORMATION;
2678 typedef struct _DEBUG_HEAP_INFORMATION {
2679 ULONG Base;
2680 ULONG Flags;
2681 USHORT Granularity;
2682 USHORT Unknown;
2683 ULONG Allocated;
2684 ULONG Committed;
2685 ULONG TagCount;
2686 ULONG BlockCount;
2687 ULONG Reserved[7];
2688 PVOID Tags;
2689 PVOID Blocks;
2690 } DEBUG_HEAP_INFORMATION, *PDEBUG_HEAP_INFORMATION;
2692 typedef struct _DEBUG_LOCK_INFORMATION {
2693 PVOID Address;
2694 USHORT Type;
2695 USHORT CreatorBackTraceIndex;
2696 ULONG OwnerThreadId;
2697 ULONG ActiveCount;
2698 ULONG ContentionCount;
2699 ULONG EntryCount;
2700 ULONG RecursionCount;
2701 ULONG NumberOfSharedWaiters;
2702 ULONG NumberOfExclusiveWaiters;
2703 } DEBUG_LOCK_INFORMATION, *PDEBUG_LOCK_INFORMATION;
2705 typedef struct _PORT_MESSAGE_HEADER {
2706 USHORT DataSize;
2707 USHORT MessageSize;
2708 USHORT MessageType;
2709 USHORT VirtualRangesOffset;
2710 CLIENT_ID ClientId;
2711 ULONG MessageId;
2712 ULONG SectionSize;
2713 } PORT_MESSAGE_HEADER, *PPORT_MESSAGE_HEADER, PORT_MESSAGE, *PPORT_MESSAGE;
2715 typedef unsigned short RTL_ATOM, *PRTL_ATOM;
2717 typedef enum _ATOM_INFORMATION_CLASS {
2718 AtomBasicInformation = 0,
2719 AtomTableInformation = 1,
2720 } ATOM_INFORMATION_CLASS;
2722 typedef struct _ATOM_BASIC_INFORMATION {
2723 USHORT ReferenceCount;
2724 USHORT Pinned;
2725 USHORT NameLength;
2726 WCHAR Name[1];
2727 } ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION;
2729 /* FIXME: names probably not correct */
2730 typedef struct _RTL_HANDLE
2732 struct _RTL_HANDLE * Next;
2733 } RTL_HANDLE;
2735 /* FIXME: names probably not correct */
2736 typedef struct _RTL_HANDLE_TABLE
2738 ULONG MaxHandleCount; /* 0x00 */
2739 ULONG HandleSize; /* 0x04 */
2740 ULONG Unused[2]; /* 0x08-0x0c */
2741 PVOID NextFree; /* 0x10 */
2742 PVOID FirstHandle; /* 0x14 */
2743 PVOID ReservedMemory; /* 0x18 */
2744 PVOID MaxHandle; /* 0x1c */
2745 } RTL_HANDLE_TABLE;
2747 typedef struct _RTL_ATOM_TABLE_ENTRY
2749 struct _RTL_ATOM_TABLE_ENTRY *HashLink;
2750 WORD HandleIndex;
2751 WORD Atom;
2752 WORD ReferenceCount;
2753 UCHAR Flags;
2754 UCHAR NameLength;
2755 WCHAR Name[1];
2756 } RTL_ATOM_TABLE_ENTRY, *PRTL_ATOM_TABLE_ENTRY;
2758 typedef struct _RTL_ATOM_TABLE
2760 ULONG Signature;
2761 RTL_CRITICAL_SECTION CriticalSection;
2762 RTL_HANDLE_TABLE HandleTable;
2763 ULONG NumberOfBuckets;
2764 RTL_ATOM_TABLE_ENTRY *Buckets[1];
2765 } *RTL_ATOM_TABLE, **PRTL_ATOM_TABLE;
2767 /***********************************************************************
2768 * Defines
2771 /* flags for NtCreateFile and NtOpenFile */
2772 #define FILE_DIRECTORY_FILE 0x00000001
2773 #define FILE_WRITE_THROUGH 0x00000002
2774 #define FILE_SEQUENTIAL_ONLY 0x00000004
2775 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
2776 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
2777 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
2778 #define FILE_NON_DIRECTORY_FILE 0x00000040
2779 #define FILE_CREATE_TREE_CONNECTION 0x00000080
2780 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
2781 #define FILE_NO_EA_KNOWLEDGE 0x00000200
2782 #define FILE_OPEN_FOR_RECOVERY 0x00000400
2783 #define FILE_RANDOM_ACCESS 0x00000800
2784 #define FILE_DELETE_ON_CLOSE 0x00001000
2785 #define FILE_OPEN_BY_FILE_ID 0x00002000
2786 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
2787 #define FILE_NO_COMPRESSION 0x00008000
2788 #define FILE_RESERVE_OPFILTER 0x00100000
2789 #define FILE_OPEN_REPARSE_POINT 0x00200000
2790 #define FILE_OPEN_OFFLINE_FILE 0x00400000
2791 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
2793 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
2794 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
2796 /* status for NtCreateFile or NtOpenFile */
2797 #define FILE_SUPERSEDED 0
2798 #define FILE_OPENED 1
2799 #define FILE_CREATED 2
2800 #define FILE_OVERWRITTEN 3
2801 #define FILE_EXISTS 4
2802 #define FILE_DOES_NOT_EXIST 5
2804 /* disposition for NtCreateFile */
2805 #define FILE_SUPERSEDE 0
2806 #define FILE_OPEN 1
2807 #define FILE_CREATE 2
2808 #define FILE_OPEN_IF 3
2809 #define FILE_OVERWRITE 4
2810 #define FILE_OVERWRITE_IF 5
2811 #define FILE_MAXIMUM_DISPOSITION 5
2813 /* Characteristics of a File System */
2814 #define FILE_REMOVABLE_MEDIA 0x00000001
2815 #define FILE_READ_ONLY_DEVICE 0x00000002
2816 #define FILE_FLOPPY_DISKETTE 0x00000004
2817 #define FILE_WRITE_ONE_MEDIA 0x00000008
2818 #define FILE_REMOTE_DEVICE 0x00000010
2819 #define FILE_DEVICE_IS_MOUNTED 0x00000020
2820 #define FILE_VIRTUAL_VOLUME 0x00000040
2821 #define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
2822 #define FILE_DEVICE_SECURE_OPEN 0x00000100
2823 #define FILE_CHARACTERISTIC_PNP_DEVICE 0x00000800
2824 #define FILE_CHARACTERISTIC_TS_DEVICE 0x00001000
2825 #define FILE_CHARACTERISTIC_WEBDAV_DEVICE 0x00002000
2826 #define FILE_CHARACTERISTIC_CSV 0x00010000
2827 #define FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL 0x00020000
2828 #define FILE_PORTABLE_DEVICE 0x00040000
2830 /* options for NtCreateNamedPipeFile */
2831 #define FILE_PIPE_INBOUND 0x00000000
2832 #define FILE_PIPE_OUTBOUND 0x00000001
2833 #define FILE_PIPE_FULL_DUPLEX 0x00000002
2835 /* options for pipe's type */
2836 #define FILE_PIPE_TYPE_MESSAGE 0x00000001
2837 #define FILE_PIPE_TYPE_BYTE 0x00000000
2838 /* options for pipe's message mode */
2839 #define FILE_PIPE_MESSAGE_MODE 0x00000001
2840 #define FILE_PIPE_BYTE_STREAM_MODE 0x00000000
2841 /* options for pipe's blocking mode */
2842 #define FILE_PIPE_COMPLETE_OPERATION 0x00000001
2843 #define FILE_PIPE_QUEUE_OPERATION 0x00000000
2844 /* and client / server end */
2845 #define FILE_PIPE_SERVER_END 0x00000001
2846 #define FILE_PIPE_CLIENT_END 0x00000000
2848 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
2850 #define LOGONID_CURRENT ((ULONG)-1)
2852 #define OBJ_PROTECT_CLOSE 0x00000001
2853 #define OBJ_INHERIT 0x00000002
2854 #define OBJ_PERMANENT 0x00000010
2855 #define OBJ_EXCLUSIVE 0x00000020
2856 #define OBJ_CASE_INSENSITIVE 0x00000040
2857 #define OBJ_OPENIF 0x00000080
2858 #define OBJ_OPENLINK 0x00000100
2859 #define OBJ_KERNEL_HANDLE 0x00000200
2860 #define OBJ_VALID_ATTRIBUTES 0x000003F2
2862 #define SERVERNAME_CURRENT ((HANDLE)NULL)
2864 typedef void (CALLBACK *PNTAPCFUNC)(ULONG_PTR,ULONG_PTR,ULONG_PTR); /* FIXME: not the right name */
2865 typedef void (CALLBACK *PRTL_THREAD_START_ROUTINE)(LPVOID); /* FIXME: not the right name */
2866 typedef DWORD (CALLBACK *PRTL_WORK_ITEM_ROUTINE)(LPVOID); /* FIXME: not the right name */
2867 typedef void (NTAPI *RTL_WAITORTIMERCALLBACKFUNC)(PVOID,BOOLEAN); /* FIXME: not the right name */
2870 /* DbgPrintEx default levels */
2871 #define DPFLTR_ERROR_LEVEL 0
2872 #define DPFLTR_WARNING_LEVEL 1
2873 #define DPFLTR_TRACE_LEVEL 2
2874 #define DPFLTR_INFO_LEVEL 3
2875 #define DPFLTR_MASK 0x8000000
2877 /* Well-known LUID values */
2878 #define SE_MIN_WELL_KNOWN_PRIVILEGE 2
2879 #define SE_CREATE_TOKEN_PRIVILEGE 2
2880 #define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3
2881 #define SE_LOCK_MEMORY_PRIVILEGE 4
2882 #define SE_INCREASE_QUOTA_PRIVILEGE 5
2883 #define SE_UNSOLICITED_INPUT_PRIVILEGE 6 /* obsolete */
2884 #define SE_MACHINE_ACCOUNT_PRIVILEGE 6
2885 #define SE_TCB_PRIVILEGE 7
2886 #define SE_SECURITY_PRIVILEGE 8
2887 #define SE_TAKE_OWNERSHIP_PRIVILEGE 9
2888 #define SE_LOAD_DRIVER_PRIVILEGE 10
2889 #define SE_SYSTEM_PROFILE_PRIVILEGE 11
2890 #define SE_SYSTEMTIME_PRIVILEGE 12
2891 #define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13
2892 #define SE_INC_BASE_PRIORITY_PRIVILEGE 14
2893 #define SE_CREATE_PAGEFILE_PRIVILEGE 15
2894 #define SE_CREATE_PERMANENT_PRIVILEGE 16
2895 #define SE_BACKUP_PRIVILEGE 17
2896 #define SE_RESTORE_PRIVILEGE 18
2897 #define SE_SHUTDOWN_PRIVILEGE 19
2898 #define SE_DEBUG_PRIVILEGE 20
2899 #define SE_AUDIT_PRIVILEGE 21
2900 #define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22
2901 #define SE_CHANGE_NOTIFY_PRIVILEGE 23
2902 #define SE_REMOTE_SHUTDOWN_PRIVILEGE 24
2903 #define SE_UNDOCK_PRIVILEGE 25
2904 #define SE_SYNC_AGENT_PRIVILEGE 26
2905 #define SE_ENABLE_DELEGATION_PRIVILEGE 27
2906 #define SE_MANAGE_VOLUME_PRIVILEGE 28
2907 #define SE_IMPERSONATE_PRIVILEGE 29
2908 #define SE_CREATE_GLOBAL_PRIVILEGE 30
2909 #define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_GLOBAL_PRIVILEGE
2911 /* NtGlobalFlag bits */
2912 #define FLG_STOP_ON_EXCEPTION 0x00000001
2913 #define FLG_SHOW_LDR_SNAPS 0x00000002
2914 #define FLG_DEBUG_INITIAL_COMMAND 0x00000004
2915 #define FLG_STOP_ON_HUNG_GUI 0x00000008
2916 #define FLG_HEAP_ENABLE_TAIL_CHECK 0x00000010
2917 #define FLG_HEAP_ENABLE_FREE_CHECK 0x00000020
2918 #define FLG_HEAP_VALIDATE_PARAMETERS 0x00000040
2919 #define FLG_HEAP_VALIDATE_ALL 0x00000080
2920 #define FLG_APPLICATION_VERIFIER 0x00000100
2921 #define FLG_POOL_ENABLE_TAGGING 0x00000400
2922 #define FLG_HEAP_ENABLE_TAGGING 0x00000800
2923 #define FLG_USER_STACK_TRACE_DB 0x00001000
2924 #define FLG_KERNEL_STACK_TRACE_DB 0x00002000
2925 #define FLG_MAINTAIN_OBJECT_TYPELIST 0x00004000
2926 #define FLG_HEAP_ENABLE_TAG_BY_DLL 0x00008000
2927 #define FLG_DISABLE_STACK_EXTENSION 0x00010000
2928 #define FLG_ENABLE_CSRDEBUG 0x00020000
2929 #define FLG_ENABLE_KDEBUG_SYMBOL_LOAD 0x00040000
2930 #define FLG_DISABLE_PAGE_KERNEL_STACKS 0x00080000
2931 #define FLG_ENABLE_SYSTEM_CRIT_BREAKS 0x00100000
2932 #define FLG_HEAP_DISABLE_COALESCING 0x00200000
2933 #define FLG_ENABLE_CLOSE_EXCEPTIONS 0x00400000
2934 #define FLG_ENABLE_EXCEPTION_LOGGING 0x00800000
2935 #define FLG_ENABLE_HANDLE_TYPE_TAGGING 0x01000000
2936 #define FLG_HEAP_PAGE_ALLOCS 0x02000000
2937 #define FLG_DEBUG_INITIAL_COMMAND_EX 0x04000000
2938 #define FLG_DISABLE_DBGPRINT 0x08000000
2939 #define FLG_CRITSEC_EVENT_CREATION 0x10000000
2940 #define FLG_LDR_TOP_DOWN 0x20000000
2941 #define FLG_ENABLE_HANDLE_EXCEPTIONS 0x40000000
2942 #define FLG_DISABLE_PROTDLLS 0x80000000
2944 /* Rtl*Registry* functions structs and defines */
2945 #define RTL_REGISTRY_ABSOLUTE 0
2946 #define RTL_REGISTRY_SERVICES 1
2947 #define RTL_REGISTRY_CONTROL 2
2948 #define RTL_REGISTRY_WINDOWS_NT 3
2949 #define RTL_REGISTRY_DEVICEMAP 4
2950 #define RTL_REGISTRY_USER 5
2952 #define RTL_REGISTRY_HANDLE 0x40000000
2953 #define RTL_REGISTRY_OPTIONAL 0x80000000
2955 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
2956 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
2957 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
2958 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
2959 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
2960 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
2961 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
2962 #define RTL_QUERY_REGISTRY_TYPECHECK 0x00000100
2964 #define RTL_QUERY_REGISTRY_TYPECHECK_SHIFT 24
2966 typedef NTSTATUS (WINAPI *PRTL_QUERY_REGISTRY_ROUTINE)( PCWSTR ValueName,
2967 ULONG ValueType,
2968 PVOID ValueData,
2969 ULONG ValueLength,
2970 PVOID Context,
2971 PVOID EntryContext);
2973 typedef struct _RTL_QUERY_REGISTRY_TABLE
2975 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
2976 ULONG Flags;
2977 PWSTR Name;
2978 PVOID EntryContext;
2979 ULONG DefaultType;
2980 PVOID DefaultData;
2981 ULONG DefaultLength;
2982 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
2984 typedef struct _KEY_MULTIPLE_VALUE_INFORMATION
2986 PUNICODE_STRING ValueName;
2987 ULONG DataLength;
2988 ULONG DataOffset;
2989 ULONG Type;
2990 } KEY_MULTIPLE_VALUE_INFORMATION, *PKEY_MULTIPLE_VALUE_INFORMATION;
2992 typedef VOID (CALLBACK *PRTL_OVERLAPPED_COMPLETION_ROUTINE)(DWORD,DWORD,LPVOID);
2994 typedef VOID (CALLBACK *PTIMER_APC_ROUTINE) ( PVOID, ULONG, LONG );
2996 typedef enum _EVENT_INFORMATION_CLASS {
2997 EventBasicInformation
2998 } EVENT_INFORMATION_CLASS, *PEVENT_INFORMATION_CLASS;
3000 typedef struct _EVENT_BASIC_INFORMATION {
3001 EVENT_TYPE EventType;
3002 LONG EventState;
3003 } EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION;
3005 typedef enum _SEMAPHORE_INFORMATION_CLASS {
3006 SemaphoreBasicInformation
3007 } SEMAPHORE_INFORMATION_CLASS, *PSEMAPHORE_INFORMATION_CLASS;
3009 typedef struct _SEMAPHORE_BASIC_INFORMATION {
3010 ULONG CurrentCount;
3011 ULONG MaximumCount;
3012 } SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION;
3014 typedef enum _SECTION_INFORMATION_CLASS
3016 SectionBasicInformation,
3017 SectionImageInformation,
3018 SectionRelocationInformation,
3019 SectionOriginalBaseInformation,
3020 SectionInternalImageInformation
3021 } SECTION_INFORMATION_CLASS;
3023 typedef struct _SECTION_BASIC_INFORMATION {
3024 PVOID BaseAddress;
3025 ULONG Attributes;
3026 LARGE_INTEGER Size;
3027 } SECTION_BASIC_INFORMATION, *PSECTION_BASIC_INFORMATION;
3029 typedef struct _SECTION_IMAGE_INFORMATION {
3030 PVOID TransferAddress;
3031 ULONG ZeroBits;
3032 SIZE_T MaximumStackSize;
3033 SIZE_T CommittedStackSize;
3034 ULONG SubSystemType;
3035 USHORT MinorSubsystemVersion;
3036 USHORT MajorSubsystemVersion;
3037 USHORT MajorOperatingSystemVersion;
3038 USHORT MinorOperatingSystemVersion;
3039 USHORT ImageCharacteristics;
3040 USHORT DllCharacteristics;
3041 USHORT Machine;
3042 BOOLEAN ImageContainsCode;
3043 union
3045 UCHAR ImageFlags;
3046 struct
3048 UCHAR ComPlusNativeReady : 1;
3049 UCHAR ComPlusILOnly : 1;
3050 UCHAR ImageDynamicallyRelocated : 1;
3051 UCHAR ImageMappedFlat : 1;
3052 UCHAR BaseBelow4gb : 1;
3053 UCHAR ComPlusPrefer32bit : 1;
3054 #ifdef __WINESRC__ /* Wine extensions */
3055 UCHAR WineBuiltin : 1;
3056 UCHAR WineFakeDll : 1;
3057 #else
3058 UCHAR Reserved : 2;
3059 #endif
3060 } DUMMYSTRUCTNAME;
3061 } DUMMYUNIONNAME;
3062 ULONG LoaderFlags;
3063 ULONG ImageFileSize;
3064 ULONG CheckSum;
3065 } SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION;
3067 typedef struct _LPC_SECTION_WRITE {
3068 ULONG Length;
3069 HANDLE SectionHandle;
3070 ULONG SectionOffset;
3071 ULONG ViewSize;
3072 PVOID ViewBase;
3073 PVOID TargetViewBase;
3074 } LPC_SECTION_WRITE, *PLPC_SECTION_WRITE;
3076 typedef struct _LPC_SECTION_READ {
3077 ULONG Length;
3078 ULONG ViewSize;
3079 PVOID ViewBase;
3080 } LPC_SECTION_READ, *PLPC_SECTION_READ;
3082 typedef struct _LPC_MESSAGE {
3083 USHORT DataSize;
3084 USHORT MessageSize;
3085 USHORT MessageType;
3086 USHORT VirtualRangesOffset;
3087 CLIENT_ID ClientId;
3088 ULONG_PTR MessageId;
3089 ULONG_PTR SectionSize;
3090 UCHAR Data[ANYSIZE_ARRAY];
3091 } LPC_MESSAGE, *PLPC_MESSAGE;
3093 typedef struct _RTL_USER_PROCESS_INFORMATION
3095 ULONG Length;
3096 HANDLE Process;
3097 HANDLE Thread;
3098 CLIENT_ID ClientId;
3099 SECTION_IMAGE_INFORMATION ImageInformation;
3100 } RTL_USER_PROCESS_INFORMATION, *PRTL_USER_PROCESS_INFORMATION;
3102 typedef enum _SHUTDOWN_ACTION {
3103 ShutdownNoReboot,
3104 ShutdownReboot,
3105 ShutdownPowerOff
3106 } SHUTDOWN_ACTION, *PSHUTDOWN_ACTION;
3108 typedef enum _KPROFILE_SOURCE {
3109 ProfileTime,
3110 ProfileAlignmentFixup,
3111 ProfileTotalIssues,
3112 ProfilePipelineDry,
3113 ProfileLoadInstructions,
3114 ProfilePipelineFrozen,
3115 ProfileBranchInstructions,
3116 ProfileTotalNonissues,
3117 ProfileDcacheMisses,
3118 ProfileIcacheMisses,
3119 ProfileCacheMisses,
3120 ProfileBranchMispredictions,
3121 ProfileStoreInstructions,
3122 ProfileFpInstructions,
3123 ProfileIntegerInstructions,
3124 Profile2Issue,
3125 Profile3Issue,
3126 Profile4Issue,
3127 ProfileSpecialInstructions,
3128 ProfileTotalCycles,
3129 ProfileIcacheIssues,
3130 ProfileDcacheAccesses,
3131 ProfileMemoryBarrierCycles,
3132 ProfileLoadLinkedIssues,
3133 ProfileMaximum
3134 } KPROFILE_SOURCE, *PKPROFILE_SOURCE;
3136 typedef struct _DIRECTORY_BASIC_INFORMATION {
3137 UNICODE_STRING ObjectName;
3138 UNICODE_STRING ObjectTypeName;
3139 } DIRECTORY_BASIC_INFORMATION, *PDIRECTORY_BASIC_INFORMATION;
3141 typedef struct _INITIAL_TEB {
3142 void *OldStackBase;
3143 void *OldStackLimit;
3144 void *StackBase;
3145 void *StackLimit;
3146 void *DeallocationStack;
3147 } INITIAL_TEB, *PINITIAL_TEB;
3149 typedef enum _PORT_INFORMATION_CLASS {
3150 PortNoInformation
3151 } PORT_INFORMATION_CLASS, *PPORT_INFORMATION_CLASS;
3153 typedef enum _IO_COMPLETION_INFORMATION_CLASS {
3154 IoCompletionBasicInformation
3155 } IO_COMPLETION_INFORMATION_CLASS, *PIO_COMPLETION_INFORMATION_CLASS;
3157 typedef struct _FILE_COMPLETION_INFORMATION {
3158 HANDLE CompletionPort;
3159 ULONG_PTR CompletionKey;
3160 } FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION;
3162 #define IO_COMPLETION_QUERY_STATE 0x0001
3163 #define IO_COMPLETION_MODIFY_STATE 0x0002
3164 #define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
3166 typedef struct _FILE_IO_COMPLETION_INFORMATION {
3167 ULONG_PTR CompletionKey;
3168 ULONG_PTR CompletionValue;
3169 IO_STATUS_BLOCK IoStatusBlock;
3170 } FILE_IO_COMPLETION_INFORMATION, *PFILE_IO_COMPLETION_INFORMATION;
3172 typedef enum _HARDERROR_RESPONSE_OPTION {
3173 OptionAbortRetryIgnore,
3174 OptionOk,
3175 OptionOkCancel,
3176 OptionRetryCancel,
3177 OptionYesNo,
3178 OptionYesNoCancel,
3179 OptionShutdownSystem
3180 } HARDERROR_RESPONSE_OPTION, *PHARDERROR_RESPONSE_OPTION;
3182 typedef enum _HARDERROR_RESPONSE {
3183 ResponseReturnToCaller,
3184 ResponseNotHandled,
3185 ResponseAbort,
3186 ResponseCancel,
3187 ResponseIgnore,
3188 ResponseNo,
3189 ResponseOk,
3190 ResponseRetry,
3191 ResponseYes
3192 } HARDERROR_RESPONSE, *PHARDERROR_RESPONSE;
3194 typedef enum _SYSDBG_COMMAND {
3195 SysDbgQueryModuleInformation,
3196 SysDbgQueryTraceInformation,
3197 SysDbgSetTracepoint,
3198 SysDbgSetSpecialCall,
3199 SysDbgClearSpecialCalls,
3200 SysDbgQuerySpecialCalls,
3201 SysDbgBreakPoint,
3202 SysDbgQueryVersion,
3203 SysDbgReadVirtual,
3204 SysDbgWriteVirtual,
3205 SysDbgReadPhysical,
3206 SysDbgWritePhysical,
3207 SysDbgReadControlSpace,
3208 SysDbgWriteControlSpace,
3209 SysDbgReadIoSpace,
3210 SysDbgWriteIoSpace,
3211 SysDbgReadMsr,
3212 SysDbgWriteMsr,
3213 SysDbgReadBusData,
3214 SysDbgWriteBusData
3215 } SYSDBG_COMMAND, *PSYSDBG_COMMAND;
3217 typedef struct _CPTABLEINFO
3219 USHORT CodePage;
3220 USHORT MaximumCharacterSize;
3221 USHORT DefaultChar;
3222 USHORT UniDefaultChar;
3223 USHORT TransDefaultChar;
3224 USHORT TransUniDefaultChar;
3225 USHORT DBCSCodePage;
3226 UCHAR LeadByte[12];
3227 USHORT *MultiByteTable;
3228 void *WideCharTable;
3229 USHORT *DBCSRanges;
3230 USHORT *DBCSOffsets;
3231 } CPTABLEINFO, *PCPTABLEINFO;
3233 typedef struct _NLSTABLEINFO
3235 CPTABLEINFO OemTableInfo;
3236 CPTABLEINFO AnsiTableInfo;
3237 USHORT *UpperCaseTable;
3238 USHORT *LowerCaseTable;
3239 } NLSTABLEINFO, *PNLSTABLEINFO;
3241 /*************************************************************************
3242 * Loader structures
3244 * Those are not part of standard Winternl.h
3247 typedef struct _LDR_SERVICE_TAG_RECORD
3249 struct _LDR_SERVICE_TAG_RECORD *Next;
3250 ULONG ServiceTag;
3251 } LDR_SERVICE_TAG_RECORD, *PLDR_SERVICE_TAG_RECORD;
3253 typedef struct _LDRP_CSLIST
3255 SINGLE_LIST_ENTRY *Tail;
3256 } LDRP_CSLIST, *PLDRP_CSLIST;
3258 typedef enum _LDR_DDAG_STATE
3260 LdrModulesMerged = -5,
3261 LdrModulesInitError = -4,
3262 LdrModulesSnapError = -3,
3263 LdrModulesUnloaded = -2,
3264 LdrModulesUnloading = -1,
3265 LdrModulesPlaceHolder = 0,
3266 LdrModulesMapping = 1,
3267 LdrModulesMapped = 2,
3268 LdrModulesWaitingForDependencies = 3,
3269 LdrModulesSnapping = 4,
3270 LdrModulesSnapped = 5,
3271 LdrModulesCondensed = 6,
3272 LdrModulesReadyToInit = 7,
3273 LdrModulesInitializing = 8,
3274 LdrModulesReadyToRun = 9,
3275 } LDR_DDAG_STATE;
3277 typedef struct _LDR_DDAG_NODE
3279 LIST_ENTRY Modules;
3280 LDR_SERVICE_TAG_RECORD *ServiceTagList;
3281 ULONG LoadCount;
3282 ULONG ReferenceCount;
3283 ULONG DependencyCount;
3284 union
3286 LDRP_CSLIST Dependencies;
3287 SINGLE_LIST_ENTRY RemovalLink;
3289 LDRP_CSLIST IncomingDependencies;
3290 LDR_DDAG_STATE State;
3291 SINGLE_LIST_ENTRY CondenseLink;
3292 ULONG PreorderNumber;
3293 ULONG LowestLink;
3294 } LDR_DDAG_NODE, *PLDR_DDAG_NODE;
3296 typedef enum _LDR_DLL_LOAD_REASON
3298 LoadReasonStaticDependency,
3299 LoadReasonStaticForwarderDependency,
3300 LoadReasonDynamicForwarderDependency,
3301 LoadReasonDelayloadDependency,
3302 LoadReasonDynamicLoad,
3303 LoadReasonAsImageLoad,
3304 LoadReasonAsDataLoad,
3305 LoadReasonUnknown = -1
3306 } LDR_DLL_LOAD_REASON, *PLDR_DLL_LOAD_REASON;
3308 typedef struct _LDR_DATA_TABLE_ENTRY
3310 LIST_ENTRY InLoadOrderLinks;
3311 LIST_ENTRY InMemoryOrderLinks;
3312 LIST_ENTRY InInitializationOrderLinks;
3313 void* DllBase;
3314 void* EntryPoint;
3315 ULONG SizeOfImage;
3316 UNICODE_STRING FullDllName;
3317 UNICODE_STRING BaseDllName;
3318 ULONG Flags;
3319 SHORT LoadCount;
3320 SHORT TlsIndex;
3321 HANDLE SectionHandle;
3322 ULONG CheckSum;
3323 ULONG TimeDateStamp;
3324 HANDLE ActivationContext;
3325 void* Lock;
3326 LDR_DDAG_NODE* DdagNode;
3327 LIST_ENTRY NodeModuleLink;
3328 struct _LDRP_LOAD_CONTEXT *LoadContext;
3329 void* ParentDllBase;
3330 void* SwitchBackContext;
3331 RTL_BALANCED_NODE BaseAddressIndexNode;
3332 RTL_BALANCED_NODE MappingInfoIndexNode;
3333 ULONG_PTR OriginalBase;
3334 LARGE_INTEGER LoadTime;
3335 ULONG BaseNameHashValue;
3336 LDR_DLL_LOAD_REASON LoadReason;
3337 ULONG ImplicitPathOptions;
3338 ULONG ReferenceCount;
3339 } LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY;
3341 typedef struct _LDR_DLL_LOADED_NOTIFICATION_DATA
3343 ULONG Flags;
3344 const UNICODE_STRING *FullDllName;
3345 const UNICODE_STRING *BaseDllName;
3346 void *DllBase;
3347 ULONG SizeOfImage;
3348 } LDR_DLL_LOADED_NOTIFICATION_DATA, *PLDR_DLL_LOADED_NOTIFICATION_DATA;
3350 typedef struct _LDR_DLL_UNLOADED_NOTIFICATION_DATA
3352 ULONG Flags;
3353 const UNICODE_STRING *FullDllName;
3354 const UNICODE_STRING *BaseDllName;
3355 void *DllBase;
3356 ULONG SizeOfImage;
3357 } LDR_DLL_UNLOADED_NOTIFICATION_DATA, *PLDR_DLL_UNLOADED_NOTIFICATION_DATA;
3359 typedef union _LDR_DLL_NOTIFICATION_DATA
3361 LDR_DLL_LOADED_NOTIFICATION_DATA Loaded;
3362 LDR_DLL_UNLOADED_NOTIFICATION_DATA Unloaded;
3363 } LDR_DLL_NOTIFICATION_DATA, *PLDR_DLL_NOTIFICATION_DATA;
3365 typedef void (CALLBACK *PLDR_DLL_NOTIFICATION_FUNCTION)(ULONG, LDR_DLL_NOTIFICATION_DATA*, void*);
3367 /* those defines are (some of the) regular LDR_DATA_TABLE_ENTRY.Flags values */
3368 #define LDR_IMAGE_IS_DLL 0x00000004
3369 #define LDR_LOAD_IN_PROGRESS 0x00001000
3370 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
3371 #define LDR_NO_DLL_CALLS 0x00040000
3372 #define LDR_PROCESS_ATTACHED 0x00080000
3373 #define LDR_COR_IMAGE 0x00400000
3374 #define LDR_COR_ILONLY 0x01000000
3376 /* these ones is Wine specific */
3377 #define LDR_DONT_RESOLVE_REFS 0x40000000
3378 #define LDR_WINE_INTERNAL 0x80000000
3380 /* flag for LdrAddRefDll */
3381 #define LDR_ADDREF_DLL_PIN 0x00000001
3383 /* flags for LdrGetDllHandleEx */
3384 #define LDR_GET_DLL_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT 0x00000001
3385 #define LDR_GET_DLL_HANDLE_EX_FLAG_PIN 0x00000002
3387 #define LDR_DLL_NOTIFICATION_REASON_LOADED 1
3388 #define LDR_DLL_NOTIFICATION_REASON_UNLOADED 2
3390 /* FIXME: to be checked */
3391 #define MAXIMUM_FILENAME_LENGTH 256
3393 typedef struct _RTL_PROCESS_MODULE_INFORMATION
3395 PVOID Section; /* 00/00 */
3396 PVOID MappedBaseAddress; /* 04/08 */
3397 PVOID ImageBaseAddress; /* 08/10 */
3398 ULONG ImageSize; /* 0c/18 */
3399 ULONG Flags; /* 10/1c */
3400 WORD LoadOrderIndex; /* 14/20 */
3401 WORD InitOrderIndex; /* 16/22 */
3402 WORD LoadCount; /* 18/24 */
3403 WORD NameOffset; /* 1a/26 */
3404 BYTE Name[MAXIMUM_FILENAME_LENGTH]; /* 1c/28 */
3405 } RTL_PROCESS_MODULE_INFORMATION, *PRTL_PROCESS_MODULE_INFORMATION;
3407 typedef struct _RTL_PROCESS_MODULES
3409 ULONG ModulesCount;
3410 RTL_PROCESS_MODULE_INFORMATION Modules[1]; /* FIXME: should be Modules[0] */
3411 } RTL_PROCESS_MODULES, *PRTL_PROCESS_MODULES;
3413 #define PROCESS_CREATE_FLAGS_BREAKAWAY 0x00000001
3414 #define PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT 0x00000002
3415 #define PROCESS_CREATE_FLAGS_INHERIT_HANDLES 0x00000004
3416 #define PROCESS_CREATE_FLAGS_OVERRIDE_ADDRESS_SPACE 0x00000008
3417 #define PROCESS_CREATE_FLAGS_LARGE_PAGES 0x00000010
3418 #define PROCESS_CREATE_FLAGS_LARGE_PAGE_SYSTEM_DLL 0x00000020
3419 #define PROCESS_CREATE_FLAGS_PROTECTED_PROCESS 0x00000040
3420 #define PROCESS_CREATE_FLAGS_CREATE_SESSION 0x00000080
3421 #define PROCESS_CREATE_FLAGS_INHERIT_FROM_PARENT 0x00000100
3422 #define PROCESS_CREATE_FLAGS_SUSPENDED 0x00000200
3423 #define PROCESS_CREATE_FLAGS_EXTENDED_UNKNOWN 0x00000400
3425 typedef struct _RTL_PROCESS_MODULE_INFORMATION_EX
3427 USHORT NextOffset;
3428 RTL_PROCESS_MODULE_INFORMATION BaseInfo;
3429 ULONG ImageCheckSum;
3430 ULONG TimeDateStamp;
3431 void *DefaultBase;
3432 } RTL_PROCESS_MODULE_INFORMATION_EX;
3434 #define THREAD_CREATE_FLAGS_CREATE_SUSPENDED 0x00000001
3435 #define THREAD_CREATE_FLAGS_SKIP_THREAD_ATTACH 0x00000002
3436 #define THREAD_CREATE_FLAGS_HIDE_FROM_DEBUGGER 0x00000004
3437 #define THREAD_CREATE_FLAGS_HAS_SECURITY_DESCRIPTOR 0x00000010
3438 #define THREAD_CREATE_FLAGS_ACCESS_CHECK_IN_TARGET 0x00000020
3439 #define THREAD_CREATE_FLAGS_INITIAL_THREAD 0x00000080
3441 typedef LONG (CALLBACK *PRTL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS);
3443 typedef void (CALLBACK *PTP_IO_CALLBACK)(PTP_CALLBACK_INSTANCE,void*,void*,IO_STATUS_BLOCK*,PTP_IO);
3445 #define PS_ATTRIBUTE_THREAD 0x00010000
3446 #define PS_ATTRIBUTE_INPUT 0x00020000
3447 #define PS_ATTRIBUTE_ADDITIVE 0x00040000
3449 typedef enum _PS_ATTRIBUTE_NUM
3451 PsAttributeParentProcess,
3452 PsAttributeDebugPort,
3453 PsAttributeToken,
3454 PsAttributeClientId,
3455 PsAttributeTebAddress,
3456 PsAttributeImageName,
3457 PsAttributeImageInfo,
3458 PsAttributeMemoryReserve,
3459 PsAttributePriorityClass,
3460 PsAttributeErrorMode,
3461 PsAttributeStdHandleInfo,
3462 PsAttributeHandleList,
3463 PsAttributeGroupAffinity,
3464 PsAttributePreferredNode,
3465 PsAttributeIdealProcessor,
3466 PsAttributeUmsThread,
3467 PsAttributeMitigationOptions,
3468 PsAttributeProtectionLevel,
3469 PsAttributeSecureProcess,
3470 PsAttributeJobList,
3471 PsAttributeChildProcessPolicy,
3472 PsAttributeAllApplicationPackagesPolicy,
3473 PsAttributeWin32kFilter,
3474 PsAttributeSafeOpenPromptOriginClaim,
3475 PsAttributeBnoIsolation,
3476 PsAttributeDesktopAppPolicy,
3477 PsAttributeChpe,
3478 PsAttributeMax
3479 } PS_ATTRIBUTE_NUM;
3481 #define PS_ATTRIBUTE_PARENT_PROCESS (PsAttributeParentProcess | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_ADDITIVE)
3482 #define PS_ATTRIBUTE_DEBUG_PORT (PsAttributeDebugPort | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_ADDITIVE)
3483 #define PS_ATTRIBUTE_TOKEN (PsAttributeToken | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_ADDITIVE)
3484 #define PS_ATTRIBUTE_CLIENT_ID (PsAttributeClientId | PS_ATTRIBUTE_THREAD)
3485 #define PS_ATTRIBUTE_TEB_ADDRESS (PsAttributeTebAddress | PS_ATTRIBUTE_THREAD)
3486 #define PS_ATTRIBUTE_IMAGE_NAME (PsAttributeImageName | PS_ATTRIBUTE_INPUT)
3487 #define PS_ATTRIBUTE_IMAGE_INFO (PsAttributeImageInfo)
3488 #define PS_ATTRIBUTE_MEMORY_RESERVE (PsAttributeMemoryReserve | PS_ATTRIBUTE_INPUT)
3489 #define PS_ATTRIBUTE_PRIORITY_CLASS (PsAttributePriorityClass | PS_ATTRIBUTE_INPUT)
3490 #define PS_ATTRIBUTE_ERROR_MODE (PsAttributeErrorMode | PS_ATTRIBUTE_INPUT)
3491 #define PS_ATTRIBUTE_STD_HANDLE_INFO (PsAttributeStdHandleInfo | PS_ATTRIBUTE_INPUT)
3492 #define PS_ATTRIBUTE_HANDLE_LIST (PsAttributeHandleList | PS_ATTRIBUTE_INPUT)
3493 #define PS_ATTRIBUTE_GROUP_AFFINITY (PsAttributeGroupAffinity | PS_ATTRIBUTE_THREAD | PS_ATTRIBUTE_INPUT)
3494 #define PS_ATTRIBUTE_PREFERRED_NODE (PsAttributePreferredNode | PS_ATTRIBUTE_INPUT)
3495 #define PS_ATTRIBUTE_IDEAL_PROCESSOR (PsAttributeIdealProcessor | PS_ATTRIBUTE_THREAD | PS_ATTRIBUTE_INPUT)
3496 #define PS_ATTRIBUTE_MITIGATION_OPTIONS (PsAttributeMitigationOptions | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_UNKNOWN)
3497 #define PS_ATTRIBUTE_PROTECTION_LEVEL (PsAttributeProtectionLevel | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_UNKNOWN)
3498 #define PS_ATTRIBUTE_SECURE_PROCESS (PsAttributeSecureProcess | PS_ATTRIBUTE_INPUT)
3499 #define PS_ATTRIBUTE_JOB_LIST (PsAttributeJobList | PS_ATTRIBUTE_INPUT)
3500 #define PS_ATTRIBUTE_CHILD_PROCESS_POLICY (PsAttributeChildProcessPolicy | PS_ATTRIBUTE_INPUT)
3501 #define PS_ATTRIBUTE_ALL_APPLICATION_PACKAGES_POLICY (PsAttributeAllApplicationPackagesPolicy | PS_ATTRIBUTE_INPUT)
3502 #define PS_ATTRIBUTE_WIN32K_FILTER (PsAttributeWin32kFilter | PS_ATTRIBUTE_INPUT)
3503 #define PS_ATTRIBUTE_SAFE_OPEN_PROMPT_ORIGIN_CLAIM (PsAttributeSafeOpenPromptOriginClaim | PS_ATTRIBUTE_INPUT)
3504 #define PS_ATTRIBUTE_BNO_ISOLATION (PsAttributeBnoIsolation | PS_ATTRIBUTE_INPUT)
3505 #define PS_ATTRIBUTE_DESKTOP_APP_POLICY (PsAttributeDesktopAppPolicy | PS_ATTRIBUTE_INPUT)
3507 typedef struct _PS_ATTRIBUTE
3509 ULONG_PTR Attribute;
3510 SIZE_T Size;
3511 union
3513 ULONG_PTR Value;
3514 void *ValuePtr;
3516 SIZE_T *ReturnLength;
3517 } PS_ATTRIBUTE;
3519 typedef struct _PS_ATTRIBUTE_LIST
3521 SIZE_T TotalLength;
3522 PS_ATTRIBUTE Attributes[1];
3523 } PS_ATTRIBUTE_LIST, *PPS_ATTRIBUTE_LIST;
3525 typedef enum _PS_CREATE_STATE
3527 PsCreateInitialState,
3528 PsCreateFailOnFileOpen,
3529 PsCreateFailOnSectionCreate,
3530 PsCreateFailExeFormat,
3531 PsCreateFailMachineMismatch,
3532 PsCreateFailExeName,
3533 PsCreateSuccess,
3534 PsCreateMaximumStates
3535 } PS_CREATE_STATE;
3537 typedef struct _PS_CREATE_INFO
3539 SIZE_T Size;
3540 PS_CREATE_STATE State;
3541 union
3543 struct
3545 union
3547 ULONG InitFlags;
3548 struct
3550 UCHAR WriteOutputOnExit : 1;
3551 UCHAR DetectManifest : 1;
3552 UCHAR IFEOSkipDebugger : 1;
3553 UCHAR IFEODoNotPropagateKeyState : 1;
3554 UCHAR SpareBits1 : 4;
3555 UCHAR SpareBits2 : 8;
3556 USHORT ProhibitedImageCharacteristics : 16;
3559 ACCESS_MASK AdditionalFileAccess;
3560 } InitState;
3561 struct
3563 HANDLE FileHandle;
3564 } FailSection;
3565 struct
3567 USHORT DllCharacteristics;
3568 } ExeFormat;
3569 struct
3571 HANDLE IFEOKey;
3572 } ExeName;
3573 struct
3575 union
3577 ULONG OutputFlags;
3578 struct
3580 UCHAR ProtectedProcess : 1;
3581 UCHAR AddressSpaceOverride : 1;
3582 UCHAR DevOverrideEnabled : 1;
3583 UCHAR ManifestDetected : 1;
3584 UCHAR ProtectedProcessLight : 1;
3585 UCHAR SpareBits1 : 3;
3586 UCHAR SpareBits2 : 8;
3587 USHORT SpareBits3 : 16;
3590 HANDLE FileHandle;
3591 HANDLE SectionHandle;
3592 ULONGLONG UserProcessParametersNative;
3593 ULONG UserProcessParametersWow64;
3594 ULONG CurrentParameterFlags;
3595 ULONGLONG PebAddressNative;
3596 ULONG PebAddressWow64;
3597 ULONGLONG ManifestAddress;
3598 ULONG ManifestSize;
3599 } SuccessState;
3601 } PS_CREATE_INFO, *PPS_CREATE_INFO;
3603 typedef struct _DBGKM_EXCEPTION
3605 EXCEPTION_RECORD ExceptionRecord;
3606 ULONG FirstChance;
3607 } DBGKM_EXCEPTION, *PDBGKM_EXCEPTION;
3609 typedef struct _DBGKM_CREATE_THREAD
3611 ULONG SubSystemKey;
3612 PVOID StartAddress;
3613 } DBGKM_CREATE_THREAD, *PDBGKM_CREATE_THREAD;
3615 typedef struct _DBGKM_CREATE_PROCESS
3617 ULONG SubSystemKey;
3618 HANDLE FileHandle;
3619 PVOID BaseOfImage;
3620 ULONG DebugInfoFileOffset;
3621 ULONG DebugInfoSize;
3622 DBGKM_CREATE_THREAD InitialThread;
3623 } DBGKM_CREATE_PROCESS, *PDBGKM_CREATE_PROCESS;
3625 typedef struct _DBGKM_EXIT_THREAD
3627 NTSTATUS ExitStatus;
3628 } DBGKM_EXIT_THREAD, *PDBGKM_EXIT_THREAD;
3630 typedef struct _DBGKM_EXIT_PROCESS
3632 NTSTATUS ExitStatus;
3633 } DBGKM_EXIT_PROCESS, *PDBGKM_EXIT_PROCESS;
3635 typedef struct _DBGKM_LOAD_DLL
3637 HANDLE FileHandle;
3638 PVOID BaseOfDll;
3639 ULONG DebugInfoFileOffset;
3640 ULONG DebugInfoSize;
3641 PVOID NamePointer;
3642 } DBGKM_LOAD_DLL, *PDBGKM_LOAD_DLL;
3644 typedef struct _DBGKM_UNLOAD_DLL
3646 PVOID BaseAddress;
3647 } DBGKM_UNLOAD_DLL, *PDBGKM_UNLOAD_DLL;
3649 typedef enum _DBG_STATE
3651 DbgIdle,
3652 DbgReplyPending,
3653 DbgCreateThreadStateChange,
3654 DbgCreateProcessStateChange,
3655 DbgExitThreadStateChange,
3656 DbgExitProcessStateChange,
3657 DbgExceptionStateChange,
3658 DbgBreakpointStateChange,
3659 DbgSingleStepStateChange,
3660 DbgLoadDllStateChange,
3661 DbgUnloadDllStateChange
3662 } DBG_STATE, *PDBG_STATE;
3664 typedef struct _DBGUI_CREATE_THREAD
3666 HANDLE HandleToThread;
3667 DBGKM_CREATE_THREAD NewThread;
3668 } DBGUI_CREATE_THREAD, *PDBGUI_CREATE_THREAD;
3670 typedef struct _DBGUI_CREATE_PROCESS
3672 HANDLE HandleToProcess;
3673 HANDLE HandleToThread;
3674 DBGKM_CREATE_PROCESS NewProcess;
3675 } DBGUI_CREATE_PROCESS, *PDBGUI_CREATE_PROCESS;
3677 typedef struct _DBGUI_WAIT_STATE_CHANGE
3679 DBG_STATE NewState;
3680 CLIENT_ID AppClientId;
3681 union
3683 DBGKM_EXCEPTION Exception;
3684 DBGUI_CREATE_THREAD CreateThread;
3685 DBGUI_CREATE_PROCESS CreateProcessInfo;
3686 DBGKM_EXIT_THREAD ExitThread;
3687 DBGKM_EXIT_PROCESS ExitProcess;
3688 DBGKM_LOAD_DLL LoadDll;
3689 DBGKM_UNLOAD_DLL UnloadDll;
3690 } StateInfo;
3691 } DBGUI_WAIT_STATE_CHANGE, *PDBGUI_WAIT_STATE_CHANGE;
3693 struct _DEBUG_EVENT;
3695 #define DEBUG_READ_EVENT 0x0001
3696 #define DEBUG_PROCESS_ASSIGN 0x0002
3697 #define DEBUG_SET_INFORMATION 0x0004
3698 #define DEBUG_QUERY_INFORMATION 0x0008
3699 #define DEBUG_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x0f)
3701 #define DEBUG_KILL_ON_CLOSE 0x1
3703 typedef enum _DEBUGOBJECTINFOCLASS
3705 DebugObjectKillProcessOnExitInformation = 1,
3706 MaxDebugObjectInfoClass
3707 } DEBUGOBJECTINFOCLASS, *PDEBUGOBJECTINFOCLASS;
3710 typedef struct _WOW64_CPURESERVED
3712 USHORT Flags;
3713 USHORT Machine;
3714 /* CONTEXT context */
3715 /* CONTEXT_EX *context_ex */
3716 } WOW64_CPURESERVED, *PWOW64_CPURESERVED;
3718 #define WOW64_CPURESERVED_FLAG_RESET_STATE 1
3720 typedef struct _WOW64_CPU_AREA_INFO
3722 void *Context;
3723 void *ContextEx;
3724 void *ContextFlagsLocation;
3725 WOW64_CPURESERVED *CpuReserved;
3726 ULONG ContextFlag;
3727 USHORT Machine;
3728 } WOW64_CPU_AREA_INFO, *PWOW64_CPU_AREA_INFO;
3730 #ifdef __WINESRC__
3731 /* undocumented layout of LdrSystemDllInitBlock */
3732 /* this varies across Windows version; we are using the win10-2004 layout */
3733 typedef struct
3735 ULONG version;
3736 ULONG unknown1[3];
3737 ULONG64 unknown2;
3738 ULONG64 pLdrInitializeThunk;
3739 ULONG64 pKiUserExceptionDispatcher;
3740 ULONG64 pKiUserApcDispatcher;
3741 ULONG64 pKiUserCallbackDispatcher;
3742 ULONG64 pRtlUserThreadStart;
3743 ULONG64 pRtlpQueryProcessDebugInformationRemote;
3744 ULONG64 ntdll_handle;
3745 ULONG64 pLdrSystemDllInitBlock;
3746 ULONG64 pRtlpFreezeTimeBias;
3747 } SYSTEM_DLL_INIT_BLOCK;
3748 #endif
3750 typedef struct
3752 ULONG_PTR *ServiceTable;
3753 ULONG_PTR *CounterTable;
3754 ULONG_PTR ServiceLimit;
3755 BYTE *ArgumentTable;
3756 } SYSTEM_SERVICE_TABLE;
3758 /***********************************************************************
3759 * Function declarations
3762 NTSYSAPI void WINAPI DbgBreakPoint(void);
3763 NTSYSAPI NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
3764 NTSYSAPI NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
3765 NTSYSAPI NTSTATUS WINAPI DbgUiConnectToDbg(void);
3766 NTSYSAPI NTSTATUS WINAPI DbgUiContinue(CLIENT_ID*,NTSTATUS);
3767 NTSYSAPI NTSTATUS WINAPI DbgUiConvertStateChangeStructure(DBGUI_WAIT_STATE_CHANGE*,struct _DEBUG_EVENT*);
3768 NTSYSAPI NTSTATUS WINAPI DbgUiDebugActiveProcess(HANDLE);
3769 NTSYSAPI HANDLE WINAPI DbgUiGetThreadDebugObject(void);
3770 NTSYSAPI NTSTATUS WINAPI DbgUiIssueRemoteBreakin(HANDLE);
3771 NTSYSAPI void WINAPI DbgUiRemoteBreakin(void*);
3772 NTSYSAPI void WINAPI DbgUiSetThreadDebugObject(HANDLE);
3773 NTSYSAPI NTSTATUS WINAPI DbgUiStopDebugging(HANDLE);
3774 NTSYSAPI NTSTATUS WINAPI DbgUiWaitStateChange(DBGUI_WAIT_STATE_CHANGE*,LARGE_INTEGER*);
3775 NTSYSAPI void WINAPI DbgUserBreakPoint(void);
3776 NTSYSAPI NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
3777 NTSYSAPI NTSTATUS WINAPI LdrAddDllDirectory(const UNICODE_STRING*,void**);
3778 NTSYSAPI NTSTATUS WINAPI LdrAddRefDll(ULONG,HMODULE);
3779 NTSYSAPI NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
3780 NTSYSAPI NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_DATA_TABLE_ENTRY*);
3781 NTSYSAPI NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
3782 NTSYSAPI NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
3783 NTSYSAPI NTSTATUS WINAPI LdrGetDllDirectory(UNICODE_STRING*);
3784 NTSYSAPI NTSTATUS WINAPI LdrGetDllHandle(LPCWSTR, ULONG, const UNICODE_STRING*, HMODULE*);
3785 NTSYSAPI NTSTATUS WINAPI LdrGetDllHandleEx(ULONG, LPCWSTR, ULONG *, const UNICODE_STRING*, HMODULE*);
3786 NTSYSAPI NTSTATUS WINAPI LdrGetDllPath(PCWSTR,ULONG,PWSTR*,PWSTR*);
3787 NTSYSAPI NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
3788 NTSYSAPI NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
3789 NTSYSAPI NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG_PTR*);
3790 IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock(void*,UINT,USHORT*,INT_PTR);
3791 NTSYSAPI NTSTATUS WINAPI LdrQueryImageFileExecutionOptions(const UNICODE_STRING*,LPCWSTR,ULONG,void*,ULONG,ULONG*);
3792 NTSYSAPI NTSTATUS WINAPI LdrQueryProcessModuleInformation(RTL_PROCESS_MODULES*, ULONG, ULONG*);
3793 NTSYSAPI NTSTATUS WINAPI LdrRegisterDllNotification(ULONG,PLDR_DLL_NOTIFICATION_FUNCTION,void*,void**);
3794 NTSYSAPI NTSTATUS WINAPI LdrRemoveDllDirectory(void*);
3795 NTSYSAPI NTSTATUS WINAPI LdrSetDefaultDllDirectories(ULONG);
3796 NTSYSAPI NTSTATUS WINAPI LdrSetDllDirectory(const UNICODE_STRING*);
3797 NTSYSAPI void WINAPI LdrShutdownProcess(void);
3798 NTSYSAPI void WINAPI LdrShutdownThread(void);
3799 NTSYSAPI NTSTATUS WINAPI LdrUnloadDll(HMODULE);
3800 NTSYSAPI NTSTATUS WINAPI LdrUnlockLoaderLock(ULONG,ULONG_PTR);
3801 NTSYSAPI NTSTATUS WINAPI LdrUnregisterDllNotification(void*);
3802 NTSYSAPI NTSTATUS WINAPI NtAcceptConnectPort(PHANDLE,ULONG,PLPC_MESSAGE,BOOLEAN,PLPC_SECTION_WRITE,PLPC_SECTION_READ);
3803 NTSYSAPI NTSTATUS WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,NTSTATUS*);
3804 NTSYSAPI NTSTATUS WINAPI NtAccessCheckAndAuditAlarm(PUNICODE_STRING,HANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,ACCESS_MASK,PGENERIC_MAPPING,BOOLEAN,PACCESS_MASK,PBOOLEAN,PBOOLEAN);
3805 NTSYSAPI NTSTATUS WINAPI NtAddAtom(const WCHAR*,ULONG,RTL_ATOM*);
3806 NTSYSAPI NTSTATUS WINAPI NtAdjustGroupsToken(HANDLE,BOOLEAN,PTOKEN_GROUPS,ULONG,PTOKEN_GROUPS,PULONG);
3807 NTSYSAPI NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
3808 NTSYSAPI NTSTATUS WINAPI NtAlertResumeThread(HANDLE,PULONG);
3809 NTSYSAPI NTSTATUS WINAPI NtAlertThread(HANDLE ThreadHandle);
3810 NTSYSAPI NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID lpLuid);
3811 NTSYSAPI NTSTATUS WINAPI NtAllocateUuids(PULARGE_INTEGER,PULONG,PULONG,PUCHAR);
3812 NTSYSAPI NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,ULONG_PTR,SIZE_T*,ULONG,ULONG);
3813 NTSYSAPI NTSTATUS WINAPI NtAllocateVirtualMemoryEx(HANDLE,PVOID*,SIZE_T*,ULONG,ULONG,MEM_EXTENDED_PARAMETER*,ULONG);
3814 NTSYSAPI NTSTATUS WINAPI NtAreMappedFilesTheSame(PVOID,PVOID);
3815 NTSYSAPI NTSTATUS WINAPI NtAssignProcessToJobObject(HANDLE,HANDLE);
3816 NTSYSAPI NTSTATUS WINAPI NtCallbackReturn(PVOID,ULONG,NTSTATUS);
3817 NTSYSAPI NTSTATUS WINAPI NtCancelIoFile(HANDLE,PIO_STATUS_BLOCK);
3818 NTSYSAPI NTSTATUS WINAPI NtCancelIoFileEx(HANDLE,PIO_STATUS_BLOCK,PIO_STATUS_BLOCK);
3819 NTSYSAPI NTSTATUS WINAPI NtCancelTimer(HANDLE, BOOLEAN*);
3820 NTSYSAPI NTSTATUS WINAPI NtClearEvent(HANDLE);
3821 NTSYSAPI NTSTATUS WINAPI NtClose(HANDLE);
3822 NTSYSAPI NTSTATUS WINAPI NtCloseObjectAuditAlarm(PUNICODE_STRING,HANDLE,BOOLEAN);
3823 NTSYSAPI NTSTATUS WINAPI NtCompleteConnectPort(HANDLE);
3824 NTSYSAPI NTSTATUS WINAPI NtConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
3825 NTSYSAPI NTSTATUS WINAPI NtContinue(PCONTEXT,BOOLEAN);
3826 NTSYSAPI NTSTATUS WINAPI NtCreateDebugObject(HANDLE*,ACCESS_MASK,OBJECT_ATTRIBUTES*,ULONG);
3827 NTSYSAPI NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
3828 NTSYSAPI NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,EVENT_TYPE,BOOLEAN);
3829 NTSYSAPI NTSTATUS WINAPI NtCreateEventPair(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
3830 NTSYSAPI NTSTATUS WINAPI NtCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
3831 NTSYSAPI NTSTATUS WINAPI NtCreateIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,ULONG);
3832 NTSYSAPI NTSTATUS WINAPI NtCreateJobObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3833 NTSYSAPI NTSTATUS WINAPI NtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
3834 NTSYSAPI NTSTATUS WINAPI NtCreateKeyTransacted(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,HANDLE,ULONG*);
3835 NTSYSAPI NTSTATUS WINAPI NtCreateKeyedEvent(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG);
3836 NTSYSAPI NTSTATUS WINAPI NtCreateLowBoxToken(HANDLE*,HANDLE,ACCESS_MASK,OBJECT_ATTRIBUTES*,SID*,ULONG,SID_AND_ATTRIBUTES*,ULONG,HANDLE*);
3837 NTSYSAPI NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,PLARGE_INTEGER);
3838 NTSYSAPI NTSTATUS WINAPI NtCreateMutant(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,BOOLEAN);
3839 NTSYSAPI NTSTATUS WINAPI NtCreateNamedPipeFile(PHANDLE,ULONG,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,PLARGE_INTEGER);
3840 NTSYSAPI NTSTATUS WINAPI NtCreatePagingFile(PUNICODE_STRING,PLARGE_INTEGER,PLARGE_INTEGER,PLARGE_INTEGER);
3841 NTSYSAPI NTSTATUS WINAPI NtCreatePort(PHANDLE,POBJECT_ATTRIBUTES,ULONG,ULONG,PULONG);
3842 NTSYSAPI NTSTATUS WINAPI NtCreateProcess(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,BOOLEAN,HANDLE,HANDLE,HANDLE);
3843 NTSYSAPI NTSTATUS WINAPI NtCreateProfile(PHANDLE,HANDLE,PVOID,ULONG,ULONG,PVOID,ULONG,KPROFILE_SOURCE,KAFFINITY);
3844 NTSYSAPI NTSTATUS WINAPI NtCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
3845 NTSYSAPI NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,LONG,LONG);
3846 NTSYSAPI NTSTATUS WINAPI NtCreateSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PUNICODE_STRING);
3847 NTSYSAPI NTSTATUS WINAPI NtCreateThread(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,PCLIENT_ID,PCONTEXT,PINITIAL_TEB,BOOLEAN);
3848 NTSYSAPI NTSTATUS WINAPI NtCreateThreadEx(HANDLE*,ACCESS_MASK,OBJECT_ATTRIBUTES*,HANDLE,PRTL_THREAD_START_ROUTINE,void*,ULONG,ULONG_PTR,SIZE_T,SIZE_T,PS_ATTRIBUTE_LIST*);
3849 NTSYSAPI NTSTATUS WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
3850 NTSYSAPI NTSTATUS WINAPI NtCreateToken(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,TOKEN_TYPE,PLUID,PLARGE_INTEGER,PTOKEN_USER,PTOKEN_GROUPS,PTOKEN_PRIVILEGES,PTOKEN_OWNER,PTOKEN_PRIMARY_GROUP,PTOKEN_DEFAULT_DACL,PTOKEN_SOURCE);
3851 NTSYSAPI NTSTATUS WINAPI NtCreateUserProcess(HANDLE*,HANDLE*,ACCESS_MASK,ACCESS_MASK,OBJECT_ATTRIBUTES*,OBJECT_ATTRIBUTES*,ULONG,ULONG,RTL_USER_PROCESS_PARAMETERS*,PS_CREATE_INFO*,PS_ATTRIBUTE_LIST*);
3852 NTSYSAPI NTSTATUS WINAPI NtDebugActiveProcess(HANDLE,HANDLE);
3853 NTSYSAPI NTSTATUS WINAPI NtDebugContinue(HANDLE,CLIENT_ID*,NTSTATUS);
3854 NTSYSAPI NTSTATUS WINAPI NtDelayExecution(BOOLEAN,const LARGE_INTEGER*);
3855 NTSYSAPI NTSTATUS WINAPI NtDeleteAtom(RTL_ATOM);
3856 NTSYSAPI NTSTATUS WINAPI NtDeleteFile(POBJECT_ATTRIBUTES);
3857 NTSYSAPI NTSTATUS WINAPI NtDeleteKey(HANDLE);
3858 NTSYSAPI NTSTATUS WINAPI NtDeleteValueKey(HANDLE,const UNICODE_STRING *);
3859 NTSYSAPI NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
3860 NTSYSAPI NTSTATUS WINAPI NtDisplayString(PUNICODE_STRING);
3861 NTSYSAPI NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
3862 NTSYSAPI NTSTATUS WINAPI NtDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE);
3863 NTSYSAPI NTSTATUS WINAPI NtEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
3864 NTSYSAPI NTSTATUS WINAPI NtEnumerateValueKey(HANDLE,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3865 NTSYSAPI NTSTATUS WINAPI NtExtendSection(HANDLE,PLARGE_INTEGER);
3866 NTSYSAPI NTSTATUS WINAPI NtFilterToken(HANDLE,ULONG,TOKEN_GROUPS*,TOKEN_PRIVILEGES*,TOKEN_GROUPS*,HANDLE*);
3867 NTSYSAPI NTSTATUS WINAPI NtFindAtom(const WCHAR*,ULONG,RTL_ATOM*);
3868 NTSYSAPI NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
3869 NTSYSAPI NTSTATUS WINAPI NtFlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
3870 NTSYSAPI NTSTATUS WINAPI NtFlushKey(HANDLE);
3871 NTSYSAPI void WINAPI NtFlushProcessWriteBuffers(void);
3872 NTSYSAPI NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,SIZE_T*,ULONG);
3873 NTSYSAPI NTSTATUS WINAPI NtFlushWriteBuffer(VOID);
3874 NTSYSAPI NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
3875 NTSYSAPI NTSTATUS WINAPI NtFsControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
3876 NTSYSAPI NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*);
3877 NTSYSAPI ULONG WINAPI NtGetCurrentProcessorNumber(void);
3878 NTSYSAPI NTSTATUS WINAPI NtGetNextThread(HANDLE,HANDLE,ACCESS_MASK,ULONG,ULONG,HANDLE*);
3879 NTSYSAPI NTSTATUS WINAPI NtGetNlsSectionPtr(ULONG,ULONG,void*,void**,SIZE_T*);
3880 NTSYSAPI NTSTATUS WINAPI NtGetPlugPlayEvent(ULONG,ULONG,PVOID,ULONG);
3881 NTSYSAPI ULONG WINAPI NtGetTickCount(VOID);
3882 NTSYSAPI NTSTATUS WINAPI NtGetWriteWatch(HANDLE,ULONG,PVOID,SIZE_T,PVOID*,ULONG_PTR*,ULONG*);
3883 NTSYSAPI NTSTATUS WINAPI NtImpersonateAnonymousToken(HANDLE);
3884 NTSYSAPI NTSTATUS WINAPI NtImpersonateClientOfPort(HANDLE,PPORT_MESSAGE);
3885 NTSYSAPI NTSTATUS WINAPI NtImpersonateThread(HANDLE,HANDLE,PSECURITY_QUALITY_OF_SERVICE);
3886 NTSYSAPI NTSTATUS WINAPI NtInitializeRegistry(BOOLEAN);
3887 NTSYSAPI NTSTATUS WINAPI NtInitiatePowerAction(POWER_ACTION,SYSTEM_POWER_STATE,ULONG,BOOLEAN);
3888 NTSYSAPI NTSTATUS WINAPI NtIsProcessInJob(HANDLE,HANDLE);
3889 NTSYSAPI NTSTATUS WINAPI NtListenPort(HANDLE,PLPC_MESSAGE);
3890 NTSYSAPI NTSTATUS WINAPI NtLoadDriver(const UNICODE_STRING *);
3891 NTSYSAPI NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *);
3892 NTSYSAPI NTSTATUS WINAPI NtLoadKey2(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *,ULONG);
3893 NTSYSAPI NTSTATUS WINAPI NtLockFile(HANDLE,HANDLE,PIO_APC_ROUTINE,void*,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,ULONG*,BOOLEAN,BOOLEAN);
3894 NTSYSAPI NTSTATUS WINAPI NtLockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
3895 NTSYSAPI NTSTATUS WINAPI NtMakeTemporaryObject(HANDLE);
3896 NTSYSAPI NTSTATUS WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG_PTR,SIZE_T,const LARGE_INTEGER*,SIZE_T*,SECTION_INHERIT,ULONG,ULONG);
3897 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,ULONG,BOOLEAN);
3898 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeKey(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
3899 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeMultipleKeys(HANDLE,ULONG,OBJECT_ATTRIBUTES*,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
3900 NTSYSAPI NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3901 NTSYSAPI NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
3902 NTSYSAPI NTSTATUS WINAPI NtOpenEventPair(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3903 NTSYSAPI NTSTATUS WINAPI NtOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
3904 NTSYSAPI NTSTATUS WINAPI NtOpenIoCompletion(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3905 NTSYSAPI NTSTATUS WINAPI NtOpenJobObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3906 NTSYSAPI NTSTATUS WINAPI NtOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
3907 NTSYSAPI NTSTATUS WINAPI NtOpenKeyEx(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG);
3908 NTSYSAPI NTSTATUS WINAPI NtOpenKeyTransacted(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,HANDLE);
3909 NTSYSAPI NTSTATUS WINAPI NtOpenKeyTransactedEx(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,HANDLE);
3910 NTSYSAPI NTSTATUS WINAPI NtOpenKeyedEvent(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3911 NTSYSAPI NTSTATUS WINAPI NtOpenMutant(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3912 NTSYSAPI NTSTATUS WINAPI NtOpenObjectAuditAlarm(PUNICODE_STRING,PHANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,ACCESS_MASK,PPRIVILEGE_SET,BOOLEAN,BOOLEAN,PBOOLEAN);
3913 NTSYSAPI NTSTATUS WINAPI NtOpenProcess(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
3914 NTSYSAPI NTSTATUS WINAPI NtOpenProcessToken(HANDLE,DWORD,HANDLE *);
3915 NTSYSAPI NTSTATUS WINAPI NtOpenProcessTokenEx(HANDLE,DWORD,DWORD,HANDLE *);
3916 NTSYSAPI NTSTATUS WINAPI NtOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3917 NTSYSAPI NTSTATUS WINAPI NtOpenSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3918 NTSYSAPI NTSTATUS WINAPI NtOpenSymbolicLinkObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3919 NTSYSAPI NTSTATUS WINAPI NtOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
3920 NTSYSAPI NTSTATUS WINAPI NtOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
3921 NTSYSAPI NTSTATUS WINAPI NtOpenThreadTokenEx(HANDLE,DWORD,BOOLEAN,DWORD,HANDLE *);
3922 NTSYSAPI NTSTATUS WINAPI NtOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
3923 NTSYSAPI NTSTATUS WINAPI NtPowerInformation(POWER_INFORMATION_LEVEL,PVOID,ULONG,PVOID,ULONG);
3924 NTSYSAPI NTSTATUS WINAPI NtPrivilegeCheck(HANDLE,PPRIVILEGE_SET,PBOOLEAN);
3925 NTSYSAPI NTSTATUS WINAPI NtPrivilegeObjectAuditAlarm(PUNICODE_STRING,HANDLE,HANDLE,ULONG,PPRIVILEGE_SET,BOOLEAN);
3926 NTSYSAPI NTSTATUS WINAPI NtPrivilegedServiceAuditAlarm(PUNICODE_STRING,PUNICODE_STRING,HANDLE,PPRIVILEGE_SET,BOOLEAN);
3927 NTSYSAPI NTSTATUS WINAPI NtProtectVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG,ULONG*);
3928 NTSYSAPI NTSTATUS WINAPI NtPulseEvent(HANDLE,LONG*);
3929 NTSYSAPI NTSTATUS WINAPI NtQueueApcThread(HANDLE,PNTAPCFUNC,ULONG_PTR,ULONG_PTR,ULONG_PTR);
3930 NTSYSAPI NTSTATUS WINAPI NtQueryAttributesFile(const OBJECT_ATTRIBUTES*,FILE_BASIC_INFORMATION*);
3931 NTSYSAPI NTSTATUS WINAPI NtQueryDefaultLocale(BOOLEAN,LCID*);
3932 NTSYSAPI NTSTATUS WINAPI NtQueryDefaultUILanguage(LANGID*);
3933 NTSYSAPI NTSTATUS WINAPI NtQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
3934 NTSYSAPI NTSTATUS WINAPI NtQueryDirectoryObject(HANDLE,PDIRECTORY_BASIC_INFORMATION,ULONG,BOOLEAN,BOOLEAN,PULONG,PULONG);
3935 NTSYSAPI NTSTATUS WINAPI NtQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PULONG,BOOLEAN);
3936 NTSYSAPI NTSTATUS WINAPI NtQueryEvent(HANDLE,EVENT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3937 NTSYSAPI NTSTATUS WINAPI NtQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*);
3938 NTSYSAPI NTSTATUS WINAPI NtQueryInformationAtom(RTL_ATOM,ATOM_INFORMATION_CLASS,PVOID,ULONG,ULONG*);
3939 NTSYSAPI NTSTATUS WINAPI NtQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS);
3940 NTSYSAPI NTSTATUS WINAPI NtQueryInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,PVOID,ULONG,PULONG);
3941 NTSYSAPI NTSTATUS WINAPI NtQueryInformationPort(HANDLE,PORT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3942 NTSYSAPI NTSTATUS WINAPI NtQueryInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG,PULONG);
3943 NTSYSAPI NTSTATUS WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
3944 NTSYSAPI NTSTATUS WINAPI NtQueryInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3945 NTSYSAPI NTSTATUS WINAPI NtQueryInstallUILanguage(LANGID*);
3946 NTSYSAPI NTSTATUS WINAPI NtQueryIntervalProfile(KPROFILE_SOURCE,PULONG);
3947 NTSYSAPI NTSTATUS WINAPI NtQueryIoCompletion(HANDLE,IO_COMPLETION_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3948 NTSYSAPI NTSTATUS WINAPI NtQueryKey(HANDLE,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
3949 NTSYSAPI NTSTATUS WINAPI NtQueryMultipleValueKey(HANDLE,PKEY_MULTIPLE_VALUE_INFORMATION,ULONG,PVOID,ULONG,PULONG);
3950 NTSYSAPI NTSTATUS WINAPI NtQueryMutant(HANDLE,MUTANT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3951 NTSYSAPI NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
3952 NTSYSAPI NTSTATUS WINAPI NtQueryOpenSubKeys(POBJECT_ATTRIBUTES,PULONG);
3953 NTSYSAPI NTSTATUS WINAPI NtQueryPerformanceCounter(PLARGE_INTEGER, PLARGE_INTEGER);
3954 NTSYSAPI NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
3955 NTSYSAPI NTSTATUS WINAPI NtQuerySection(HANDLE,SECTION_INFORMATION_CLASS,PVOID,SIZE_T,SIZE_T*);
3956 NTSYSAPI NTSTATUS WINAPI NtQuerySemaphore(HANDLE,SEMAPHORE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3957 NTSYSAPI NTSTATUS WINAPI NtQuerySymbolicLinkObject(HANDLE,PUNICODE_STRING,PULONG);
3958 NTSYSAPI NTSTATUS WINAPI NtQuerySystemEnvironmentValue(PUNICODE_STRING,PWCHAR,ULONG,PULONG);
3959 NTSYSAPI NTSTATUS WINAPI NtQuerySystemEnvironmentValueEx(PUNICODE_STRING,GUID*,void*,ULONG*,ULONG*);
3960 NTSYSAPI NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3961 NTSYSAPI NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS,void*,ULONG,void*,ULONG,ULONG*);
3962 NTSYSAPI NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER);
3963 NTSYSAPI NTSTATUS WINAPI NtQueryTimer(HANDLE,TIMER_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3964 NTSYSAPI NTSTATUS WINAPI NtQueryTimerResolution(PULONG,PULONG,PULONG);
3965 NTSYSAPI NTSTATUS WINAPI NtQueryValueKey(HANDLE,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
3966 NTSYSAPI NTSTATUS WINAPI NtQueryLicenseValue(const UNICODE_STRING *,ULONG *,PVOID,ULONG,ULONG *);
3967 NTSYSAPI NTSTATUS WINAPI NtQueryVirtualMemory(HANDLE,LPCVOID,MEMORY_INFORMATION_CLASS,PVOID,SIZE_T,SIZE_T*);
3968 NTSYSAPI NTSTATUS WINAPI NtQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
3969 NTSYSAPI NTSTATUS WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
3970 NTSYSAPI NTSTATUS WINAPI NtRaiseHardError(NTSTATUS,ULONG,PUNICODE_STRING,PVOID*,HARDERROR_RESPONSE_OPTION,PHARDERROR_RESPONSE);
3971 NTSYSAPI NTSTATUS WINAPI NtReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
3972 NTSYSAPI NTSTATUS WINAPI NtReadFileScatter(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT*,ULONG,PLARGE_INTEGER,PULONG);
3973 NTSYSAPI NTSTATUS WINAPI NtReadRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
3974 NTSYSAPI NTSTATUS WINAPI NtReadVirtualMemory(HANDLE,const void*,void*,SIZE_T,SIZE_T*);
3975 NTSYSAPI NTSTATUS WINAPI NtRegisterThreadTerminatePort(HANDLE);
3976 NTSYSAPI NTSTATUS WINAPI NtReleaseKeyedEvent(HANDLE,const void*,BOOLEAN,const LARGE_INTEGER*);
3977 NTSYSAPI NTSTATUS WINAPI NtReleaseMutant(HANDLE,PLONG);
3978 NTSYSAPI NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
3979 NTSYSAPI NTSTATUS WINAPI NtRemoveIoCompletion(HANDLE,PULONG_PTR,PULONG_PTR,PIO_STATUS_BLOCK,PLARGE_INTEGER);
3980 NTSYSAPI NTSTATUS WINAPI NtRemoveIoCompletionEx(HANDLE,FILE_IO_COMPLETION_INFORMATION*,ULONG,ULONG*,LARGE_INTEGER*,BOOLEAN);
3981 NTSYSAPI NTSTATUS WINAPI NtRemoveProcessDebug(HANDLE,HANDLE);
3982 NTSYSAPI NTSTATUS WINAPI NtRenameKey(HANDLE,UNICODE_STRING*);
3983 NTSYSAPI NTSTATUS WINAPI NtReplaceKey(POBJECT_ATTRIBUTES,HANDLE,POBJECT_ATTRIBUTES);
3984 NTSYSAPI NTSTATUS WINAPI NtReplyPort(HANDLE,PLPC_MESSAGE);
3985 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReceivePort(HANDLE,PULONG,PLPC_MESSAGE,PLPC_MESSAGE);
3986 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReceivePortEx(HANDLE,PVOID*,PPORT_MESSAGE,PPORT_MESSAGE,PLARGE_INTEGER);
3987 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReplyPort(HANDLE,PLPC_MESSAGE);
3988 NTSYSAPI NTSTATUS WINAPI NtRequestPort(HANDLE,PLPC_MESSAGE);
3989 NTSYSAPI NTSTATUS WINAPI NtRequestWaitReplyPort(HANDLE,PLPC_MESSAGE,PLPC_MESSAGE);
3990 NTSYSAPI NTSTATUS WINAPI NtResetEvent(HANDLE,LONG*);
3991 NTSYSAPI NTSTATUS WINAPI NtResetWriteWatch(HANDLE,PVOID,SIZE_T);
3992 NTSYSAPI NTSTATUS WINAPI NtRestoreKey(HANDLE,HANDLE,ULONG);
3993 NTSYSAPI NTSTATUS WINAPI NtResumeProcess(HANDLE);
3994 NTSYSAPI NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG);
3995 NTSYSAPI NTSTATUS WINAPI NtSaveKey(HANDLE,HANDLE);
3996 NTSYSAPI NTSTATUS WINAPI NtSecureConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PSID,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
3997 NTSYSAPI NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
3998 NTSYSAPI NTSTATUS WINAPI NtSetDefaultHardErrorPort(HANDLE);
3999 NTSYSAPI NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID);
4000 NTSYSAPI NTSTATUS WINAPI NtSetDefaultUILanguage(LANGID);
4001 NTSYSAPI NTSTATUS WINAPI NtSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG);
4002 NTSYSAPI NTSTATUS WINAPI NtSetEvent(HANDLE,LONG*);
4003 NTSYSAPI NTSTATUS WINAPI NtSetHighEventPair(HANDLE);
4004 NTSYSAPI NTSTATUS WINAPI NtSetHighWaitLowEventPair(HANDLE);
4005 NTSYSAPI NTSTATUS WINAPI NtSetHighWaitLowThread(VOID);
4006 NTSYSAPI NTSTATUS WINAPI NtSetInformationDebugObject(HANDLE,DEBUGOBJECTINFOCLASS,PVOID,ULONG,ULONG*);
4007 NTSYSAPI NTSTATUS WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
4008 NTSYSAPI NTSTATUS WINAPI NtSetInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,PVOID,ULONG);
4009 NTSYSAPI NTSTATUS WINAPI NtSetInformationKey(HANDLE,const int,PVOID,ULONG);
4010 NTSYSAPI NTSTATUS WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
4011 NTSYSAPI NTSTATUS WINAPI NtSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLASS,PVOID,ULONG);
4012 NTSYSAPI NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
4013 NTSYSAPI NTSTATUS WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG);
4014 NTSYSAPI NTSTATUS WINAPI NtSetIntervalProfile(ULONG,KPROFILE_SOURCE);
4015 NTSYSAPI NTSTATUS WINAPI NtSetIoCompletion(HANDLE,ULONG_PTR,ULONG_PTR,NTSTATUS,SIZE_T);
4016 NTSYSAPI NTSTATUS WINAPI NtSetLdtEntries(ULONG,LDT_ENTRY,ULONG,LDT_ENTRY);
4017 NTSYSAPI NTSTATUS WINAPI NtSetLowEventPair(HANDLE);
4018 NTSYSAPI NTSTATUS WINAPI NtSetLowWaitHighEventPair(HANDLE);
4019 NTSYSAPI NTSTATUS WINAPI NtSetLowWaitHighThread(VOID);
4020 NTSYSAPI NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
4021 NTSYSAPI NTSTATUS WINAPI NtSetSystemEnvironmentValue(PUNICODE_STRING,PUNICODE_STRING);
4022 NTSYSAPI NTSTATUS WINAPI NtSetSystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG);
4023 NTSYSAPI NTSTATUS WINAPI NtSetSystemPowerState(POWER_ACTION,SYSTEM_POWER_STATE,ULONG);
4024 NTSYSAPI NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
4025 NTSYSAPI NTSTATUS WINAPI NtSetThreadExecutionState(EXECUTION_STATE,EXECUTION_STATE*);
4026 NTSYSAPI NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMER_APC_ROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
4027 NTSYSAPI NTSTATUS WINAPI NtSetTimerResolution(ULONG,BOOLEAN,PULONG);
4028 NTSYSAPI NTSTATUS WINAPI NtSetValueKey(HANDLE,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
4029 NTSYSAPI NTSTATUS WINAPI NtSetVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
4030 NTSYSAPI NTSTATUS WINAPI NtSignalAndWaitForSingleObject(HANDLE,HANDLE,BOOLEAN,const LARGE_INTEGER*);
4031 NTSYSAPI NTSTATUS WINAPI NtShutdownSystem(SHUTDOWN_ACTION);
4032 NTSYSAPI NTSTATUS WINAPI NtStartProfile(HANDLE);
4033 NTSYSAPI NTSTATUS WINAPI NtStopProfile(HANDLE);
4034 NTSYSAPI NTSTATUS WINAPI NtSuspendProcess(HANDLE);
4035 NTSYSAPI NTSTATUS WINAPI NtSuspendThread(HANDLE,PULONG);
4036 NTSYSAPI NTSTATUS WINAPI NtSystemDebugControl(SYSDBG_COMMAND,PVOID,ULONG,PVOID,ULONG,PULONG);
4037 NTSYSAPI NTSTATUS WINAPI NtTerminateJobObject(HANDLE,NTSTATUS);
4038 NTSYSAPI NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG);
4039 NTSYSAPI NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG);
4040 NTSYSAPI NTSTATUS WINAPI NtTestAlert(VOID);
4041 NTSYSAPI NTSTATUS WINAPI NtTraceControl(ULONG,void*,ULONG,void*,ULONG,ULONG*);
4042 NTSYSAPI NTSTATUS WINAPI NtUnloadDriver(const UNICODE_STRING *);
4043 NTSYSAPI NTSTATUS WINAPI NtUnloadKey(POBJECT_ATTRIBUTES);
4044 NTSYSAPI NTSTATUS WINAPI NtUnloadKeyEx(POBJECT_ATTRIBUTES,HANDLE);
4045 NTSYSAPI NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
4046 NTSYSAPI NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
4047 NTSYSAPI NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
4048 NTSYSAPI NTSTATUS WINAPI NtVdmControl(ULONG,PVOID);
4049 NTSYSAPI NTSTATUS WINAPI NtWaitForDebugEvent(HANDLE,BOOLEAN,LARGE_INTEGER*,DBGUI_WAIT_STATE_CHANGE*);
4050 NTSYSAPI NTSTATUS WINAPI NtWaitForKeyedEvent(HANDLE,const void*,BOOLEAN,const LARGE_INTEGER*);
4051 NTSYSAPI NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
4052 NTSYSAPI NTSTATUS WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
4053 NTSYSAPI NTSTATUS WINAPI NtWaitHighEventPair(HANDLE);
4054 NTSYSAPI NTSTATUS WINAPI NtWaitLowEventPair(HANDLE);
4055 NTSYSAPI NTSTATUS WINAPI NtWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
4056 NTSYSAPI NTSTATUS WINAPI NtWriteFileGather(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT*,ULONG,PLARGE_INTEGER,PULONG);
4057 NTSYSAPI NTSTATUS WINAPI NtWriteRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
4058 NTSYSAPI NTSTATUS WINAPI NtWriteVirtualMemory(HANDLE,void*,const void*,SIZE_T,SIZE_T*);
4059 NTSYSAPI NTSTATUS WINAPI NtYieldExecution(void);
4061 NTSYSAPI NTSTATUS WINAPI RtlAbsoluteToSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PULONG);
4062 NTSYSAPI void WINAPI RtlAcquirePebLock(void);
4063 NTSYSAPI BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK,BYTE);
4064 NTSYSAPI BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK,BYTE);
4065 NTSYSAPI void WINAPI RtlAcquireSRWLockExclusive(RTL_SRWLOCK*);
4066 NTSYSAPI void WINAPI RtlAcquireSRWLockShared(RTL_SRWLOCK*);
4067 NTSYSAPI NTSTATUS WINAPI RtlActivateActivationContext(DWORD,HANDLE,ULONG_PTR*);
4068 NTSYSAPI NTSTATUS WINAPI RtlActivateActivationContextEx(ULONG,TEB*,HANDLE,ULONG_PTR*);
4069 NTSYSAPI NTSTATUS WINAPI RtlAddAce(PACL,DWORD,DWORD,PACE_HEADER,DWORD);
4070 NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
4071 NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
4072 NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID);
4073 NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
4074 NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
4075 NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID);
4076 NTSYSAPI NTSTATUS WINAPI RtlAddAtomToAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
4077 NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL);
4078 NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAceEx(PACL,DWORD,DWORD,DWORD,PSID,BOOL,BOOL);
4079 NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID,BOOL,BOOL);
4080 NTSYSAPI NTSTATUS WINAPI RtlAddMandatoryAce(PACL,DWORD,DWORD,DWORD,DWORD,PSID);
4081 NTSYSAPI void WINAPI RtlAddRefActivationContext(HANDLE);
4082 NTSYSAPI PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
4083 NTSYSAPI NTSTATUS WINAPI RtlAdjustPrivilege(ULONG,BOOLEAN,BOOLEAN,PBOOLEAN);
4084 NTSYSAPI NTSTATUS WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
4085 NTSYSAPI RTL_HANDLE * WINAPI RtlAllocateHandle(RTL_HANDLE_TABLE *,ULONG *);
4086 NTSYSAPI PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,SIZE_T) __WINE_ALLOC_SIZE(3);
4087 NTSYSAPI WCHAR WINAPI RtlAnsiCharToUnicodeChar(LPSTR *);
4088 NTSYSAPI DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING *);
4089 NTSYSAPI NTSTATUS WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING,PCANSI_STRING,BOOLEAN);
4090 NTSYSAPI NTSTATUS WINAPI RtlAppendAsciizToString(STRING *,LPCSTR);
4091 NTSYSAPI NTSTATUS WINAPI RtlAppendStringToString(STRING *,const STRING *);
4092 NTSYSAPI NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING *,const UNICODE_STRING *);
4093 NTSYSAPI NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING *,LPCWSTR);
4094 NTSYSAPI BOOLEAN WINAPI RtlAreAllAccessesGranted(ACCESS_MASK,ACCESS_MASK);
4095 NTSYSAPI BOOLEAN WINAPI RtlAreAnyAccessesGranted(ACCESS_MASK,ACCESS_MASK);
4096 NTSYSAPI BOOLEAN WINAPI RtlAreBitsSet(PCRTL_BITMAP,ULONG,ULONG);
4097 NTSYSAPI BOOLEAN WINAPI RtlAreBitsClear(PCRTL_BITMAP,ULONG,ULONG);
4098 NTSYSAPI NTSTATUS WINAPI RtlCharToInteger(PCSZ,ULONG,PULONG);
4099 NTSYSAPI NTSTATUS WINAPI RtlCheckRegistryKey(ULONG, PWSTR);
4100 NTSYSAPI void WINAPI RtlClearAllBits(PRTL_BITMAP);
4101 NTSYSAPI void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
4102 NTSYSAPI NTSTATUS WINAPI RtlCreateActivationContext(HANDLE*,const void*);
4103 NTSYSAPI PDEBUG_BUFFER WINAPI RtlCreateQueryDebugBuffer(ULONG,BOOLEAN);
4104 NTSYSAPI NTSTATUS WINAPI RtlCreateRegistryKey(ULONG,PWSTR);
4105 NTSYSAPI ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
4106 NTSYSAPI LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
4107 NTSYSAPI LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
4108 NTSYSAPI LONG WINAPI RtlCompareUnicodeStrings(const WCHAR*,SIZE_T,const WCHAR*,SIZE_T,BOOLEAN);
4109 NTSYSAPI NTSTATUS WINAPI RtlCompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,ULONG,PULONG,PVOID);
4110 NTSYSAPI DWORD WINAPI RtlComputeCrc32(DWORD,const BYTE*,INT);
4111 NTSYSAPI NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
4112 NTSYSAPI NTSTATUS WINAPI RtlConvertToAutoInheritSecurityObject(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,GUID*,BOOL,PGENERIC_MAPPING);
4113 NTSYSAPI NTSTATUS WINAPI RtlCopyContext(CONTEXT*,DWORD,CONTEXT*);
4114 NTSYSAPI NTSTATUS WINAPI RtlCopyExtendedContext(CONTEXT_EX*,ULONG,CONTEXT_EX*);
4115 NTSYSAPI void WINAPI RtlCopyLuid(PLUID,const LUID*);
4116 NTSYSAPI void WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
4117 NTSYSAPI BOOLEAN WINAPI RtlCopySid(DWORD,PSID,PSID);
4118 NTSYSAPI NTSTATUS WINAPI RtlCopySecurityDescriptor(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR);
4119 NTSYSAPI void WINAPI RtlCopyString(STRING*,const STRING*);
4120 NTSYSAPI void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
4121 NTSYSAPI NTSTATUS WINAPI RtlCreateAcl(PACL,DWORD,DWORD);
4122 NTSYSAPI NTSTATUS WINAPI RtlCreateAtomTable(ULONG,RTL_ATOM_TABLE*);
4123 NTSYSAPI NTSTATUS WINAPI RtlCreateEnvironment(BOOLEAN, PWSTR*);
4124 NTSYSAPI HANDLE WINAPI RtlCreateHeap(ULONG,PVOID,SIZE_T,SIZE_T,PVOID,PRTL_HEAP_DEFINITION);
4125 NTSYSAPI NTSTATUS WINAPI RtlCreateProcessParameters(RTL_USER_PROCESS_PARAMETERS**,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*,PWSTR,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*);
4126 NTSYSAPI NTSTATUS WINAPI RtlCreateProcessParametersEx(RTL_USER_PROCESS_PARAMETERS**,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*,PWSTR,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*,ULONG);
4127 NTSYSAPI NTSTATUS WINAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
4128 NTSYSAPI NTSTATUS WINAPI RtlCreateTimerQueue(PHANDLE);
4129 NTSYSAPI NTSTATUS WINAPI RtlCreateTimer(PHANDLE, HANDLE, RTL_WAITORTIMERCALLBACKFUNC, PVOID, DWORD, DWORD, ULONG);
4130 NTSYSAPI BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
4131 NTSYSAPI BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
4132 NTSYSAPI NTSTATUS WINAPI RtlCreateUserProcess(UNICODE_STRING*,ULONG,RTL_USER_PROCESS_PARAMETERS*,SECURITY_DESCRIPTOR*,SECURITY_DESCRIPTOR*,HANDLE,BOOLEAN,HANDLE,HANDLE,RTL_USER_PROCESS_INFORMATION*);
4133 NTSYSAPI NTSTATUS WINAPI RtlCreateUserThread(HANDLE,SECURITY_DESCRIPTOR*,BOOLEAN,ULONG,SIZE_T,SIZE_T,PRTL_THREAD_START_ROUTINE,void*,HANDLE*,CLIENT_ID*);
4134 NTSYSAPI NTSTATUS WINAPI RtlCreateUserStack(SIZE_T,SIZE_T,ULONG,SIZE_T,SIZE_T,INITIAL_TEB*);
4135 NTSYSAPI NTSTATUS WINAPI RtlCustomCPToUnicodeN(CPTABLEINFO*,WCHAR*,DWORD,DWORD*,const char*,DWORD);
4136 NTSYSAPI void WINAPI RtlDeactivateActivationContext(DWORD,ULONG_PTR);
4137 NTSYSAPI PVOID WINAPI RtlDecodePointer(PVOID);
4138 NTSYSAPI NTSTATUS WINAPI RtlDecompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,PULONG);
4139 NTSYSAPI NTSTATUS WINAPI RtlDecompressFragment(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,ULONG,PULONG,PVOID);
4140 NTSYSAPI NTSTATUS WINAPI RtlDeleteAce(PACL,DWORD);
4141 NTSYSAPI NTSTATUS WINAPI RtlDeleteAtomFromAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
4142 NTSYSAPI NTSTATUS WINAPI RtlDeleteCriticalSection(RTL_CRITICAL_SECTION *);
4143 NTSYSAPI NTSTATUS WINAPI RtlDeleteRegistryValue(ULONG, PCWSTR, PCWSTR);
4144 NTSYSAPI void WINAPI RtlDeleteResource(LPRTL_RWLOCK);
4145 NTSYSAPI NTSTATUS WINAPI RtlDeleteSecurityObject(PSECURITY_DESCRIPTOR*);
4146 NTSYSAPI NTSTATUS WINAPI RtlDeleteTimer(HANDLE, HANDLE, HANDLE);
4147 NTSYSAPI NTSTATUS WINAPI RtlDeleteTimerQueueEx(HANDLE, HANDLE);
4148 NTSYSAPI PRTL_USER_PROCESS_PARAMETERS WINAPI RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
4149 NTSYSAPI NTSTATUS WINAPI RtlDeregisterWait(HANDLE);
4150 NTSYSAPI NTSTATUS WINAPI RtlDeregisterWaitEx(HANDLE,HANDLE);
4151 NTSYSAPI NTSTATUS WINAPI RtlDestroyAtomTable(RTL_ATOM_TABLE);
4152 NTSYSAPI NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR);
4153 NTSYSAPI NTSTATUS WINAPI RtlDestroyHandleTable(RTL_HANDLE_TABLE *);
4154 NTSYSAPI HANDLE WINAPI RtlDestroyHeap(HANDLE);
4155 NTSYSAPI void WINAPI RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS*);
4156 NTSYSAPI NTSTATUS WINAPI RtlDestroyQueryDebugBuffer(PDEBUG_BUFFER);
4157 NTSYSAPI DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
4158 NTSYSAPI BOOLEAN WINAPI RtlDllShutdownInProgress(void);
4159 NTSYSAPI BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR);
4160 NTSYSAPI BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(PCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
4161 NTSYSAPI NTSTATUS WINAPI RtlDosPathNameToNtPathName_U_WithStatus(PCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
4162 NTSYSAPI ULONG WINAPI RtlDosSearchPath_U(LPCWSTR, LPCWSTR, LPCWSTR, ULONG, LPWSTR, LPWSTR*);
4163 NTSYSAPI WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
4164 NTSYSAPI NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
4165 NTSYSAPI void WINAPI RtlDumpResource(LPRTL_RWLOCK);
4166 NTSYSAPI NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
4167 NTSYSAPI NTSTATUS WINAPI RtlEmptyAtomTable(RTL_ATOM_TABLE,BOOLEAN);
4168 NTSYSAPI PVOID WINAPI RtlEncodePointer(PVOID);
4169 NTSYSAPI NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
4170 NTSYSAPI void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
4171 NTSYSAPI NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
4172 NTSYSAPI NTSTATUS WINAPI RtlEqualDomainName(const UNICODE_STRING*,const UNICODE_STRING*);
4173 NTSYSAPI BOOLEAN WINAPI RtlEqualLuid(const LUID*,const LUID*);
4174 NTSYSAPI BOOL WINAPI RtlEqualPrefixSid(PSID,PSID);
4175 NTSYSAPI BOOL WINAPI RtlEqualSid(PSID,PSID);
4176 NTSYSAPI BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
4177 NTSYSAPI BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
4178 NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlExitUserProcess(ULONG);
4179 NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlExitUserThread(ULONG);
4180 NTSYSAPI NTSTATUS WINAPI RtlExpandEnvironmentStrings(const WCHAR*,WCHAR*,SIZE_T,WCHAR*,SIZE_T,SIZE_T*);
4181 NTSYSAPI NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PCWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*);
4182 NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionString(ULONG,const GUID*,ULONG,const UNICODE_STRING*,PVOID);
4183 NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionGuid(ULONG,const GUID*,ULONG,const GUID*,PVOID);
4184 NTSYSAPI NTSTATUS WINAPI RtlFindCharInUnicodeString(int,const UNICODE_STRING*,const UNICODE_STRING*,USHORT*);
4185 NTSYSAPI ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
4186 NTSYSAPI ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
4187 NTSYSAPI ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
4188 NTSYSAPI void * WINAPI RtlFindExportedRoutineByName(HMODULE,const char*);
4189 NTSYSAPI ULONG WINAPI RtlFindLastBackwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
4190 NTSYSAPI ULONG WINAPI RtlFindLastBackwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
4191 NTSYSAPI CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG);
4192 NTSYSAPI ULONG WINAPI RtlFindLongestRunSet(PCRTL_BITMAP,PULONG);
4193 NTSYSAPI ULONG WINAPI RtlFindLongestRunClear(PCRTL_BITMAP,PULONG);
4194 NTSYSAPI NTSTATUS WINAPI RtlFindMessage(HMODULE,ULONG,ULONG,ULONG,const MESSAGE_RESOURCE_ENTRY**);
4195 NTSYSAPI CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG);
4196 NTSYSAPI ULONG WINAPI RtlFindNextForwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
4197 NTSYSAPI ULONG WINAPI RtlFindNextForwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
4198 NTSYSAPI ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP,ULONG,ULONG);
4199 NTSYSAPI ULONG WINAPI RtlFindSetBitsAndClear(PRTL_BITMAP,ULONG,ULONG);
4200 NTSYSAPI ULONG WINAPI RtlFindSetRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
4201 NTSYSAPI BOOLEAN WINAPI RtlFirstFreeAce(PACL,PACE_HEADER *);
4202 NTSYSAPI NTSTATUS WINAPI RtlFlsAlloc(PFLS_CALLBACK_FUNCTION,ULONG *);
4203 NTSYSAPI NTSTATUS WINAPI RtlFlsFree(ULONG);
4204 NTSYSAPI NTSTATUS WINAPI RtlFlsGetValue(ULONG,void **);
4205 NTSYSAPI NTSTATUS WINAPI RtlFlsSetValue(ULONG,void *);
4206 NTSYSAPI NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING);
4207 NTSYSAPI NTSTATUS WINAPI RtlFormatMessage(LPCWSTR,ULONG,BOOLEAN,BOOLEAN,BOOLEAN,__ms_va_list *,LPWSTR,ULONG,ULONG*);
4208 NTSYSAPI NTSTATUS WINAPI RtlFormatMessageEx(LPCWSTR,ULONG,BOOLEAN,BOOLEAN,BOOLEAN,__ms_va_list *,LPWSTR,ULONG,ULONG*,ULONG);
4209 NTSYSAPI void WINAPI RtlFreeAnsiString(PANSI_STRING);
4210 NTSYSAPI BOOLEAN WINAPI RtlFreeHandle(RTL_HANDLE_TABLE *,RTL_HANDLE *);
4211 NTSYSAPI BOOLEAN WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
4212 NTSYSAPI void WINAPI RtlFreeOemString(POEM_STRING);
4213 NTSYSAPI DWORD WINAPI RtlFreeSid(PSID);
4214 NTSYSAPI void WINAPI RtlFreeThreadActivationContextStack(void);
4215 NTSYSAPI void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
4216 NTSYSAPI void WINAPI RtlFreeUserStack(void*);
4217 NTSYSAPI NTSTATUS WINAPI RtlGetAce(PACL,DWORD,LPVOID *);
4218 NTSYSAPI NTSTATUS WINAPI RtlGetActiveActivationContext(HANDLE*);
4219 NTSYSAPI NTSTATUS WINAPI RtlGetCompressionWorkSpaceSize(USHORT,PULONG,PULONG);
4220 NTSYSAPI NTSTATUS WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
4221 NTSYSAPI ULONG WINAPI RtlGetCurrentDirectory_U(ULONG, LPWSTR);
4222 NTSYSAPI PEB * WINAPI RtlGetCurrentPeb(void);
4223 NTSYSAPI NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
4224 NTSYSAPI ULONG64 WINAPI RtlGetEnabledExtendedFeatures(ULONG64);
4225 NTSYSAPI NTSTATUS WINAPI RtlGetExePath(PCWSTR,PWSTR*);
4226 NTSYSAPI NTSTATUS WINAPI RtlGetExtendedContextLength(ULONG,ULONG*);
4227 NTSYSAPI NTSTATUS WINAPI RtlGetExtendedContextLength2(ULONG,ULONG*,ULONG64);
4228 NTSYSAPI ULONG64 WINAPI RtlGetExtendedFeaturesMask(CONTEXT_EX*);
4229 NTSYSAPI TEB_ACTIVE_FRAME * WINAPI RtlGetFrame(void);
4230 NTSYSAPI ULONG WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*);
4231 NTSYSAPI NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
4232 NTSYSAPI NTSTATUS WINAPI RtlGetLastNtStatus(void);
4233 NTSYSAPI DWORD WINAPI RtlGetLastWin32Error(void);
4234 NTSYSAPI DWORD WINAPI RtlGetLongestNtPathLength(void);
4235 NTSYSAPI ULONG WINAPI RtlGetNtGlobalFlags(void);
4236 NTSYSAPI BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
4237 NTSYSAPI NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
4238 NTSYSAPI ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
4239 NTSYSAPI NTSTATUS WINAPI RtlGetProcessPreferredUILanguages(DWORD,ULONG*,WCHAR*,ULONG*);
4240 NTSYSAPI NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
4241 NTSYSAPI NTSTATUS WINAPI RtlGetSearchPath(PWSTR*);
4242 NTSYSAPI NTSTATUS WINAPI RtlGetSystemPreferredUILanguages(DWORD,ULONG,ULONG*,WCHAR*,ULONG*);
4243 NTSYSAPI LONGLONG WINAPI RtlGetSystemTimePrecise(void);
4244 NTSYSAPI DWORD WINAPI RtlGetThreadErrorMode(void);
4245 NTSYSAPI NTSTATUS WINAPI RtlGetThreadPreferredUILanguages(DWORD,ULONG*,WCHAR*,ULONG*);
4246 NTSYSAPI NTSTATUS WINAPI RtlGetUserPreferredUILanguages(DWORD,ULONG,ULONG*,WCHAR*,ULONG*);
4247 NTSYSAPI NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
4248 NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING,GUID*);
4249 NTSYSAPI PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
4250 NTSYSAPI NTSTATUS WINAPI RtlIdnToAscii(DWORD,const WCHAR*,INT,WCHAR*,INT*);
4251 NTSYSAPI NTSTATUS WINAPI RtlIdnToNameprepUnicode(DWORD,const WCHAR*,INT,WCHAR*,INT*);
4252 NTSYSAPI NTSTATUS WINAPI RtlIdnToUnicode(DWORD,const WCHAR*,INT,WCHAR*,INT*);
4253 NTSYSAPI PVOID WINAPI RtlImageDirectoryEntryToData(HMODULE,BOOL,WORD,ULONG *);
4254 NTSYSAPI PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE);
4255 NTSYSAPI PIMAGE_SECTION_HEADER WINAPI RtlImageRvaToSection(const IMAGE_NT_HEADERS *,HMODULE,DWORD);
4256 NTSYSAPI PVOID WINAPI RtlImageRvaToVa(const IMAGE_NT_HEADERS *,HMODULE,DWORD,IMAGE_SECTION_HEADER **);
4257 NTSYSAPI NTSTATUS WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
4258 NTSYSAPI void WINAPI RtlInitString(PSTRING,PCSZ);
4259 NTSYSAPI void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
4260 NTSYSAPI NTSTATUS WINAPI RtlInitAnsiStringEx(PANSI_STRING,PCSZ);
4261 NTSYSAPI void WINAPI RtlInitCodePageTable(USHORT*,CPTABLEINFO*);
4262 NTSYSAPI void WINAPI RtlInitNlsTables(USHORT*,USHORT*,USHORT*,NLSTABLEINFO*);
4263 NTSYSAPI void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
4264 NTSYSAPI NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
4265 NTSYSAPI void WINAPI RtlInitializeBitMap(PRTL_BITMAP,PULONG,ULONG);
4266 NTSYSAPI void WINAPI RtlInitializeConditionVariable(RTL_CONDITION_VARIABLE *);
4267 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
4268 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,ULONG);
4269 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSectionEx(RTL_CRITICAL_SECTION *,ULONG,ULONG);
4270 NTSYSAPI NTSTATUS WINAPI RtlInitializeExtendedContext(void*,ULONG,CONTEXT_EX**);
4271 NTSYSAPI NTSTATUS WINAPI RtlInitializeExtendedContext2(void*,ULONG,CONTEXT_EX**,ULONG64);
4272 NTSYSAPI void WINAPI RtlInitializeHandleTable(ULONG,ULONG,RTL_HANDLE_TABLE *);
4273 NTSYSAPI void WINAPI RtlInitializeResource(LPRTL_RWLOCK);
4274 NTSYSAPI void WINAPI RtlInitializeSRWLock(RTL_SRWLOCK*);
4275 NTSYSAPI BOOL WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
4276 NTSYSAPI NTSTATUS WINAPI RtlInt64ToUnicodeString(ULONGLONG,ULONG,UNICODE_STRING *);
4277 NTSYSAPI NTSTATUS WINAPI RtlIntegerToChar(ULONG,ULONG,ULONG,PCHAR);
4278 NTSYSAPI NTSTATUS WINAPI RtlIntegerToUnicodeString(ULONG,ULONG,UNICODE_STRING *);
4279 NTSYSAPI BOOLEAN WINAPI RtlIsActivationContextActive(HANDLE);
4280 NTSYSAPI BOOL WINAPI RtlIsCriticalSectionLocked(RTL_CRITICAL_SECTION *);
4281 NTSYSAPI BOOL WINAPI RtlIsCriticalSectionLockedByThread(RTL_CRITICAL_SECTION *);
4282 NTSYSAPI ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR);
4283 NTSYSAPI BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN);
4284 NTSYSAPI NTSTATUS WINAPI RtlIsNormalizedString(ULONG,const WCHAR*,INT,BOOLEAN*);
4285 NTSYSAPI BOOLEAN WINAPI RtlIsProcessorFeaturePresent(UINT);
4286 NTSYSAPI BOOLEAN WINAPI RtlIsTextUnicode(LPCVOID,INT,INT *);
4287 NTSYSAPI BOOLEAN WINAPI RtlIsValidHandle(const RTL_HANDLE_TABLE *, const RTL_HANDLE *);
4288 NTSYSAPI BOOLEAN WINAPI RtlIsValidIndexHandle(const RTL_HANDLE_TABLE *, ULONG Index, RTL_HANDLE **);
4289 NTSYSAPI NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *);
4290 NTSYSAPI DWORD WINAPI RtlLengthRequiredSid(DWORD);
4291 NTSYSAPI ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR);
4292 NTSYSAPI DWORD WINAPI RtlLengthSid(PSID);
4293 NTSYSAPI NTSTATUS WINAPI RtlLocalTimeToSystemTime(const LARGE_INTEGER*,PLARGE_INTEGER);
4294 NTSYSAPI NTSTATUS WINAPI RtlLocaleNameToLcid(const WCHAR*,LCID*,ULONG);
4295 NTSYSAPI void * WINAPI RtlLocateExtendedFeature(CONTEXT_EX*,ULONG,ULONG*);
4296 NTSYSAPI void * WINAPI RtlLocateExtendedFeature2(CONTEXT_EX*,ULONG,XSTATE_CONFIGURATION*,ULONG*);
4297 NTSYSAPI void * WINAPI RtlLocateLegacyContext(CONTEXT_EX*,ULONG*);
4298 NTSYSAPI BOOLEAN WINAPI RtlLockHeap(HANDLE);
4299 NTSYSAPI NTSTATUS WINAPI RtlLookupAtomInAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
4300 NTSYSAPI NTSTATUS WINAPI RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
4301 NTSYSAPI void WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*);
4302 NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
4303 NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
4304 NTSYSAPI NTSTATUS WINAPI RtlNewSecurityObject(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,BOOLEAN,HANDLE,PGENERIC_MAPPING);
4305 NTSYSAPI PRTL_USER_PROCESS_PARAMETERS WINAPI RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
4306 NTSYSAPI NTSTATUS WINAPI RtlNormalizeString(ULONG,const WCHAR*,INT,WCHAR*,INT*);
4307 NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS);
4308 NTSYSAPI ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS);
4309 NTSYSAPI ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP);
4310 NTSYSAPI ULONG WINAPI RtlNumberOfClearBits(PCRTL_BITMAP);
4311 NTSYSAPI UINT WINAPI RtlOemStringToUnicodeSize(const STRING*);
4312 NTSYSAPI NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
4313 NTSYSAPI NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
4314 NTSYSAPI NTSTATUS WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHANDLE);
4315 NTSYSAPI PVOID WINAPI RtlPcToFileHeader(PVOID,PVOID*);
4316 NTSYSAPI NTSTATUS WINAPI RtlPinAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
4317 NTSYSAPI void WINAPI RtlPopFrame(TEB_ACTIVE_FRAME*);
4318 NTSYSAPI BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
4319 NTSYSAPI BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
4320 NTSYSAPI void WINAPI RtlProcessFlsData(void*,ULONG);
4321 NTSYSAPI void WINAPI RtlPushFrame(TEB_ACTIVE_FRAME*);
4322 NTSYSAPI NTSTATUS WINAPI RtlQueryActivationContextApplicationSettings(DWORD,HANDLE,const WCHAR*,const WCHAR*,WCHAR*,SIZE_T,SIZE_T*);
4323 NTSYSAPI NTSTATUS WINAPI RtlQueryAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM,ULONG*,ULONG*,WCHAR*,ULONG*);
4324 NTSYSAPI NTSTATUS WINAPI RtlQueryDynamicTimeZoneInformation(RTL_DYNAMIC_TIME_ZONE_INFORMATION*);
4325 NTSYSAPI NTSTATUS WINAPI RtlQueryEnvironmentVariable(WCHAR*,const WCHAR*,SIZE_T,WCHAR*,SIZE_T,SIZE_T*);
4326 NTSYSAPI NTSTATUS WINAPI RtlQueryEnvironmentVariable_U(PWSTR,PUNICODE_STRING,PUNICODE_STRING);
4327 NTSYSAPI NTSTATUS WINAPI RtlQueryHeapInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T,PSIZE_T);
4328 NTSYSAPI NTSTATUS WINAPI RtlQueryInformationAcl(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
4329 NTSYSAPI NTSTATUS WINAPI RtlQueryInformationActivationContext(ULONG,HANDLE,PVOID,ULONG,PVOID,SIZE_T,SIZE_T*);
4330 NTSYSAPI BOOL WINAPI RtlQueryPerformanceCounter(LARGE_INTEGER*);
4331 NTSYSAPI BOOL WINAPI RtlQueryPerformanceFrequency(LARGE_INTEGER*);
4332 NTSYSAPI NTSTATUS WINAPI RtlQueryProcessDebugInformation(ULONG,ULONG,PDEBUG_BUFFER);
4333 NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID);
4334 NTSYSAPI NTSTATUS WINAPI RtlQueryTimeZoneInformation(RTL_TIME_ZONE_INFORMATION*);
4335 NTSYSAPI BOOL WINAPI RtlQueryUnbiasedInterruptTime(ULONGLONG*);
4336 NTSYSAPI NTSTATUS WINAPI RtlQueueWorkItem(PRTL_WORK_ITEM_ROUTINE,PVOID,ULONG);
4337 NTSYSAPI void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
4338 NTSYSAPI void WINAPI RtlRaiseStatus(NTSTATUS);
4339 NTSYSAPI ULONG WINAPI RtlRandom(PULONG);
4340 NTSYSAPI PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,SIZE_T);
4341 NTSYSAPI NTSTATUS WINAPI RtlRegisterWait(PHANDLE,HANDLE,RTL_WAITORTIMERCALLBACKFUNC,PVOID,ULONG,ULONG);
4342 NTSYSAPI void WINAPI RtlReleaseActivationContext(HANDLE);
4343 NTSYSAPI void WINAPI RtlReleasePath(PWSTR);
4344 NTSYSAPI void WINAPI RtlReleasePebLock(void);
4345 NTSYSAPI void WINAPI RtlReleaseResource(LPRTL_RWLOCK);
4346 NTSYSAPI void WINAPI RtlReleaseSRWLockExclusive(RTL_SRWLOCK*);
4347 NTSYSAPI void WINAPI RtlReleaseSRWLockShared(RTL_SRWLOCK*);
4348 NTSYSAPI ULONG WINAPI RtlRemoveVectoredExceptionHandler(PVOID);
4349 NTSYSAPI void WINAPI RtlResetRtlTranslations(const NLSTABLEINFO*);
4350 NTSYSAPI void WINAPI RtlRestoreLastWin32Error(DWORD);
4351 NTSYSAPI void WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *);
4352 NTSYSAPI void WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *);
4353 NTSYSAPI NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD);
4354 NTSYSAPI void WINAPI RtlSetAllBits(PRTL_BITMAP);
4355 NTSYSAPI void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG);
4356 NTSYSAPI ULONG WINAPI RtlSetCriticalSectionSpinCount(RTL_CRITICAL_SECTION*,ULONG);
4357 NTSYSAPI NTSTATUS WINAPI RtlSetControlSecurityDescriptor(PSECURITY_DESCRIPTOR,SECURITY_DESCRIPTOR_CONTROL,SECURITY_DESCRIPTOR_CONTROL);
4358 NTSYSAPI NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING*);
4359 NTSYSAPI void WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*);
4360 NTSYSAPI NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
4361 NTSYSAPI NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR*,PUNICODE_STRING,PUNICODE_STRING);
4362 NTSYSAPI void WINAPI RtlSetExtendedFeaturesMask(CONTEXT_EX*,ULONG64);
4363 NTSYSAPI NTSTATUS WINAPI RtlSetHeapInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T);
4364 NTSYSAPI NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
4365 NTSYSAPI NTSTATUS WINAPI RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
4366 NTSYSAPI NTSTATUS WINAPI RtlSetIoCompletionCallback(HANDLE,PRTL_OVERLAPPED_COMPLETION_ROUTINE,ULONG);
4367 NTSYSAPI void WINAPI RtlSetLastWin32Error(DWORD);
4368 NTSYSAPI void WINAPI RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS);
4369 NTSYSAPI NTSTATUS WINAPI RtlSetProcessPreferredUILanguages(DWORD,PCZZWSTR,ULONG*);
4370 NTSYSAPI NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
4371 NTSYSAPI NTSTATUS WINAPI RtlSetSearchPathMode(ULONG);
4372 NTSYSAPI NTSTATUS WINAPI RtlSetThreadErrorMode(DWORD,LPDWORD);
4373 NTSYSAPI NTSTATUS WINAPI RtlSetThreadPreferredUILanguages(DWORD,PCZZWSTR,ULONG*);
4374 NTSYSAPI NTSTATUS WINAPI RtlSetTimeZoneInformation(const RTL_TIME_ZONE_INFORMATION*);
4375 NTSYSAPI void WINAPI RtlSetUnhandledExceptionFilter(PRTL_EXCEPTION_FILTER);
4376 NTSYSAPI SIZE_T WINAPI RtlSizeHeap(HANDLE,ULONG,const void*);
4377 NTSYSAPI NTSTATUS WINAPI RtlSleepConditionVariableCS(RTL_CONDITION_VARIABLE*,RTL_CRITICAL_SECTION*,const LARGE_INTEGER*);
4378 NTSYSAPI NTSTATUS WINAPI RtlSleepConditionVariableSRW(RTL_CONDITION_VARIABLE*,RTL_SRWLOCK*,const LARGE_INTEGER*,ULONG);
4379 NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID,PUNICODE_STRING);
4380 NTSYSAPI LPDWORD WINAPI RtlSubAuthoritySid(PSID,DWORD);
4381 NTSYSAPI LPBYTE WINAPI RtlSubAuthorityCountSid(PSID);
4382 NTSYSAPI NTSTATUS WINAPI RtlSystemTimeToLocalTime(const LARGE_INTEGER*,PLARGE_INTEGER);
4383 NTSYSAPI void WINAPI RtlTimeToTimeFields(const LARGE_INTEGER*,PTIME_FIELDS);
4384 NTSYSAPI BOOLEAN WINAPI RtlTimeFieldsToTime(PTIME_FIELDS,PLARGE_INTEGER);
4385 NTSYSAPI void WINAPI RtlTimeToElapsedTimeFields(const LARGE_INTEGER *,PTIME_FIELDS);
4386 NTSYSAPI BOOLEAN WINAPI RtlTimeToSecondsSince1970(const LARGE_INTEGER *,LPDWORD);
4387 NTSYSAPI BOOLEAN WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *,LPDWORD);
4388 NTSYSAPI BOOLEAN WINAPI RtlTryAcquireSRWLockExclusive(RTL_SRWLOCK *);
4389 NTSYSAPI BOOLEAN WINAPI RtlTryAcquireSRWLockShared(RTL_SRWLOCK *);
4390 NTSYSAPI BOOL WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *);
4391 NTSYSAPI NTSTATUS WINAPI RtlUTF8ToUnicodeN(WCHAR*,DWORD,DWORD*,const char*,DWORD);
4392 NTSYSAPI ULONGLONG __cdecl RtlUlonglongByteSwap(ULONGLONG);
4393 NTSYSAPI DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
4394 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING,PCUNICODE_STRING,BOOLEAN);
4395 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToInteger(const UNICODE_STRING *,ULONG,ULONG *);
4396 NTSYSAPI DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
4397 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToOemString(POEM_STRING,PCUNICODE_STRING,BOOLEAN);
4398 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToCustomCPN(CPTABLEINFO*,char*,DWORD,DWORD*,const WCHAR*,DWORD);
4399 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
4400 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToMultiByteSize(PULONG,PCWSTR,ULONG);
4401 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
4402 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToUTF8N(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
4403 NTSYSAPI ULONG WINAPI RtlUniform(PULONG);
4404 NTSYSAPI BOOLEAN WINAPI RtlUnlockHeap(HANDLE);
4405 NTSYSAPI void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID);
4406 NTSYSAPI WCHAR WINAPI RtlUpcaseUnicodeChar(WCHAR);
4407 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
4408 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
4409 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
4410 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
4411 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeToCustomCPN(CPTABLEINFO*,char*,DWORD,DWORD*,const WCHAR*,DWORD);
4412 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
4413 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
4414 NTSYSAPI NTSTATUS WINAPI RtlUpdateTimer(HANDLE, HANDLE, DWORD, DWORD);
4415 NTSYSAPI CHAR WINAPI RtlUpperChar(CHAR);
4416 NTSYSAPI void WINAPI RtlUpperString(STRING *,const STRING *);
4417 NTSYSAPI void WINAPI RtlUserThreadStart(PRTL_THREAD_START_ROUTINE,void*);
4418 NTSYSAPI NTSTATUS WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
4419 NTSYSAPI BOOLEAN WINAPI RtlValidRelativeSecurityDescriptor(PSECURITY_DESCRIPTOR,ULONG,SECURITY_INFORMATION);
4420 NTSYSAPI BOOLEAN WINAPI RtlValidAcl(PACL);
4421 NTSYSAPI BOOLEAN WINAPI RtlValidSid(PSID);
4422 NTSYSAPI BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
4423 NTSYSAPI NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
4424 NTSYSAPI NTSTATUS WINAPI RtlWaitOnAddress(const void *,const void *,SIZE_T,const LARGE_INTEGER *);
4425 NTSYSAPI void WINAPI RtlWakeAddressAll(const void *);
4426 NTSYSAPI void WINAPI RtlWakeAddressSingle(const void *);
4427 NTSYSAPI void WINAPI RtlWakeAllConditionVariable(RTL_CONDITION_VARIABLE *);
4428 NTSYSAPI void WINAPI RtlWakeConditionVariable(RTL_CONDITION_VARIABLE *);
4429 NTSYSAPI NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
4430 NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirection(BOOLEAN);
4431 NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx(ULONG,ULONG*);
4432 NTSYSAPI USHORT WINAPI RtlWow64GetCurrentMachine(void);
4433 NTSYSAPI NTSTATUS WINAPI RtlWow64GetProcessMachines(HANDLE,USHORT*,USHORT*);
4434 NTSYSAPI NTSTATUS WINAPI RtlWow64IsWowGuestMachineSupported(USHORT,BOOLEAN*);
4435 NTSYSAPI NTSTATUS WINAPI RtlWriteRegistryValue(ULONG,PCWSTR,PCWSTR,ULONG,PVOID,ULONG);
4436 NTSYSAPI NTSTATUS WINAPI RtlZombifyActivationContext(HANDLE);
4437 NTSYSAPI NTSTATUS WINAPI RtlpNtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
4438 NTSYSAPI NTSTATUS WINAPI RtlpNtEnumerateSubKey(HANDLE,UNICODE_STRING *, ULONG);
4439 NTSYSAPI NTSTATUS WINAPI RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION *);
4440 NTSYSAPI NTSTATUS WINAPI RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION *);
4441 NTSYSAPI NTSTATUS WINAPI vDbgPrintEx(ULONG,ULONG,LPCSTR,__ms_va_list);
4442 NTSYSAPI NTSTATUS WINAPI vDbgPrintExWithPrefix(LPCSTR,ULONG,ULONG,LPCSTR,__ms_va_list);
4444 #ifndef __WINE_USE_MSVCRT
4445 NTSYSAPI int __cdecl _strnicmp(LPCSTR,LPCSTR,size_t);
4446 #endif
4448 /* 32-bit or 64-bit only functions */
4450 #ifdef _WIN64
4451 NTSYSAPI NTSTATUS WINAPI RtlWow64GetCpuAreaInfo(WOW64_CPURESERVED*,ULONG,WOW64_CPU_AREA_INFO*);
4452 NTSYSAPI NTSTATUS WINAPI RtlWow64GetCurrentCpuArea(USHORT*,void**,void**);
4453 NTSYSAPI NTSTATUS WINAPI RtlWow64GetThreadContext(HANDLE,WOW64_CONTEXT*);
4454 NTSYSAPI NTSTATUS WINAPI RtlWow64GetThreadSelectorEntry(HANDLE,THREAD_DESCRIPTOR_INFORMATION*,ULONG,ULONG*);
4455 NTSYSAPI NTSTATUS WINAPI RtlWow64SetThreadContext(HANDLE,const WOW64_CONTEXT*);
4456 #else
4457 NTSYSAPI NTSTATUS WINAPI NtWow64AllocateVirtualMemory64(HANDLE,ULONG64*,ULONG64,ULONG64*,ULONG,ULONG);
4458 NTSYSAPI NTSTATUS WINAPI NtWow64GetNativeSystemInformation(SYSTEM_INFORMATION_CLASS,void*,ULONG,ULONG*);
4459 NTSYSAPI NTSTATUS WINAPI NtWow64ReadVirtualMemory64(HANDLE,ULONG64,void*,ULONG64,ULONG64*);
4460 NTSYSAPI NTSTATUS WINAPI NtWow64WriteVirtualMemory64(HANDLE,ULONG64,const void*,ULONG64,ULONG64*);
4461 NTSYSAPI LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
4462 NTSYSAPI ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
4463 NTSYSAPI LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
4464 NTSYSAPI ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
4465 NTSYSAPI UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
4466 NTSYSAPI LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
4467 NTSYSAPI LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
4468 NTSYSAPI LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
4469 NTSYSAPI LONGLONG WINAPI RtlInterlockedCompareExchange64(LONGLONG*,LONGLONG,LONGLONG);
4470 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
4471 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
4472 NTSYSAPI ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
4473 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerNegate(LONGLONG);
4474 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
4475 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
4476 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
4477 NTSYSAPI NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
4478 #endif
4480 /* Threadpool functions */
4482 NTSYSAPI NTSTATUS WINAPI TpAllocCleanupGroup(TP_CLEANUP_GROUP **);
4483 NTSYSAPI NTSTATUS WINAPI TpAllocIoCompletion(TP_IO **,HANDLE,PTP_IO_CALLBACK,void *,TP_CALLBACK_ENVIRON *);
4484 NTSYSAPI NTSTATUS WINAPI TpAllocPool(TP_POOL **,PVOID);
4485 NTSYSAPI NTSTATUS WINAPI TpAllocTimer(TP_TIMER **,PTP_TIMER_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
4486 NTSYSAPI NTSTATUS WINAPI TpAllocWait(TP_WAIT **,PTP_WAIT_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
4487 NTSYSAPI NTSTATUS WINAPI TpAllocWork(TP_WORK **,PTP_WORK_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
4488 NTSYSAPI void WINAPI TpCallbackLeaveCriticalSectionOnCompletion(TP_CALLBACK_INSTANCE *,RTL_CRITICAL_SECTION *);
4489 NTSYSAPI NTSTATUS WINAPI TpCallbackMayRunLong(TP_CALLBACK_INSTANCE *);
4490 NTSYSAPI void WINAPI TpCallbackReleaseMutexOnCompletion(TP_CALLBACK_INSTANCE *,HANDLE);
4491 NTSYSAPI void WINAPI TpCallbackReleaseSemaphoreOnCompletion(TP_CALLBACK_INSTANCE *,HANDLE,DWORD);
4492 NTSYSAPI void WINAPI TpCallbackSetEventOnCompletion(TP_CALLBACK_INSTANCE *,HANDLE);
4493 NTSYSAPI void WINAPI TpCallbackUnloadDllOnCompletion(TP_CALLBACK_INSTANCE *,HMODULE);
4494 NTSYSAPI void WINAPI TpCancelAsyncIoOperation(TP_IO *);
4495 NTSYSAPI void WINAPI TpDisassociateCallback(TP_CALLBACK_INSTANCE *);
4496 NTSYSAPI BOOL WINAPI TpIsTimerSet(TP_TIMER *);
4497 NTSYSAPI void WINAPI TpPostWork(TP_WORK *);
4498 NTSYSAPI NTSTATUS WINAPI TpQueryPoolStackInformation(TP_POOL *, TP_POOL_STACK_INFORMATION *stack_info);
4499 NTSYSAPI void WINAPI TpReleaseCleanupGroup(TP_CLEANUP_GROUP *);
4500 NTSYSAPI void WINAPI TpReleaseCleanupGroupMembers(TP_CLEANUP_GROUP *,BOOL,PVOID);
4501 NTSYSAPI void WINAPI TpReleaseIoCompletion(TP_IO *);
4502 NTSYSAPI void WINAPI TpReleasePool(TP_POOL *);
4503 NTSYSAPI void WINAPI TpReleaseTimer(TP_TIMER *);
4504 NTSYSAPI void WINAPI TpReleaseWait(TP_WAIT *);
4505 NTSYSAPI void WINAPI TpReleaseWork(TP_WORK *);
4506 NTSYSAPI void WINAPI TpSetPoolMaxThreads(TP_POOL *,DWORD);
4507 NTSYSAPI BOOL WINAPI TpSetPoolMinThreads(TP_POOL *,DWORD);
4508 NTSYSAPI NTSTATUS WINAPI TpSetPoolStackInformation(TP_POOL *, TP_POOL_STACK_INFORMATION *stack_info);
4509 NTSYSAPI void WINAPI TpSetTimer(TP_TIMER *, LARGE_INTEGER *,LONG,LONG);
4510 NTSYSAPI void WINAPI TpSetWait(TP_WAIT *,HANDLE,LARGE_INTEGER *);
4511 NTSYSAPI NTSTATUS WINAPI TpSimpleTryPost(PTP_SIMPLE_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
4512 NTSYSAPI void WINAPI TpStartAsyncIoOperation(TP_IO *);
4513 NTSYSAPI void WINAPI TpWaitForIoCompletion(TP_IO *,BOOL);
4514 NTSYSAPI void WINAPI TpWaitForTimer(TP_TIMER *,BOOL);
4515 NTSYSAPI void WINAPI TpWaitForWait(TP_WAIT *,BOOL);
4516 NTSYSAPI void WINAPI TpWaitForWork(TP_WORK *,BOOL);
4518 /* Wine internal functions */
4520 NTSYSAPI NTSTATUS WINAPI wine_nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char *nameA, ULONG *size,
4521 UINT disposition );
4522 NTSYSAPI NTSTATUS WINAPI wine_unix_to_nt_file_name( const char *name, WCHAR *buffer, ULONG *size );
4525 /***********************************************************************
4526 * Inline functions
4529 #define InitializeObjectAttributes(p,n,a,r,s) \
4530 do { \
4531 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
4532 (p)->RootDirectory = r; \
4533 (p)->Attributes = a; \
4534 (p)->ObjectName = n; \
4535 (p)->SecurityDescriptor = s; \
4536 (p)->SecurityQualityOfService = NULL; \
4537 } while (0)
4539 #define NtCurrentProcess() ((HANDLE)-1)
4541 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
4542 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
4543 #define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
4544 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
4545 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
4546 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
4547 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
4549 static inline BOOLEAN RtlCheckBit(PCRTL_BITMAP lpBits, ULONG ulBit)
4551 if (lpBits && ulBit < lpBits->SizeOfBitMap &&
4552 lpBits->Buffer[ulBit >> 5] & (1 << (ulBit & 31)))
4553 return TRUE;
4554 return FALSE;
4557 /* These are implemented as __fastcall, so we can't let Winelib apps link with them */
4558 static inline USHORT RtlUshortByteSwap(USHORT s)
4560 return (s >> 8) | (s << 8);
4562 static inline ULONG RtlUlongByteSwap(ULONG i)
4564 #if defined(__i386__) && defined(__GNUC__)
4565 ULONG ret;
4566 __asm__("bswap %0" : "=r" (ret) : "0" (i) );
4567 return ret;
4568 #else
4569 return ((ULONG)RtlUshortByteSwap((USHORT)i) << 16) | RtlUshortByteSwap((USHORT)(i >> 16));
4570 #endif
4573 /* list manipulation macros */
4574 #define InitializeListHead(le) (void)((le)->Flink = (le)->Blink = (le))
4575 #define InsertHeadList(le,e) do { PLIST_ENTRY f = (le)->Flink; (e)->Flink = f; (e)->Blink = (le); f->Blink = (e); (le)->Flink = (e); } while (0)
4576 #define InsertTailList(le,e) do { PLIST_ENTRY b = (le)->Blink; (e)->Flink = (le); (e)->Blink = b; b->Flink = (e); (le)->Blink = (e); } while (0)
4577 #define IsListEmpty(le) ((le)->Flink == (le))
4578 #define RemoveEntryList(e) do { PLIST_ENTRY f = (e)->Flink, b = (e)->Blink; f->Blink = b; b->Flink = f; (e)->Flink = (e)->Blink = NULL; } while (0)
4579 static inline PLIST_ENTRY RemoveHeadList(PLIST_ENTRY le)
4581 PLIST_ENTRY f, b, e;
4583 e = le->Flink;
4584 f = le->Flink->Flink;
4585 b = le->Flink->Blink;
4586 f->Blink = b;
4587 b->Flink = f;
4589 if (e != le) e->Flink = e->Blink = NULL;
4590 return e;
4592 static inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le)
4594 PLIST_ENTRY f, b, e;
4596 e = le->Blink;
4597 f = le->Blink->Flink;
4598 b = le->Blink->Blink;
4599 f->Blink = b;
4600 b->Flink = f;
4602 if (e != le) e->Flink = e->Blink = NULL;
4603 return e;
4607 #ifdef __WINESRC__
4609 /* Wine internal functions */
4610 extern NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out );
4611 extern NTSTATUS WINAPI __wine_unix_spawnvp( char * const argv[], int wait );
4613 /* The thread information for 16-bit threads */
4614 /* NtCurrentTeb()->SubSystemTib points to this */
4615 typedef struct
4617 void *unknown; /* 00 unknown */
4618 UNICODE_STRING *exe_name; /* 04 exe module name */
4620 /* the following fields do not exist under Windows */
4621 UNICODE_STRING exe_str; /* exe name string pointed to by exe_name */
4622 CURDIR curdir; /* current directory */
4623 WCHAR curdir_buffer[MAX_PATH];
4624 } WIN16_SUBSYSTEM_TIB;
4626 #endif /* __WINESRC__ */
4628 #ifdef __cplusplus
4629 } /* extern "C" */
4630 #endif /* defined(__cplusplus) */
4632 #endif /* __WINE_WINTERNL_H */