wineps: Change initial printer font to DEVICE_DEFAULT_FONT.
[wine.git] / include / winternl.h
blob4061843c4c7788527d72c1f2cdf64adebad80315
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 UCHAR ImageUsedLargePages : 1; /* 003/003 */
311 UCHAR IsProtectedProcess : 1;
312 UCHAR IsImageDynamicallyRelocated : 1;
313 UCHAR SkipPatchingUser32Forwarders : 1;
314 UCHAR IsPackagedProcess : 1;
315 UCHAR IsAppContainer: 1;
316 UCHAR IsProtectedProcessLight : 1;
317 UCHAR IsLongPathAwareProcess : 1;
318 HANDLE Mutant; /* 004/008 */
319 HMODULE ImageBaseAddress; /* 008/010 */
320 PPEB_LDR_DATA LdrData; /* 00c/018 */
321 RTL_USER_PROCESS_PARAMETERS *ProcessParameters; /* 010/020 */
322 PVOID SubSystemData; /* 014/028 */
323 HANDLE ProcessHeap; /* 018/030 */
324 PRTL_CRITICAL_SECTION FastPebLock; /* 01c/038 */
325 PVOID AtlThunkSListPtr; /* 020/040 */
326 PVOID IFEOKey; /* 024/048 */
327 ULONG ProcessInJob : 1; /* 028/050 */
328 ULONG ProcessInitializing : 1;
329 ULONG ProcessUsingVEH : 1;
330 ULONG ProcessUsingVCH : 1;
331 ULONG ProcessUsingFTH : 1;
332 ULONG ProcessPreviouslyThrottled : 1;
333 ULONG ProcessCurrentlyThrottled : 1;
334 ULONG ProcessImagesHotPatched : 1;
335 ULONG ReservedBits0 : 24;
336 PVOID KernelCallbackTable; /* 02c/058 */
337 ULONG Reserved; /* 030/060 */
338 ULONG AtlThunkSListPtr32; /* 034/064 */
339 PVOID ApiSetMap; /* 038/068 */
340 ULONG TlsExpansionCounter; /* 03c/070 */
341 PRTL_BITMAP TlsBitmap; /* 040/078 */
342 ULONG TlsBitmapBits[2]; /* 044/080 */
343 PVOID ReadOnlySharedMemoryBase; /* 04c/088 */
344 PVOID SharedData; /* 050/090 */
345 PVOID *ReadOnlyStaticServerData; /* 054/098 */
346 PVOID AnsiCodePageData; /* 058/0a0 */
347 PVOID OemCodePageData; /* 05c/0a8 */
348 PVOID UnicodeCaseTableData; /* 060/0b0 */
349 ULONG NumberOfProcessors; /* 064/0b8 */
350 ULONG NtGlobalFlag; /* 068/0bc */
351 LARGE_INTEGER CriticalSectionTimeout; /* 070/0c0 */
352 SIZE_T HeapSegmentReserve; /* 078/0c8 */
353 SIZE_T HeapSegmentCommit; /* 07c/0d0 */
354 SIZE_T HeapDeCommitTotalFreeThreshold; /* 080/0d8 */
355 SIZE_T HeapDeCommitFreeBlockThreshold; /* 084/0e0 */
356 ULONG NumberOfHeaps; /* 088/0e8 */
357 ULONG MaximumNumberOfHeaps; /* 08c/0ec */
358 PVOID *ProcessHeaps; /* 090/0f0 */
359 PVOID GdiSharedHandleTable; /* 094/0f8 */
360 PVOID ProcessStarterHelper; /* 098/100 */
361 PVOID GdiDCAttributeList; /* 09c/108 */
362 PVOID LoaderLock; /* 0a0/110 */
363 ULONG OSMajorVersion; /* 0a4/118 */
364 ULONG OSMinorVersion; /* 0a8/11c */
365 ULONG OSBuildNumber; /* 0ac/120 */
366 ULONG OSPlatformId; /* 0b0/124 */
367 ULONG ImageSubSystem; /* 0b4/128 */
368 ULONG ImageSubSystemMajorVersion; /* 0b8/12c */
369 ULONG ImageSubSystemMinorVersion; /* 0bc/130 */
370 KAFFINITY ActiveProcessAffinityMask; /* 0c0/138 */
371 #ifdef _WIN64
372 ULONG GdiHandleBuffer[60]; /* /140 */
373 #else
374 ULONG GdiHandleBuffer[34]; /* 0c4/ */
375 #endif
376 PVOID PostProcessInitRoutine; /* 14c/230 */
377 PRTL_BITMAP TlsExpansionBitmap; /* 150/238 */
378 ULONG TlsExpansionBitmapBits[32]; /* 154/240 */
379 ULONG SessionId; /* 1d4/2c0 */
380 ULARGE_INTEGER AppCompatFlags; /* 1d8/2c8 */
381 ULARGE_INTEGER AppCompatFlagsUser; /* 1e0/2d0 */
382 PVOID ShimData; /* 1e8/2d8 */
383 PVOID AppCompatInfo; /* 1ec/2e0 */
384 UNICODE_STRING CSDVersion; /* 1f0/2e8 */
385 PVOID ActivationContextData; /* 1f8/2f8 */
386 PVOID ProcessAssemblyStorageMap; /* 1fc/300 */
387 PVOID SystemDefaultActivationData; /* 200/308 */
388 PVOID SystemAssemblyStorageMap; /* 204/310 */
389 SIZE_T MinimumStackCommit; /* 208/318 */
390 PVOID *FlsCallback; /* 20c/320 */
391 LIST_ENTRY FlsListHead; /* 210/328 */
392 PRTL_BITMAP FlsBitmap; /* 218/338 */
393 ULONG FlsBitmapBits[4]; /* 21c/340 */
394 ULONG FlsHighIndex; /* 22c/350 */
395 PVOID WerRegistrationData; /* 230/358 */
396 PVOID WerShipAssertPtr; /* 234/360 */
397 PVOID EcCodeBitMap; /* 238/368 */
398 PVOID pImageHeaderHash; /* 23c/370 */
399 ULONG HeapTracingEnabled : 1; /* 240/378 */
400 ULONG CritSecTracingEnabled : 1;
401 ULONG LibLoaderTracingEnabled : 1;
402 ULONG SpareTracingBits : 29;
403 ULONGLONG CsrServerReadOnlySharedMemoryBase; /* 248/380 */
404 ULONG TppWorkerpListLock; /* 250/388 */
405 LIST_ENTRY TppWorkerpList; /* 254/390 */
406 PVOID WaitOnAddressHashTable [0x80]; /* 25c/3a0 */
407 PVOID TelemetryCoverageHeader; /* 45c/7a0 */
408 ULONG CloudFileFlags; /* 460/7a8 */
409 ULONG CloudFileDiagFlags; /* 464/7ac */
410 CHAR PlaceholderCompatibilityMode; /* 468/7b0 */
411 CHAR PlaceholderCompatibilityModeReserved[7]; /* 469/7b1 */
412 PVOID LeapSecondData; /* 470/7b8 */
413 ULONG LeapSecondFlags; /* 474/7c0 */
414 ULONG NtGlobalFlag2; /* 478/7c4 */
415 } PEB, *PPEB;
418 /***********************************************************************
419 * TEB data structure
421 typedef struct _TEB
422 { /* win32/win64 */
423 NT_TIB Tib; /* 000/0000 */
424 PVOID EnvironmentPointer; /* 01c/0038 */
425 CLIENT_ID ClientId; /* 020/0040 */
426 PVOID ActiveRpcHandle; /* 028/0050 */
427 PVOID ThreadLocalStoragePointer; /* 02c/0058 */
428 PPEB Peb; /* 030/0060 */
429 ULONG LastErrorValue; /* 034/0068 */
430 ULONG CountOfOwnedCriticalSections; /* 038/006c */
431 PVOID CsrClientThread; /* 03c/0070 */
432 PVOID Win32ThreadInfo; /* 040/0078 */
433 ULONG User32Reserved[26]; /* 044/0080 */
434 ULONG UserReserved[5]; /* 0ac/00e8 */
435 PVOID WOW32Reserved; /* 0c0/0100 */
436 ULONG CurrentLocale; /* 0c4/0108 */
437 ULONG FpSoftwareStatusRegister; /* 0c8/010c */
438 PVOID ReservedForDebuggerInstrumentation[16]; /* 0cc/0110 */
439 #ifdef _WIN64
440 PVOID SystemReserved1[30]; /* /0190 */
441 #else
442 PVOID SystemReserved1[26]; /* 10c/ used for krnl386 private data in Wine */
443 #endif
444 char PlaceholderCompatibilityMode; /* 174/0280 */
445 BOOLEAN PlaceholderHydrationAlwaysExplicit;/* 175/0281 */
446 char PlaceholderReserved[10]; /* 176/0282 */
447 DWORD ProxiedProcessId; /* 180/028c */
448 ACTIVATION_CONTEXT_STACK ActivationContextStack; /* 184/0290 */
449 UCHAR WorkingOnBehalfOfTicket[8]; /* 19c/02b8 */
450 LONG ExceptionCode; /* 1a4/02c0 */
451 ACTIVATION_CONTEXT_STACK *ActivationContextStackPointer; /* 1a8/02c8 */
452 ULONG_PTR InstrumentationCallbackSp; /* 1ac/02d0 */
453 ULONG_PTR InstrumentationCallbackPreviousPc; /* 1b0/02d8 */
454 ULONG_PTR InstrumentationCallbackPreviousSp; /* 1b4/02e0 */
455 #ifdef _WIN64
456 ULONG TxFsContext; /* /02e8 */
457 BOOLEAN InstrumentationCallbackDisabled; /* /02ec */
458 BOOLEAN UnalignedLoadStoreExceptions; /* /02ed */
459 #else
460 BOOLEAN InstrumentationCallbackDisabled; /* 1b8/ */
461 BYTE SpareBytes1[23]; /* 1b9/ */
462 ULONG TxFsContext; /* 1d0/ */
463 #endif
464 GDI_TEB_BATCH GdiTebBatch; /* 1d4/02f0 used for ntdll private data in Wine */
465 CLIENT_ID RealClientId; /* 6b4/07d8 */
466 HANDLE GdiCachedProcessHandle; /* 6bc/07e8 */
467 ULONG GdiClientPID; /* 6c0/07f0 */
468 ULONG GdiClientTID; /* 6c4/07f4 */
469 PVOID GdiThreadLocaleInfo; /* 6c8/07f8 */
470 ULONG_PTR Win32ClientInfo[62]; /* 6cc/0800 used for user32 private data in Wine */
471 PVOID glDispatchTable[233]; /* 7c4/09f0 */
472 PVOID glReserved1[29]; /* b68/1138 */
473 PVOID glReserved2; /* bdc/1220 */
474 PVOID glSectionInfo; /* be0/1228 */
475 PVOID glSection; /* be4/1230 */
476 PVOID glTable; /* be8/1238 */
477 PVOID glCurrentRC; /* bec/1240 */
478 PVOID glContext; /* bf0/1248 */
479 ULONG LastStatusValue; /* bf4/1250 */
480 UNICODE_STRING StaticUnicodeString; /* bf8/1258 */
481 WCHAR StaticUnicodeBuffer[261]; /* c00/1268 */
482 PVOID DeallocationStack; /* e0c/1478 */
483 PVOID TlsSlots[64]; /* e10/1480 */
484 LIST_ENTRY TlsLinks; /* f10/1680 */
485 PVOID Vdm; /* f18/1690 */
486 PVOID ReservedForNtRpc; /* f1c/1698 */
487 PVOID DbgSsReserved[2]; /* f20/16a0 */
488 ULONG HardErrorMode; /* f28/16b0 */
489 #ifdef _WIN64
490 PVOID Instrumentation[11]; /* /16b8 */
491 #else
492 PVOID Instrumentation[9]; /* f2c/ */
493 #endif
494 GUID ActivityId; /* f50/1710 */
495 PVOID SubProcessTag; /* f60/1720 */
496 PVOID PerflibData; /* f64/1728 */
497 PVOID EtwTraceData; /* f68/1730 */
498 PVOID WinSockData; /* f6c/1738 */
499 ULONG GdiBatchCount; /* f70/1740 */
500 ULONG IdealProcessorValue; /* f74/1744 */
501 ULONG GuaranteedStackBytes; /* f78/1748 */
502 PVOID ReservedForPerf; /* f7c/1750 */
503 PVOID ReservedForOle; /* f80/1758 */
504 ULONG WaitingOnLoaderLock; /* f84/1760 */
505 PVOID SavedPriorityState; /* f88/1768 */
506 ULONG_PTR ReservedForCodeCoverage; /* f8c/1770 */
507 PVOID ThreadPoolData; /* f90/1778 */
508 PVOID *TlsExpansionSlots; /* f94/1780 */
509 #ifdef _WIN64
510 PVOID DeallocationBStore; /* /1788 */
511 PVOID BStoreLimit; /* /1790 */
512 #endif
513 ULONG MuiGeneration; /* f98/1798 */
514 ULONG IsImpersonating; /* f9c/179c */
515 PVOID NlsCache; /* fa0/17a0 */
516 PVOID ShimData; /* fa4/17a8 */
517 ULONG HeapVirtualAffinity; /* fa8/17b0 */
518 PVOID CurrentTransactionHandle; /* fac/17b8 */
519 TEB_ACTIVE_FRAME *ActiveFrame; /* fb0/17c0 */
520 TEB_FLS_DATA *FlsSlots; /* fb4/17c8 */
521 PVOID PreferredLanguages; /* fb8/17d0 */
522 PVOID UserPrefLanguages; /* fbc/17d8 */
523 PVOID MergedPrefLanguages; /* fc0/17e0 */
524 ULONG MuiImpersonation; /* fc4/17e8 */
525 USHORT CrossTebFlags; /* fc8/17ec */
526 USHORT SameTebFlags; /* fca/17ee */
527 PVOID TxnScopeEnterCallback; /* fcc/17f0 */
528 PVOID TxnScopeExitCallback; /* fd0/17f8 */
529 PVOID TxnScopeContext; /* fd4/1800 */
530 ULONG LockCount; /* fd8/1808 */
531 LONG WowTebOffset; /* fdc/180c */
532 PVOID ResourceRetValue; /* fe0/1810 */
533 PVOID ReservedForWdf; /* fe4/1818 */
534 ULONGLONG ReservedForCrt; /* fe8/1820 */
535 GUID EffectiveContainerId; /* ff0/1828 */
536 } TEB, *PTEB;
539 /***********************************************************************
540 * The 32-bit/64-bit version of the PEB and TEB for WoW64
542 typedef struct _NT_TIB32
544 ULONG ExceptionList; /* 0000 */
545 ULONG StackBase; /* 0004 */
546 ULONG StackLimit; /* 0008 */
547 ULONG SubSystemTib; /* 000c */
548 ULONG FiberData; /* 0010 */
549 ULONG ArbitraryUserPointer; /* 0014 */
550 ULONG Self; /* 0018 */
551 } NT_TIB32;
553 typedef struct _NT_TIB64
555 ULONG64 ExceptionList; /* 0000 */
556 ULONG64 StackBase; /* 0008 */
557 ULONG64 StackLimit; /* 0010 */
558 ULONG64 SubSystemTib; /* 0018 */
559 ULONG64 FiberData; /* 0020 */
560 ULONG64 ArbitraryUserPointer; /* 0028 */
561 ULONG64 Self; /* 0030 */
562 } NT_TIB64;
564 typedef struct _CLIENT_ID32
566 ULONG UniqueProcess;
567 ULONG UniqueThread;
568 } CLIENT_ID32;
570 typedef struct _CLIENT_ID64
572 ULONG64 UniqueProcess;
573 ULONG64 UniqueThread;
574 } CLIENT_ID64;
576 typedef struct _LIST_ENTRY32
578 ULONG Flink;
579 ULONG Blink;
580 } LIST_ENTRY32;
582 typedef struct _LIST_ENTRY64
584 ULONG64 Flink;
585 ULONG64 Blink;
586 } LIST_ENTRY64;
588 typedef struct _UNICODE_STRING32
590 USHORT Length;
591 USHORT MaximumLength;
592 ULONG Buffer;
593 } UNICODE_STRING32;
595 typedef struct _UNICODE_STRING64
597 USHORT Length;
598 USHORT MaximumLength;
599 ULONG64 Buffer;
600 } UNICODE_STRING64;
602 typedef struct _ACTIVATION_CONTEXT_STACK32
604 ULONG ActiveFrame;
605 LIST_ENTRY32 FrameListCache;
606 ULONG Flags;
607 ULONG NextCookieSequenceNumber;
608 ULONG32 StackId;
609 } ACTIVATION_CONTEXT_STACK32;
611 typedef struct _ACTIVATION_CONTEXT_STACK64
613 ULONG64 ActiveFrame;
614 LIST_ENTRY64 FrameListCache;
615 ULONG Flags;
616 ULONG NextCookieSequenceNumber;
617 ULONG64 StackId;
618 } ACTIVATION_CONTEXT_STACK64;
620 typedef struct _CURDIR32
622 UNICODE_STRING32 DosPath;
623 ULONG Handle;
624 } CURDIR32;
626 typedef struct _CURDIR64
628 UNICODE_STRING64 DosPath;
629 ULONG64 Handle;
630 } CURDIR64;
632 typedef struct RTL_DRIVE_LETTER_CURDIR32
634 USHORT Flags;
635 USHORT Length;
636 ULONG TimeStamp;
637 UNICODE_STRING32 DosPath;
638 } RTL_DRIVE_LETTER_CURDIR32;
640 typedef struct RTL_DRIVE_LETTER_CURDIR64
642 USHORT Flags;
643 USHORT Length;
644 ULONG TimeStamp;
645 UNICODE_STRING64 DosPath;
646 } RTL_DRIVE_LETTER_CURDIR64;
648 typedef struct _RTL_USER_PROCESS_PARAMETERS32
650 ULONG AllocationSize;
651 ULONG Size;
652 ULONG Flags;
653 ULONG DebugFlags;
654 ULONG ConsoleHandle;
655 ULONG ConsoleFlags;
656 ULONG hStdInput;
657 ULONG hStdOutput;
658 ULONG hStdError;
659 CURDIR32 CurrentDirectory;
660 UNICODE_STRING32 DllPath;
661 UNICODE_STRING32 ImagePathName;
662 UNICODE_STRING32 CommandLine;
663 ULONG Environment;
664 ULONG dwX;
665 ULONG dwY;
666 ULONG dwXSize;
667 ULONG dwYSize;
668 ULONG dwXCountChars;
669 ULONG dwYCountChars;
670 ULONG dwFillAttribute;
671 ULONG dwFlags;
672 ULONG wShowWindow;
673 UNICODE_STRING32 WindowTitle;
674 UNICODE_STRING32 Desktop;
675 UNICODE_STRING32 ShellInfo;
676 UNICODE_STRING32 RuntimeInfo;
677 RTL_DRIVE_LETTER_CURDIR32 DLCurrentDirectory[0x20];
678 ULONG EnvironmentSize;
679 ULONG EnvironmentVersion;
680 ULONG PackageDependencyData;
681 ULONG ProcessGroupId;
682 ULONG LoaderThreads;
683 } RTL_USER_PROCESS_PARAMETERS32;
685 typedef struct _RTL_USER_PROCESS_PARAMETERS64
687 ULONG AllocationSize;
688 ULONG Size;
689 ULONG Flags;
690 ULONG DebugFlags;
691 ULONG64 ConsoleHandle;
692 ULONG ConsoleFlags;
693 ULONG64 hStdInput;
694 ULONG64 hStdOutput;
695 ULONG64 hStdError;
696 CURDIR64 CurrentDirectory;
697 UNICODE_STRING64 DllPath;
698 UNICODE_STRING64 ImagePathName;
699 UNICODE_STRING64 CommandLine;
700 ULONG64 Environment;
701 ULONG dwX;
702 ULONG dwY;
703 ULONG dwXSize;
704 ULONG dwYSize;
705 ULONG dwXCountChars;
706 ULONG dwYCountChars;
707 ULONG dwFillAttribute;
708 ULONG dwFlags;
709 ULONG wShowWindow;
710 UNICODE_STRING64 WindowTitle;
711 UNICODE_STRING64 Desktop;
712 UNICODE_STRING64 ShellInfo;
713 UNICODE_STRING64 RuntimeInfo;
714 RTL_DRIVE_LETTER_CURDIR64 DLCurrentDirectory[0x20];
715 ULONG64 EnvironmentSize;
716 ULONG64 EnvironmentVersion;
717 ULONG64 PackageDependencyData;
718 ULONG ProcessGroupId;
719 ULONG LoaderThreads;
720 } RTL_USER_PROCESS_PARAMETERS64;
722 typedef struct _PEB_LDR_DATA32
724 ULONG Length;
725 BOOLEAN Initialized;
726 ULONG SsHandle;
727 LIST_ENTRY32 InLoadOrderModuleList;
728 LIST_ENTRY32 InMemoryOrderModuleList;
729 LIST_ENTRY32 InInitializationOrderModuleList;
730 ULONG EntryInProgress;
731 BOOLEAN ShutdownInProgress;
732 ULONG ShutdownThreadId;
733 } PEB_LDR_DATA32, *PPEB_LDR_DATA32;
735 typedef struct _PEB_LDR_DATA64
737 ULONG Length;
738 BOOLEAN Initialized;
739 ULONG64 SsHandle;
740 LIST_ENTRY64 InLoadOrderModuleList;
741 LIST_ENTRY64 InMemoryOrderModuleList;
742 LIST_ENTRY64 InInitializationOrderModuleList;
743 ULONG64 EntryInProgress;
744 BOOLEAN ShutdownInProgress;
745 ULONG64 ShutdownThreadId;
746 } PEB_LDR_DATA64, *PPEB_LDR_DATA64;
748 typedef struct _PEB32
750 BOOLEAN InheritedAddressSpace; /* 0000 */
751 BOOLEAN ReadImageFileExecOptions; /* 0001 */
752 BOOLEAN BeingDebugged; /* 0002 */
753 UCHAR ImageUsedLargePages : 1; /* 0003 */
754 UCHAR IsProtectedProcess : 1;
755 UCHAR IsImageDynamicallyRelocated : 1;
756 UCHAR SkipPatchingUser32Forwarders : 1;
757 UCHAR IsPackagedProcess : 1;
758 UCHAR IsAppContainer: 1;
759 UCHAR IsProtectedProcessLight : 1;
760 UCHAR IsLongPathAwareProcess : 1;
761 ULONG Mutant; /* 0004 */
762 ULONG ImageBaseAddress; /* 0008 */
763 ULONG LdrData; /* 000c */
764 ULONG ProcessParameters; /* 0010 */
765 ULONG SubSystemData; /* 0014 */
766 ULONG ProcessHeap; /* 0018 */
767 ULONG FastPebLock; /* 001c */
768 ULONG AtlThunkSListPtr; /* 0020 */
769 ULONG IFEOKey; /* 0024 */
770 ULONG ProcessInJob : 1; /* 0028 */
771 ULONG ProcessInitializing : 1;
772 ULONG ProcessUsingVEH : 1;
773 ULONG ProcessUsingVCH : 1;
774 ULONG ProcessUsingFTH : 1;
775 ULONG ProcessPreviouslyThrottled : 1;
776 ULONG ProcessCurrentlyThrottled : 1;
777 ULONG ProcessImagesHotPatched : 1;
778 ULONG ReservedBits0 : 24;
779 ULONG KernelCallbackTable; /* 002c */
780 ULONG Reserved; /* 0030 */
781 ULONG AtlThunkSListPtr32; /* 0034 */
782 ULONG ApiSetMap; /* 0038 */
783 ULONG TlsExpansionCounter; /* 003c */
784 ULONG TlsBitmap; /* 0040 */
785 ULONG TlsBitmapBits[2]; /* 0044 */
786 ULONG ReadOnlySharedMemoryBase; /* 004c */
787 ULONG SharedData; /* 0050 */
788 ULONG ReadOnlyStaticServerData; /* 0054 */
789 ULONG AnsiCodePageData; /* 0058 */
790 ULONG OemCodePageData; /* 005c */
791 ULONG UnicodeCaseTableData; /* 0060 */
792 ULONG NumberOfProcessors; /* 0064 */
793 ULONG NtGlobalFlag; /* 0068 */
794 LARGE_INTEGER CriticalSectionTimeout; /* 0070 */
795 ULONG HeapSegmentReserve; /* 0078 */
796 ULONG HeapSegmentCommit; /* 007c */
797 ULONG HeapDeCommitTotalFreeThreshold; /* 0080 */
798 ULONG HeapDeCommitFreeBlockThreshold; /* 0084 */
799 ULONG NumberOfHeaps; /* 0088 */
800 ULONG MaximumNumberOfHeaps; /* 008c */
801 ULONG ProcessHeaps; /* 0090 */
802 ULONG GdiSharedHandleTable; /* 0094 */
803 ULONG ProcessStarterHelper; /* 0098 */
804 ULONG GdiDCAttributeList; /* 009c */
805 ULONG LoaderLock; /* 00a0 */
806 ULONG OSMajorVersion; /* 00a4 */
807 ULONG OSMinorVersion; /* 00a8 */
808 ULONG OSBuildNumber; /* 00ac */
809 ULONG OSPlatformId; /* 00b0 */
810 ULONG ImageSubSystem; /* 00b4 */
811 ULONG ImageSubSystemMajorVersion; /* 00b8 */
812 ULONG ImageSubSystemMinorVersion; /* 00bc */
813 ULONG ActiveProcessAffinityMask; /* 00c0 */
814 ULONG GdiHandleBuffer[34]; /* 00c4 */
815 ULONG PostProcessInitRoutine; /* 014c */
816 ULONG TlsExpansionBitmap; /* 0150 */
817 ULONG TlsExpansionBitmapBits[32]; /* 0154 */
818 ULONG SessionId; /* 01d4 */
819 ULARGE_INTEGER AppCompatFlags; /* 01d8 */
820 ULARGE_INTEGER AppCompatFlagsUser; /* 01e0 */
821 ULONG ShimData; /* 01e8 */
822 ULONG AppCompatInfo; /* 01ec */
823 UNICODE_STRING32 CSDVersion; /* 01f0 */
824 ULONG ActivationContextData; /* 01f8 */
825 ULONG ProcessAssemblyStorageMap; /* 01fc */
826 ULONG SystemDefaultActivationData; /* 0200 */
827 ULONG SystemAssemblyStorageMap; /* 0204 */
828 ULONG MinimumStackCommit; /* 0208 */
829 ULONG FlsCallback; /* 020c */
830 LIST_ENTRY32 FlsListHead; /* 0210 */
831 ULONG FlsBitmap; /* 0218 */
832 ULONG FlsBitmapBits[4]; /* 021c */
833 ULONG FlsHighIndex; /* 022c */
834 ULONG WerRegistrationData; /* 0230 */
835 ULONG WerShipAssertPtr; /* 0234 */
836 ULONG pUnused; /* 0238 */
837 ULONG pImageHeaderHash; /* 023c */
838 ULONG HeapTracingEnabled : 1; /* 0240 */
839 ULONG CritSecTracingEnabled : 1;
840 ULONG LibLoaderTracingEnabled : 1;
841 ULONG SpareTracingBits : 29;
842 ULONGLONG CsrServerReadOnlySharedMemoryBase; /* 0248 */
843 ULONG TppWorkerpListLock; /* 0250 */
844 LIST_ENTRY32 TppWorkerpList; /* 0254 */
845 ULONG WaitOnAddressHashTable [0x80]; /* 025c */
846 ULONG TelemetryCoverageHeader; /* 045c */
847 ULONG CloudFileFlags; /* 0460 */
848 ULONG CloudFileDiagFlags; /* 0464 */
849 CHAR PlaceholderCompatibilityMode; /* 0468 */
850 CHAR PlaceholderCompatibilityModeReserved[7]; /* 0469 */
851 ULONG LeapSecondData; /* 0470 */
852 ULONG LeapSecondFlags; /* 0474 */
853 ULONG NtGlobalFlag2; /* 0478 */
854 } PEB32;
856 C_ASSERT( sizeof(PEB32) == 0x480 );
858 typedef struct _PEB64
860 BOOLEAN InheritedAddressSpace; /* 0000 */
861 BOOLEAN ReadImageFileExecOptions; /* 0001 */
862 BOOLEAN BeingDebugged; /* 0002 */
863 UCHAR ImageUsedLargePages : 1; /* 0003 */
864 UCHAR IsProtectedProcess : 1;
865 UCHAR IsImageDynamicallyRelocated : 1;
866 UCHAR SkipPatchingUser32Forwarders : 1;
867 UCHAR IsPackagedProcess : 1;
868 UCHAR IsAppContainer: 1;
869 UCHAR IsProtectedProcessLight : 1;
870 UCHAR IsLongPathAwareProcess : 1;
871 ULONG64 Mutant; /* 0008 */
872 ULONG64 ImageBaseAddress; /* 0010 */
873 ULONG64 LdrData; /* 0018 */
874 ULONG64 ProcessParameters; /* 0020 */
875 ULONG64 SubSystemData; /* 0028 */
876 ULONG64 ProcessHeap; /* 0030 */
877 ULONG64 FastPebLock; /* 0038 */
878 ULONG64 AtlThunkSListPtr; /* 0040 */
879 ULONG64 IFEOKey; /* 0048 */
880 ULONG ProcessInJob : 1; /* 0050 */
881 ULONG ProcessInitializing : 1;
882 ULONG ProcessUsingVEH : 1;
883 ULONG ProcessUsingVCH : 1;
884 ULONG ProcessUsingFTH : 1;
885 ULONG ProcessPreviouslyThrottled : 1;
886 ULONG ProcessCurrentlyThrottled : 1;
887 ULONG ProcessImagesHotPatched : 1;
888 ULONG ReservedBits0 : 24;
889 ULONG64 KernelCallbackTable; /* 0058 */
890 ULONG Reserved; /* 0060 */
891 ULONG AtlThunkSListPtr32; /* 0064 */
892 ULONG64 ApiSetMap; /* 0068 */
893 ULONG TlsExpansionCounter; /* 0070 */
894 ULONG64 TlsBitmap; /* 0078 */
895 ULONG TlsBitmapBits[2]; /* 0080 */
896 ULONG64 ReadOnlySharedMemoryBase; /* 0088 */
897 ULONG64 SharedData; /* 0090 */
898 ULONG64 ReadOnlyStaticServerData; /* 0098 */
899 ULONG64 AnsiCodePageData; /* 00a0 */
900 ULONG64 OemCodePageData; /* 00a8 */
901 ULONG64 UnicodeCaseTableData; /* 00b0 */
902 ULONG NumberOfProcessors; /* 00b8 */
903 ULONG NtGlobalFlag; /* 00bc */
904 LARGE_INTEGER CriticalSectionTimeout; /* 00c0 */
905 ULONG64 HeapSegmentReserve; /* 00c8 */
906 ULONG64 HeapSegmentCommit; /* 00d0 */
907 ULONG64 HeapDeCommitTotalFreeThreshold; /* 00d8 */
908 ULONG64 HeapDeCommitFreeBlockThreshold; /* 00e0 */
909 ULONG NumberOfHeaps; /* 00e8 */
910 ULONG MaximumNumberOfHeaps; /* 00ec */
911 ULONG64 ProcessHeaps; /* 00f0 */
912 ULONG64 GdiSharedHandleTable; /* 00f8 */
913 ULONG64 ProcessStarterHelper; /* 0100 */
914 ULONG64 GdiDCAttributeList; /* 0108 */
915 ULONG64 LoaderLock; /* 0110 */
916 ULONG OSMajorVersion; /* 0118 */
917 ULONG OSMinorVersion; /* 011c */
918 ULONG OSBuildNumber; /* 0120 */
919 ULONG OSPlatformId; /* 0124 */
920 ULONG ImageSubSystem; /* 0128 */
921 ULONG ImageSubSystemMajorVersion; /* 012c */
922 ULONG ImageSubSystemMinorVersion; /* 0130 */
923 ULONG64 ActiveProcessAffinityMask; /* 0138 */
924 ULONG GdiHandleBuffer[60]; /* 0140 */
925 ULONG64 PostProcessInitRoutine; /* 0230 */
926 ULONG64 TlsExpansionBitmap; /* 0238 */
927 ULONG TlsExpansionBitmapBits[32]; /* 0240 */
928 ULONG SessionId; /* 02c0 */
929 ULARGE_INTEGER AppCompatFlags; /* 02c8 */
930 ULARGE_INTEGER AppCompatFlagsUser; /* 02d0 */
931 ULONG64 ShimData; /* 02d8 */
932 ULONG64 AppCompatInfo; /* 02e0 */
933 UNICODE_STRING64 CSDVersion; /* 02e8 */
934 ULONG64 ActivationContextData; /* 02f8 */
935 ULONG64 ProcessAssemblyStorageMap; /* 0300 */
936 ULONG64 SystemDefaultActivationData; /* 0308 */
937 ULONG64 SystemAssemblyStorageMap; /* 0310 */
938 ULONG64 MinimumStackCommit; /* 0318 */
939 ULONG64 FlsCallback; /* 0320 */
940 LIST_ENTRY64 FlsListHead; /* 0328 */
941 ULONG64 FlsBitmap; /* 0338 */
942 ULONG FlsBitmapBits[4]; /* 0340 */
943 ULONG FlsHighIndex; /* 0350 */
944 ULONG64 WerRegistrationData; /* 0358 */
945 ULONG64 WerShipAssertPtr; /* 0360 */
946 ULONG64 pUnused; /* 0368 */
947 ULONG64 pImageHeaderHash; /* 0370 */
948 ULONG HeapTracingEnabled : 1; /* 0378 */
949 ULONG CritSecTracingEnabled : 1;
950 ULONG LibLoaderTracingEnabled : 1;
951 ULONG SpareTracingBits : 29;
952 ULONGLONG CsrServerReadOnlySharedMemoryBase; /* 0380 */
953 ULONG TppWorkerpListLock; /* 0388 */
954 LIST_ENTRY64 TppWorkerpList; /* 0390 */
955 ULONG64 WaitOnAddressHashTable [0x80]; /* 03a0 */
956 ULONG64 TelemetryCoverageHeader; /* 07a0 */
957 ULONG CloudFileFlags; /* 07a8 */
958 ULONG CloudFileDiagFlags; /* 07ac */
959 CHAR PlaceholderCompatibilityMode; /* 07b0 */
960 CHAR PlaceholderCompatibilityModeReserved[7]; /* 07b1 */
961 ULONG64 LeapSecondData; /* 07b8 */
962 ULONG LeapSecondFlags; /* 07c0 */
963 ULONG NtGlobalFlag2; /* 07c4 */
964 } PEB64;
966 C_ASSERT( sizeof(PEB64) == 0x7c8 );
968 typedef struct _TEB32
970 NT_TIB32 Tib; /* 0000 */
971 ULONG EnvironmentPointer; /* 001c */
972 CLIENT_ID32 ClientId; /* 0020 */
973 ULONG ActiveRpcHandle; /* 0028 */
974 ULONG ThreadLocalStoragePointer; /* 002c */
975 ULONG Peb; /* 0030 */
976 ULONG LastErrorValue; /* 0034 */
977 ULONG CountOfOwnedCriticalSections; /* 0038 */
978 ULONG CsrClientThread; /* 003c */
979 ULONG Win32ThreadInfo; /* 0040 */
980 ULONG User32Reserved[26]; /* 0044 */
981 ULONG UserReserved[5]; /* 00ac */
982 ULONG WOW32Reserved; /* 00c0 */
983 ULONG CurrentLocale; /* 00c4 */
984 ULONG FpSoftwareStatusRegister; /* 00c8 */
985 ULONG ReservedForDebuggerInstrumentation[16]; /* 00cc */
986 ULONG SystemReserved1[26]; /* 010c */
987 char PlaceholderCompatibilityMode; /* 0174 */
988 BOOLEAN PlaceholderHydrationAlwaysExplicit;/* 0175 */
989 char PlaceholderReserved[10]; /* 0176 */
990 DWORD ProxiedProcessId; /* 0180 */
991 ACTIVATION_CONTEXT_STACK32 ActivationContextStack; /* 0184 */
992 UCHAR WorkingOnBehalfOfTicket[8]; /* 019c */
993 LONG ExceptionCode; /* 01a4 */
994 ULONG ActivationContextStackPointer; /* 01a8 */
995 ULONG InstrumentationCallbackSp; /* 01ac */
996 ULONG InstrumentationCallbackPreviousPc; /* 01b0 */
997 ULONG InstrumentationCallbackPreviousSp; /* 01b4 */
998 BOOLEAN InstrumentationCallbackDisabled; /* 01b8 */
999 BYTE SpareBytes1[23]; /* 01b9 */
1000 ULONG TxFsContext; /* 01d0 */
1001 ULONG GdiTebBatch[0x138]; /* 01d4 */
1002 CLIENT_ID32 RealClientId; /* 06b4 */
1003 ULONG GdiCachedProcessHandle; /* 06bc */
1004 ULONG GdiClientPID; /* 06c0 */
1005 ULONG GdiClientTID; /* 06c4 */
1006 ULONG GdiThreadLocaleInfo; /* 06c8 */
1007 ULONG Win32ClientInfo[62]; /* 06cc */
1008 ULONG glDispatchTable[233]; /* 07c4 */
1009 ULONG glReserved1[29]; /* 0b68 */
1010 ULONG glReserved2; /* 0bdc */
1011 ULONG glSectionInfo; /* 0be0 */
1012 ULONG glSection; /* 0be4 */
1013 ULONG glTable; /* 0be8 */
1014 ULONG glCurrentRC; /* 0bec */
1015 ULONG glContext; /* 0bf0 */
1016 ULONG LastStatusValue; /* 0bf4 */
1017 UNICODE_STRING32 StaticUnicodeString; /* 0bf8 */
1018 WCHAR StaticUnicodeBuffer[261]; /* 0c00 */
1019 ULONG DeallocationStack; /* 0e0c */
1020 ULONG TlsSlots[64]; /* 0e10 */
1021 LIST_ENTRY32 TlsLinks; /* 0f10 */
1022 ULONG Vdm; /* 0f18 */
1023 ULONG ReservedForNtRpc; /* 0f1c */
1024 ULONG DbgSsReserved[2]; /* 0f20 */
1025 ULONG HardErrorMode; /* 0f28 */
1026 ULONG Instrumentation[9]; /* 0f2c */
1027 GUID ActivityId; /* 0f50 */
1028 ULONG SubProcessTag; /* 0f60 */
1029 ULONG PerflibData; /* 0f64 */
1030 ULONG EtwTraceData; /* 0f68 */
1031 ULONG WinSockData; /* 0f6c */
1032 ULONG GdiBatchCount; /* 0f70 */
1033 ULONG IdealProcessorValue; /* 0f74 */
1034 ULONG GuaranteedStackBytes; /* 0f78 */
1035 ULONG ReservedForPerf; /* 0f7c */
1036 ULONG ReservedForOle; /* 0f80 */
1037 ULONG WaitingOnLoaderLock; /* 0f84 */
1038 ULONG SavedPriorityState; /* 0f88 */
1039 ULONG ReservedForCodeCoverage; /* 0f8c */
1040 ULONG ThreadPoolData; /* 0f90 */
1041 ULONG TlsExpansionSlots; /* 0f94 */
1042 ULONG MuiGeneration; /* 0f98 */
1043 ULONG IsImpersonating; /* 0f9c */
1044 ULONG NlsCache; /* 0fa0 */
1045 ULONG ShimData; /* 0fa4 */
1046 ULONG HeapVirtualAffinity; /* 0fa8 */
1047 ULONG CurrentTransactionHandle; /* 0fac */
1048 ULONG ActiveFrame; /* 0fb0 */
1049 ULONG FlsSlots; /* 0fb4 */
1050 ULONG PreferredLanguages; /* 0fb8 */
1051 ULONG UserPrefLanguages; /* 0fbc */
1052 ULONG MergedPrefLanguages; /* 0fc0 */
1053 ULONG MuiImpersonation; /* 0fc4 */
1054 USHORT CrossTebFlags; /* 0fc8 */
1055 USHORT SameTebFlags; /* 0fca */
1056 ULONG TxnScopeEnterCallback; /* 0fcc */
1057 ULONG TxnScopeExitCallback; /* 0fd0 */
1058 ULONG TxnScopeContext; /* 0fd4 */
1059 ULONG LockCount; /* 0fd8 */
1060 LONG WowTebOffset; /* 0fdc */
1061 ULONG ResourceRetValue; /* 0fe0 */
1062 ULONG ReservedForWdf; /* 0fe4 */
1063 ULONGLONG ReservedForCrt; /* 0fe8 */
1064 GUID EffectiveContainerId; /* 0ff0 */
1065 } TEB32;
1067 C_ASSERT( sizeof(TEB32) == 0x1000 );
1069 typedef struct _TEB64
1071 NT_TIB64 Tib; /* 0000 */
1072 ULONG64 EnvironmentPointer; /* 0038 */
1073 CLIENT_ID64 ClientId; /* 0040 */
1074 ULONG64 ActiveRpcHandle; /* 0050 */
1075 ULONG64 ThreadLocalStoragePointer; /* 0058 */
1076 ULONG64 Peb; /* 0060 */
1077 ULONG LastErrorValue; /* 0068 */
1078 ULONG CountOfOwnedCriticalSections; /* 006c */
1079 ULONG64 CsrClientThread; /* 0070 */
1080 ULONG64 Win32ThreadInfo; /* 0078 */
1081 ULONG User32Reserved[26]; /* 0080 */
1082 ULONG UserReserved[5]; /* 00e8 */
1083 ULONG64 WOW32Reserved; /* 0100 */
1084 ULONG CurrentLocale; /* 0108 */
1085 ULONG FpSoftwareStatusRegister; /* 010c */
1086 ULONG64 ReservedForDebuggerInstrumentation[16]; /* 0110 */
1087 ULONG64 SystemReserved1[30]; /* 0190 */
1088 char PlaceholderCompatibilityMode; /* 0280 */
1089 BOOLEAN PlaceholderHydrationAlwaysExplicit;/* 0281 */
1090 char PlaceholderReserved[10]; /* 0282 */
1091 DWORD ProxiedProcessId; /* 028c */
1092 ACTIVATION_CONTEXT_STACK64 ActivationContextStack; /* 0290 */
1093 UCHAR WorkingOnBehalfOfTicket[8]; /* 02b8 */
1094 LONG ExceptionCode; /* 02c0 */
1095 ULONG64 ActivationContextStackPointer; /* 02c8 */
1096 ULONG64 InstrumentationCallbackSp; /* 02d0 */
1097 ULONG64 InstrumentationCallbackPreviousPc; /* 02d8 */
1098 ULONG64 InstrumentationCallbackPreviousSp; /* 02e0 */
1099 ULONG TxFsContext; /* 02e8 */
1100 BOOLEAN InstrumentationCallbackDisabled; /* 02ec */
1101 BOOLEAN UnalignedLoadStoreExceptions; /* 02ed */
1102 ULONG64 GdiTebBatch[0x9d]; /* 02f0 */
1103 CLIENT_ID64 RealClientId; /* 07d8 */
1104 ULONG64 GdiCachedProcessHandle; /* 07e8 */
1105 ULONG GdiClientPID; /* 07f0 */
1106 ULONG GdiClientTID; /* 07f4 */
1107 ULONG64 GdiThreadLocaleInfo; /* 07f8 */
1108 ULONG64 Win32ClientInfo[62]; /* 0800 */
1109 ULONG64 glDispatchTable[233]; /* 09f0 */
1110 ULONG64 glReserved1[29]; /* 1138 */
1111 ULONG64 glReserved2; /* 1220 */
1112 ULONG64 glSectionInfo; /* 1228 */
1113 ULONG64 glSection; /* 1230 */
1114 ULONG64 glTable; /* 1238 */
1115 ULONG64 glCurrentRC; /* 1240 */
1116 ULONG64 glContext; /* 1248 */
1117 ULONG LastStatusValue; /* 1250 */
1118 UNICODE_STRING64 StaticUnicodeString; /* 1258 */
1119 WCHAR StaticUnicodeBuffer[261]; /* 1268 */
1120 ULONG64 DeallocationStack; /* 1478 */
1121 ULONG64 TlsSlots[64]; /* 1480 */
1122 LIST_ENTRY64 TlsLinks; /* 1680 */
1123 ULONG64 Vdm; /* 1690 */
1124 ULONG64 ReservedForNtRpc; /* 1698 */
1125 ULONG64 DbgSsReserved[2]; /* 16a0 */
1126 ULONG HardErrorMode; /* 16b0 */
1127 ULONG64 Instrumentation[11]; /* 16b8 */
1128 GUID ActivityId; /* 1710 */
1129 ULONG64 SubProcessTag; /* 1720 */
1130 ULONG64 PerflibData; /* 1728 */
1131 ULONG64 EtwTraceData; /* 1730 */
1132 ULONG64 WinSockData; /* 1738 */
1133 ULONG GdiBatchCount; /* 1740 */
1134 ULONG IdealProcessorValue; /* 1744 */
1135 ULONG GuaranteedStackBytes; /* 1748 */
1136 ULONG64 ReservedForPerf; /* 1750 */
1137 ULONG64 ReservedForOle; /* 1758 */
1138 ULONG WaitingOnLoaderLock; /* 1760 */
1139 ULONG64 SavedPriorityState; /* 1768 */
1140 ULONG64 ReservedForCodeCoverage; /* 1770 */
1141 ULONG64 ThreadPoolData; /* 1778 */
1142 ULONG64 TlsExpansionSlots; /* 1780 */
1143 ULONG64 DeallocationBStore; /* 1788 */
1144 ULONG64 BStoreLimit; /* 1790 */
1145 ULONG MuiGeneration; /* 1798 */
1146 ULONG IsImpersonating; /* 179c */
1147 ULONG64 NlsCache; /* 17a0 */
1148 ULONG64 ShimData; /* 17a8 */
1149 ULONG HeapVirtualAffinity; /* 17b0 */
1150 ULONG64 CurrentTransactionHandle; /* 17b8 */
1151 ULONG64 ActiveFrame; /* 17c0 */
1152 ULONG64 FlsSlots; /* 17c8 */
1153 ULONG64 PreferredLanguages; /* 17d0 */
1154 ULONG64 UserPrefLanguages; /* 17d8 */
1155 ULONG64 MergedPrefLanguages; /* 17e0 */
1156 ULONG MuiImpersonation; /* 17e8 */
1157 USHORT CrossTebFlags; /* 17ec */
1158 USHORT SameTebFlags; /* 17ee */
1159 ULONG64 TxnScopeEnterCallback; /* 17f0 */
1160 ULONG64 TxnScopeExitCallback; /* 17f8 */
1161 ULONG64 TxnScopeContext; /* 1800 */
1162 ULONG LockCount; /* 1808 */
1163 LONG WowTebOffset; /* 180c */
1164 ULONG64 ResourceRetValue; /* 1810 */
1165 ULONG64 ReservedForWdf; /* 1818 */
1166 ULONGLONG ReservedForCrt; /* 1820 */
1167 GUID EffectiveContainerId; /* 1828 */
1168 } TEB64;
1170 C_ASSERT( sizeof(TEB64) == 0x1838 );
1172 #ifdef _WIN64
1173 C_ASSERT( sizeof(PEB) == sizeof(PEB64) );
1174 C_ASSERT( sizeof(TEB) == sizeof(TEB64) );
1175 #else
1176 C_ASSERT( sizeof(PEB) == sizeof(PEB32) );
1177 C_ASSERT( sizeof(TEB) == sizeof(TEB32) );
1178 #endif
1180 /* reserved TEB64 TLS slots for Wow64 */
1181 #define WOW64_TLS_CPURESERVED 1
1182 #define WOW64_TLS_TEMPLIST 3
1183 #define WOW64_TLS_USERCALLBACKDATA 5
1184 #define WOW64_TLS_APCLIST 7
1185 #define WOW64_TLS_FILESYSREDIR 8
1186 #define WOW64_TLS_WOW64INFO 10
1187 #define WOW64_TLS_MAX_NUMBER 19
1190 /***********************************************************************
1191 * Enums
1194 typedef enum _FILE_INFORMATION_CLASS {
1195 FileDirectoryInformation = 1,
1196 FileFullDirectoryInformation,
1197 FileBothDirectoryInformation,
1198 FileBasicInformation,
1199 FileStandardInformation,
1200 FileInternalInformation,
1201 FileEaInformation,
1202 FileAccessInformation,
1203 FileNameInformation,
1204 FileRenameInformation,
1205 FileLinkInformation,
1206 FileNamesInformation,
1207 FileDispositionInformation,
1208 FilePositionInformation,
1209 FileFullEaInformation,
1210 FileModeInformation,
1211 FileAlignmentInformation,
1212 FileAllInformation,
1213 FileAllocationInformation,
1214 FileEndOfFileInformation,
1215 FileAlternateNameInformation,
1216 FileStreamInformation,
1217 FilePipeInformation,
1218 FilePipeLocalInformation,
1219 FilePipeRemoteInformation,
1220 FileMailslotQueryInformation,
1221 FileMailslotSetInformation,
1222 FileCompressionInformation,
1223 FileObjectIdInformation,
1224 FileCompletionInformation,
1225 FileMoveClusterInformation,
1226 FileQuotaInformation,
1227 FileReparsePointInformation,
1228 FileNetworkOpenInformation,
1229 FileAttributeTagInformation,
1230 FileTrackingInformation,
1231 FileIdBothDirectoryInformation,
1232 FileIdFullDirectoryInformation,
1233 FileValidDataLengthInformation,
1234 FileShortNameInformation,
1235 FileIoCompletionNotificationInformation,
1236 FileIoStatusBlockRangeInformation,
1237 FileIoPriorityHintInformation,
1238 FileSfioReserveInformation,
1239 FileSfioVolumeInformation,
1240 FileHardLinkInformation,
1241 FileProcessIdsUsingFileInformation,
1242 FileNormalizedNameInformation,
1243 FileNetworkPhysicalNameInformation,
1244 FileIdGlobalTxDirectoryInformation,
1245 FileIsRemoteDeviceInformation,
1246 FileAttributeCacheInformation,
1247 FileNumaNodeInformation,
1248 FileStandardLinkInformation,
1249 FileRemoteProtocolInformation,
1250 FileRenameInformationBypassAccessCheck,
1251 FileLinkInformationBypassAccessCheck,
1252 FileVolumeNameInformation,
1253 FileIdInformation,
1254 FileIdExtdDirectoryInformation,
1255 FileReplaceCompletionInformation,
1256 FileHardLinkFullIdInformation,
1257 FileIdExtdBothDirectoryInformation,
1258 FileMaximumInformation
1259 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
1261 typedef struct _FILE_DIRECTORY_INFORMATION {
1262 ULONG NextEntryOffset;
1263 ULONG FileIndex;
1264 LARGE_INTEGER CreationTime;
1265 LARGE_INTEGER LastAccessTime;
1266 LARGE_INTEGER LastWriteTime;
1267 LARGE_INTEGER ChangeTime;
1268 LARGE_INTEGER EndOfFile;
1269 LARGE_INTEGER AllocationSize;
1270 ULONG FileAttributes;
1271 ULONG FileNameLength;
1272 WCHAR FileName[ANYSIZE_ARRAY];
1273 } FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
1275 typedef struct _FILE_FULL_DIRECTORY_INFORMATION {
1276 ULONG NextEntryOffset;
1277 ULONG FileIndex;
1278 LARGE_INTEGER CreationTime;
1279 LARGE_INTEGER LastAccessTime;
1280 LARGE_INTEGER LastWriteTime;
1281 LARGE_INTEGER ChangeTime;
1282 LARGE_INTEGER EndOfFile;
1283 LARGE_INTEGER AllocationSize;
1284 ULONG FileAttributes;
1285 ULONG FileNameLength;
1286 ULONG EaSize;
1287 WCHAR FileName[ANYSIZE_ARRAY];
1288 } FILE_FULL_DIRECTORY_INFORMATION, *PFILE_FULL_DIRECTORY_INFORMATION,
1289 FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION;
1291 typedef struct _FILE_ID_FULL_DIRECTORY_INFORMATION {
1292 ULONG NextEntryOffset;
1293 ULONG FileIndex;
1294 LARGE_INTEGER CreationTime;
1295 LARGE_INTEGER LastAccessTime;
1296 LARGE_INTEGER LastWriteTime;
1297 LARGE_INTEGER ChangeTime;
1298 LARGE_INTEGER EndOfFile;
1299 LARGE_INTEGER AllocationSize;
1300 ULONG FileAttributes;
1301 ULONG FileNameLength;
1302 ULONG EaSize;
1303 LARGE_INTEGER FileId;
1304 WCHAR FileName[ANYSIZE_ARRAY];
1305 } FILE_ID_FULL_DIRECTORY_INFORMATION, *PFILE_ID_FULL_DIRECTORY_INFORMATION;
1307 typedef struct _FILE_BOTH_DIRECTORY_INFORMATION {
1308 ULONG NextEntryOffset;
1309 ULONG FileIndex;
1310 LARGE_INTEGER CreationTime;
1311 LARGE_INTEGER LastAccessTime;
1312 LARGE_INTEGER LastWriteTime;
1313 LARGE_INTEGER ChangeTime;
1314 LARGE_INTEGER EndOfFile;
1315 LARGE_INTEGER AllocationSize;
1316 ULONG FileAttributes;
1317 ULONG FileNameLength;
1318 ULONG EaSize;
1319 CHAR ShortNameLength;
1320 WCHAR ShortName[12];
1321 WCHAR FileName[ANYSIZE_ARRAY];
1322 } FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION,
1323 FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
1325 typedef struct _FILE_ID_BOTH_DIRECTORY_INFORMATION {
1326 ULONG NextEntryOffset;
1327 ULONG FileIndex;
1328 LARGE_INTEGER CreationTime;
1329 LARGE_INTEGER LastAccessTime;
1330 LARGE_INTEGER LastWriteTime;
1331 LARGE_INTEGER ChangeTime;
1332 LARGE_INTEGER EndOfFile;
1333 LARGE_INTEGER AllocationSize;
1334 ULONG FileAttributes;
1335 ULONG FileNameLength;
1336 ULONG EaSize;
1337 CHAR ShortNameLength;
1338 WCHAR ShortName[12];
1339 LARGE_INTEGER FileId;
1340 WCHAR FileName[ANYSIZE_ARRAY];
1341 } FILE_ID_BOTH_DIRECTORY_INFORMATION, *PFILE_ID_BOTH_DIRECTORY_INFORMATION;
1343 typedef struct _FILE_ID_GLOBAL_TX_DIR_INFORMATION {
1344 ULONG NextEntryOffset;
1345 ULONG FileIndex;
1346 LARGE_INTEGER CreationTime;
1347 LARGE_INTEGER LastAccessTime;
1348 LARGE_INTEGER LastWriteTime;
1349 LARGE_INTEGER ChangeTime;
1350 LARGE_INTEGER EndOfFile;
1351 LARGE_INTEGER AllocationSize;
1352 ULONG FileAttributes;
1353 ULONG FileNameLength;
1354 LARGE_INTEGER FileId;
1355 GUID LockingTransactionId;
1356 ULONG TxInfoFlags;
1357 WCHAR FileName[ANYSIZE_ARRAY];
1358 } FILE_ID_GLOBAL_TX_DIR_INFORMATION, *PFILE_ID_GLOBAL_TX_DIR_INFORMATION;
1360 typedef struct _FILE_BASIC_INFORMATION {
1361 LARGE_INTEGER CreationTime;
1362 LARGE_INTEGER LastAccessTime;
1363 LARGE_INTEGER LastWriteTime;
1364 LARGE_INTEGER ChangeTime;
1365 ULONG FileAttributes;
1366 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
1368 typedef struct _FILE_STANDARD_INFORMATION {
1369 LARGE_INTEGER AllocationSize;
1370 LARGE_INTEGER EndOfFile;
1371 ULONG NumberOfLinks;
1372 BOOLEAN DeletePending;
1373 BOOLEAN Directory;
1374 } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
1376 typedef struct _FILE_INTERNAL_INFORMATION {
1377 LARGE_INTEGER IndexNumber;
1378 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
1380 typedef struct _FILE_ID_128 {
1381 UCHAR Identifier[16];
1382 } FILE_ID_128, *PFILE_ID_128;
1384 typedef struct _FILE_ID_INFORMATION {
1385 ULONGLONG VolumeSerialNumber;
1386 FILE_ID_128 FileId;
1387 } FILE_ID_INFORMATION, *PFILE_ID_INFORMATION;
1389 typedef struct _FILE_EA_INFORMATION {
1390 ULONG EaSize;
1391 } FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
1393 typedef struct _FILE_ACCESS_INFORMATION {
1394 ACCESS_MASK AccessFlags;
1395 } FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
1397 typedef struct _FILE_NAME_INFORMATION {
1398 ULONG FileNameLength;
1399 WCHAR FileName[1];
1400 } FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
1402 typedef struct _FILE_RENAME_INFORMATION {
1403 BOOLEAN ReplaceIfExists;
1404 HANDLE RootDirectory;
1405 ULONG FileNameLength;
1406 WCHAR FileName[1];
1407 } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
1409 typedef struct _FILE_LINK_INFORMATION {
1410 BOOLEAN ReplaceIfExists;
1411 HANDLE RootDirectory;
1412 ULONG FileNameLength;
1413 WCHAR FileName[1];
1414 } FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION;
1416 typedef struct _FILE_NAMES_INFORMATION {
1417 ULONG NextEntryOffset;
1418 ULONG FileIndex;
1419 ULONG FileNameLength;
1420 WCHAR FileName[1];
1421 } FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
1423 typedef struct _FILE_DISPOSITION_INFORMATION {
1424 BOOLEAN DoDeleteFile;
1425 } FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
1427 typedef struct _FILE_POSITION_INFORMATION {
1428 LARGE_INTEGER CurrentByteOffset;
1429 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
1431 typedef struct _FILE_ALIGNMENT_INFORMATION {
1432 ULONG AlignmentRequirement;
1433 } FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION;
1435 typedef struct _FILE_ALLOCATION_INFORMATION {
1436 LARGE_INTEGER AllocationSize;
1437 } FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
1439 typedef struct _FILE_END_OF_FILE_INFORMATION {
1440 LARGE_INTEGER EndOfFile;
1441 } FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
1443 typedef struct _FILE_NETWORK_OPEN_INFORMATION {
1444 LARGE_INTEGER CreationTime;
1445 LARGE_INTEGER LastAccessTime;
1446 LARGE_INTEGER LastWriteTime;
1447 LARGE_INTEGER ChangeTime;
1448 LARGE_INTEGER AllocationSize;
1449 LARGE_INTEGER EndOfFile;
1450 ULONG FileAttributes;
1451 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
1453 typedef struct _FILE_FULL_EA_INFORMATION {
1454 ULONG NextEntryOffset;
1455 UCHAR Flags;
1456 UCHAR EaNameLength;
1457 USHORT EaValueLength;
1458 CHAR EaName[1];
1459 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
1461 typedef struct _FILE_MODE_INFORMATION {
1462 ULONG Mode;
1463 } FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION;
1465 typedef struct _FILE_STREAM_INFORMATION
1467 ULONG NextEntryOffset;
1468 ULONG StreamNameLength;
1469 LARGE_INTEGER StreamSize;
1470 LARGE_INTEGER StreamAllocationSize;
1471 WCHAR StreamName[1];
1472 } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
1474 typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION
1476 ULONG FileAttributes;
1477 ULONG ReparseTag;
1478 } FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
1480 typedef struct _FILE_MAILSLOT_QUERY_INFORMATION {
1481 ULONG MaximumMessageSize;
1482 ULONG MailslotQuota;
1483 ULONG NextMessageSize;
1484 ULONG MessagesAvailable;
1485 LARGE_INTEGER ReadTimeout;
1486 } FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION;
1488 typedef struct _FILE_MAILSLOT_SET_INFORMATION {
1489 LARGE_INTEGER ReadTimeout;
1490 } FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
1492 typedef struct _FILE_PIPE_INFORMATION {
1493 ULONG ReadMode;
1494 ULONG CompletionMode;
1495 } FILE_PIPE_INFORMATION, *PFILE_PIPE_INFORMATION;
1497 typedef struct _FILE_PIPE_LOCAL_INFORMATION {
1498 ULONG NamedPipeType;
1499 ULONG NamedPipeConfiguration;
1500 ULONG MaximumInstances;
1501 ULONG CurrentInstances;
1502 ULONG InboundQuota;
1503 ULONG ReadDataAvailable;
1504 ULONG OutboundQuota;
1505 ULONG WriteQuotaAvailable;
1506 ULONG NamedPipeState;
1507 ULONG NamedPipeEnd;
1508 } FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
1510 #define FILE_PIPE_DISCONNECTED_STATE 0x00000001
1511 #define FILE_PIPE_LISTENING_STATE 0x00000002
1512 #define FILE_PIPE_CONNECTED_STATE 0x00000003
1513 #define FILE_PIPE_CLOSING_STATE 0x00000004
1515 typedef struct _FILE_OBJECTID_BUFFER
1517 BYTE ObjectId[16];
1518 union
1520 struct
1522 BYTE BirthVolumeId[16];
1523 BYTE BirthObjectId[16];
1524 BYTE DomainId[16];
1525 } DUMMYSTRUCTNAME;
1526 BYTE ExtendedInfo[48];
1527 } DUMMYUNIONNAME;
1528 } FILE_OBJECTID_BUFFER, *PFILE_OBJECTID_BUFFER;
1530 typedef struct _FILE_OBJECTID_INFORMATION {
1531 LONGLONG FileReference;
1532 UCHAR ObjectId[16];
1533 union {
1534 struct {
1535 UCHAR BirthVolumeId[16];
1536 UCHAR BirthObjectId[16];
1537 UCHAR DomainId[16];
1538 } DUMMYSTRUCTNAME;
1539 UCHAR ExtendedInfo[48];
1540 } DUMMYUNIONNAME;
1541 } FILE_OBJECTID_INFORMATION, *PFILE_OBJECTID_INFORMATION;
1543 typedef struct _FILE_QUOTA_INFORMATION {
1544 ULONG NextEntryOffset;
1545 ULONG SidLength;
1546 LARGE_INTEGER ChangeTime;
1547 LARGE_INTEGER QuotaUsed;
1548 LARGE_INTEGER QuotaThreshold;
1549 LARGE_INTEGER QuotaLimit;
1550 SID Sid;
1551 } FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION;
1553 typedef struct _FILE_REPARSE_POINT_INFORMATION {
1554 LONGLONG FileReference;
1555 ULONG Tag;
1556 } FILE_REPARSE_POINT_INFORMATION, *PFILE_REPARSE_POINT_INFORMATION;
1558 typedef struct _FILE_ALL_INFORMATION {
1559 FILE_BASIC_INFORMATION BasicInformation;
1560 FILE_STANDARD_INFORMATION StandardInformation;
1561 FILE_INTERNAL_INFORMATION InternalInformation;
1562 FILE_EA_INFORMATION EaInformation;
1563 FILE_ACCESS_INFORMATION AccessInformation;
1564 FILE_POSITION_INFORMATION PositionInformation;
1565 FILE_MODE_INFORMATION ModeInformation;
1566 FILE_ALIGNMENT_INFORMATION AlignmentInformation;
1567 FILE_NAME_INFORMATION NameInformation;
1568 } FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION;
1570 typedef struct _FILE_IO_COMPLETION_NOTIFICATION_INFORMATION {
1571 ULONG Flags;
1572 } FILE_IO_COMPLETION_NOTIFICATION_INFORMATION, *PFILE_IO_COMPLETION_NOTIFICATION_INFORMATION;
1574 #define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS 0x1
1575 #define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2
1576 #define FILE_SKIP_SET_USER_EVENT_ON_FAST_IO 0x4
1578 typedef struct _PROCESS_INSTRUMENTATION_CALLBACK_INFORMATION
1580 ULONG Version;
1581 ULONG Reserved;
1582 VOID *Callback;
1583 } PROCESS_INSTRUMENTATION_CALLBACK_INFORMATION, *PPROCESS_INSTRUMENTATION_CALLBACK_INFORMATION;
1585 typedef enum _FSINFOCLASS {
1586 FileFsVolumeInformation = 1,
1587 FileFsLabelInformation,
1588 FileFsSizeInformation,
1589 FileFsDeviceInformation,
1590 FileFsAttributeInformation,
1591 FileFsControlInformation,
1592 FileFsFullSizeInformation,
1593 FileFsObjectIdInformation,
1594 FileFsMaximumInformation
1595 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
1597 typedef enum _KEY_INFORMATION_CLASS {
1598 KeyBasicInformation,
1599 KeyNodeInformation,
1600 KeyFullInformation,
1601 KeyNameInformation,
1602 KeyCachedInformation,
1603 KeyFlagsInformation,
1604 KeyVirtualizationInformation,
1605 KeyHandleTagsInformation,
1606 MaxKeyInfoClass
1607 } KEY_INFORMATION_CLASS;
1609 typedef enum _KEY_VALUE_INFORMATION_CLASS {
1610 KeyValueBasicInformation,
1611 KeyValueFullInformation,
1612 KeyValuePartialInformation,
1613 KeyValueFullInformationAlign64,
1614 KeyValuePartialInformationAlign64
1615 } KEY_VALUE_INFORMATION_CLASS;
1617 typedef enum _OBJECT_INFORMATION_CLASS {
1618 ObjectBasicInformation,
1619 ObjectNameInformation,
1620 ObjectTypeInformation,
1621 ObjectTypesInformation,
1622 ObjectDataInformation
1623 } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
1625 typedef enum _PROCESSINFOCLASS {
1626 ProcessBasicInformation = 0,
1627 ProcessQuotaLimits = 1,
1628 ProcessIoCounters = 2,
1629 ProcessVmCounters = 3,
1630 ProcessTimes = 4,
1631 ProcessBasePriority = 5,
1632 ProcessRaisePriority = 6,
1633 ProcessDebugPort = 7,
1634 ProcessExceptionPort = 8,
1635 ProcessAccessToken = 9,
1636 ProcessLdtInformation = 10,
1637 ProcessLdtSize = 11,
1638 ProcessDefaultHardErrorMode = 12,
1639 ProcessIoPortHandlers = 13,
1640 ProcessPooledUsageAndLimits = 14,
1641 ProcessWorkingSetWatch = 15,
1642 ProcessUserModeIOPL = 16,
1643 ProcessEnableAlignmentFaultFixup = 17,
1644 ProcessPriorityClass = 18,
1645 ProcessWx86Information = 19,
1646 ProcessHandleCount = 20,
1647 ProcessAffinityMask = 21,
1648 ProcessPriorityBoost = 22,
1649 ProcessDeviceMap = 23,
1650 ProcessSessionInformation = 24,
1651 ProcessForegroundInformation = 25,
1652 ProcessWow64Information = 26,
1653 ProcessImageFileName = 27,
1654 ProcessLUIDDeviceMapsEnabled = 28,
1655 ProcessBreakOnTermination = 29,
1656 ProcessDebugObjectHandle = 30,
1657 ProcessDebugFlags = 31,
1658 ProcessHandleTracing = 32,
1659 ProcessIoPriority = 33,
1660 ProcessExecuteFlags = 34,
1661 ProcessTlsInformation = 35,
1662 ProcessCookie = 36,
1663 ProcessImageInformation = 37,
1664 ProcessCycleTime = 38,
1665 ProcessPagePriority = 39,
1666 ProcessInstrumentationCallback = 40,
1667 ProcessThreadStackAllocation = 41,
1668 ProcessWorkingSetWatchEx = 42,
1669 ProcessImageFileNameWin32 = 43,
1670 ProcessImageFileMapping = 44,
1671 ProcessAffinityUpdateMode = 45,
1672 ProcessMemoryAllocationMode = 46,
1673 ProcessGroupInformation = 47,
1674 ProcessTokenVirtualizationEnabled = 48,
1675 ProcessConsoleHostProcess = 49,
1676 ProcessWindowInformation = 50,
1677 ProcessHandleInformation = 51,
1678 ProcessHandleTable = 58,
1679 ProcessPowerThrottlingState = 77,
1680 ProcessLeapSecondInformation = 97,
1681 MaxProcessInfoClass,
1682 #ifdef __WINESRC__
1683 ProcessWineMakeProcessSystem = 1000,
1684 ProcessWineLdtCopy,
1685 #endif
1686 } PROCESSINFOCLASS;
1688 #define MEM_EXECUTE_OPTION_DISABLE 0x01
1689 #define MEM_EXECUTE_OPTION_ENABLE 0x02
1690 #define MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION 0x04
1691 #define MEM_EXECUTE_OPTION_PERMANENT 0x08
1693 typedef enum _SECTION_INHERIT {
1694 ViewShare = 1,
1695 ViewUnmap = 2
1696 } SECTION_INHERIT;
1698 typedef enum _SYSTEM_INFORMATION_CLASS {
1699 SystemBasicInformation = 0,
1700 SystemCpuInformation = 1,
1701 SystemPerformanceInformation = 2,
1702 SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
1703 SystemPathInformation = 4,
1704 SystemProcessInformation = 5,
1705 SystemCallCountInformation = 6,
1706 SystemDeviceInformation = 7,
1707 SystemProcessorPerformanceInformation = 8,
1708 SystemFlagsInformation = 9,
1709 SystemCallTimeInformation = 10,
1710 SystemModuleInformation = 11,
1711 SystemLocksInformation = 12,
1712 SystemStackTraceInformation = 13,
1713 SystemPagedPoolInformation = 14,
1714 SystemNonPagedPoolInformation = 15,
1715 SystemHandleInformation = 16,
1716 SystemObjectInformation = 17,
1717 SystemPageFileInformation = 18,
1718 SystemVdmInstemulInformation = 19,
1719 SystemVdmBopInformation = 20,
1720 SystemFileCacheInformation = 21,
1721 SystemPoolTagInformation = 22,
1722 SystemInterruptInformation = 23,
1723 SystemDpcBehaviorInformation = 24,
1724 SystemFullMemoryInformation = 25,
1725 SystemNotImplemented6 = 25,
1726 SystemLoadGdiDriverInformation = 26,
1727 SystemUnloadGdiDriverInformation = 27,
1728 SystemTimeAdjustmentInformation = 28,
1729 SystemTimeAdjustment = 28,
1730 SystemSummaryMemoryInformation = 29,
1731 SystemMirrorMemoryInformation = 30,
1732 SystemPerformanceTraceInformation = 31,
1733 SystemObsolete0 = 32,
1734 SystemExceptionInformation = 33,
1735 SystemCrashDumpStateInformation = 34,
1736 SystemKernelDebuggerInformation = 35,
1737 SystemContextSwitchInformation = 36,
1738 SystemRegistryQuotaInformation = 37,
1739 SystemExtendServiceTableInformation = 38,
1740 SystemPrioritySeparation = 39,
1741 SystemVerifierAddDriverInformation = 40,
1742 SystemVerifierRemoveDriverInformation = 41,
1743 SystemProcessorIdleInformation = 42,
1744 SystemLegacyDriverInformation = 43,
1745 SystemCurrentTimeZoneInformation = 44,
1746 SystemLookasideInformation = 45,
1747 SystemTimeSlipNotification = 46,
1748 SystemSessionCreate = 47,
1749 SystemSessionDetach = 48,
1750 SystemSessionInformation = 49,
1751 SystemRangeStartInformation = 50,
1752 SystemVerifierInformation = 51,
1753 SystemVerifierThunkExtend = 52,
1754 SystemSessionProcessesInformation = 53,
1755 SystemLoadGdiDriverInSystemSpace = 54,
1756 SystemNumaProcessorMap = 55,
1757 SystemPrefetcherInformation = 56,
1758 SystemExtendedProcessInformation = 57,
1759 SystemRecommendedSharedDataAlignment = 58,
1760 SystemComPlusPackage = 59,
1761 SystemNumaAvailableMemory = 60,
1762 SystemProcessorPowerInformation = 61,
1763 SystemEmulationBasicInformation = 62,
1764 SystemEmulationProcessorInformation = 63,
1765 SystemExtendedHandleInformation = 64,
1766 SystemLostDelayedWriteInformation = 65,
1767 SystemBigPoolInformation = 66,
1768 SystemSessionPoolTagInformation = 67,
1769 SystemSessionMappedViewInformation = 68,
1770 SystemHotpatchInformation = 69,
1771 SystemObjectSecurityMode = 70,
1772 SystemWatchdogTimerHandler = 71,
1773 SystemWatchdogTimerInformation = 72,
1774 SystemLogicalProcessorInformation = 73,
1775 SystemWow64SharedInformationObsolete = 74,
1776 SystemRegisterFirmwareTableInformationHandler = 75,
1777 SystemFirmwareTableInformation = 76,
1778 SystemModuleInformationEx = 77,
1779 SystemVerifierTriageInformation = 78,
1780 SystemSuperfetchInformation = 79,
1781 SystemMemoryListInformation = 80,
1782 SystemFileCacheInformationEx = 81,
1783 SystemThreadPriorityClientIdInformation = 82,
1784 SystemProcessorIdleCycleTimeInformation = 83,
1785 SystemVerifierCancellationInformation = 84,
1786 SystemProcessorPowerInformationEx = 85,
1787 SystemRefTraceInformation = 86,
1788 SystemSpecialPoolInformation = 87,
1789 SystemProcessIdInformation = 88,
1790 SystemErrorPortInformation = 89,
1791 SystemBootEnvironmentInformation = 90,
1792 SystemHypervisorInformation = 91,
1793 SystemVerifierInformationEx = 92,
1794 SystemTimeZoneInformation = 93,
1795 SystemImageFileExecutionOptionsInformation = 94,
1796 SystemCoverageInformation = 95,
1797 SystemPrefetchPatchInformation = 96,
1798 SystemVerifierFaultsInformation = 97,
1799 SystemSystemPartitionInformation = 98,
1800 SystemSystemDiskInformation = 99,
1801 SystemProcessorPerformanceDistribution = 100,
1802 SystemNumaProximityNodeInformation = 101,
1803 SystemDynamicTimeZoneInformation = 102,
1804 SystemCodeIntegrityInformation = 103,
1805 SystemProcessorMicrocodeUpdateInformation = 104,
1806 SystemProcessorBrandString = 105,
1807 SystemVirtualAddressInformation = 106,
1808 SystemLogicalProcessorInformationEx = 107,
1809 SystemProcessorCycleTimeInformation = 108,
1810 SystemStoreInformation = 109,
1811 SystemRegistryAppendString = 110,
1812 SystemAitSamplingValue = 111,
1813 SystemVhdBootInformation = 112,
1814 SystemCpuQuotaInformation = 113,
1815 SystemNativeBasicInformation = 114,
1816 SystemErrorPortTimeouts = 115,
1817 SystemLowPriorityIoInformation = 116,
1818 SystemTpmBootEntropyInformation = 117,
1819 SystemVerifierCountersInformation = 118,
1820 SystemPagedPoolInformationEx = 119,
1821 SystemSystemPtesInformationEx = 120,
1822 SystemNodeDistanceInformation = 121,
1823 SystemAcpiAuditInformation = 122,
1824 SystemBasicPerformanceInformation = 123,
1825 SystemQueryPerformanceCounterInformation = 124,
1826 SystemSessionBigPoolInformation = 125,
1827 SystemBootGraphicsInformation = 126,
1828 SystemScrubPhysicalMemoryInformation = 127,
1829 SystemBadPageInformation = 128,
1830 SystemProcessorProfileControlArea = 129,
1831 SystemCombinePhysicalMemoryInformation = 130,
1832 SystemEntropyInterruptTimingInformation = 131,
1833 SystemConsoleInformation = 132,
1834 SystemPlatformBinaryInformation = 133,
1835 SystemPolicyInformation = 134,
1836 SystemHypervisorProcessorCountInformation = 135,
1837 SystemDeviceDataInformation = 136,
1838 SystemDeviceDataEnumerationInformation = 137,
1839 SystemMemoryTopologyInformation = 138,
1840 SystemMemoryChannelInformation = 139,
1841 SystemBootLogoInformation = 140,
1842 SystemProcessorPerformanceInformationEx = 141,
1843 SystemCriticalProcessErrorLogInformation = 142,
1844 SystemSecureBootPolicyInformation = 143,
1845 SystemPageFileInformationEx = 144,
1846 SystemSecureBootInformation = 145,
1847 SystemEntropyInterruptTimingRawInformation = 146,
1848 SystemPortableWorkspaceEfiLauncherInformation = 147,
1849 SystemFullProcessInformation = 148,
1850 SystemKernelDebuggerInformationEx = 149,
1851 SystemBootMetadataInformation = 150,
1852 SystemSoftRebootInformation = 151,
1853 SystemElamCertificateInformation = 152,
1854 SystemOfflineDumpConfigInformation = 153,
1855 SystemProcessorFeaturesInformation = 154,
1856 SystemRegistryReconciliationInformation = 155,
1857 SystemEdidInformation = 156,
1858 SystemManufacturingInformation = 157,
1859 SystemEnergyEstimationConfigInformation = 158,
1860 SystemHypervisorDetailInformation = 159,
1861 SystemProcessorCycleStatsInformation = 160,
1862 SystemVmGenerationCountInformation = 161,
1863 SystemTrustedPlatformModuleInformation = 162,
1864 SystemKernelDebuggerFlags = 163,
1865 SystemCodeIntegrityPolicyInformation = 164,
1866 SystemIsolatedUserModeInformation = 165,
1867 SystemHardwareSecurityTestInterfaceResultsInformation = 166,
1868 SystemSingleModuleInformation = 167,
1869 SystemAllowedCpuSetsInformation = 168,
1870 SystemVsmProtectionInformation = 169,
1871 SystemInterruptCpuSetsInformation = 170,
1872 SystemSecureBootPolicyFullInformation = 171,
1873 SystemCodeIntegrityPolicyFullInformation = 172,
1874 SystemAffinitizedInterruptProcessorInformation = 173,
1875 SystemRootSiloInformation = 174,
1876 SystemCpuSetInformation = 175,
1877 SystemCpuSetTagInformation = 176,
1878 SystemWin32WerStartCallout = 177,
1879 SystemSecureKernelProfileInformation = 178,
1880 SystemCodeIntegrityPlatformManifestInformation = 179,
1881 SystemInterruptSteeringInformation = 180,
1882 SystemSupportedProcessorArchitectures = 181,
1883 SystemMemoryUsageInformation = 182,
1884 SystemCodeIntegrityCertificateInformation = 183,
1885 SystemPhysicalMemoryInformation = 184,
1886 SystemControlFlowTransition = 185,
1887 SystemKernelDebuggingAllowed = 186,
1888 SystemActivityModerationExeState = 187,
1889 SystemActivityModerationUserSettings = 188,
1890 SystemCodeIntegrityPoliciesFullInformation = 189,
1891 SystemCodeIntegrityUnlockInformation = 190,
1892 SystemIntegrityQuotaInformation = 191,
1893 SystemFlushInformation = 192,
1894 SystemProcessorIdleMaskInformation = 193,
1895 SystemSecureDumpEncryptionInformation = 194,
1896 SystemWriteConstraintInformation = 195,
1897 SystemKernelVaShadowInformation = 196,
1898 SystemHypervisorSharedPageInformation = 197,
1899 SystemFirmwareBootPerformanceInformation = 198,
1900 SystemCodeIntegrityVerificationInformation = 199,
1901 SystemFirmwarePartitionInformation = 200,
1902 SystemSpeculationControlInformation = 201,
1903 SystemDmaGuardPolicyInformation = 202,
1904 SystemEnclaveLaunchControlInformation = 203,
1905 SystemWorkloadAllowedCpuSetsInformation = 204,
1906 SystemCodeIntegrityUnlockModeInformation = 205,
1907 SystemLeapSecondInformation = 206,
1908 SystemFlags2Information = 207,
1909 SystemSecurityModelInformation = 208,
1910 SystemCodeIntegritySyntheticCacheInformation = 209,
1911 SystemFeatureConfigurationInformation = 210,
1912 SystemFeatureConfigurationSectionInformation = 211,
1913 SystemFeatureUsageSubscriptionInformation = 212,
1914 SystemSecureSpeculationControlInformation = 213,
1915 SystemSpacesBootInformation = 214,
1916 SystemFwRamdiskInformation = 215,
1917 SystemWheaIpmiHardwareInformation = 216,
1918 SystemDifSetRuleClassInformation = 217,
1919 SystemDifClearRuleClassInformation = 218,
1920 SystemDifApplyPluginVerificationOnDriver = 219,
1921 SystemDifRemovePluginVerificationOnDriver = 220,
1922 SystemShadowStackInformation = 221,
1923 SystemBuildVersionInformation = 222,
1924 #ifdef __WINESRC__
1925 SystemWineVersionInformation = 1000,
1926 #endif
1927 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
1929 typedef struct _SYSTEM_CODEINTEGRITY_INFORMATION
1931 ULONG Length;
1932 ULONG CodeIntegrityOptions;
1933 } SYSTEM_CODEINTEGRITY_INFORMATION, *PSYSTEM_CODEINTEGRITY_INFORMATION;
1935 #define CODEINTEGRITY_OPTION_ENABLED 0x0001
1936 #define CODEINTEGRITY_OPTION_TESTSIGN 0x0002
1937 #define CODEINTEGRITY_OPTION_UMCI_ENABLED 0x0004
1938 #define CODEINTEGRITY_OPTION_UMCI_AUDITMODE_ENABLED 0x0008
1939 #define CODEINTEGRITY_OPTION_UMCI_EXCLUSIONPATHS_ENABLED 0x0010
1940 #define CODEINTEGRITY_OPTION_TEST_BUILD 0x0020
1941 #define CODEINTEGRITY_OPTION_PREPRODUCTION_BUILD 0x0040
1942 #define CODEINTEGRITY_OPTION_DEBUGMODE_ENABLED 0x0080
1943 #define CODEINTEGRITY_OPTION_FLIGHT_BUILD 0x0100
1944 #define CODEINTEGRITY_OPTION_FLIGHTING_ENABLED 0x0200
1945 #define CODEINTEGRITY_OPTION_HVCI_KMCI_ENABLED 0x0400
1946 #define CODEINTEGRITY_OPTION_HVCI_KMCI_AUDITMODE_ENABLED 0x0800
1947 #define CODEINTEGRITY_OPTION_HVCI_KMCI_STRICTMODE_ENABLED 0x1000
1948 #define CODEINTEGRITY_OPTION_HVCI_IUM_ENABLED 0x2000
1950 typedef enum _THREADINFOCLASS {
1951 ThreadBasicInformation = 0,
1952 ThreadTimes,
1953 ThreadPriority,
1954 ThreadBasePriority,
1955 ThreadAffinityMask,
1956 ThreadImpersonationToken,
1957 ThreadDescriptorTableEntry,
1958 ThreadEnableAlignmentFaultFixup,
1959 ThreadEventPair_Reusable,
1960 ThreadQuerySetWin32StartAddress,
1961 ThreadZeroTlsCell,
1962 ThreadPerformanceCount,
1963 ThreadAmILastThread,
1964 ThreadIdealProcessor,
1965 ThreadPriorityBoost,
1966 ThreadSetTlsArrayAddress,
1967 ThreadIsIoPending,
1968 ThreadHideFromDebugger,
1969 ThreadBreakOnTermination,
1970 ThreadSwitchLegacyState,
1971 ThreadIsTerminated,
1972 ThreadLastSystemCall,
1973 ThreadIoPriority,
1974 ThreadCycleTime,
1975 ThreadPagePriority,
1976 ThreadActualBasePriority,
1977 ThreadTebInformation,
1978 ThreadCSwitchMon,
1979 ThreadCSwitchPmu,
1980 ThreadWow64Context,
1981 ThreadGroupInformation,
1982 ThreadUmsInformation,
1983 ThreadCounterProfiling,
1984 ThreadIdealProcessorEx,
1985 ThreadCpuAccountingInformation,
1986 ThreadSuspendCount,
1987 ThreadHeterogeneousCpuPolicy,
1988 ThreadContainerId,
1989 ThreadNameInformation,
1990 ThreadSelectedCpuSets,
1991 ThreadSystemThreadInformation,
1992 ThreadActualGroupAffinity,
1993 ThreadDynamicCodePolicyInfo,
1994 ThreadExplicitCaseSensitivity,
1995 ThreadWorkOnBehalfTicket,
1996 ThreadSubsystemInformation,
1997 ThreadDbgkWerReportActive,
1998 ThreadAttachContainer,
1999 ThreadManageWritesToExecutableMemory,
2000 ThreadPowerThrottlingState,
2001 ThreadWorkloadClass,
2002 MaxThreadInfoClass,
2003 #ifdef __WINESRC__
2004 ThreadWineNativeThreadName = 1000,
2005 #endif
2006 } THREADINFOCLASS;
2008 typedef struct _THREAD_BASIC_INFORMATION
2010 NTSTATUS ExitStatus;
2011 PVOID TebBaseAddress;
2012 CLIENT_ID ClientId;
2013 ULONG_PTR AffinityMask;
2014 LONG Priority;
2015 LONG BasePriority;
2016 } THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
2018 typedef struct _THREAD_DESCRIPTOR_INFORMATION
2020 DWORD Selector;
2021 LDT_ENTRY Entry;
2022 } THREAD_DESCRIPTOR_INFORMATION, *PTHREAD_DESCRIPTOR_INFORMATION;
2024 typedef struct _THREAD_NAME_INFORMATION
2026 UNICODE_STRING ThreadName;
2027 } THREAD_NAME_INFORMATION, *PTHREAD_NAME_INFORMATION;
2029 typedef struct _KERNEL_USER_TIMES {
2030 LARGE_INTEGER CreateTime;
2031 LARGE_INTEGER ExitTime;
2032 LARGE_INTEGER KernelTime;
2033 LARGE_INTEGER UserTime;
2034 } KERNEL_USER_TIMES, *PKERNEL_USER_TIMES;
2036 typedef enum _WINSTATIONINFOCLASS {
2037 WinStationInformation = 8
2038 } WINSTATIONINFOCLASS;
2040 typedef enum _MEMORY_INFORMATION_CLASS {
2041 MemoryBasicInformation,
2042 MemoryWorkingSetInformation,
2043 MemoryMappedFilenameInformation,
2044 MemoryRegionInformation,
2045 MemoryWorkingSetExInformation,
2046 MemorySharedCommitInformation,
2047 MemoryImageInformation,
2048 MemoryRegionInformationEx,
2049 MemoryPrivilegedBasicInformation,
2050 MemoryEnclaveImageInformation,
2051 MemoryBasicInformationCapped,
2052 MemoryPhysicalContiguityInformation,
2053 #ifdef __WINESRC__
2054 MemoryWineUnixFuncs = 1000,
2055 MemoryWineUnixWow64Funcs,
2056 #endif
2057 } MEMORY_INFORMATION_CLASS;
2059 typedef struct _MEMORY_SECTION_NAME
2061 UNICODE_STRING SectionFileName;
2062 } MEMORY_SECTION_NAME, *PMEMORY_SECTION_NAME;
2064 typedef union _MEMORY_WORKING_SET_EX_BLOCK {
2065 ULONG_PTR Flags;
2066 struct {
2067 ULONG_PTR Valid : 1;
2068 ULONG_PTR ShareCount : 3;
2069 ULONG_PTR Win32Protection : 11;
2070 ULONG_PTR Shared : 1;
2071 ULONG_PTR Node : 6;
2072 ULONG_PTR Locked : 1;
2073 ULONG_PTR LargePage : 1;
2074 } DUMMYSTRUCTNAME;
2075 } MEMORY_WORKING_SET_EX_BLOCK, *PMEMORY_WORKING_SET_EX_BLOCK;
2077 typedef struct _MEMORY_WORKING_SET_EX_INFORMATION {
2078 PVOID VirtualAddress;
2079 MEMORY_WORKING_SET_EX_BLOCK VirtualAttributes;
2080 } MEMORY_WORKING_SET_EX_INFORMATION, *PMEMORY_WORKING_SET_EX_INFORMATION;
2082 typedef struct _MEMORY_REGION_INFORMATION
2084 PVOID AllocationBase;
2085 ULONG AllocationProtect;
2086 union
2088 ULONG RegionType;
2089 struct
2091 ULONG Private : 1;
2092 ULONG MappedDataFile : 1;
2093 ULONG MappedImage : 1;
2094 ULONG MappedPageFile : 1;
2095 ULONG MappedPhysical : 1;
2096 ULONG DirectMapped : 1;
2097 ULONG Reserved : 26;
2098 } DUMMYSTRUCTNAME;
2099 } DUMMYUNIONNAME;
2100 SIZE_T RegionSize;
2101 SIZE_T CommitSize;
2102 ULONG_PTR PartitionId;
2103 ULONG_PTR NodePreference;
2104 } MEMORY_REGION_INFORMATION, *PMEMORY_REGION_INFORMATION;
2106 typedef enum _MUTANT_INFORMATION_CLASS
2108 MutantBasicInformation
2109 } MUTANT_INFORMATION_CLASS, *PMUTANT_INFORMATION_CLASS;
2111 typedef struct _MUTANT_BASIC_INFORMATION {
2112 LONG CurrentCount;
2113 BOOLEAN OwnedByCaller;
2114 BOOLEAN AbandonedState;
2115 } MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION;
2117 typedef enum _TIMER_INFORMATION_CLASS
2119 TimerBasicInformation = 0
2120 } TIMER_INFORMATION_CLASS;
2122 typedef struct _TIMER_BASIC_INFORMATION
2124 LARGE_INTEGER RemainingTime;
2125 BOOLEAN TimerState;
2126 } TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION;
2128 typedef enum
2130 VmPrefetchInformation,
2131 VmPagePriorityInformation,
2132 VmCfgCallTargetInformation
2133 } VIRTUAL_MEMORY_INFORMATION_CLASS, *PVIRTUAL_MEMORY_INFORMATION_CLASS;
2135 typedef struct _MEMORY_RANGE_ENTRY
2137 PVOID VirtualAddress;
2138 SIZE_T NumberOfBytes;
2139 } MEMORY_RANGE_ENTRY, *PMEMORY_RANGE_ENTRY;
2142 /* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
2143 typedef enum
2145 INVALID_PATH = 0,
2146 UNC_PATH, /* "//foo" */
2147 ABSOLUTE_DRIVE_PATH, /* "c:/foo" */
2148 RELATIVE_DRIVE_PATH, /* "c:foo" */
2149 ABSOLUTE_PATH, /* "/foo" */
2150 RELATIVE_PATH, /* "foo" */
2151 DEVICE_PATH, /* "//./foo" */
2152 UNC_DOT_PATH /* "//." */
2153 } DOS_PATHNAME_TYPE;
2156 /***********************************************************************
2157 * Types and data structures
2160 /* This is used by NtQuerySystemInformation */
2161 typedef struct _SYSTEM_THREAD_INFORMATION
2162 { /* win32/win64 */
2163 LARGE_INTEGER KernelTime; /* 00/00 */
2164 LARGE_INTEGER UserTime; /* 08/08 */
2165 LARGE_INTEGER CreateTime; /* 10/10 */
2166 DWORD dwTickCount; /* 18/18 */
2167 LPVOID StartAddress; /* 1c/20 */
2168 CLIENT_ID ClientId; /* 20/28 */
2169 DWORD dwCurrentPriority; /* 28/38 */
2170 DWORD dwBasePriority; /* 2c/3c */
2171 DWORD dwContextSwitches; /* 30/40 */
2172 DWORD dwThreadState; /* 34/44 */
2173 DWORD dwWaitReason; /* 38/48 */
2174 DWORD dwUnknown; /* 3c/4c */
2175 } SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION;
2177 typedef struct _SYSTEM_EXTENDED_THREAD_INFORMATION
2179 SYSTEM_THREAD_INFORMATION ThreadInfo; /* 00/00 */
2180 void *StackBase; /* 40/50 */
2181 void *StackLimit; /* 44/58 */
2182 void *Win32StartAddress; /* 48/60 */
2183 void *TebBase; /* 4c/68 */
2184 ULONG_PTR Reserved2; /* 50/70 */
2185 ULONG_PTR Reserved3; /* 54/78 */
2186 ULONG_PTR Reserved4; /* 58/80 */
2187 } SYSTEM_EXTENDED_THREAD_INFORMATION, *PSYSTEM_EXTENDED_THREAD_INFORMATION;
2189 typedef struct _IO_STATUS_BLOCK {
2190 union {
2191 NTSTATUS Status;
2192 PVOID Pointer;
2193 } DUMMYUNIONNAME;
2195 ULONG_PTR Information;
2196 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
2198 typedef void (WINAPI * PIO_APC_ROUTINE)(PVOID,PIO_STATUS_BLOCK,ULONG);
2200 typedef struct _KEY_BASIC_INFORMATION {
2201 LARGE_INTEGER LastWriteTime;
2202 ULONG TitleIndex;
2203 ULONG NameLength;
2204 WCHAR Name[1];
2205 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
2207 typedef struct _KEY_NODE_INFORMATION
2209 LARGE_INTEGER LastWriteTime;
2210 ULONG TitleIndex;
2211 ULONG ClassOffset;
2212 ULONG ClassLength;
2213 ULONG NameLength;
2214 WCHAR Name[1];
2215 /* Class[1]; */
2216 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
2218 typedef struct _KEY_FULL_INFORMATION
2220 LARGE_INTEGER LastWriteTime;
2221 ULONG TitleIndex;
2222 ULONG ClassOffset;
2223 ULONG ClassLength;
2224 ULONG SubKeys;
2225 ULONG MaxNameLen;
2226 ULONG MaxClassLen;
2227 ULONG Values;
2228 ULONG MaxValueNameLen;
2229 ULONG MaxValueDataLen;
2230 WCHAR Class[1];
2231 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
2233 typedef struct _KEY_NAME_INFORMATION {
2234 ULONG NameLength;
2235 WCHAR Name[1];
2236 } KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION;
2238 typedef struct _KEY_CACHED_INFORMATION
2240 LARGE_INTEGER LastWriteTime;
2241 ULONG TitleIndex;
2242 ULONG SubKeys;
2243 ULONG MaxNameLen;
2244 ULONG Values;
2245 ULONG MaxValueNameLen;
2246 ULONG MaxValueDataLen;
2247 ULONG NameLength;
2248 } KEY_CACHED_INFORMATION, *PKEY_CACHED_INFORMATION;
2250 typedef struct _KEY_VALUE_ENTRY
2252 PUNICODE_STRING ValueName;
2253 ULONG DataLength;
2254 ULONG DataOffset;
2255 ULONG Type;
2256 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
2258 typedef struct _KEY_VALUE_BASIC_INFORMATION {
2259 ULONG TitleIndex;
2260 ULONG Type;
2261 ULONG NameLength;
2262 WCHAR Name[1];
2263 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
2265 typedef struct _KEY_VALUE_FULL_INFORMATION {
2266 ULONG TitleIndex;
2267 ULONG Type;
2268 ULONG DataOffset;
2269 ULONG DataLength;
2270 ULONG NameLength;
2271 WCHAR Name[1];
2272 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
2274 typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
2275 ULONG TitleIndex;
2276 ULONG Type;
2277 ULONG DataLength;
2278 UCHAR Data[1];
2279 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
2281 #ifndef __OBJECT_ATTRIBUTES_DEFINED__
2282 #define __OBJECT_ATTRIBUTES_DEFINED__
2283 typedef struct _OBJECT_ATTRIBUTES {
2284 ULONG Length;
2285 HANDLE RootDirectory;
2286 PUNICODE_STRING ObjectName;
2287 ULONG Attributes;
2288 PVOID SecurityDescriptor; /* type SECURITY_DESCRIPTOR */
2289 PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
2290 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
2291 #endif
2293 typedef struct _OBJECT_DATA_INFORMATION {
2294 BOOLEAN InheritHandle;
2295 BOOLEAN ProtectFromClose;
2296 } OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION;
2298 typedef struct _OBJECT_BASIC_INFORMATION {
2299 ULONG Attributes;
2300 ACCESS_MASK GrantedAccess;
2301 ULONG HandleCount;
2302 ULONG PointerCount;
2303 ULONG PagedPoolUsage;
2304 ULONG NonPagedPoolUsage;
2305 ULONG Reserved[3];
2306 ULONG NameInformationLength;
2307 ULONG TypeInformationLength;
2308 ULONG SecurityDescriptorLength;
2309 LARGE_INTEGER CreateTime;
2310 } OBJECT_BASIC_INFORMATION, *POBJECT_BASIC_INFORMATION;
2312 typedef struct _OBJECT_NAME_INFORMATION {
2313 UNICODE_STRING Name;
2314 } OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;
2316 typedef struct __OBJECT_TYPE_INFORMATION {
2317 UNICODE_STRING TypeName;
2318 ULONG TotalNumberOfObjects;
2319 ULONG TotalNumberOfHandles;
2320 ULONG TotalPagedPoolUsage;
2321 ULONG TotalNonPagedPoolUsage;
2322 ULONG TotalNamePoolUsage;
2323 ULONG TotalHandleTableUsage;
2324 ULONG HighWaterNumberOfObjects;
2325 ULONG HighWaterNumberOfHandles;
2326 ULONG HighWaterPagedPoolUsage;
2327 ULONG HighWaterNonPagedPoolUsage;
2328 ULONG HighWaterNamePoolUsage;
2329 ULONG HighWaterHandleTableUsage;
2330 ULONG InvalidAttributes;
2331 GENERIC_MAPPING GenericMapping;
2332 ULONG ValidAccessMask;
2333 BOOLEAN SecurityRequired;
2334 BOOLEAN MaintainHandleCount;
2335 UCHAR TypeIndex;
2336 CHAR ReservedByte;
2337 ULONG PoolType;
2338 ULONG DefaultPagedPoolCharge;
2339 ULONG DefaultNonPagedPoolCharge;
2340 } OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION;
2342 typedef struct _OBJECT_TYPES_INFORMATION
2344 ULONG NumberOfTypes;
2345 } OBJECT_TYPES_INFORMATION, *POBJECT_TYPES_INFORMATION;
2347 typedef struct _PROCESS_BASIC_INFORMATION {
2348 #ifdef __WINESRC__
2349 NTSTATUS ExitStatus;
2350 PEB *PebBaseAddress;
2351 ULONG_PTR AffinityMask;
2352 LONG BasePriority;
2353 ULONG_PTR UniqueProcessId;
2354 ULONG_PTR InheritedFromUniqueProcessId;
2355 #else
2356 PVOID Reserved1;
2357 PPEB PebBaseAddress;
2358 PVOID Reserved2[2];
2359 ULONG_PTR UniqueProcessId;
2360 PVOID Reserved3;
2361 #endif
2362 } PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION;
2364 #define PROCESS_PRIOCLASS_IDLE 1
2365 #define PROCESS_PRIOCLASS_NORMAL 2
2366 #define PROCESS_PRIOCLASS_HIGH 3
2367 #define PROCESS_PRIOCLASS_REALTIME 4
2368 #define PROCESS_PRIOCLASS_BELOW_NORMAL 5
2369 #define PROCESS_PRIOCLASS_ABOVE_NORMAL 6
2371 typedef struct _PROCESS_PRIORITY_CLASS {
2372 BOOLEAN Foreground;
2373 UCHAR PriorityClass;
2374 } PROCESS_PRIORITY_CLASS, *PPROCESS_PRIORITY_CLASS;
2376 typedef struct _PROCESS_CYCLE_TIME_INFORMATION {
2377 ULONGLONG AccumulatedCycles;
2378 ULONGLONG CurrentCycleCount;
2379 } PROCESS_CYCLE_TIME_INFORMATION, *PPROCESS_CYCLE_TIME_INFORMATION;
2381 typedef struct _PROCESS_STACK_ALLOCATION_INFORMATION
2383 SIZE_T ReserveSize;
2384 SIZE_T ZeroBits;
2385 PVOID StackBase;
2386 } PROCESS_STACK_ALLOCATION_INFORMATION, *PPROCESS_STACK_ALLOCATION_INFORMATION;
2388 typedef struct _PROCESS_STACK_ALLOCATION_INFORMATION_EX
2390 ULONG PreferredNode;
2391 ULONG Reserved0;
2392 ULONG Reserved1;
2393 ULONG Reserved2;
2394 PROCESS_STACK_ALLOCATION_INFORMATION AllocInfo;
2395 } PROCESS_STACK_ALLOCATION_INFORMATION_EX, *PPROCESS_STACK_ALLOCATION_INFORMATION_EX;
2397 typedef struct _RTL_HEAP_DEFINITION {
2398 ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
2400 ULONG Unknown[11];
2401 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
2403 typedef struct _RTL_RWLOCK {
2404 RTL_CRITICAL_SECTION rtlCS;
2406 HANDLE hSharedReleaseSemaphore;
2407 UINT uSharedWaiters;
2409 HANDLE hExclusiveReleaseSemaphore;
2410 UINT uExclusiveWaiters;
2412 INT iNumberActive;
2413 HANDLE hOwningThreadId;
2414 DWORD dwTimeoutBoost;
2415 PVOID pDebugInfo;
2416 } RTL_RWLOCK, *LPRTL_RWLOCK;
2418 /* System Information Class 0x00 */
2420 typedef struct _SYSTEM_BASIC_INFORMATION {
2421 #ifdef __WINESRC__
2422 DWORD unknown;
2423 ULONG KeMaximumIncrement;
2424 ULONG PageSize;
2425 ULONG MmNumberOfPhysicalPages;
2426 ULONG MmLowestPhysicalPage;
2427 ULONG MmHighestPhysicalPage;
2428 ULONG_PTR AllocationGranularity;
2429 PVOID LowestUserAddress;
2430 PVOID HighestUserAddress;
2431 ULONG_PTR ActiveProcessorsAffinityMask;
2432 BYTE NumberOfProcessors;
2433 #else
2434 BYTE Reserved1[24];
2435 PVOID Reserved2[4];
2436 CCHAR NumberOfProcessors;
2437 #endif
2438 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
2440 /* System Information Class 0x01 */
2442 typedef struct _SYSTEM_CPU_INFORMATION {
2443 USHORT ProcessorArchitecture;
2444 USHORT ProcessorLevel;
2445 USHORT ProcessorRevision;
2446 USHORT MaximumProcessors;
2447 ULONG ProcessorFeatureBits;
2448 } SYSTEM_CPU_INFORMATION, *PSYSTEM_CPU_INFORMATION;
2450 /* definitions of bits in the Feature set for the x86 processors */
2451 #define CPU_FEATURE_VME 0x00000005 /* Virtual 86 Mode Extensions */
2452 #define CPU_FEATURE_TSC 0x00000002 /* Time Stamp Counter available */
2453 #define CPU_FEATURE_CMOV 0x00000008 /* Conditional Move instruction*/
2454 #define CPU_FEATURE_PGE 0x00000014 /* Page table Entry Global bit */
2455 #define CPU_FEATURE_PSE 0x00000024 /* Page Size Extension */
2456 #define CPU_FEATURE_MTRR 0x00000040 /* Memory Type Range Registers */
2457 #define CPU_FEATURE_CX8 0x00000080 /* Compare and eXchange 8 byte instr. */
2458 #define CPU_FEATURE_MMX 0x00000100 /* Multi Media eXtensions */
2459 #define CPU_FEATURE_X86 0x00000200 /* seems to be always ON, on the '86 */
2460 #define CPU_FEATURE_PAT 0x00000400 /* Page Attribute Table */
2461 #define CPU_FEATURE_FXSR 0x00000800 /* FXSAVE and FXSTORE instructions */
2462 #define CPU_FEATURE_SEP 0x00001000 /* SYSENTER and SYSEXIT instructions */
2463 #define CPU_FEATURE_SSE 0x00002000 /* SSE extensions (ext. MMX) */
2464 #define CPU_FEATURE_3DNOW 0x00004000 /* 3DNOW instructions available */
2465 #define CPU_FEATURE_SSE2 0x00010000 /* SSE2 extensions (XMMI64) */
2466 #define CPU_FEATURE_DS 0x00020000 /* Debug Store */
2467 #define CPU_FEATURE_HTT 0x00040000 /* Hyper Threading Technology */
2468 #define CPU_FEATURE_SSE3 0x00080000 /* SSE3 extensions */
2469 #define CPU_FEATURE_CX128 0x00100000 /* cmpxchg16b instruction */
2470 #define CPU_FEATURE_XSAVE 0x00800000 /* XSAVE instructions */
2471 #define CPU_FEATURE_2NDLEV 0x04000000 /* Second-level address translation */
2472 #define CPU_FEATURE_VIRT 0x08000000 /* Virtualization support */
2473 #define CPU_FEATURE_RDFS 0x10000000 /* RDFSBASE etc. instructions */
2474 #define CPU_FEATURE_NX 0x20000000 /* Data execution prevention */
2476 /* FIXME: following values are made up, actual flags are unknown */
2477 #define CPU_FEATURE_SSSE3 0x00008000 /* SSSE3 instructions */
2478 #define CPU_FEATURE_SSE41 0x01000000 /* SSE41 instructions */
2479 #define CPU_FEATURE_SSE42 0x02000000 /* SSE42 instructions */
2480 #define CPU_FEATURE_AVX 0x40000000 /* AVX instructions */
2481 #define CPU_FEATURE_AVX2 0x80000000 /* AVX2 instructions */
2482 #define CPU_FEATURE_PAE 0x00200000
2483 #define CPU_FEATURE_DAZ 0x00400000
2485 #define CPU_FEATURE_ARM_VFP_32 0x00000001
2486 #define CPU_FEATURE_ARM_NEON 0x00000002
2487 #define CPU_FEATURE_ARM_V8_CRC32 0x00000004
2488 #define CPU_FEATURE_ARM_V8_CRYPTO 0x00000008
2490 typedef struct _SYSTEM_PROCESSOR_FEATURES_INFORMATION
2492 ULONGLONG ProcessorFeatureBits;
2493 ULONGLONG Reserved[3];
2494 } SYSTEM_PROCESSOR_FEATURES_INFORMATION, *PSYSTEM_PROCESSOR_FEATURES_INFORMATION;
2496 /* System Information Class 0x02 */
2498 /* Documented in "Windows NT/2000 Native API Reference" by Gary Nebbett. */
2499 typedef struct _SYSTEM_PERFORMANCE_INFORMATION {
2500 LARGE_INTEGER IdleTime;
2501 LARGE_INTEGER ReadTransferCount;
2502 LARGE_INTEGER WriteTransferCount;
2503 LARGE_INTEGER OtherTransferCount;
2504 ULONG ReadOperationCount;
2505 ULONG WriteOperationCount;
2506 ULONG OtherOperationCount;
2507 ULONG AvailablePages;
2508 ULONG TotalCommittedPages;
2509 ULONG TotalCommitLimit;
2510 ULONG PeakCommitment;
2511 ULONG PageFaults;
2512 ULONG WriteCopyFaults;
2513 ULONG TransitionFaults;
2514 ULONG Reserved1;
2515 ULONG DemandZeroFaults;
2516 ULONG PagesRead;
2517 ULONG PageReadIos;
2518 ULONG Reserved2[2];
2519 ULONG PagefilePagesWritten;
2520 ULONG PagefilePageWriteIos;
2521 ULONG MappedFilePagesWritten;
2522 ULONG MappedFilePageWriteIos;
2523 ULONG PagedPoolUsage;
2524 ULONG NonPagedPoolUsage;
2525 ULONG PagedPoolAllocs;
2526 ULONG PagedPoolFrees;
2527 ULONG NonPagedPoolAllocs;
2528 ULONG NonPagedPoolFrees;
2529 ULONG TotalFreeSystemPtes;
2530 ULONG SystemCodePage;
2531 ULONG TotalSystemDriverPages;
2532 ULONG TotalSystemCodePages;
2533 ULONG SmallNonPagedLookasideListAllocateHits;
2534 ULONG SmallPagedLookasideListAllocateHits;
2535 ULONG Reserved3;
2536 ULONG MmSystemCachePage;
2537 ULONG PagedPoolPage;
2538 ULONG SystemDriverPage;
2539 ULONG FastReadNoWait;
2540 ULONG FastReadWait;
2541 ULONG FastReadResourceMiss;
2542 ULONG FastReadNotPossible;
2543 ULONG FastMdlReadNoWait;
2544 ULONG FastMdlReadWait;
2545 ULONG FastMdlReadResourceMiss;
2546 ULONG FastMdlReadNotPossible;
2547 ULONG MapDataNoWait;
2548 ULONG MapDataWait;
2549 ULONG MapDataNoWaitMiss;
2550 ULONG MapDataWaitMiss;
2551 ULONG PinMappedDataCount;
2552 ULONG PinReadNoWait;
2553 ULONG PinReadWait;
2554 ULONG PinReadNoWaitMiss;
2555 ULONG PinReadWaitMiss;
2556 ULONG CopyReadNoWait;
2557 ULONG CopyReadWait;
2558 ULONG CopyReadNoWaitMiss;
2559 ULONG CopyReadWaitMiss;
2560 ULONG MdlReadNoWait;
2561 ULONG MdlReadWait;
2562 ULONG MdlReadNoWaitMiss;
2563 ULONG MdlReadWaitMiss;
2564 ULONG ReadAheadIos;
2565 ULONG LazyWriteIos;
2566 ULONG LazyWritePages;
2567 ULONG DataFlushes;
2568 ULONG DataPages;
2569 ULONG ContextSwitches;
2570 ULONG FirstLevelTbFills;
2571 ULONG SecondLevelTbFills;
2572 ULONG SystemCalls;
2573 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
2575 /* System Information Class 0x03 */
2577 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
2578 #ifdef __WINESRC__
2579 LARGE_INTEGER BootTime;
2580 LARGE_INTEGER SystemTime;
2581 LARGE_INTEGER TimeZoneBias;
2582 ULONG TimeZoneId;
2583 ULONG Reserved;
2584 ULONGLONG BootTimeBias;
2585 ULONGLONG SleepTimeBias;
2586 #else
2587 BYTE Reserved1[48];
2588 #endif
2589 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; /* was SYSTEM_TIME_INFORMATION */
2591 /* System Information Class 0x08 */
2593 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
2594 LARGE_INTEGER IdleTime;
2595 LARGE_INTEGER KernelTime;
2596 LARGE_INTEGER UserTime;
2597 LARGE_INTEGER Reserved1[2];
2598 ULONG Reserved2;
2599 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
2601 /* System Information Class 0x0b */
2603 typedef struct _SYSTEM_DRIVER_INFORMATION {
2604 PVOID pvAddress;
2605 DWORD dwUnknown1;
2606 DWORD dwUnknown2;
2607 DWORD dwEntryIndex;
2608 DWORD dwUnknown3;
2609 char szName[MAX_PATH + 1];
2610 } SYSTEM_DRIVER_INFORMATION, *PSYSTEM_DRIVER_INFORMATION;
2612 /* System Information Class 0x10 */
2614 typedef struct _SYSTEM_HANDLE_ENTRY {
2615 ULONG OwnerPid;
2616 BYTE ObjectType;
2617 BYTE HandleFlags;
2618 USHORT HandleValue;
2619 PVOID ObjectPointer;
2620 ULONG AccessMask;
2621 } SYSTEM_HANDLE_ENTRY, *PSYSTEM_HANDLE_ENTRY;
2623 typedef struct _SYSTEM_HANDLE_INFORMATION {
2624 ULONG Count;
2625 SYSTEM_HANDLE_ENTRY Handle[1];
2626 } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
2628 typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX
2630 void *Object;
2631 ULONG_PTR UniqueProcessId;
2632 ULONG_PTR HandleValue;
2633 ULONG GrantedAccess;
2634 USHORT CreatorBackTraceIndex;
2635 USHORT ObjectTypeIndex;
2636 ULONG HandleAttributes;
2637 ULONG Reserved;
2638 } SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX;
2640 typedef struct _SYSTEM_HANDLE_INFORMATION_EX
2642 ULONG_PTR NumberOfHandles;
2643 ULONG_PTR Reserved;
2644 SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX Handles[1];
2645 } SYSTEM_HANDLE_INFORMATION_EX;
2647 /* System Information Class 0x15 */
2649 typedef struct _SYSTEM_CACHE_INFORMATION {
2650 SIZE_T CurrentSize;
2651 SIZE_T PeakSize;
2652 ULONG PageFaultCount;
2653 SIZE_T MinimumWorkingSet;
2654 SIZE_T MaximumWorkingSet;
2655 SIZE_T CurrentSizeIncludingTransitionInPages;
2656 SIZE_T PeakSizeIncludingTransitionInPages;
2657 ULONG TransitionRePurposeCount;
2658 ULONG Flags;
2659 } SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION;
2661 /* System Information Class 0x17 */
2663 typedef struct _SYSTEM_INTERRUPT_INFORMATION {
2664 ULONG ContextSwitches;
2665 ULONG DpcCount;
2666 ULONG DpcRate;
2667 ULONG TimeIncrement;
2668 ULONG DpcBypassCount;
2669 ULONG ApcBypassCount;
2670 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
2672 typedef struct _SYSTEM_CONFIGURATION_INFO {
2673 union {
2674 ULONG OemId;
2675 struct {
2676 WORD ProcessorArchitecture;
2677 WORD Reserved;
2678 } tag1;
2679 } tag2;
2680 ULONG PageSize;
2681 PVOID MinimumApplicationAddress;
2682 PVOID MaximumApplicationAddress;
2683 ULONG ActiveProcessorMask;
2684 ULONG NumberOfProcessors;
2685 ULONG ProcessorType;
2686 ULONG AllocationGranularity;
2687 WORD ProcessorLevel;
2688 WORD ProcessorRevision;
2689 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
2691 typedef struct _SYSTEM_EXCEPTION_INFORMATION {
2692 BYTE Reserved1[16];
2693 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
2695 typedef struct _SYSTEM_LOOKASIDE_INFORMATION {
2696 BYTE Reserved1[32];
2697 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
2699 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION {
2700 BOOLEAN DebuggerEnabled;
2701 BOOLEAN DebuggerNotPresent;
2702 } SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
2704 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION_EX {
2705 BOOLEAN DebuggerAllowed;
2706 BOOLEAN DebuggerEnabled;
2707 BOOLEAN DebuggerPresent;
2708 } SYSTEM_KERNEL_DEBUGGER_INFORMATION_EX, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION_EX;
2710 typedef struct _VM_COUNTERS
2712 SIZE_T PeakVirtualSize;
2713 SIZE_T VirtualSize;
2714 ULONG PageFaultCount;
2715 SIZE_T PeakWorkingSetSize;
2716 SIZE_T WorkingSetSize;
2717 SIZE_T QuotaPeakPagedPoolUsage;
2718 SIZE_T QuotaPagedPoolUsage;
2719 SIZE_T QuotaPeakNonPagedPoolUsage;
2720 SIZE_T QuotaNonPagedPoolUsage;
2721 SIZE_T PagefileUsage;
2722 SIZE_T PeakPagefileUsage;
2723 } VM_COUNTERS, *PVM_COUNTERS;
2725 typedef struct _VM_COUNTERS_EX
2727 SIZE_T PeakVirtualSize;
2728 SIZE_T VirtualSize;
2729 ULONG PageFaultCount;
2730 SIZE_T PeakWorkingSetSize;
2731 SIZE_T WorkingSetSize;
2732 SIZE_T QuotaPeakPagedPoolUsage;
2733 SIZE_T QuotaPagedPoolUsage;
2734 SIZE_T QuotaPeakNonPagedPoolUsage;
2735 SIZE_T QuotaNonPagedPoolUsage;
2736 SIZE_T PagefileUsage;
2737 SIZE_T PeakPagefileUsage;
2738 SIZE_T PrivateUsage;
2739 } VM_COUNTERS_EX, *PVM_COUNTERS_EX;
2741 typedef struct _SYSTEM_PROCESS_INFORMATION {
2742 #ifdef __WINESRC__ /* win32/win64 */
2743 ULONG NextEntryOffset; /* 00/00 */
2744 DWORD dwThreadCount; /* 04/04 */
2745 LARGE_INTEGER WorkingSetPrivateSize; /* 08/08 */
2746 ULONG HardFaultCount; /* 10/10 */
2747 ULONG NumberOfThreadsHighWatermark;/* 14/14 */
2748 ULONGLONG CycleTime; /* 18/18 */
2749 LARGE_INTEGER CreationTime; /* 20/20 */
2750 LARGE_INTEGER UserTime; /* 28/28 */
2751 LARGE_INTEGER KernelTime; /* 30/30 */
2752 UNICODE_STRING ProcessName; /* 38/38 */
2753 DWORD dwBasePriority; /* 40/48 */
2754 HANDLE UniqueProcessId; /* 44/50 */
2755 HANDLE ParentProcessId; /* 48/58 */
2756 ULONG HandleCount; /* 4c/60 */
2757 ULONG SessionId; /* 50/64 */
2758 ULONG_PTR UniqueProcessKey; /* 54/68 */
2759 VM_COUNTERS_EX vmCounters; /* 58/70 */
2760 IO_COUNTERS ioCounters; /* 88/d0 */
2761 SYSTEM_THREAD_INFORMATION ti[1]; /* b8/100 */
2762 #else
2763 ULONG NextEntryOffset; /* 00/00 */
2764 BYTE Reserved1[52]; /* 04/04 */
2765 PVOID Reserved2[3]; /* 38/38 */
2766 HANDLE UniqueProcessId; /* 44/50 */
2767 PVOID Reserved3; /* 48/58 */
2768 ULONG HandleCount; /* 4c/60 */
2769 BYTE Reserved4[4]; /* 50/64 */
2770 PVOID Reserved5[11]; /* 54/68 */
2771 SIZE_T PeakPagefileUsage; /* 80/c0 */
2772 SIZE_T PrivatePageCount; /* 84/c8 */
2773 LARGE_INTEGER Reserved6[6]; /* 88/d0 */
2774 #endif
2775 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
2777 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION {
2778 ULONG RegistryQuotaAllowed;
2779 ULONG RegistryQuotaUsed;
2780 PVOID Reserved1;
2781 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
2783 typedef struct _SYSTEM_TIME_ADJUSTMENT_QUERY {
2784 ULONG TimeAdjustment;
2785 ULONG TimeIncrement;
2786 BOOLEAN TimeAdjustmentDisabled;
2787 } SYSTEM_TIME_ADJUSTMENT_QUERY, *PSYSTEM_TIME_ADJUSTMENT_QUERY;
2789 typedef struct _SYSTEM_TIME_ADJUSTMENT {
2790 ULONG TimeAdjustment;
2791 BOOLEAN TimeAdjustmentDisabled;
2792 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
2794 typedef enum _SYSTEM_FIRMWARE_TABLE_ACTION
2796 SystemFirmwareTable_Enumerate = 0,
2797 SystemFirmwareTable_Get = 1
2798 } SYSTEM_FIRMWARE_TABLE_ACTION, *PSYSTEM_FIRMWARE_TABLE_ACTION;
2800 /* System Information Class 0x4C */
2802 typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
2804 ULONG ProviderSignature;
2805 SYSTEM_FIRMWARE_TABLE_ACTION Action;
2806 ULONG TableID;
2807 ULONG TableBufferLength;
2808 UCHAR TableBuffer[1];
2809 } SYSTEM_FIRMWARE_TABLE_INFORMATION, *PSYSTEM_FIRMWARE_TABLE_INFORMATION;
2811 typedef struct _TIME_FIELDS
2812 { CSHORT Year;
2813 CSHORT Month;
2814 CSHORT Day;
2815 CSHORT Hour;
2816 CSHORT Minute;
2817 CSHORT Second;
2818 CSHORT Milliseconds;
2819 CSHORT Weekday;
2820 } TIME_FIELDS, *PTIME_FIELDS;
2822 typedef struct _WINSTATIONINFORMATIONW {
2823 BYTE Reserved2[70];
2824 ULONG LogonId;
2825 BYTE Reserved3[1140];
2826 } WINSTATIONINFORMATIONW, *PWINSTATIONINFORMATIONW;
2828 typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONW)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
2830 typedef struct _LDR_RESOURCE_INFO
2832 ULONG_PTR Type;
2833 ULONG_PTR Name;
2834 ULONG Language;
2835 } LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO;
2838 /* debug buffer definitions */
2840 typedef struct _DEBUG_BUFFER {
2841 HANDLE SectionHandle;
2842 PVOID SectionBase;
2843 PVOID RemoteSectionBase;
2844 ULONG SectionBaseDelta;
2845 HANDLE EventPairHandle;
2846 ULONG Unknown[2];
2847 HANDLE RemoteThreadHandle;
2848 ULONG InfoClassMask;
2849 ULONG SizeOfInfo;
2850 ULONG AllocatedSize;
2851 ULONG SectionSize;
2852 PVOID ModuleInformation;
2853 PVOID BackTraceInformation;
2854 PVOID HeapInformation;
2855 PVOID LockInformation;
2856 PVOID Reserved[8];
2857 } DEBUG_BUFFER, *PDEBUG_BUFFER;
2859 #define PDI_MODULES 0x01
2860 #define PDI_BACKTRACE 0x02
2861 #define PDI_HEAPS 0x04
2862 #define PDI_HEAP_TAGS 0x08
2863 #define PDI_HEAP_BLOCKS 0x10
2864 #define PDI_LOCKS 0x20
2866 typedef struct _DEBUG_MODULE_INFORMATION {
2867 ULONG Reserved[2];
2868 ULONG Base;
2869 ULONG Size;
2870 ULONG Flags;
2871 USHORT Index;
2872 USHORT Unknown;
2873 USHORT LoadCount;
2874 USHORT ModuleNameOffset;
2875 CHAR ImageName[256];
2876 } DEBUG_MODULE_INFORMATION, *PDEBUG_MODULE_INFORMATION;
2878 typedef struct _DEBUG_HEAP_INFORMATION {
2879 ULONG Base;
2880 ULONG Flags;
2881 USHORT Granularity;
2882 USHORT Unknown;
2883 ULONG Allocated;
2884 ULONG Committed;
2885 ULONG TagCount;
2886 ULONG BlockCount;
2887 ULONG Reserved[7];
2888 PVOID Tags;
2889 PVOID Blocks;
2890 } DEBUG_HEAP_INFORMATION, *PDEBUG_HEAP_INFORMATION;
2892 typedef struct _DEBUG_LOCK_INFORMATION {
2893 PVOID Address;
2894 USHORT Type;
2895 USHORT CreatorBackTraceIndex;
2896 ULONG OwnerThreadId;
2897 ULONG ActiveCount;
2898 ULONG ContentionCount;
2899 ULONG EntryCount;
2900 ULONG RecursionCount;
2901 ULONG NumberOfSharedWaiters;
2902 ULONG NumberOfExclusiveWaiters;
2903 } DEBUG_LOCK_INFORMATION, *PDEBUG_LOCK_INFORMATION;
2905 typedef struct _PORT_MESSAGE_HEADER {
2906 USHORT DataSize;
2907 USHORT MessageSize;
2908 USHORT MessageType;
2909 USHORT VirtualRangesOffset;
2910 CLIENT_ID ClientId;
2911 ULONG MessageId;
2912 ULONG SectionSize;
2913 } PORT_MESSAGE_HEADER, *PPORT_MESSAGE_HEADER, PORT_MESSAGE, *PPORT_MESSAGE;
2915 typedef unsigned short RTL_ATOM, *PRTL_ATOM;
2917 typedef enum _ATOM_INFORMATION_CLASS {
2918 AtomBasicInformation = 0,
2919 AtomTableInformation = 1,
2920 } ATOM_INFORMATION_CLASS;
2922 typedef struct _ATOM_BASIC_INFORMATION {
2923 USHORT ReferenceCount;
2924 USHORT Pinned;
2925 USHORT NameLength;
2926 WCHAR Name[1];
2927 } ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION;
2929 /* FIXME: names probably not correct */
2930 typedef struct _RTL_HANDLE
2932 struct _RTL_HANDLE * Next;
2933 } RTL_HANDLE;
2935 /* FIXME: names probably not correct */
2936 typedef struct _RTL_HANDLE_TABLE
2938 ULONG MaxHandleCount; /* 0x00 */
2939 ULONG HandleSize; /* 0x04 */
2940 ULONG Unused[2]; /* 0x08-0x0c */
2941 PVOID NextFree; /* 0x10 */
2942 PVOID FirstHandle; /* 0x14 */
2943 PVOID ReservedMemory; /* 0x18 */
2944 PVOID MaxHandle; /* 0x1c */
2945 } RTL_HANDLE_TABLE;
2947 typedef struct _RTL_ATOM_TABLE_ENTRY
2949 struct _RTL_ATOM_TABLE_ENTRY *HashLink;
2950 WORD HandleIndex;
2951 WORD Atom;
2952 WORD ReferenceCount;
2953 UCHAR Flags;
2954 UCHAR NameLength;
2955 WCHAR Name[1];
2956 } RTL_ATOM_TABLE_ENTRY, *PRTL_ATOM_TABLE_ENTRY;
2958 typedef struct _RTL_ATOM_TABLE
2960 ULONG Signature;
2961 RTL_CRITICAL_SECTION CriticalSection;
2962 RTL_HANDLE_TABLE HandleTable;
2963 ULONG NumberOfBuckets;
2964 RTL_ATOM_TABLE_ENTRY *Buckets[1];
2965 } *RTL_ATOM_TABLE, **PRTL_ATOM_TABLE;
2967 /***********************************************************************
2968 * Defines
2971 /* flags for NtCreateFile and NtOpenFile */
2972 #define FILE_DIRECTORY_FILE 0x00000001
2973 #define FILE_WRITE_THROUGH 0x00000002
2974 #define FILE_SEQUENTIAL_ONLY 0x00000004
2975 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
2976 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
2977 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
2978 #define FILE_NON_DIRECTORY_FILE 0x00000040
2979 #define FILE_CREATE_TREE_CONNECTION 0x00000080
2980 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
2981 #define FILE_NO_EA_KNOWLEDGE 0x00000200
2982 #define FILE_OPEN_FOR_RECOVERY 0x00000400
2983 #define FILE_RANDOM_ACCESS 0x00000800
2984 #define FILE_DELETE_ON_CLOSE 0x00001000
2985 #define FILE_OPEN_BY_FILE_ID 0x00002000
2986 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
2987 #define FILE_NO_COMPRESSION 0x00008000
2988 #define FILE_RESERVE_OPFILTER 0x00100000
2989 #define FILE_OPEN_REPARSE_POINT 0x00200000
2990 #define FILE_OPEN_OFFLINE_FILE 0x00400000
2991 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
2993 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
2994 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
2996 /* status for NtCreateFile or NtOpenFile */
2997 #define FILE_SUPERSEDED 0
2998 #define FILE_OPENED 1
2999 #define FILE_CREATED 2
3000 #define FILE_OVERWRITTEN 3
3001 #define FILE_EXISTS 4
3002 #define FILE_DOES_NOT_EXIST 5
3004 /* disposition for NtCreateFile */
3005 #define FILE_SUPERSEDE 0
3006 #define FILE_OPEN 1
3007 #define FILE_CREATE 2
3008 #define FILE_OPEN_IF 3
3009 #define FILE_OVERWRITE 4
3010 #define FILE_OVERWRITE_IF 5
3011 #define FILE_MAXIMUM_DISPOSITION 5
3013 /* Characteristics of a File System */
3014 #define FILE_REMOVABLE_MEDIA 0x00000001
3015 #define FILE_READ_ONLY_DEVICE 0x00000002
3016 #define FILE_FLOPPY_DISKETTE 0x00000004
3017 #define FILE_WRITE_ONE_MEDIA 0x00000008
3018 #define FILE_REMOTE_DEVICE 0x00000010
3019 #define FILE_DEVICE_IS_MOUNTED 0x00000020
3020 #define FILE_VIRTUAL_VOLUME 0x00000040
3021 #define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
3022 #define FILE_DEVICE_SECURE_OPEN 0x00000100
3023 #define FILE_CHARACTERISTIC_PNP_DEVICE 0x00000800
3024 #define FILE_CHARACTERISTIC_TS_DEVICE 0x00001000
3025 #define FILE_CHARACTERISTIC_WEBDAV_DEVICE 0x00002000
3026 #define FILE_CHARACTERISTIC_CSV 0x00010000
3027 #define FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL 0x00020000
3028 #define FILE_PORTABLE_DEVICE 0x00040000
3030 /* options for NtCreateNamedPipeFile */
3031 #define FILE_PIPE_INBOUND 0x00000000
3032 #define FILE_PIPE_OUTBOUND 0x00000001
3033 #define FILE_PIPE_FULL_DUPLEX 0x00000002
3035 /* options for pipe's type */
3036 #define FILE_PIPE_TYPE_MESSAGE 0x00000001
3037 #define FILE_PIPE_TYPE_BYTE 0x00000000
3038 /* options for pipe's message mode */
3039 #define FILE_PIPE_MESSAGE_MODE 0x00000001
3040 #define FILE_PIPE_BYTE_STREAM_MODE 0x00000000
3041 /* options for pipe's blocking mode */
3042 #define FILE_PIPE_COMPLETE_OPERATION 0x00000001
3043 #define FILE_PIPE_QUEUE_OPERATION 0x00000000
3044 /* and client / server end */
3045 #define FILE_PIPE_SERVER_END 0x00000001
3046 #define FILE_PIPE_CLIENT_END 0x00000000
3048 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
3050 #define LOGONID_CURRENT ((ULONG)-1)
3052 #define OBJ_PROTECT_CLOSE 0x00000001
3053 #define OBJ_INHERIT 0x00000002
3054 #define OBJ_PERMANENT 0x00000010
3055 #define OBJ_EXCLUSIVE 0x00000020
3056 #define OBJ_CASE_INSENSITIVE 0x00000040
3057 #define OBJ_OPENIF 0x00000080
3058 #define OBJ_OPENLINK 0x00000100
3059 #define OBJ_KERNEL_HANDLE 0x00000200
3060 #define OBJ_VALID_ATTRIBUTES 0x000003F2
3062 #define SERVERNAME_CURRENT ((HANDLE)NULL)
3064 typedef void (CALLBACK *PNTAPCFUNC)(ULONG_PTR,ULONG_PTR,ULONG_PTR); /* FIXME: not the right name */
3065 typedef void (CALLBACK *PRTL_THREAD_START_ROUTINE)(LPVOID); /* FIXME: not the right name */
3066 typedef DWORD (CALLBACK *PRTL_WORK_ITEM_ROUTINE)(LPVOID); /* FIXME: not the right name */
3067 typedef void (NTAPI *RTL_WAITORTIMERCALLBACKFUNC)(PVOID,BOOLEAN); /* FIXME: not the right name */
3070 /* DbgPrintEx default levels */
3071 #define DPFLTR_ERROR_LEVEL 0
3072 #define DPFLTR_WARNING_LEVEL 1
3073 #define DPFLTR_TRACE_LEVEL 2
3074 #define DPFLTR_INFO_LEVEL 3
3075 #define DPFLTR_MASK 0x8000000
3077 /* Well-known LUID values */
3078 #define SE_MIN_WELL_KNOWN_PRIVILEGE 2
3079 #define SE_CREATE_TOKEN_PRIVILEGE 2
3080 #define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3
3081 #define SE_LOCK_MEMORY_PRIVILEGE 4
3082 #define SE_INCREASE_QUOTA_PRIVILEGE 5
3083 #define SE_UNSOLICITED_INPUT_PRIVILEGE 6 /* obsolete */
3084 #define SE_MACHINE_ACCOUNT_PRIVILEGE 6
3085 #define SE_TCB_PRIVILEGE 7
3086 #define SE_SECURITY_PRIVILEGE 8
3087 #define SE_TAKE_OWNERSHIP_PRIVILEGE 9
3088 #define SE_LOAD_DRIVER_PRIVILEGE 10
3089 #define SE_SYSTEM_PROFILE_PRIVILEGE 11
3090 #define SE_SYSTEMTIME_PRIVILEGE 12
3091 #define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13
3092 #define SE_INC_BASE_PRIORITY_PRIVILEGE 14
3093 #define SE_CREATE_PAGEFILE_PRIVILEGE 15
3094 #define SE_CREATE_PERMANENT_PRIVILEGE 16
3095 #define SE_BACKUP_PRIVILEGE 17
3096 #define SE_RESTORE_PRIVILEGE 18
3097 #define SE_SHUTDOWN_PRIVILEGE 19
3098 #define SE_DEBUG_PRIVILEGE 20
3099 #define SE_AUDIT_PRIVILEGE 21
3100 #define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22
3101 #define SE_CHANGE_NOTIFY_PRIVILEGE 23
3102 #define SE_REMOTE_SHUTDOWN_PRIVILEGE 24
3103 #define SE_UNDOCK_PRIVILEGE 25
3104 #define SE_SYNC_AGENT_PRIVILEGE 26
3105 #define SE_ENABLE_DELEGATION_PRIVILEGE 27
3106 #define SE_MANAGE_VOLUME_PRIVILEGE 28
3107 #define SE_IMPERSONATE_PRIVILEGE 29
3108 #define SE_CREATE_GLOBAL_PRIVILEGE 30
3109 #define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_GLOBAL_PRIVILEGE
3111 /* NtGlobalFlag bits */
3112 #define FLG_STOP_ON_EXCEPTION 0x00000001
3113 #define FLG_SHOW_LDR_SNAPS 0x00000002
3114 #define FLG_DEBUG_INITIAL_COMMAND 0x00000004
3115 #define FLG_STOP_ON_HUNG_GUI 0x00000008
3116 #define FLG_HEAP_ENABLE_TAIL_CHECK 0x00000010
3117 #define FLG_HEAP_ENABLE_FREE_CHECK 0x00000020
3118 #define FLG_HEAP_VALIDATE_PARAMETERS 0x00000040
3119 #define FLG_HEAP_VALIDATE_ALL 0x00000080
3120 #define FLG_APPLICATION_VERIFIER 0x00000100
3121 #define FLG_POOL_ENABLE_TAGGING 0x00000400
3122 #define FLG_HEAP_ENABLE_TAGGING 0x00000800
3123 #define FLG_USER_STACK_TRACE_DB 0x00001000
3124 #define FLG_KERNEL_STACK_TRACE_DB 0x00002000
3125 #define FLG_MAINTAIN_OBJECT_TYPELIST 0x00004000
3126 #define FLG_HEAP_ENABLE_TAG_BY_DLL 0x00008000
3127 #define FLG_DISABLE_STACK_EXTENSION 0x00010000
3128 #define FLG_ENABLE_CSRDEBUG 0x00020000
3129 #define FLG_ENABLE_KDEBUG_SYMBOL_LOAD 0x00040000
3130 #define FLG_DISABLE_PAGE_KERNEL_STACKS 0x00080000
3131 #define FLG_ENABLE_SYSTEM_CRIT_BREAKS 0x00100000
3132 #define FLG_HEAP_DISABLE_COALESCING 0x00200000
3133 #define FLG_ENABLE_CLOSE_EXCEPTIONS 0x00400000
3134 #define FLG_ENABLE_EXCEPTION_LOGGING 0x00800000
3135 #define FLG_ENABLE_HANDLE_TYPE_TAGGING 0x01000000
3136 #define FLG_HEAP_PAGE_ALLOCS 0x02000000
3137 #define FLG_DEBUG_INITIAL_COMMAND_EX 0x04000000
3138 #define FLG_DISABLE_DBGPRINT 0x08000000
3139 #define FLG_CRITSEC_EVENT_CREATION 0x10000000
3140 #define FLG_LDR_TOP_DOWN 0x20000000
3141 #define FLG_ENABLE_HANDLE_EXCEPTIONS 0x40000000
3142 #define FLG_DISABLE_PROTDLLS 0x80000000
3144 /* Rtl*Registry* functions structs and defines */
3145 #define RTL_REGISTRY_ABSOLUTE 0
3146 #define RTL_REGISTRY_SERVICES 1
3147 #define RTL_REGISTRY_CONTROL 2
3148 #define RTL_REGISTRY_WINDOWS_NT 3
3149 #define RTL_REGISTRY_DEVICEMAP 4
3150 #define RTL_REGISTRY_USER 5
3152 #define RTL_REGISTRY_HANDLE 0x40000000
3153 #define RTL_REGISTRY_OPTIONAL 0x80000000
3155 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
3156 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
3157 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
3158 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
3159 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
3160 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
3161 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
3162 #define RTL_QUERY_REGISTRY_TYPECHECK 0x00000100
3164 #define RTL_QUERY_REGISTRY_TYPECHECK_SHIFT 24
3166 typedef NTSTATUS (WINAPI *PRTL_QUERY_REGISTRY_ROUTINE)( PCWSTR ValueName,
3167 ULONG ValueType,
3168 PVOID ValueData,
3169 ULONG ValueLength,
3170 PVOID Context,
3171 PVOID EntryContext);
3173 typedef struct _RTL_QUERY_REGISTRY_TABLE
3175 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
3176 ULONG Flags;
3177 PWSTR Name;
3178 PVOID EntryContext;
3179 ULONG DefaultType;
3180 PVOID DefaultData;
3181 ULONG DefaultLength;
3182 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
3184 typedef struct _KEY_MULTIPLE_VALUE_INFORMATION
3186 PUNICODE_STRING ValueName;
3187 ULONG DataLength;
3188 ULONG DataOffset;
3189 ULONG Type;
3190 } KEY_MULTIPLE_VALUE_INFORMATION, *PKEY_MULTIPLE_VALUE_INFORMATION;
3192 typedef VOID (CALLBACK *PRTL_OVERLAPPED_COMPLETION_ROUTINE)(DWORD,DWORD,LPVOID);
3194 typedef VOID (CALLBACK *PTIMER_APC_ROUTINE) ( PVOID, ULONG, LONG );
3196 typedef enum _EVENT_INFORMATION_CLASS {
3197 EventBasicInformation
3198 } EVENT_INFORMATION_CLASS, *PEVENT_INFORMATION_CLASS;
3200 typedef struct _EVENT_BASIC_INFORMATION {
3201 EVENT_TYPE EventType;
3202 LONG EventState;
3203 } EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION;
3205 typedef enum _SEMAPHORE_INFORMATION_CLASS {
3206 SemaphoreBasicInformation
3207 } SEMAPHORE_INFORMATION_CLASS, *PSEMAPHORE_INFORMATION_CLASS;
3209 typedef struct _SEMAPHORE_BASIC_INFORMATION {
3210 ULONG CurrentCount;
3211 ULONG MaximumCount;
3212 } SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION;
3214 typedef enum _SECTION_INFORMATION_CLASS
3216 SectionBasicInformation,
3217 SectionImageInformation,
3218 SectionRelocationInformation,
3219 SectionOriginalBaseInformation,
3220 SectionInternalImageInformation
3221 } SECTION_INFORMATION_CLASS;
3223 typedef struct _SECTION_BASIC_INFORMATION {
3224 PVOID BaseAddress;
3225 ULONG Attributes;
3226 LARGE_INTEGER Size;
3227 } SECTION_BASIC_INFORMATION, *PSECTION_BASIC_INFORMATION;
3229 typedef struct _SECTION_IMAGE_INFORMATION {
3230 PVOID TransferAddress;
3231 ULONG ZeroBits;
3232 SIZE_T MaximumStackSize;
3233 SIZE_T CommittedStackSize;
3234 ULONG SubSystemType;
3235 USHORT MinorSubsystemVersion;
3236 USHORT MajorSubsystemVersion;
3237 USHORT MajorOperatingSystemVersion;
3238 USHORT MinorOperatingSystemVersion;
3239 USHORT ImageCharacteristics;
3240 USHORT DllCharacteristics;
3241 USHORT Machine;
3242 BOOLEAN ImageContainsCode;
3243 union
3245 UCHAR ImageFlags;
3246 struct
3248 UCHAR ComPlusNativeReady : 1;
3249 UCHAR ComPlusILOnly : 1;
3250 UCHAR ImageDynamicallyRelocated : 1;
3251 UCHAR ImageMappedFlat : 1;
3252 UCHAR BaseBelow4gb : 1;
3253 UCHAR ComPlusPrefer32bit : 1;
3254 #ifdef __WINESRC__ /* Wine extensions */
3255 UCHAR WineBuiltin : 1;
3256 UCHAR WineFakeDll : 1;
3257 #else
3258 UCHAR Reserved : 2;
3259 #endif
3260 } DUMMYSTRUCTNAME;
3261 } DUMMYUNIONNAME;
3262 ULONG LoaderFlags;
3263 ULONG ImageFileSize;
3264 ULONG CheckSum;
3265 } SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION;
3267 typedef struct _LPC_SECTION_WRITE {
3268 ULONG Length;
3269 HANDLE SectionHandle;
3270 ULONG SectionOffset;
3271 ULONG ViewSize;
3272 PVOID ViewBase;
3273 PVOID TargetViewBase;
3274 } LPC_SECTION_WRITE, *PLPC_SECTION_WRITE;
3276 typedef struct _LPC_SECTION_READ {
3277 ULONG Length;
3278 ULONG ViewSize;
3279 PVOID ViewBase;
3280 } LPC_SECTION_READ, *PLPC_SECTION_READ;
3282 typedef struct _LPC_MESSAGE {
3283 USHORT DataSize;
3284 USHORT MessageSize;
3285 USHORT MessageType;
3286 USHORT VirtualRangesOffset;
3287 CLIENT_ID ClientId;
3288 ULONG_PTR MessageId;
3289 ULONG_PTR SectionSize;
3290 UCHAR Data[ANYSIZE_ARRAY];
3291 } LPC_MESSAGE, *PLPC_MESSAGE;
3293 typedef struct _RTL_USER_PROCESS_INFORMATION
3295 ULONG Length;
3296 HANDLE Process;
3297 HANDLE Thread;
3298 CLIENT_ID ClientId;
3299 SECTION_IMAGE_INFORMATION ImageInformation;
3300 } RTL_USER_PROCESS_INFORMATION, *PRTL_USER_PROCESS_INFORMATION;
3302 typedef enum _SHUTDOWN_ACTION {
3303 ShutdownNoReboot,
3304 ShutdownReboot,
3305 ShutdownPowerOff
3306 } SHUTDOWN_ACTION, *PSHUTDOWN_ACTION;
3308 typedef enum _KPROFILE_SOURCE {
3309 ProfileTime,
3310 ProfileAlignmentFixup,
3311 ProfileTotalIssues,
3312 ProfilePipelineDry,
3313 ProfileLoadInstructions,
3314 ProfilePipelineFrozen,
3315 ProfileBranchInstructions,
3316 ProfileTotalNonissues,
3317 ProfileDcacheMisses,
3318 ProfileIcacheMisses,
3319 ProfileCacheMisses,
3320 ProfileBranchMispredictions,
3321 ProfileStoreInstructions,
3322 ProfileFpInstructions,
3323 ProfileIntegerInstructions,
3324 Profile2Issue,
3325 Profile3Issue,
3326 Profile4Issue,
3327 ProfileSpecialInstructions,
3328 ProfileTotalCycles,
3329 ProfileIcacheIssues,
3330 ProfileDcacheAccesses,
3331 ProfileMemoryBarrierCycles,
3332 ProfileLoadLinkedIssues,
3333 ProfileMaximum
3334 } KPROFILE_SOURCE, *PKPROFILE_SOURCE;
3336 typedef struct _DIRECTORY_BASIC_INFORMATION {
3337 UNICODE_STRING ObjectName;
3338 UNICODE_STRING ObjectTypeName;
3339 } DIRECTORY_BASIC_INFORMATION, *PDIRECTORY_BASIC_INFORMATION;
3341 typedef struct _INITIAL_TEB {
3342 void *OldStackBase;
3343 void *OldStackLimit;
3344 void *StackBase;
3345 void *StackLimit;
3346 void *DeallocationStack;
3347 } INITIAL_TEB, *PINITIAL_TEB;
3349 typedef enum _PORT_INFORMATION_CLASS {
3350 PortNoInformation
3351 } PORT_INFORMATION_CLASS, *PPORT_INFORMATION_CLASS;
3353 typedef enum _IO_COMPLETION_INFORMATION_CLASS {
3354 IoCompletionBasicInformation
3355 } IO_COMPLETION_INFORMATION_CLASS, *PIO_COMPLETION_INFORMATION_CLASS;
3357 typedef struct _FILE_COMPLETION_INFORMATION {
3358 HANDLE CompletionPort;
3359 ULONG_PTR CompletionKey;
3360 } FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION;
3362 #define IO_COMPLETION_QUERY_STATE 0x0001
3363 #define IO_COMPLETION_MODIFY_STATE 0x0002
3364 #define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
3366 typedef struct _FILE_IO_COMPLETION_INFORMATION {
3367 ULONG_PTR CompletionKey;
3368 ULONG_PTR CompletionValue;
3369 IO_STATUS_BLOCK IoStatusBlock;
3370 } FILE_IO_COMPLETION_INFORMATION, *PFILE_IO_COMPLETION_INFORMATION;
3372 typedef enum _HARDERROR_RESPONSE_OPTION {
3373 OptionAbortRetryIgnore,
3374 OptionOk,
3375 OptionOkCancel,
3376 OptionRetryCancel,
3377 OptionYesNo,
3378 OptionYesNoCancel,
3379 OptionShutdownSystem
3380 } HARDERROR_RESPONSE_OPTION, *PHARDERROR_RESPONSE_OPTION;
3382 typedef enum _HARDERROR_RESPONSE {
3383 ResponseReturnToCaller,
3384 ResponseNotHandled,
3385 ResponseAbort,
3386 ResponseCancel,
3387 ResponseIgnore,
3388 ResponseNo,
3389 ResponseOk,
3390 ResponseRetry,
3391 ResponseYes
3392 } HARDERROR_RESPONSE, *PHARDERROR_RESPONSE;
3394 typedef enum _SYSDBG_COMMAND {
3395 SysDbgQueryModuleInformation,
3396 SysDbgQueryTraceInformation,
3397 SysDbgSetTracepoint,
3398 SysDbgSetSpecialCall,
3399 SysDbgClearSpecialCalls,
3400 SysDbgQuerySpecialCalls,
3401 SysDbgBreakPoint,
3402 SysDbgQueryVersion,
3403 SysDbgReadVirtual,
3404 SysDbgWriteVirtual,
3405 SysDbgReadPhysical,
3406 SysDbgWritePhysical,
3407 SysDbgReadControlSpace,
3408 SysDbgWriteControlSpace,
3409 SysDbgReadIoSpace,
3410 SysDbgWriteIoSpace,
3411 SysDbgReadMsr,
3412 SysDbgWriteMsr,
3413 SysDbgReadBusData,
3414 SysDbgWriteBusData
3415 } SYSDBG_COMMAND, *PSYSDBG_COMMAND;
3417 typedef struct _CPTABLEINFO
3419 USHORT CodePage;
3420 USHORT MaximumCharacterSize;
3421 USHORT DefaultChar;
3422 USHORT UniDefaultChar;
3423 USHORT TransDefaultChar;
3424 USHORT TransUniDefaultChar;
3425 USHORT DBCSCodePage;
3426 UCHAR LeadByte[12];
3427 USHORT *MultiByteTable;
3428 void *WideCharTable;
3429 USHORT *DBCSRanges;
3430 USHORT *DBCSOffsets;
3431 } CPTABLEINFO, *PCPTABLEINFO;
3433 typedef struct _NLSTABLEINFO
3435 CPTABLEINFO OemTableInfo;
3436 CPTABLEINFO AnsiTableInfo;
3437 USHORT *UpperCaseTable;
3438 USHORT *LowerCaseTable;
3439 } NLSTABLEINFO, *PNLSTABLEINFO;
3441 /*************************************************************************
3442 * Loader structures
3444 * Those are not part of standard Winternl.h
3447 typedef struct _LDR_SERVICE_TAG_RECORD
3449 struct _LDR_SERVICE_TAG_RECORD *Next;
3450 ULONG ServiceTag;
3451 } LDR_SERVICE_TAG_RECORD, *PLDR_SERVICE_TAG_RECORD;
3453 typedef struct _LDRP_CSLIST
3455 SINGLE_LIST_ENTRY *Tail;
3456 } LDRP_CSLIST, *PLDRP_CSLIST;
3458 typedef struct _LDR_DEPENDENCY
3460 SINGLE_LIST_ENTRY dependency_to_entry;
3461 struct _LDR_DDAG_NODE *dependency_to;
3462 SINGLE_LIST_ENTRY dependency_from_entry;
3463 struct _LDR_DDAG_NODE *dependency_from;
3464 } LDR_DEPENDENCY, *PLDR_DEPENDENCY;
3466 typedef enum _LDR_DDAG_STATE
3468 LdrModulesMerged = -5,
3469 LdrModulesInitError = -4,
3470 LdrModulesSnapError = -3,
3471 LdrModulesUnloaded = -2,
3472 LdrModulesUnloading = -1,
3473 LdrModulesPlaceHolder = 0,
3474 LdrModulesMapping = 1,
3475 LdrModulesMapped = 2,
3476 LdrModulesWaitingForDependencies = 3,
3477 LdrModulesSnapping = 4,
3478 LdrModulesSnapped = 5,
3479 LdrModulesCondensed = 6,
3480 LdrModulesReadyToInit = 7,
3481 LdrModulesInitializing = 8,
3482 LdrModulesReadyToRun = 9,
3483 } LDR_DDAG_STATE;
3485 typedef struct _LDR_DDAG_NODE
3487 LIST_ENTRY Modules;
3488 LDR_SERVICE_TAG_RECORD *ServiceTagList;
3489 LONG LoadCount;
3490 ULONG LoadWhileUnloadingCount;
3491 ULONG LowestLink;
3492 LDRP_CSLIST Dependencies;
3493 LDRP_CSLIST IncomingDependencies;
3494 LDR_DDAG_STATE State;
3495 SINGLE_LIST_ENTRY CondenseLink;
3496 ULONG PreorderNumber;
3497 } LDR_DDAG_NODE, *PLDR_DDAG_NODE;
3499 typedef enum _LDR_DLL_LOAD_REASON
3501 LoadReasonStaticDependency,
3502 LoadReasonStaticForwarderDependency,
3503 LoadReasonDynamicForwarderDependency,
3504 LoadReasonDelayloadDependency,
3505 LoadReasonDynamicLoad,
3506 LoadReasonAsImageLoad,
3507 LoadReasonAsDataLoad,
3508 LoadReasonUnknown = -1
3509 } LDR_DLL_LOAD_REASON, *PLDR_DLL_LOAD_REASON;
3511 typedef struct _LDR_DATA_TABLE_ENTRY
3513 LIST_ENTRY InLoadOrderLinks;
3514 LIST_ENTRY InMemoryOrderLinks;
3515 LIST_ENTRY InInitializationOrderLinks;
3516 void* DllBase;
3517 void* EntryPoint;
3518 ULONG SizeOfImage;
3519 UNICODE_STRING FullDllName;
3520 UNICODE_STRING BaseDllName;
3521 ULONG Flags;
3522 SHORT LoadCount;
3523 SHORT TlsIndex;
3524 LIST_ENTRY HashLinks;
3525 ULONG TimeDateStamp;
3526 HANDLE ActivationContext;
3527 void* Lock;
3528 LDR_DDAG_NODE* DdagNode;
3529 LIST_ENTRY NodeModuleLink;
3530 struct _LDRP_LOAD_CONTEXT *LoadContext;
3531 void* ParentDllBase;
3532 void* SwitchBackContext;
3533 RTL_BALANCED_NODE BaseAddressIndexNode;
3534 RTL_BALANCED_NODE MappingInfoIndexNode;
3535 ULONG_PTR OriginalBase;
3536 LARGE_INTEGER LoadTime;
3537 ULONG BaseNameHashValue;
3538 LDR_DLL_LOAD_REASON LoadReason;
3539 ULONG ImplicitPathOptions;
3540 ULONG ReferenceCount;
3541 } LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY;
3543 typedef struct _LDR_DLL_LOADED_NOTIFICATION_DATA
3545 ULONG Flags;
3546 const UNICODE_STRING *FullDllName;
3547 const UNICODE_STRING *BaseDllName;
3548 void *DllBase;
3549 ULONG SizeOfImage;
3550 } LDR_DLL_LOADED_NOTIFICATION_DATA, *PLDR_DLL_LOADED_NOTIFICATION_DATA;
3552 typedef struct _LDR_DLL_UNLOADED_NOTIFICATION_DATA
3554 ULONG Flags;
3555 const UNICODE_STRING *FullDllName;
3556 const UNICODE_STRING *BaseDllName;
3557 void *DllBase;
3558 ULONG SizeOfImage;
3559 } LDR_DLL_UNLOADED_NOTIFICATION_DATA, *PLDR_DLL_UNLOADED_NOTIFICATION_DATA;
3561 typedef union _LDR_DLL_NOTIFICATION_DATA
3563 LDR_DLL_LOADED_NOTIFICATION_DATA Loaded;
3564 LDR_DLL_UNLOADED_NOTIFICATION_DATA Unloaded;
3565 } LDR_DLL_NOTIFICATION_DATA, *PLDR_DLL_NOTIFICATION_DATA;
3567 typedef void (CALLBACK *PLDR_DLL_NOTIFICATION_FUNCTION)(ULONG, LDR_DLL_NOTIFICATION_DATA*, void*);
3569 /* those defines are (some of the) regular LDR_DATA_TABLE_ENTRY.Flags values */
3570 #define LDR_IMAGE_IS_DLL 0x00000004
3571 #define LDR_LOAD_IN_PROGRESS 0x00001000
3572 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
3573 #define LDR_NO_DLL_CALLS 0x00040000
3574 #define LDR_PROCESS_ATTACHED 0x00080000
3575 #define LDR_COR_IMAGE 0x00400000
3576 #define LDR_COR_ILONLY 0x01000000
3578 /* these ones is Wine specific */
3579 #define LDR_DONT_RESOLVE_REFS 0x40000000
3580 #define LDR_WINE_INTERNAL 0x80000000
3582 /* flag for LdrAddRefDll */
3583 #define LDR_ADDREF_DLL_PIN 0x00000001
3585 /* flags for LdrGetDllHandleEx */
3586 #define LDR_GET_DLL_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT 0x00000001
3587 #define LDR_GET_DLL_HANDLE_EX_FLAG_PIN 0x00000002
3589 #define LDR_DLL_NOTIFICATION_REASON_LOADED 1
3590 #define LDR_DLL_NOTIFICATION_REASON_UNLOADED 2
3592 /* FIXME: to be checked */
3593 #define MAXIMUM_FILENAME_LENGTH 256
3595 typedef struct _RTL_PROCESS_MODULE_INFORMATION
3597 PVOID Section; /* 00/00 */
3598 PVOID MappedBaseAddress; /* 04/08 */
3599 PVOID ImageBaseAddress; /* 08/10 */
3600 ULONG ImageSize; /* 0c/18 */
3601 ULONG Flags; /* 10/1c */
3602 WORD LoadOrderIndex; /* 14/20 */
3603 WORD InitOrderIndex; /* 16/22 */
3604 WORD LoadCount; /* 18/24 */
3605 WORD NameOffset; /* 1a/26 */
3606 BYTE Name[MAXIMUM_FILENAME_LENGTH]; /* 1c/28 */
3607 } RTL_PROCESS_MODULE_INFORMATION, *PRTL_PROCESS_MODULE_INFORMATION;
3609 typedef struct _RTL_PROCESS_MODULES
3611 ULONG ModulesCount;
3612 RTL_PROCESS_MODULE_INFORMATION Modules[1]; /* FIXME: should be Modules[0] */
3613 } RTL_PROCESS_MODULES, *PRTL_PROCESS_MODULES;
3615 #define PROCESS_CREATE_FLAGS_BREAKAWAY 0x00000001
3616 #define PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT 0x00000002
3617 #define PROCESS_CREATE_FLAGS_INHERIT_HANDLES 0x00000004
3618 #define PROCESS_CREATE_FLAGS_OVERRIDE_ADDRESS_SPACE 0x00000008
3619 #define PROCESS_CREATE_FLAGS_LARGE_PAGES 0x00000010
3620 #define PROCESS_CREATE_FLAGS_LARGE_PAGE_SYSTEM_DLL 0x00000020
3621 #define PROCESS_CREATE_FLAGS_PROTECTED_PROCESS 0x00000040
3622 #define PROCESS_CREATE_FLAGS_CREATE_SESSION 0x00000080
3623 #define PROCESS_CREATE_FLAGS_INHERIT_FROM_PARENT 0x00000100
3624 #define PROCESS_CREATE_FLAGS_SUSPENDED 0x00000200
3625 #define PROCESS_CREATE_FLAGS_EXTENDED_UNKNOWN 0x00000400
3627 typedef struct _RTL_PROCESS_MODULE_INFORMATION_EX
3629 USHORT NextOffset;
3630 RTL_PROCESS_MODULE_INFORMATION BaseInfo;
3631 ULONG ImageCheckSum;
3632 ULONG TimeDateStamp;
3633 void *DefaultBase;
3634 } RTL_PROCESS_MODULE_INFORMATION_EX;
3636 #define THREAD_CREATE_FLAGS_CREATE_SUSPENDED 0x00000001
3637 #define THREAD_CREATE_FLAGS_SKIP_THREAD_ATTACH 0x00000002
3638 #define THREAD_CREATE_FLAGS_HIDE_FROM_DEBUGGER 0x00000004
3639 #define THREAD_CREATE_FLAGS_HAS_SECURITY_DESCRIPTOR 0x00000010
3640 #define THREAD_CREATE_FLAGS_ACCESS_CHECK_IN_TARGET 0x00000020
3641 #define THREAD_CREATE_FLAGS_INITIAL_THREAD 0x00000080
3643 #define EH_NONCONTINUABLE 0x01
3644 #define EH_UNWINDING 0x02
3645 #define EH_EXIT_UNWIND 0x04
3646 #define EH_STACK_INVALID 0x08
3647 #define EH_NESTED_CALL 0x10
3648 #define EH_TARGET_UNWIND 0x20
3649 #define EH_COLLIDED_UNWIND 0x40
3651 #ifdef __WINESRC__
3653 /* Wine-specific exceptions codes */
3655 #define EXCEPTION_WINE_STUB 0x80000100 /* stub entry point called */
3656 #define EXCEPTION_WINE_ASSERTION 0x80000101 /* assertion failed */
3658 /* Wine extension; Windows doesn't have a name for this code. This is an
3659 undocumented exception understood by MS VC debugger, allowing the program
3660 to name a particular thread. */
3661 #define EXCEPTION_WINE_NAME_THREAD 0x406D1388
3663 /* used for C++ exceptions in msvcrt
3664 * parameters:
3665 * [0] CXX_FRAME_MAGIC
3666 * [1] pointer to exception object
3667 * [2] pointer to type
3669 #define EXCEPTION_WINE_CXX_EXCEPTION 0xe06d7363
3670 #define EXCEPTION_WINE_CXX_FRAME_MAGIC 0x19930520
3672 #endif
3674 typedef LONG (CALLBACK *PRTL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS);
3676 typedef void (CALLBACK *PTP_IO_CALLBACK)(PTP_CALLBACK_INSTANCE,void*,void*,IO_STATUS_BLOCK*,PTP_IO);
3678 #define PS_ATTRIBUTE_THREAD 0x00010000
3679 #define PS_ATTRIBUTE_INPUT 0x00020000
3680 #define PS_ATTRIBUTE_ADDITIVE 0x00040000
3682 typedef enum _PS_ATTRIBUTE_NUM
3684 PsAttributeParentProcess,
3685 PsAttributeDebugPort,
3686 PsAttributeToken,
3687 PsAttributeClientId,
3688 PsAttributeTebAddress,
3689 PsAttributeImageName,
3690 PsAttributeImageInfo,
3691 PsAttributeMemoryReserve,
3692 PsAttributePriorityClass,
3693 PsAttributeErrorMode,
3694 PsAttributeStdHandleInfo,
3695 PsAttributeHandleList,
3696 PsAttributeGroupAffinity,
3697 PsAttributePreferredNode,
3698 PsAttributeIdealProcessor,
3699 PsAttributeUmsThread,
3700 PsAttributeMitigationOptions,
3701 PsAttributeProtectionLevel,
3702 PsAttributeSecureProcess,
3703 PsAttributeJobList,
3704 PsAttributeChildProcessPolicy,
3705 PsAttributeAllApplicationPackagesPolicy,
3706 PsAttributeWin32kFilter,
3707 PsAttributeSafeOpenPromptOriginClaim,
3708 PsAttributeBnoIsolation,
3709 PsAttributeDesktopAppPolicy,
3710 PsAttributeChpe,
3711 PsAttributeMitigationAuditOptions,
3712 PsAttributeMachineType,
3713 PsAttributeComponentFilter,
3714 PsAttributeEnableOptionalXStateFeatures,
3715 PsAttributeMax
3716 } PS_ATTRIBUTE_NUM;
3718 #define PS_ATTRIBUTE_PARENT_PROCESS (PsAttributeParentProcess | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_ADDITIVE)
3719 #define PS_ATTRIBUTE_DEBUG_PORT (PsAttributeDebugPort | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_ADDITIVE)
3720 #define PS_ATTRIBUTE_TOKEN (PsAttributeToken | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_ADDITIVE)
3721 #define PS_ATTRIBUTE_CLIENT_ID (PsAttributeClientId | PS_ATTRIBUTE_THREAD)
3722 #define PS_ATTRIBUTE_TEB_ADDRESS (PsAttributeTebAddress | PS_ATTRIBUTE_THREAD)
3723 #define PS_ATTRIBUTE_IMAGE_NAME (PsAttributeImageName | PS_ATTRIBUTE_INPUT)
3724 #define PS_ATTRIBUTE_IMAGE_INFO (PsAttributeImageInfo)
3725 #define PS_ATTRIBUTE_MEMORY_RESERVE (PsAttributeMemoryReserve | PS_ATTRIBUTE_INPUT)
3726 #define PS_ATTRIBUTE_PRIORITY_CLASS (PsAttributePriorityClass | PS_ATTRIBUTE_INPUT)
3727 #define PS_ATTRIBUTE_ERROR_MODE (PsAttributeErrorMode | PS_ATTRIBUTE_INPUT)
3728 #define PS_ATTRIBUTE_STD_HANDLE_INFO (PsAttributeStdHandleInfo | PS_ATTRIBUTE_INPUT)
3729 #define PS_ATTRIBUTE_HANDLE_LIST (PsAttributeHandleList | PS_ATTRIBUTE_INPUT)
3730 #define PS_ATTRIBUTE_GROUP_AFFINITY (PsAttributeGroupAffinity | PS_ATTRIBUTE_THREAD | PS_ATTRIBUTE_INPUT)
3731 #define PS_ATTRIBUTE_PREFERRED_NODE (PsAttributePreferredNode | PS_ATTRIBUTE_INPUT)
3732 #define PS_ATTRIBUTE_IDEAL_PROCESSOR (PsAttributeIdealProcessor | PS_ATTRIBUTE_THREAD | PS_ATTRIBUTE_INPUT)
3733 #define PS_ATTRIBUTE_MITIGATION_OPTIONS (PsAttributeMitigationOptions | PS_ATTRIBUTE_INPUT)
3734 #define PS_ATTRIBUTE_PROTECTION_LEVEL (PsAttributeProtectionLevel | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_ADDITIVE)
3735 #define PS_ATTRIBUTE_SECURE_PROCESS (PsAttributeSecureProcess | PS_ATTRIBUTE_INPUT)
3736 #define PS_ATTRIBUTE_JOB_LIST (PsAttributeJobList | PS_ATTRIBUTE_INPUT)
3737 #define PS_ATTRIBUTE_CHILD_PROCESS_POLICY (PsAttributeChildProcessPolicy | PS_ATTRIBUTE_INPUT)
3738 #define PS_ATTRIBUTE_ALL_APPLICATION_PACKAGES_POLICY (PsAttributeAllApplicationPackagesPolicy | PS_ATTRIBUTE_INPUT)
3739 #define PS_ATTRIBUTE_WIN32K_FILTER (PsAttributeWin32kFilter | PS_ATTRIBUTE_INPUT)
3740 #define PS_ATTRIBUTE_SAFE_OPEN_PROMPT_ORIGIN_CLAIM (PsAttributeSafeOpenPromptOriginClaim | PS_ATTRIBUTE_INPUT)
3741 #define PS_ATTRIBUTE_BNO_ISOLATION (PsAttributeBnoIsolation | PS_ATTRIBUTE_INPUT)
3742 #define PS_ATTRIBUTE_DESKTOP_APP_POLICY (PsAttributeDesktopAppPolicy | PS_ATTRIBUTE_INPUT)
3743 #define PS_ATTRIBUTE_CHPE (PsAttributeChpe | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_ADDITIVE)
3744 #define PS_ATTRIBUTE_MITIGATION_AUDIT_OPTIONS (PsAttributeMitigationAuditOptions | PS_ATTRIBUTE_INPUT)
3745 #define PS_ATTRIBUTE_MACHINE_TYPE (PsAttributeMachineType | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_ADDITIVE)
3746 #define PS_ATTRIBUTE_COMPONENT_FILTER (PsAttributeComponentFilter | PS_ATTRIBUTE_INPUT)
3747 #define PS_ATTRIBUTE_ENABLE_OPTIONAL_XSTATE_FEATURES (PsAttributeEnableOptionalXStateFeatures | PS_ATTRIBUTE_THREAD | PS_ATTRIBUTE_INPUT)
3749 typedef struct _PS_ATTRIBUTE
3751 ULONG_PTR Attribute;
3752 SIZE_T Size;
3753 union
3755 ULONG_PTR Value;
3756 void *ValuePtr;
3758 SIZE_T *ReturnLength;
3759 } PS_ATTRIBUTE;
3761 typedef struct _PS_ATTRIBUTE_LIST
3763 SIZE_T TotalLength;
3764 PS_ATTRIBUTE Attributes[1];
3765 } PS_ATTRIBUTE_LIST, *PPS_ATTRIBUTE_LIST;
3767 typedef enum _PS_CREATE_STATE
3769 PsCreateInitialState,
3770 PsCreateFailOnFileOpen,
3771 PsCreateFailOnSectionCreate,
3772 PsCreateFailExeFormat,
3773 PsCreateFailMachineMismatch,
3774 PsCreateFailExeName,
3775 PsCreateSuccess,
3776 PsCreateMaximumStates
3777 } PS_CREATE_STATE;
3779 typedef struct _PS_CREATE_INFO
3781 SIZE_T Size;
3782 PS_CREATE_STATE State;
3783 union
3785 struct
3787 union
3789 ULONG InitFlags;
3790 struct
3792 UCHAR WriteOutputOnExit : 1;
3793 UCHAR DetectManifest : 1;
3794 UCHAR IFEOSkipDebugger : 1;
3795 UCHAR IFEODoNotPropagateKeyState : 1;
3796 UCHAR SpareBits1 : 4;
3797 UCHAR SpareBits2 : 8;
3798 USHORT ProhibitedImageCharacteristics : 16;
3801 ACCESS_MASK AdditionalFileAccess;
3802 } InitState;
3803 struct
3805 HANDLE FileHandle;
3806 } FailSection;
3807 struct
3809 USHORT DllCharacteristics;
3810 } ExeFormat;
3811 struct
3813 HANDLE IFEOKey;
3814 } ExeName;
3815 struct
3817 union
3819 ULONG OutputFlags;
3820 struct
3822 UCHAR ProtectedProcess : 1;
3823 UCHAR AddressSpaceOverride : 1;
3824 UCHAR DevOverrideEnabled : 1;
3825 UCHAR ManifestDetected : 1;
3826 UCHAR ProtectedProcessLight : 1;
3827 UCHAR SpareBits1 : 3;
3828 UCHAR SpareBits2 : 8;
3829 USHORT SpareBits3 : 16;
3832 HANDLE FileHandle;
3833 HANDLE SectionHandle;
3834 ULONGLONG UserProcessParametersNative;
3835 ULONG UserProcessParametersWow64;
3836 ULONG CurrentParameterFlags;
3837 ULONGLONG PebAddressNative;
3838 ULONG PebAddressWow64;
3839 ULONGLONG ManifestAddress;
3840 ULONG ManifestSize;
3841 } SuccessState;
3843 } PS_CREATE_INFO, *PPS_CREATE_INFO;
3845 typedef struct _DBGKM_EXCEPTION
3847 EXCEPTION_RECORD ExceptionRecord;
3848 ULONG FirstChance;
3849 } DBGKM_EXCEPTION, *PDBGKM_EXCEPTION;
3851 typedef struct _DBGKM_CREATE_THREAD
3853 ULONG SubSystemKey;
3854 PVOID StartAddress;
3855 } DBGKM_CREATE_THREAD, *PDBGKM_CREATE_THREAD;
3857 typedef struct _DBGKM_CREATE_PROCESS
3859 ULONG SubSystemKey;
3860 HANDLE FileHandle;
3861 PVOID BaseOfImage;
3862 ULONG DebugInfoFileOffset;
3863 ULONG DebugInfoSize;
3864 DBGKM_CREATE_THREAD InitialThread;
3865 } DBGKM_CREATE_PROCESS, *PDBGKM_CREATE_PROCESS;
3867 typedef struct _DBGKM_EXIT_THREAD
3869 NTSTATUS ExitStatus;
3870 } DBGKM_EXIT_THREAD, *PDBGKM_EXIT_THREAD;
3872 typedef struct _DBGKM_EXIT_PROCESS
3874 NTSTATUS ExitStatus;
3875 } DBGKM_EXIT_PROCESS, *PDBGKM_EXIT_PROCESS;
3877 typedef struct _DBGKM_LOAD_DLL
3879 HANDLE FileHandle;
3880 PVOID BaseOfDll;
3881 ULONG DebugInfoFileOffset;
3882 ULONG DebugInfoSize;
3883 PVOID NamePointer;
3884 } DBGKM_LOAD_DLL, *PDBGKM_LOAD_DLL;
3886 typedef struct _DBGKM_UNLOAD_DLL
3888 PVOID BaseAddress;
3889 } DBGKM_UNLOAD_DLL, *PDBGKM_UNLOAD_DLL;
3891 typedef enum _DBG_STATE
3893 DbgIdle,
3894 DbgReplyPending,
3895 DbgCreateThreadStateChange,
3896 DbgCreateProcessStateChange,
3897 DbgExitThreadStateChange,
3898 DbgExitProcessStateChange,
3899 DbgExceptionStateChange,
3900 DbgBreakpointStateChange,
3901 DbgSingleStepStateChange,
3902 DbgLoadDllStateChange,
3903 DbgUnloadDllStateChange
3904 } DBG_STATE, *PDBG_STATE;
3906 typedef struct _DBGUI_CREATE_THREAD
3908 HANDLE HandleToThread;
3909 DBGKM_CREATE_THREAD NewThread;
3910 } DBGUI_CREATE_THREAD, *PDBGUI_CREATE_THREAD;
3912 typedef struct _DBGUI_CREATE_PROCESS
3914 HANDLE HandleToProcess;
3915 HANDLE HandleToThread;
3916 DBGKM_CREATE_PROCESS NewProcess;
3917 } DBGUI_CREATE_PROCESS, *PDBGUI_CREATE_PROCESS;
3919 typedef struct _DBGUI_WAIT_STATE_CHANGE
3921 DBG_STATE NewState;
3922 CLIENT_ID AppClientId;
3923 union
3925 DBGKM_EXCEPTION Exception;
3926 DBGUI_CREATE_THREAD CreateThread;
3927 DBGUI_CREATE_PROCESS CreateProcessInfo;
3928 DBGKM_EXIT_THREAD ExitThread;
3929 DBGKM_EXIT_PROCESS ExitProcess;
3930 DBGKM_LOAD_DLL LoadDll;
3931 DBGKM_UNLOAD_DLL UnloadDll;
3932 } StateInfo;
3933 } DBGUI_WAIT_STATE_CHANGE, *PDBGUI_WAIT_STATE_CHANGE;
3935 struct _DEBUG_EVENT;
3937 #define DEBUG_READ_EVENT 0x0001
3938 #define DEBUG_PROCESS_ASSIGN 0x0002
3939 #define DEBUG_SET_INFORMATION 0x0004
3940 #define DEBUG_QUERY_INFORMATION 0x0008
3941 #define DEBUG_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x0f)
3943 #define DEBUG_KILL_ON_CLOSE 0x1
3945 typedef enum _DEBUGOBJECTINFOCLASS
3947 DebugObjectKillProcessOnExitInformation = 1,
3948 MaxDebugObjectInfoClass
3949 } DEBUGOBJECTINFOCLASS, *PDEBUGOBJECTINFOCLASS;
3952 typedef struct _WOW64_CPURESERVED
3954 USHORT Flags;
3955 USHORT Machine;
3956 /* CONTEXT context */
3957 /* CONTEXT_EX *context_ex */
3958 } WOW64_CPURESERVED, *PWOW64_CPURESERVED;
3960 #define WOW64_CPURESERVED_FLAG_RESET_STATE 1
3962 typedef struct _WOW64_CPU_AREA_INFO
3964 void *Context;
3965 void *ContextEx;
3966 void *ContextFlagsLocation;
3967 WOW64_CPURESERVED *CpuReserved;
3968 ULONG ContextFlag;
3969 USHORT Machine;
3970 } WOW64_CPU_AREA_INFO, *PWOW64_CPU_AREA_INFO;
3972 typedef struct _WOW64INFO
3974 ULONG NativeSystemPageSize;
3975 ULONG CpuFlags;
3976 ULONG Wow64ExecuteFlags;
3977 ULONG unknown[5];
3978 USHORT NativeMachineType;
3979 USHORT EmulatedMachineType;
3980 } WOW64INFO;
3982 #define WOW64_CPUFLAGS_MSFT64 0x01
3983 #define WOW64_CPUFLAGS_SOFTWARE 0x02
3985 /* wow64.dll functions */
3986 void * WINAPI Wow64AllocateTemp(SIZE_T);
3987 void WINAPI Wow64ApcRoutine(ULONG_PTR,ULONG_PTR,ULONG_PTR,CONTEXT*);
3988 NTSTATUS WINAPI Wow64KiUserCallbackDispatcher(ULONG,void*,ULONG,void**,ULONG*);
3989 void WINAPI Wow64PassExceptionToGuest(EXCEPTION_POINTERS*);
3990 void WINAPI Wow64PrepareForException(EXCEPTION_RECORD*,CONTEXT*);
3991 NTSTATUS WINAPI Wow64RaiseException(int,EXCEPTION_RECORD*);
3992 NTSTATUS WINAPI Wow64SystemServiceEx(UINT,UINT*);
3994 #ifdef __WINESRC__
3995 /* undocumented layout of LdrSystemDllInitBlock */
3996 /* this varies across Windows version; we are using the win10-2004 layout */
3997 typedef struct
3999 ULONG version;
4000 ULONG unknown1[3];
4001 ULONG64 unknown2;
4002 ULONG64 pLdrInitializeThunk;
4003 ULONG64 pKiUserExceptionDispatcher;
4004 ULONG64 pKiUserApcDispatcher;
4005 ULONG64 pKiUserCallbackDispatcher;
4006 ULONG64 pRtlUserThreadStart;
4007 ULONG64 pRtlpQueryProcessDebugInformationRemote;
4008 ULONG64 ntdll_handle;
4009 ULONG64 pLdrSystemDllInitBlock;
4010 ULONG64 pRtlpFreezeTimeBias;
4011 } SYSTEM_DLL_INIT_BLOCK;
4012 #endif
4014 typedef struct
4016 ULONG_PTR *ServiceTable;
4017 ULONG_PTR *CounterTable;
4018 ULONG_PTR ServiceLimit;
4019 BYTE *ArgumentTable;
4020 } SYSTEM_SERVICE_TABLE;
4022 /* ApiSet structures (format for version 6) */
4024 typedef struct _API_SET_NAMESPACE
4026 ULONG Version;
4027 ULONG Size;
4028 ULONG Flags;
4029 ULONG Count;
4030 ULONG EntryOffset;
4031 ULONG HashOffset;
4032 ULONG HashFactor;
4033 } API_SET_NAMESPACE;
4035 typedef struct _API_SET_HASH_ENTRY
4037 ULONG Hash;
4038 ULONG Index;
4039 } API_SET_HASH_ENTRY;
4041 typedef struct _API_SET_NAMESPACE_ENTRY
4043 ULONG Flags;
4044 ULONG NameOffset;
4045 ULONG NameLength;
4046 ULONG HashedLength;
4047 ULONG ValueOffset;
4048 ULONG ValueCount;
4049 } API_SET_NAMESPACE_ENTRY;
4051 typedef struct _API_SET_VALUE_ENTRY
4053 ULONG Flags;
4054 ULONG NameOffset;
4055 ULONG NameLength;
4056 ULONG ValueOffset;
4057 ULONG ValueLength;
4058 } API_SET_VALUE_ENTRY;
4060 /***********************************************************************
4061 * Function declarations
4064 NTSYSAPI NTSTATUS WINAPI ApiSetQueryApiSetPresence(const UNICODE_STRING*,BOOLEAN*);
4065 NTSYSAPI NTSTATUS WINAPI ApiSetQueryApiSetPresenceEx(const UNICODE_STRING*,BOOLEAN*,BOOLEAN*);
4066 NTSYSAPI void WINAPI DbgBreakPoint(void);
4067 NTSYSAPI NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
4068 NTSYSAPI NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
4069 NTSYSAPI NTSTATUS WINAPI DbgUiConnectToDbg(void);
4070 NTSYSAPI NTSTATUS WINAPI DbgUiContinue(CLIENT_ID*,NTSTATUS);
4071 NTSYSAPI NTSTATUS WINAPI DbgUiConvertStateChangeStructure(DBGUI_WAIT_STATE_CHANGE*,struct _DEBUG_EVENT*);
4072 NTSYSAPI NTSTATUS WINAPI DbgUiDebugActiveProcess(HANDLE);
4073 NTSYSAPI HANDLE WINAPI DbgUiGetThreadDebugObject(void);
4074 NTSYSAPI NTSTATUS WINAPI DbgUiIssueRemoteBreakin(HANDLE);
4075 NTSYSAPI void WINAPI DbgUiRemoteBreakin(void*);
4076 NTSYSAPI void WINAPI DbgUiSetThreadDebugObject(HANDLE);
4077 NTSYSAPI NTSTATUS WINAPI DbgUiStopDebugging(HANDLE);
4078 NTSYSAPI NTSTATUS WINAPI DbgUiWaitStateChange(DBGUI_WAIT_STATE_CHANGE*,LARGE_INTEGER*);
4079 NTSYSAPI void WINAPI DbgUserBreakPoint(void);
4080 NTSYSAPI NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
4081 NTSYSAPI NTSTATUS WINAPI LdrAddDllDirectory(const UNICODE_STRING*,void**);
4082 NTSYSAPI NTSTATUS WINAPI LdrAddRefDll(ULONG,HMODULE);
4083 NTSYSAPI NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
4084 NTSYSAPI NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_DATA_TABLE_ENTRY*);
4085 NTSYSAPI NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
4086 NTSYSAPI NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
4087 NTSYSAPI NTSTATUS WINAPI LdrGetDllDirectory(UNICODE_STRING*);
4088 NTSYSAPI NTSTATUS WINAPI LdrGetDllFullName(HMODULE, UNICODE_STRING*);
4089 NTSYSAPI NTSTATUS WINAPI LdrGetDllHandle(LPCWSTR, ULONG, const UNICODE_STRING*, HMODULE*);
4090 NTSYSAPI NTSTATUS WINAPI LdrGetDllHandleEx(ULONG, LPCWSTR, ULONG *, const UNICODE_STRING*, HMODULE*);
4091 NTSYSAPI NTSTATUS WINAPI LdrGetDllPath(PCWSTR,ULONG,PWSTR*,PWSTR*);
4092 NTSYSAPI NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
4093 NTSYSAPI NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
4094 NTSYSAPI NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG_PTR*);
4095 IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock(void*,UINT,USHORT*,INT_PTR);
4096 NTSYSAPI NTSTATUS WINAPI LdrQueryImageFileExecutionOptions(const UNICODE_STRING*,LPCWSTR,ULONG,void*,ULONG,ULONG*);
4097 NTSYSAPI NTSTATUS WINAPI LdrQueryProcessModuleInformation(RTL_PROCESS_MODULES*, ULONG, ULONG*);
4098 NTSYSAPI NTSTATUS WINAPI LdrRegisterDllNotification(ULONG,PLDR_DLL_NOTIFICATION_FUNCTION,void*,void**);
4099 NTSYSAPI NTSTATUS WINAPI LdrRemoveDllDirectory(void*);
4100 NTSYSAPI NTSTATUS WINAPI LdrSetDefaultDllDirectories(ULONG);
4101 NTSYSAPI NTSTATUS WINAPI LdrSetDllDirectory(const UNICODE_STRING*);
4102 NTSYSAPI void WINAPI LdrShutdownProcess(void);
4103 NTSYSAPI void WINAPI LdrShutdownThread(void);
4104 NTSYSAPI NTSTATUS WINAPI LdrUnloadDll(HMODULE);
4105 NTSYSAPI NTSTATUS WINAPI LdrUnlockLoaderLock(ULONG,ULONG_PTR);
4106 NTSYSAPI NTSTATUS WINAPI LdrUnregisterDllNotification(void*);
4107 NTSYSAPI NTSTATUS WINAPI NtAcceptConnectPort(PHANDLE,ULONG,PLPC_MESSAGE,BOOLEAN,PLPC_SECTION_WRITE,PLPC_SECTION_READ);
4108 NTSYSAPI NTSTATUS WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,NTSTATUS*);
4109 NTSYSAPI NTSTATUS WINAPI NtAccessCheckAndAuditAlarm(PUNICODE_STRING,HANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,ACCESS_MASK,PGENERIC_MAPPING,BOOLEAN,PACCESS_MASK,PBOOLEAN,PBOOLEAN);
4110 NTSYSAPI NTSTATUS WINAPI NtAddAtom(const WCHAR*,ULONG,RTL_ATOM*);
4111 NTSYSAPI NTSTATUS WINAPI NtAdjustGroupsToken(HANDLE,BOOLEAN,PTOKEN_GROUPS,ULONG,PTOKEN_GROUPS,PULONG);
4112 NTSYSAPI NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
4113 NTSYSAPI NTSTATUS WINAPI NtAlertResumeThread(HANDLE,PULONG);
4114 NTSYSAPI NTSTATUS WINAPI NtAlertThread(HANDLE ThreadHandle);
4115 NTSYSAPI NTSTATUS WINAPI NtAlertThreadByThreadId(HANDLE);
4116 NTSYSAPI NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID lpLuid);
4117 NTSYSAPI NTSTATUS WINAPI NtAllocateUuids(PULARGE_INTEGER,PULONG,PULONG,PUCHAR);
4118 NTSYSAPI NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,ULONG_PTR,SIZE_T*,ULONG,ULONG);
4119 NTSYSAPI NTSTATUS WINAPI NtAllocateVirtualMemoryEx(HANDLE,PVOID*,SIZE_T*,ULONG,ULONG,MEM_EXTENDED_PARAMETER*,ULONG);
4120 NTSYSAPI NTSTATUS WINAPI NtAreMappedFilesTheSame(PVOID,PVOID);
4121 NTSYSAPI NTSTATUS WINAPI NtAssignProcessToJobObject(HANDLE,HANDLE);
4122 NTSYSAPI NTSTATUS WINAPI NtCallbackReturn(PVOID,ULONG,NTSTATUS);
4123 NTSYSAPI NTSTATUS WINAPI NtCancelIoFile(HANDLE,PIO_STATUS_BLOCK);
4124 NTSYSAPI NTSTATUS WINAPI NtCancelIoFileEx(HANDLE,PIO_STATUS_BLOCK,PIO_STATUS_BLOCK);
4125 NTSYSAPI NTSTATUS WINAPI NtCancelSynchronousIoFile(HANDLE,PIO_STATUS_BLOCK,PIO_STATUS_BLOCK);
4126 NTSYSAPI NTSTATUS WINAPI NtCancelTimer(HANDLE, BOOLEAN*);
4127 NTSYSAPI NTSTATUS WINAPI NtClearEvent(HANDLE);
4128 NTSYSAPI NTSTATUS WINAPI NtClose(HANDLE);
4129 NTSYSAPI NTSTATUS WINAPI NtCloseObjectAuditAlarm(PUNICODE_STRING,HANDLE,BOOLEAN);
4130 NTSYSAPI NTSTATUS WINAPI NtCommitTransaction(HANDLE,BOOLEAN);
4131 NTSYSAPI NTSTATUS WINAPI NtCompareObjects(HANDLE,HANDLE);
4132 NTSYSAPI NTSTATUS WINAPI NtCompleteConnectPort(HANDLE);
4133 NTSYSAPI NTSTATUS WINAPI NtConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
4134 NTSYSAPI NTSTATUS WINAPI NtContinue(PCONTEXT,BOOLEAN);
4135 NTSYSAPI NTSTATUS WINAPI NtCreateDebugObject(HANDLE*,ACCESS_MASK,OBJECT_ATTRIBUTES*,ULONG);
4136 NTSYSAPI NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
4137 NTSYSAPI NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,EVENT_TYPE,BOOLEAN);
4138 NTSYSAPI NTSTATUS WINAPI NtCreateEventPair(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
4139 NTSYSAPI NTSTATUS WINAPI NtCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
4140 NTSYSAPI NTSTATUS WINAPI NtCreateIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,ULONG);
4141 NTSYSAPI NTSTATUS WINAPI NtCreateJobObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
4142 NTSYSAPI NTSTATUS WINAPI NtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
4143 NTSYSAPI NTSTATUS WINAPI NtCreateKeyTransacted(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,HANDLE,ULONG*);
4144 NTSYSAPI NTSTATUS WINAPI NtCreateKeyedEvent(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG);
4145 NTSYSAPI NTSTATUS WINAPI NtCreateLowBoxToken(HANDLE*,HANDLE,ACCESS_MASK,OBJECT_ATTRIBUTES*,SID*,ULONG,SID_AND_ATTRIBUTES*,ULONG,HANDLE*);
4146 NTSYSAPI NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,PLARGE_INTEGER);
4147 NTSYSAPI NTSTATUS WINAPI NtCreateMutant(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,BOOLEAN);
4148 NTSYSAPI NTSTATUS WINAPI NtCreateNamedPipeFile(PHANDLE,ULONG,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,PLARGE_INTEGER);
4149 NTSYSAPI NTSTATUS WINAPI NtCreatePagingFile(PUNICODE_STRING,PLARGE_INTEGER,PLARGE_INTEGER,PLARGE_INTEGER);
4150 NTSYSAPI NTSTATUS WINAPI NtCreatePort(PHANDLE,POBJECT_ATTRIBUTES,ULONG,ULONG,PULONG);
4151 NTSYSAPI NTSTATUS WINAPI NtCreateProcess(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,BOOLEAN,HANDLE,HANDLE,HANDLE);
4152 NTSYSAPI NTSTATUS WINAPI NtCreateProfile(PHANDLE,HANDLE,PVOID,ULONG,ULONG,PVOID,ULONG,KPROFILE_SOURCE,KAFFINITY);
4153 NTSYSAPI NTSTATUS WINAPI NtCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
4154 NTSYSAPI NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,LONG,LONG);
4155 NTSYSAPI NTSTATUS WINAPI NtCreateSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PUNICODE_STRING);
4156 NTSYSAPI NTSTATUS WINAPI NtCreateThread(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,PCLIENT_ID,PCONTEXT,PINITIAL_TEB,BOOLEAN);
4157 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*);
4158 NTSYSAPI NTSTATUS WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
4159 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);
4160 NTSYSAPI NTSTATUS WINAPI NtCreateTransaction(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,LPGUID,HANDLE,ULONG,ULONG,ULONG,PLARGE_INTEGER,PUNICODE_STRING);
4161 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*);
4162 NTSYSAPI NTSTATUS WINAPI NtDebugActiveProcess(HANDLE,HANDLE);
4163 NTSYSAPI NTSTATUS WINAPI NtDebugContinue(HANDLE,CLIENT_ID*,NTSTATUS);
4164 NTSYSAPI NTSTATUS WINAPI NtDelayExecution(BOOLEAN,const LARGE_INTEGER*);
4165 NTSYSAPI NTSTATUS WINAPI NtDeleteAtom(RTL_ATOM);
4166 NTSYSAPI NTSTATUS WINAPI NtDeleteFile(POBJECT_ATTRIBUTES);
4167 NTSYSAPI NTSTATUS WINAPI NtDeleteKey(HANDLE);
4168 NTSYSAPI NTSTATUS WINAPI NtDeleteValueKey(HANDLE,const UNICODE_STRING *);
4169 NTSYSAPI NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
4170 NTSYSAPI NTSTATUS WINAPI NtDisplayString(PUNICODE_STRING);
4171 NTSYSAPI NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
4172 NTSYSAPI NTSTATUS WINAPI NtDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,BOOLEAN,TOKEN_TYPE,PHANDLE);
4173 NTSYSAPI NTSTATUS WINAPI NtEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
4174 NTSYSAPI NTSTATUS WINAPI NtEnumerateValueKey(HANDLE,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
4175 NTSYSAPI NTSTATUS WINAPI NtExtendSection(HANDLE,PLARGE_INTEGER);
4176 NTSYSAPI NTSTATUS WINAPI NtFilterToken(HANDLE,ULONG,TOKEN_GROUPS*,TOKEN_PRIVILEGES*,TOKEN_GROUPS*,HANDLE*);
4177 NTSYSAPI NTSTATUS WINAPI NtFindAtom(const WCHAR*,ULONG,RTL_ATOM*);
4178 NTSYSAPI NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
4179 NTSYSAPI NTSTATUS WINAPI NtFlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
4180 NTSYSAPI NTSTATUS WINAPI NtFlushKey(HANDLE);
4181 NTSYSAPI void WINAPI NtFlushProcessWriteBuffers(void);
4182 NTSYSAPI NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,SIZE_T*,ULONG);
4183 NTSYSAPI NTSTATUS WINAPI NtFlushWriteBuffer(VOID);
4184 NTSYSAPI NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
4185 NTSYSAPI NTSTATUS WINAPI NtFsControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
4186 NTSYSAPI NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*);
4187 NTSYSAPI ULONG WINAPI NtGetCurrentProcessorNumber(void);
4188 NTSYSAPI NTSTATUS WINAPI NtGetNextThread(HANDLE,HANDLE,ACCESS_MASK,ULONG,ULONG,HANDLE*);
4189 NTSYSAPI NTSTATUS WINAPI NtGetNlsSectionPtr(ULONG,ULONG,void*,void**,SIZE_T*);
4190 NTSYSAPI NTSTATUS WINAPI NtGetPlugPlayEvent(ULONG,ULONG,PVOID,ULONG);
4191 NTSYSAPI ULONG WINAPI NtGetTickCount(VOID);
4192 NTSYSAPI NTSTATUS WINAPI NtGetWriteWatch(HANDLE,ULONG,PVOID,SIZE_T,PVOID*,ULONG_PTR*,ULONG*);
4193 NTSYSAPI NTSTATUS WINAPI NtImpersonateAnonymousToken(HANDLE);
4194 NTSYSAPI NTSTATUS WINAPI NtImpersonateClientOfPort(HANDLE,PPORT_MESSAGE);
4195 NTSYSAPI NTSTATUS WINAPI NtImpersonateThread(HANDLE,HANDLE,PSECURITY_QUALITY_OF_SERVICE);
4196 NTSYSAPI NTSTATUS WINAPI NtInitializeNlsFiles(void**,LCID*,LARGE_INTEGER*);
4197 NTSYSAPI NTSTATUS WINAPI NtInitializeRegistry(BOOLEAN);
4198 NTSYSAPI NTSTATUS WINAPI NtInitiatePowerAction(POWER_ACTION,SYSTEM_POWER_STATE,ULONG,BOOLEAN);
4199 NTSYSAPI NTSTATUS WINAPI NtIsProcessInJob(HANDLE,HANDLE);
4200 NTSYSAPI NTSTATUS WINAPI NtListenPort(HANDLE,PLPC_MESSAGE);
4201 NTSYSAPI NTSTATUS WINAPI NtLoadDriver(const UNICODE_STRING *);
4202 NTSYSAPI NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *);
4203 NTSYSAPI NTSTATUS WINAPI NtLoadKey2(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *,ULONG);
4204 NTSYSAPI NTSTATUS WINAPI NtLoadKeyEx(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *,ULONG,HANDLE,HANDLE,ACCESS_MASK,HANDLE *,IO_STATUS_BLOCK *);
4205 NTSYSAPI NTSTATUS WINAPI NtLockFile(HANDLE,HANDLE,PIO_APC_ROUTINE,void*,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,ULONG*,BOOLEAN,BOOLEAN);
4206 NTSYSAPI NTSTATUS WINAPI NtLockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
4207 NTSYSAPI NTSTATUS WINAPI NtMakeTemporaryObject(HANDLE);
4208 NTSYSAPI NTSTATUS WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG_PTR,SIZE_T,const LARGE_INTEGER*,SIZE_T*,SECTION_INHERIT,ULONG,ULONG);
4209 NTSYSAPI NTSTATUS WINAPI NtMapViewOfSectionEx(HANDLE,HANDLE,PVOID*,const LARGE_INTEGER*,SIZE_T*,ULONG,ULONG,MEM_EXTENDED_PARAMETER*,ULONG);
4210 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,ULONG,BOOLEAN);
4211 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeKey(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
4212 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeMultipleKeys(HANDLE,ULONG,OBJECT_ATTRIBUTES*,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
4213 NTSYSAPI NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
4214 NTSYSAPI NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
4215 NTSYSAPI NTSTATUS WINAPI NtOpenEventPair(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
4216 NTSYSAPI NTSTATUS WINAPI NtOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
4217 NTSYSAPI NTSTATUS WINAPI NtOpenIoCompletion(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
4218 NTSYSAPI NTSTATUS WINAPI NtOpenJobObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
4219 NTSYSAPI NTSTATUS WINAPI NtOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
4220 NTSYSAPI NTSTATUS WINAPI NtOpenKeyEx(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG);
4221 NTSYSAPI NTSTATUS WINAPI NtOpenKeyTransacted(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,HANDLE);
4222 NTSYSAPI NTSTATUS WINAPI NtOpenKeyTransactedEx(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,HANDLE);
4223 NTSYSAPI NTSTATUS WINAPI NtOpenKeyedEvent(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
4224 NTSYSAPI NTSTATUS WINAPI NtOpenMutant(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
4225 NTSYSAPI NTSTATUS WINAPI NtOpenObjectAuditAlarm(PUNICODE_STRING,PHANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,ACCESS_MASK,PPRIVILEGE_SET,BOOLEAN,BOOLEAN,PBOOLEAN);
4226 NTSYSAPI NTSTATUS WINAPI NtOpenProcess(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
4227 NTSYSAPI NTSTATUS WINAPI NtOpenProcessToken(HANDLE,DWORD,HANDLE *);
4228 NTSYSAPI NTSTATUS WINAPI NtOpenProcessTokenEx(HANDLE,DWORD,DWORD,HANDLE *);
4229 NTSYSAPI NTSTATUS WINAPI NtOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
4230 NTSYSAPI NTSTATUS WINAPI NtOpenSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
4231 NTSYSAPI NTSTATUS WINAPI NtOpenSymbolicLinkObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
4232 NTSYSAPI NTSTATUS WINAPI NtOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
4233 NTSYSAPI NTSTATUS WINAPI NtOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
4234 NTSYSAPI NTSTATUS WINAPI NtOpenThreadTokenEx(HANDLE,DWORD,BOOLEAN,DWORD,HANDLE *);
4235 NTSYSAPI NTSTATUS WINAPI NtOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
4236 NTSYSAPI NTSTATUS WINAPI NtPowerInformation(POWER_INFORMATION_LEVEL,PVOID,ULONG,PVOID,ULONG);
4237 NTSYSAPI NTSTATUS WINAPI NtPrivilegeCheck(HANDLE,PPRIVILEGE_SET,PBOOLEAN);
4238 NTSYSAPI NTSTATUS WINAPI NtPrivilegeObjectAuditAlarm(PUNICODE_STRING,HANDLE,HANDLE,ULONG,PPRIVILEGE_SET,BOOLEAN);
4239 NTSYSAPI NTSTATUS WINAPI NtPrivilegedServiceAuditAlarm(PUNICODE_STRING,PUNICODE_STRING,HANDLE,PPRIVILEGE_SET,BOOLEAN);
4240 NTSYSAPI NTSTATUS WINAPI NtProtectVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG,ULONG*);
4241 NTSYSAPI NTSTATUS WINAPI NtPulseEvent(HANDLE,LONG*);
4242 NTSYSAPI NTSTATUS WINAPI NtQueueApcThread(HANDLE,PNTAPCFUNC,ULONG_PTR,ULONG_PTR,ULONG_PTR);
4243 NTSYSAPI NTSTATUS WINAPI NtQueryAttributesFile(const OBJECT_ATTRIBUTES*,FILE_BASIC_INFORMATION*);
4244 NTSYSAPI NTSTATUS WINAPI NtQueryDefaultLocale(BOOLEAN,LCID*);
4245 NTSYSAPI NTSTATUS WINAPI NtQueryDefaultUILanguage(LANGID*);
4246 NTSYSAPI NTSTATUS WINAPI NtQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
4247 NTSYSAPI NTSTATUS WINAPI NtQueryDirectoryObject(HANDLE,PDIRECTORY_BASIC_INFORMATION,ULONG,BOOLEAN,BOOLEAN,PULONG,PULONG);
4248 NTSYSAPI NTSTATUS WINAPI NtQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PULONG,BOOLEAN);
4249 NTSYSAPI NTSTATUS WINAPI NtQueryEvent(HANDLE,EVENT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
4250 NTSYSAPI NTSTATUS WINAPI NtQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*);
4251 NTSYSAPI NTSTATUS WINAPI NtQueryInformationAtom(RTL_ATOM,ATOM_INFORMATION_CLASS,PVOID,ULONG,ULONG*);
4252 NTSYSAPI NTSTATUS WINAPI NtQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
4253 NTSYSAPI NTSTATUS WINAPI NtQueryInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,PVOID,ULONG,PULONG);
4254 NTSYSAPI NTSTATUS WINAPI NtQueryInformationPort(HANDLE,PORT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
4255 NTSYSAPI NTSTATUS WINAPI NtQueryInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG,PULONG);
4256 NTSYSAPI NTSTATUS WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
4257 NTSYSAPI NTSTATUS WINAPI NtQueryInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG,PULONG);
4258 NTSYSAPI NTSTATUS WINAPI NtQueryInstallUILanguage(LANGID*);
4259 NTSYSAPI NTSTATUS WINAPI NtQueryIntervalProfile(KPROFILE_SOURCE,PULONG);
4260 NTSYSAPI NTSTATUS WINAPI NtQueryIoCompletion(HANDLE,IO_COMPLETION_INFORMATION_CLASS,PVOID,ULONG,PULONG);
4261 NTSYSAPI NTSTATUS WINAPI NtQueryKey(HANDLE,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
4262 NTSYSAPI NTSTATUS WINAPI NtQueryMultipleValueKey(HANDLE,PKEY_MULTIPLE_VALUE_INFORMATION,ULONG,PVOID,ULONG,PULONG);
4263 NTSYSAPI NTSTATUS WINAPI NtQueryMutant(HANDLE,MUTANT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
4264 NTSYSAPI NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
4265 NTSYSAPI NTSTATUS WINAPI NtQueryOpenSubKeys(POBJECT_ATTRIBUTES,PULONG);
4266 NTSYSAPI NTSTATUS WINAPI NtQueryPerformanceCounter(PLARGE_INTEGER, PLARGE_INTEGER);
4267 NTSYSAPI NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
4268 NTSYSAPI NTSTATUS WINAPI NtQuerySection(HANDLE,SECTION_INFORMATION_CLASS,PVOID,SIZE_T,SIZE_T*);
4269 NTSYSAPI NTSTATUS WINAPI NtQuerySemaphore(HANDLE,SEMAPHORE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
4270 NTSYSAPI NTSTATUS WINAPI NtQuerySymbolicLinkObject(HANDLE,PUNICODE_STRING,PULONG);
4271 NTSYSAPI NTSTATUS WINAPI NtQuerySystemEnvironmentValue(PUNICODE_STRING,PWCHAR,ULONG,PULONG);
4272 NTSYSAPI NTSTATUS WINAPI NtQuerySystemEnvironmentValueEx(PUNICODE_STRING,GUID*,void*,ULONG*,ULONG*);
4273 NTSYSAPI NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
4274 NTSYSAPI NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS,void*,ULONG,void*,ULONG,ULONG*);
4275 NTSYSAPI NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER);
4276 NTSYSAPI NTSTATUS WINAPI NtQueryTimer(HANDLE,TIMER_INFORMATION_CLASS,PVOID,ULONG,PULONG);
4277 NTSYSAPI NTSTATUS WINAPI NtQueryTimerResolution(PULONG,PULONG,PULONG);
4278 NTSYSAPI NTSTATUS WINAPI NtQueryValueKey(HANDLE,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
4279 NTSYSAPI NTSTATUS WINAPI NtQueryLicenseValue(const UNICODE_STRING *,ULONG *,PVOID,ULONG,ULONG *);
4280 NTSYSAPI NTSTATUS WINAPI NtQueryVirtualMemory(HANDLE,LPCVOID,MEMORY_INFORMATION_CLASS,PVOID,SIZE_T,SIZE_T*);
4281 NTSYSAPI NTSTATUS WINAPI NtQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
4282 NTSYSAPI NTSTATUS WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
4283 NTSYSAPI NTSTATUS WINAPI NtRaiseHardError(NTSTATUS,ULONG,PUNICODE_STRING,PVOID*,HARDERROR_RESPONSE_OPTION,PHARDERROR_RESPONSE);
4284 NTSYSAPI NTSTATUS WINAPI NtReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
4285 NTSYSAPI NTSTATUS WINAPI NtReadFileScatter(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT*,ULONG,PLARGE_INTEGER,PULONG);
4286 NTSYSAPI NTSTATUS WINAPI NtReadRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
4287 NTSYSAPI NTSTATUS WINAPI NtReadVirtualMemory(HANDLE,const void*,void*,SIZE_T,SIZE_T*);
4288 NTSYSAPI NTSTATUS WINAPI NtRegisterThreadTerminatePort(HANDLE);
4289 NTSYSAPI NTSTATUS WINAPI NtReleaseKeyedEvent(HANDLE,const void*,BOOLEAN,const LARGE_INTEGER*);
4290 NTSYSAPI NTSTATUS WINAPI NtReleaseMutant(HANDLE,PLONG);
4291 NTSYSAPI NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
4292 NTSYSAPI NTSTATUS WINAPI NtRemoveIoCompletion(HANDLE,PULONG_PTR,PULONG_PTR,PIO_STATUS_BLOCK,PLARGE_INTEGER);
4293 NTSYSAPI NTSTATUS WINAPI NtRemoveIoCompletionEx(HANDLE,FILE_IO_COMPLETION_INFORMATION*,ULONG,ULONG*,LARGE_INTEGER*,BOOLEAN);
4294 NTSYSAPI NTSTATUS WINAPI NtRemoveProcessDebug(HANDLE,HANDLE);
4295 NTSYSAPI NTSTATUS WINAPI NtRenameKey(HANDLE,UNICODE_STRING*);
4296 NTSYSAPI NTSTATUS WINAPI NtReplaceKey(POBJECT_ATTRIBUTES,HANDLE,POBJECT_ATTRIBUTES);
4297 NTSYSAPI NTSTATUS WINAPI NtReplyPort(HANDLE,PLPC_MESSAGE);
4298 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReceivePort(HANDLE,PULONG,PLPC_MESSAGE,PLPC_MESSAGE);
4299 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReceivePortEx(HANDLE,PVOID*,PPORT_MESSAGE,PPORT_MESSAGE,PLARGE_INTEGER);
4300 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReplyPort(HANDLE,PLPC_MESSAGE);
4301 NTSYSAPI NTSTATUS WINAPI NtRequestPort(HANDLE,PLPC_MESSAGE);
4302 NTSYSAPI NTSTATUS WINAPI NtRequestWaitReplyPort(HANDLE,PLPC_MESSAGE,PLPC_MESSAGE);
4303 NTSYSAPI NTSTATUS WINAPI NtResetEvent(HANDLE,LONG*);
4304 NTSYSAPI NTSTATUS WINAPI NtResetWriteWatch(HANDLE,PVOID,SIZE_T);
4305 NTSYSAPI NTSTATUS WINAPI NtRestoreKey(HANDLE,HANDLE,ULONG);
4306 NTSYSAPI NTSTATUS WINAPI NtResumeProcess(HANDLE);
4307 NTSYSAPI NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG);
4308 NTSYSAPI NTSTATUS WINAPI NtRollbackTransaction(HANDLE,BOOLEAN);
4309 NTSYSAPI NTSTATUS WINAPI NtSaveKey(HANDLE,HANDLE);
4310 NTSYSAPI NTSTATUS WINAPI NtSecureConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PSID,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
4311 NTSYSAPI NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
4312 NTSYSAPI NTSTATUS WINAPI NtSetDebugFilterState(ULONG,ULONG,BOOLEAN);
4313 NTSYSAPI NTSTATUS WINAPI NtSetDefaultHardErrorPort(HANDLE);
4314 NTSYSAPI NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID);
4315 NTSYSAPI NTSTATUS WINAPI NtSetDefaultUILanguage(LANGID);
4316 NTSYSAPI NTSTATUS WINAPI NtSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG);
4317 NTSYSAPI NTSTATUS WINAPI NtSetEvent(HANDLE,LONG*);
4318 NTSYSAPI NTSTATUS WINAPI NtSetHighEventPair(HANDLE);
4319 NTSYSAPI NTSTATUS WINAPI NtSetHighWaitLowEventPair(HANDLE);
4320 NTSYSAPI NTSTATUS WINAPI NtSetHighWaitLowThread(VOID);
4321 NTSYSAPI NTSTATUS WINAPI NtSetInformationDebugObject(HANDLE,DEBUGOBJECTINFOCLASS,PVOID,ULONG,ULONG*);
4322 NTSYSAPI NTSTATUS WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
4323 NTSYSAPI NTSTATUS WINAPI NtSetInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,PVOID,ULONG);
4324 NTSYSAPI NTSTATUS WINAPI NtSetInformationKey(HANDLE,const int,PVOID,ULONG);
4325 NTSYSAPI NTSTATUS WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
4326 NTSYSAPI NTSTATUS WINAPI NtSetInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG);
4327 NTSYSAPI NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
4328 NTSYSAPI NTSTATUS WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG);
4329 NTSYSAPI NTSTATUS WINAPI NtSetInformationVirtualMemory(HANDLE,VIRTUAL_MEMORY_INFORMATION_CLASS,ULONG_PTR,PMEMORY_RANGE_ENTRY,PVOID,ULONG);
4330 NTSYSAPI NTSTATUS WINAPI NtSetIntervalProfile(ULONG,KPROFILE_SOURCE);
4331 NTSYSAPI NTSTATUS WINAPI NtSetIoCompletion(HANDLE,ULONG_PTR,ULONG_PTR,NTSTATUS,SIZE_T);
4332 NTSYSAPI NTSTATUS WINAPI NtSetLdtEntries(ULONG,LDT_ENTRY,ULONG,LDT_ENTRY);
4333 NTSYSAPI NTSTATUS WINAPI NtSetLowEventPair(HANDLE);
4334 NTSYSAPI NTSTATUS WINAPI NtSetLowWaitHighEventPair(HANDLE);
4335 NTSYSAPI NTSTATUS WINAPI NtSetLowWaitHighThread(VOID);
4336 NTSYSAPI NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
4337 NTSYSAPI NTSTATUS WINAPI NtSetSystemEnvironmentValue(PUNICODE_STRING,PUNICODE_STRING);
4338 NTSYSAPI NTSTATUS WINAPI NtSetSystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG);
4339 NTSYSAPI NTSTATUS WINAPI NtSetSystemPowerState(POWER_ACTION,SYSTEM_POWER_STATE,ULONG);
4340 NTSYSAPI NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
4341 NTSYSAPI NTSTATUS WINAPI NtSetThreadExecutionState(EXECUTION_STATE,EXECUTION_STATE*);
4342 NTSYSAPI NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMER_APC_ROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
4343 NTSYSAPI NTSTATUS WINAPI NtSetTimerResolution(ULONG,BOOLEAN,PULONG);
4344 NTSYSAPI NTSTATUS WINAPI NtSetValueKey(HANDLE,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
4345 NTSYSAPI NTSTATUS WINAPI NtSetVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
4346 NTSYSAPI NTSTATUS WINAPI NtSignalAndWaitForSingleObject(HANDLE,HANDLE,BOOLEAN,const LARGE_INTEGER*);
4347 NTSYSAPI NTSTATUS WINAPI NtShutdownSystem(SHUTDOWN_ACTION);
4348 NTSYSAPI NTSTATUS WINAPI NtStartProfile(HANDLE);
4349 NTSYSAPI NTSTATUS WINAPI NtStopProfile(HANDLE);
4350 NTSYSAPI NTSTATUS WINAPI NtSuspendProcess(HANDLE);
4351 NTSYSAPI NTSTATUS WINAPI NtSuspendThread(HANDLE,PULONG);
4352 NTSYSAPI NTSTATUS WINAPI NtSystemDebugControl(SYSDBG_COMMAND,PVOID,ULONG,PVOID,ULONG,PULONG);
4353 NTSYSAPI NTSTATUS WINAPI NtTerminateJobObject(HANDLE,NTSTATUS);
4354 NTSYSAPI NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG);
4355 NTSYSAPI NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG);
4356 NTSYSAPI NTSTATUS WINAPI NtTestAlert(VOID);
4357 NTSYSAPI NTSTATUS WINAPI NtTraceControl(ULONG,void*,ULONG,void*,ULONG,ULONG*);
4358 NTSYSAPI NTSTATUS WINAPI NtUnloadDriver(const UNICODE_STRING *);
4359 NTSYSAPI NTSTATUS WINAPI NtUnloadKey(POBJECT_ATTRIBUTES);
4360 NTSYSAPI NTSTATUS WINAPI NtUnloadKeyEx(POBJECT_ATTRIBUTES,HANDLE);
4361 NTSYSAPI NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
4362 NTSYSAPI NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
4363 NTSYSAPI NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
4364 NTSYSAPI NTSTATUS WINAPI NtUnmapViewOfSectionEx(HANDLE,PVOID,ULONG);
4365 NTSYSAPI NTSTATUS WINAPI NtVdmControl(ULONG,PVOID);
4366 NTSYSAPI NTSTATUS WINAPI NtWaitForAlertByThreadId(const void*,const LARGE_INTEGER*);
4367 NTSYSAPI NTSTATUS WINAPI NtWaitForDebugEvent(HANDLE,BOOLEAN,LARGE_INTEGER*,DBGUI_WAIT_STATE_CHANGE*);
4368 NTSYSAPI NTSTATUS WINAPI NtWaitForKeyedEvent(HANDLE,const void*,BOOLEAN,const LARGE_INTEGER*);
4369 NTSYSAPI NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
4370 NTSYSAPI NTSTATUS WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
4371 NTSYSAPI NTSTATUS WINAPI NtWaitHighEventPair(HANDLE);
4372 NTSYSAPI NTSTATUS WINAPI NtWaitLowEventPair(HANDLE);
4373 NTSYSAPI NTSTATUS WINAPI NtWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
4374 NTSYSAPI NTSTATUS WINAPI NtWriteFileGather(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT*,ULONG,PLARGE_INTEGER,PULONG);
4375 NTSYSAPI NTSTATUS WINAPI NtWriteRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
4376 NTSYSAPI NTSTATUS WINAPI NtWriteVirtualMemory(HANDLE,void*,const void*,SIZE_T,SIZE_T*);
4377 NTSYSAPI NTSTATUS WINAPI NtYieldExecution(void);
4378 NTSYSAPI NTSTATUS WINAPI RtlAbsoluteToSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PULONG);
4379 NTSYSAPI void WINAPI RtlAcquirePebLock(void);
4380 NTSYSAPI BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK,BYTE);
4381 NTSYSAPI BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK,BYTE);
4382 NTSYSAPI void WINAPI RtlAcquireSRWLockExclusive(RTL_SRWLOCK*);
4383 NTSYSAPI void WINAPI RtlAcquireSRWLockShared(RTL_SRWLOCK*);
4384 NTSYSAPI NTSTATUS WINAPI RtlActivateActivationContext(DWORD,HANDLE,ULONG_PTR*);
4385 NTSYSAPI NTSTATUS WINAPI RtlActivateActivationContextEx(ULONG,TEB*,HANDLE,ULONG_PTR*);
4386 NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
4387 NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
4388 NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID);
4389 NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
4390 NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
4391 NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID);
4392 NTSYSAPI NTSTATUS WINAPI RtlAddAce(PACL,DWORD,DWORD,PACE_HEADER,DWORD);
4393 NTSYSAPI NTSTATUS WINAPI RtlAddAtomToAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
4394 NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL);
4395 NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAceEx(PACL,DWORD,DWORD,DWORD,PSID,BOOL,BOOL);
4396 NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID,BOOL,BOOL);
4397 NTSYSAPI NTSTATUS WINAPI RtlAddMandatoryAce(PACL,DWORD,DWORD,DWORD,DWORD,PSID);
4398 NTSYSAPI NTSTATUS WINAPI RtlAddProcessTrustLabelAce(PACL,DWORD,DWORD,PSID,DWORD,DWORD);
4399 NTSYSAPI void WINAPI RtlAddRefActivationContext(HANDLE);
4400 NTSYSAPI PVOID WINAPI RtlAddVectoredContinueHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
4401 NTSYSAPI PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
4402 NTSYSAPI PVOID WINAPI RtlAddressInSectionTable(const IMAGE_NT_HEADERS*,HMODULE,DWORD);
4403 NTSYSAPI NTSTATUS WINAPI RtlAdjustPrivilege(ULONG,BOOLEAN,BOOLEAN,PBOOLEAN);
4404 NTSYSAPI NTSTATUS WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
4405 NTSYSAPI RTL_HANDLE * WINAPI RtlAllocateHandle(RTL_HANDLE_TABLE *,ULONG *);
4406 NTSYSAPI BOOLEAN WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
4407 NTSYSAPI PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,SIZE_T) __WINE_ALLOC_SIZE(3) __WINE_DEALLOC(RtlFreeHeap,3) __WINE_MALLOC;
4408 NTSYSAPI WCHAR WINAPI RtlAnsiCharToUnicodeChar(LPSTR *);
4409 NTSYSAPI DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING *);
4410 NTSYSAPI NTSTATUS WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING,PCANSI_STRING,BOOLEAN);
4411 NTSYSAPI NTSTATUS WINAPI RtlAppendAsciizToString(STRING *,LPCSTR);
4412 NTSYSAPI NTSTATUS WINAPI RtlAppendStringToString(STRING *,const STRING *);
4413 NTSYSAPI NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING *,const UNICODE_STRING *);
4414 NTSYSAPI NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING *,LPCWSTR);
4415 NTSYSAPI BOOLEAN WINAPI RtlAreAllAccessesGranted(ACCESS_MASK,ACCESS_MASK);
4416 NTSYSAPI BOOLEAN WINAPI RtlAreAnyAccessesGranted(ACCESS_MASK,ACCESS_MASK);
4417 NTSYSAPI BOOLEAN WINAPI RtlAreBitsSet(PCRTL_BITMAP,ULONG,ULONG);
4418 NTSYSAPI BOOLEAN WINAPI RtlAreBitsClear(PCRTL_BITMAP,ULONG,ULONG);
4419 NTSYSAPI USHORT WINAPI RtlCaptureStackBackTrace(ULONG,ULONG,PVOID*,ULONG*);
4420 NTSYSAPI NTSTATUS WINAPI RtlCharToInteger(PCSZ,ULONG,PULONG);
4421 NTSYSAPI NTSTATUS WINAPI RtlCheckRegistryKey(ULONG, PWSTR);
4422 NTSYSAPI void WINAPI RtlClearAllBits(PRTL_BITMAP);
4423 NTSYSAPI void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
4424 NTSYSAPI ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
4425 NTSYSAPI LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
4426 NTSYSAPI LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
4427 NTSYSAPI LONG WINAPI RtlCompareUnicodeStrings(const WCHAR*,SIZE_T,const WCHAR*,SIZE_T,BOOLEAN);
4428 NTSYSAPI NTSTATUS WINAPI RtlCompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,ULONG,PULONG,PVOID);
4429 NTSYSAPI DWORD WINAPI RtlComputeCrc32(DWORD,const BYTE*,INT);
4430 NTSYSAPI NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
4431 NTSYSAPI NTSTATUS WINAPI RtlConvertToAutoInheritSecurityObject(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,GUID*,BOOL,PGENERIC_MAPPING);
4432 NTSYSAPI NTSTATUS WINAPI RtlCopyContext(CONTEXT*,DWORD,CONTEXT*);
4433 NTSYSAPI NTSTATUS WINAPI RtlCopyExtendedContext(CONTEXT_EX*,ULONG,CONTEXT_EX*);
4434 NTSYSAPI void WINAPI RtlCopyLuid(PLUID,const LUID*);
4435 NTSYSAPI void WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
4436 NTSYSAPI NTSTATUS WINAPI RtlCopySecurityDescriptor(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR);
4437 NTSYSAPI BOOLEAN WINAPI RtlCopySid(DWORD,PSID,PSID);
4438 NTSYSAPI void WINAPI RtlCopyString(STRING*,const STRING*);
4439 NTSYSAPI void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
4440 NTSYSAPI NTSTATUS WINAPI RtlCreateAcl(PACL,DWORD,DWORD);
4441 NTSYSAPI NTSTATUS WINAPI RtlCreateActivationContext(HANDLE*,const void*);
4442 NTSYSAPI NTSTATUS WINAPI RtlCreateAtomTable(ULONG,RTL_ATOM_TABLE*);
4443 NTSYSAPI NTSTATUS WINAPI RtlCreateEnvironment(BOOLEAN, PWSTR*);
4444 NTSYSAPI HANDLE WINAPI RtlCreateHeap(ULONG,PVOID,SIZE_T,SIZE_T,PVOID,PRTL_HEAP_DEFINITION);
4445 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*);
4446 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);
4447 NTSYSAPI PDEBUG_BUFFER WINAPI RtlCreateQueryDebugBuffer(ULONG,BOOLEAN);
4448 NTSYSAPI NTSTATUS WINAPI RtlCreateRegistryKey(ULONG,PWSTR);
4449 NTSYSAPI NTSTATUS WINAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
4450 NTSYSAPI NTSTATUS WINAPI RtlCreateTimer(HANDLE,HANDLE*,RTL_WAITORTIMERCALLBACKFUNC, PVOID, DWORD, DWORD, ULONG);
4451 NTSYSAPI NTSTATUS WINAPI RtlCreateTimerQueue(PHANDLE);
4452 NTSYSAPI BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
4453 NTSYSAPI BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
4454 NTSYSAPI NTSTATUS WINAPI RtlCreateUserProcess(UNICODE_STRING*,ULONG,RTL_USER_PROCESS_PARAMETERS*,SECURITY_DESCRIPTOR*,SECURITY_DESCRIPTOR*,HANDLE,BOOLEAN,HANDLE,HANDLE,RTL_USER_PROCESS_INFORMATION*);
4455 NTSYSAPI NTSTATUS WINAPI RtlCreateUserStack(SIZE_T,SIZE_T,ULONG,SIZE_T,SIZE_T,INITIAL_TEB*);
4456 NTSYSAPI NTSTATUS WINAPI RtlCreateUserThread(HANDLE,SECURITY_DESCRIPTOR*,BOOLEAN,ULONG,SIZE_T,SIZE_T,PRTL_THREAD_START_ROUTINE,void*,HANDLE*,CLIENT_ID*);
4457 NTSYSAPI NTSTATUS WINAPI RtlCustomCPToUnicodeN(CPTABLEINFO*,WCHAR*,DWORD,DWORD*,const char*,DWORD);
4458 NTSYSAPI PRTL_USER_PROCESS_PARAMETERS WINAPI RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
4459 NTSYSAPI void WINAPI RtlDeactivateActivationContext(DWORD,ULONG_PTR);
4460 NTSYSAPI PVOID WINAPI RtlDecodePointer(PVOID);
4461 NTSYSAPI NTSTATUS WINAPI RtlDecompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,PULONG);
4462 NTSYSAPI NTSTATUS WINAPI RtlDecompressFragment(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,ULONG,PULONG,PVOID);
4463 NTSYSAPI NTSTATUS WINAPI RtlDefaultNpAcl(PACL*);
4464 NTSYSAPI NTSTATUS WINAPI RtlDeleteAce(PACL,DWORD);
4465 NTSYSAPI NTSTATUS WINAPI RtlDeleteAtomFromAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
4466 NTSYSAPI NTSTATUS WINAPI RtlDeleteCriticalSection(RTL_CRITICAL_SECTION *);
4467 NTSYSAPI NTSTATUS WINAPI RtlDeleteRegistryValue(ULONG, PCWSTR, PCWSTR);
4468 NTSYSAPI void WINAPI RtlDeleteResource(LPRTL_RWLOCK);
4469 NTSYSAPI NTSTATUS WINAPI RtlDeleteSecurityObject(PSECURITY_DESCRIPTOR*);
4470 NTSYSAPI NTSTATUS WINAPI RtlDeleteTimer(HANDLE, HANDLE, HANDLE);
4471 NTSYSAPI NTSTATUS WINAPI RtlDeleteTimerQueueEx(HANDLE, HANDLE);
4472 NTSYSAPI PRTL_USER_PROCESS_PARAMETERS WINAPI RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
4473 NTSYSAPI NTSTATUS WINAPI RtlDeregisterWait(HANDLE);
4474 NTSYSAPI NTSTATUS WINAPI RtlDeregisterWaitEx(HANDLE,HANDLE);
4475 NTSYSAPI NTSTATUS WINAPI RtlDestroyAtomTable(RTL_ATOM_TABLE);
4476 NTSYSAPI NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR);
4477 NTSYSAPI NTSTATUS WINAPI RtlDestroyHandleTable(RTL_HANDLE_TABLE *);
4478 NTSYSAPI HANDLE WINAPI RtlDestroyHeap(HANDLE);
4479 NTSYSAPI void WINAPI RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS*);
4480 NTSYSAPI NTSTATUS WINAPI RtlDestroyQueryDebugBuffer(PDEBUG_BUFFER);
4481 NTSYSAPI DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
4482 NTSYSAPI BOOLEAN WINAPI RtlDllShutdownInProgress(void);
4483 NTSYSAPI BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR);
4484 NTSYSAPI BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(PCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
4485 NTSYSAPI NTSTATUS WINAPI RtlDosPathNameToNtPathName_U_WithStatus(PCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
4486 NTSYSAPI BOOLEAN WINAPI RtlDosPathNameToRelativeNtPathName_U(PCWSTR,PUNICODE_STRING,PWSTR*,RTL_RELATIVE_NAME*);
4487 NTSYSAPI NTSTATUS WINAPI RtlDosPathNameToRelativeNtPathName_U_WithStatus(PCWSTR,PUNICODE_STRING,PWSTR*,RTL_RELATIVE_NAME*);
4488 NTSYSAPI ULONG WINAPI RtlDosSearchPath_U(LPCWSTR, LPCWSTR, LPCWSTR, ULONG, LPWSTR, LPWSTR*);
4489 NTSYSAPI WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
4490 NTSYSAPI NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
4491 NTSYSAPI void WINAPI RtlDumpResource(LPRTL_RWLOCK);
4492 NTSYSAPI NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
4493 NTSYSAPI NTSTATUS WINAPI RtlEmptyAtomTable(RTL_ATOM_TABLE,BOOLEAN);
4494 NTSYSAPI PVOID WINAPI RtlEncodePointer(PVOID);
4495 NTSYSAPI NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
4496 NTSYSAPI void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
4497 NTSYSAPI NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
4498 NTSYSAPI NTSTATUS WINAPI RtlEqualDomainName(const UNICODE_STRING*,const UNICODE_STRING*);
4499 NTSYSAPI BOOLEAN WINAPI RtlEqualLuid(const LUID*,const LUID*);
4500 NTSYSAPI BOOL WINAPI RtlEqualPrefixSid(PSID,PSID);
4501 NTSYSAPI BOOL WINAPI RtlEqualSid(PSID,PSID);
4502 NTSYSAPI BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
4503 NTSYSAPI BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
4504 NTSYSAPI void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
4505 NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlExitUserProcess(ULONG);
4506 NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlExitUserThread(ULONG);
4507 NTSYSAPI NTSTATUS WINAPI RtlExpandEnvironmentStrings(const WCHAR*,WCHAR*,SIZE_T,WCHAR*,SIZE_T,SIZE_T*);
4508 NTSYSAPI NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PCWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*);
4509 NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionString(ULONG,const GUID*,ULONG,const UNICODE_STRING*,PVOID);
4510 NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionGuid(ULONG,const GUID*,ULONG,const GUID*,PVOID);
4511 NTSYSAPI NTSTATUS WINAPI RtlFindCharInUnicodeString(int,const UNICODE_STRING*,const UNICODE_STRING*,USHORT*);
4512 NTSYSAPI ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
4513 NTSYSAPI ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
4514 NTSYSAPI ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
4515 NTSYSAPI void * WINAPI RtlFindExportedRoutineByName(HMODULE,const char*);
4516 NTSYSAPI ULONG WINAPI RtlFindLastBackwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
4517 NTSYSAPI ULONG WINAPI RtlFindLastBackwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
4518 NTSYSAPI CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG);
4519 NTSYSAPI ULONG WINAPI RtlFindLongestRunSet(PCRTL_BITMAP,PULONG);
4520 NTSYSAPI ULONG WINAPI RtlFindLongestRunClear(PCRTL_BITMAP,PULONG);
4521 NTSYSAPI NTSTATUS WINAPI RtlFindMessage(HMODULE,ULONG,ULONG,ULONG,const MESSAGE_RESOURCE_ENTRY**);
4522 NTSYSAPI CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG);
4523 NTSYSAPI ULONG WINAPI RtlFindNextForwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
4524 NTSYSAPI ULONG WINAPI RtlFindNextForwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
4525 NTSYSAPI ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP,ULONG,ULONG);
4526 NTSYSAPI ULONG WINAPI RtlFindSetBitsAndClear(PRTL_BITMAP,ULONG,ULONG);
4527 NTSYSAPI ULONG WINAPI RtlFindSetRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
4528 NTSYSAPI BOOLEAN WINAPI RtlFirstFreeAce(PACL,PACE_HEADER *);
4529 NTSYSAPI NTSTATUS WINAPI RtlFlsAlloc(PFLS_CALLBACK_FUNCTION,ULONG *);
4530 NTSYSAPI NTSTATUS WINAPI RtlFlsFree(ULONG);
4531 NTSYSAPI NTSTATUS WINAPI RtlFlsGetValue(ULONG,void **);
4532 NTSYSAPI NTSTATUS WINAPI RtlFlsSetValue(ULONG,void *);
4533 NTSYSAPI NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING);
4534 NTSYSAPI NTSTATUS WINAPI RtlFormatMessage(LPCWSTR,ULONG,BOOLEAN,BOOLEAN,BOOLEAN,__ms_va_list *,LPWSTR,ULONG,ULONG*);
4535 NTSYSAPI NTSTATUS WINAPI RtlFormatMessageEx(LPCWSTR,ULONG,BOOLEAN,BOOLEAN,BOOLEAN,__ms_va_list *,LPWSTR,ULONG,ULONG*,ULONG);
4536 NTSYSAPI void WINAPI RtlFreeActivationContextStack(ACTIVATION_CONTEXT_STACK *);
4537 NTSYSAPI void WINAPI RtlFreeAnsiString(PANSI_STRING);
4538 NTSYSAPI BOOLEAN WINAPI RtlFreeHandle(RTL_HANDLE_TABLE *,RTL_HANDLE *);
4539 NTSYSAPI void WINAPI RtlFreeOemString(POEM_STRING);
4540 NTSYSAPI DWORD WINAPI RtlFreeSid(PSID);
4541 NTSYSAPI void WINAPI RtlFreeThreadActivationContextStack(void);
4542 NTSYSAPI void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
4543 NTSYSAPI void WINAPI RtlFreeUserStack(void*);
4544 NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING,GUID*);
4545 NTSYSAPI NTSTATUS WINAPI RtlGetAce(PACL,DWORD,LPVOID *);
4546 NTSYSAPI NTSTATUS WINAPI RtlGetActiveActivationContext(HANDLE*);
4547 NTSYSAPI NTSTATUS WINAPI RtlGetCompressionWorkSpaceSize(USHORT,PULONG,PULONG);
4548 NTSYSAPI NTSTATUS WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
4549 NTSYSAPI ULONG WINAPI RtlGetCurrentDirectory_U(ULONG, LPWSTR);
4550 NTSYSAPI PEB * WINAPI RtlGetCurrentPeb(void);
4551 NTSYSAPI void WINAPI RtlGetCurrentProcessorNumberEx(PROCESSOR_NUMBER*);
4552 NTSYSAPI HANDLE WINAPI RtlGetCurrentTransaction(void);
4553 NTSYSAPI NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
4554 NTSYSAPI ULONG64 WINAPI RtlGetEnabledExtendedFeatures(ULONG64);
4555 NTSYSAPI NTSTATUS WINAPI RtlGetExePath(PCWSTR,PWSTR*);
4556 NTSYSAPI NTSTATUS WINAPI RtlGetExtendedContextLength(ULONG,ULONG*);
4557 NTSYSAPI NTSTATUS WINAPI RtlGetExtendedContextLength2(ULONG,ULONG*,ULONG64);
4558 NTSYSAPI ULONG64 WINAPI RtlGetExtendedFeaturesMask(CONTEXT_EX*);
4559 NTSYSAPI TEB_ACTIVE_FRAME * WINAPI RtlGetFrame(void);
4560 NTSYSAPI ULONG WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*);
4561 NTSYSAPI NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
4562 NTSYSAPI NTSTATUS WINAPI RtlGetLastNtStatus(void);
4563 NTSYSAPI DWORD WINAPI RtlGetLastWin32Error(void);
4564 NTSYSAPI NTSTATUS WINAPI RtlGetLocaleFileMappingAddress(void**,LCID*,LARGE_INTEGER*);
4565 NTSYSAPI DWORD WINAPI RtlGetLongestNtPathLength(void);
4566 NTSYSAPI NTSTATUS WINAPI RtlGetNativeSystemInformation(SYSTEM_INFORMATION_CLASS,void*,ULONG,ULONG*);
4567 NTSYSAPI ULONG WINAPI RtlGetNtGlobalFlags(void);
4568 NTSYSAPI BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
4569 NTSYSAPI void WINAPI RtlGetNtVersionNumbers(LPDWORD,LPDWORD,LPDWORD);
4570 NTSYSAPI NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
4571 NTSYSAPI ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
4572 NTSYSAPI NTSTATUS WINAPI RtlGetProcessPreferredUILanguages(DWORD,ULONG*,WCHAR*,ULONG*);
4573 NTSYSAPI BOOLEAN WINAPI RtlGetProductInfo(DWORD,DWORD,DWORD,DWORD,PDWORD);
4574 NTSYSAPI NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
4575 NTSYSAPI NTSTATUS WINAPI RtlGetSearchPath(PWSTR*);
4576 NTSYSAPI NTSTATUS WINAPI RtlGetSystemPreferredUILanguages(DWORD,ULONG,ULONG*,WCHAR*,ULONG*);
4577 NTSYSAPI LONGLONG WINAPI RtlGetSystemTimePrecise(void);
4578 NTSYSAPI DWORD WINAPI RtlGetThreadErrorMode(void);
4579 NTSYSAPI NTSTATUS WINAPI RtlGetThreadPreferredUILanguages(DWORD,ULONG*,WCHAR*,ULONG*);
4580 NTSYSAPI BOOLEAN WINAPI RtlGetUserInfoHeap(HANDLE,ULONG,void*,void**,ULONG*);
4581 NTSYSAPI NTSTATUS WINAPI RtlGetUserPreferredUILanguages(DWORD,ULONG,ULONG*,WCHAR*,ULONG*);
4582 NTSYSAPI NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
4583 NTSYSAPI NTSTATUS WINAPI RtlHashUnicodeString(const UNICODE_STRING*,BOOLEAN,ULONG,ULONG*);
4584 NTSYSAPI PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
4585 NTSYSAPI NTSTATUS WINAPI RtlIdnToAscii(DWORD,const WCHAR*,INT,WCHAR*,INT*);
4586 NTSYSAPI NTSTATUS WINAPI RtlIdnToNameprepUnicode(DWORD,const WCHAR*,INT,WCHAR*,INT*);
4587 NTSYSAPI NTSTATUS WINAPI RtlIdnToUnicode(DWORD,const WCHAR*,INT,WCHAR*,INT*);
4588 NTSYSAPI PVOID WINAPI RtlImageDirectoryEntryToData(HMODULE,BOOL,WORD,ULONG *);
4589 NTSYSAPI PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE);
4590 NTSYSAPI PIMAGE_SECTION_HEADER WINAPI RtlImageRvaToSection(const IMAGE_NT_HEADERS *,HMODULE,DWORD);
4591 NTSYSAPI PVOID WINAPI RtlImageRvaToVa(const IMAGE_NT_HEADERS *,HMODULE,DWORD,IMAGE_SECTION_HEADER **);
4592 NTSYSAPI NTSTATUS WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
4593 NTSYSAPI void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
4594 NTSYSAPI NTSTATUS WINAPI RtlInitAnsiStringEx(PANSI_STRING,PCSZ);
4595 NTSYSAPI void WINAPI RtlInitCodePageTable(USHORT*,CPTABLEINFO*);
4596 NTSYSAPI void WINAPI RtlInitNlsTables(USHORT*,USHORT*,USHORT*,NLSTABLEINFO*);
4597 NTSYSAPI void WINAPI RtlInitString(PSTRING,PCSZ);
4598 NTSYSAPI void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
4599 NTSYSAPI NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
4600 NTSYSAPI void WINAPI RtlInitializeBitMap(PRTL_BITMAP,PULONG,ULONG);
4601 NTSYSAPI void WINAPI RtlInitializeConditionVariable(RTL_CONDITION_VARIABLE *);
4602 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
4603 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,ULONG);
4604 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSectionEx(RTL_CRITICAL_SECTION *,ULONG,ULONG);
4605 NTSYSAPI NTSTATUS WINAPI RtlInitializeExtendedContext(void*,ULONG,CONTEXT_EX**);
4606 NTSYSAPI NTSTATUS WINAPI RtlInitializeExtendedContext2(void*,ULONG,CONTEXT_EX**,ULONG64);
4607 NTSYSAPI void WINAPI RtlInitializeHandleTable(ULONG,ULONG,RTL_HANDLE_TABLE *);
4608 NTSYSAPI void WINAPI RtlInitializeResource(LPRTL_RWLOCK);
4609 NTSYSAPI void WINAPI RtlInitializeSRWLock(RTL_SRWLOCK*);
4610 NTSYSAPI NTSTATUS WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
4611 NTSYSAPI NTSTATUS WINAPI RtlInt64ToUnicodeString(ULONGLONG,ULONG,UNICODE_STRING *);
4612 NTSYSAPI NTSTATUS WINAPI RtlIntegerToChar(ULONG,ULONG,ULONG,PCHAR);
4613 NTSYSAPI NTSTATUS WINAPI RtlIntegerToUnicodeString(ULONG,ULONG,UNICODE_STRING *);
4614 NTSYSAPI BOOLEAN WINAPI RtlIsActivationContextActive(HANDLE);
4615 NTSYSAPI BOOL WINAPI RtlIsCriticalSectionLocked(RTL_CRITICAL_SECTION *);
4616 NTSYSAPI BOOL WINAPI RtlIsCriticalSectionLockedByThread(RTL_CRITICAL_SECTION *);
4617 NTSYSAPI ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR);
4618 #ifdef __x86_64__
4619 NTSYSAPI BOOLEAN WINAPI RtlIsEcCode(const void*);
4620 #endif
4621 NTSYSAPI BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN);
4622 NTSYSAPI NTSTATUS WINAPI RtlIsNormalizedString(ULONG,const WCHAR*,INT,BOOLEAN*);
4623 NTSYSAPI BOOLEAN WINAPI RtlIsProcessorFeaturePresent(UINT);
4624 NTSYSAPI BOOLEAN WINAPI RtlIsTextUnicode(LPCVOID,INT,INT *);
4625 NTSYSAPI BOOLEAN WINAPI RtlIsValidHandle(const RTL_HANDLE_TABLE *, const RTL_HANDLE *);
4626 NTSYSAPI BOOLEAN WINAPI RtlIsValidIndexHandle(const RTL_HANDLE_TABLE *, ULONG Index, RTL_HANDLE **);
4627 NTSYSAPI BOOLEAN WINAPI RtlIsValidLocaleName(const WCHAR*,ULONG);
4628 NTSYSAPI NTSTATUS WINAPI RtlLcidToLocaleName(LCID,UNICODE_STRING*,ULONG,BOOLEAN);
4629 NTSYSAPI NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *);
4630 NTSYSAPI DWORD WINAPI RtlLengthRequiredSid(DWORD);
4631 NTSYSAPI ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR);
4632 NTSYSAPI DWORD WINAPI RtlLengthSid(PSID);
4633 NTSYSAPI NTSTATUS WINAPI RtlLocalTimeToSystemTime(const LARGE_INTEGER*,PLARGE_INTEGER);
4634 NTSYSAPI NTSTATUS WINAPI RtlLocaleNameToLcid(const WCHAR*,LCID*,ULONG);
4635 NTSYSAPI void * WINAPI RtlLocateExtendedFeature(CONTEXT_EX*,ULONG,ULONG*);
4636 NTSYSAPI void * WINAPI RtlLocateExtendedFeature2(CONTEXT_EX*,ULONG,XSTATE_CONFIGURATION*,ULONG*);
4637 NTSYSAPI void * WINAPI RtlLocateLegacyContext(CONTEXT_EX*,ULONG*);
4638 NTSYSAPI BOOLEAN WINAPI RtlLockHeap(HANDLE);
4639 NTSYSAPI NTSTATUS WINAPI RtlLookupAtomInAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
4640 NTSYSAPI NTSTATUS WINAPI RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
4641 NTSYSAPI void WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*);
4642 NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
4643 NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,ULONG);
4644 NTSYSAPI NTSTATUS WINAPI RtlNewSecurityObject(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,BOOLEAN,HANDLE,PGENERIC_MAPPING);
4645 NTSYSAPI NTSTATUS WINAPI RtlNewSecurityObjectEx(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,GUID*,BOOLEAN,ULONG,HANDLE,PGENERIC_MAPPING);
4646 NTSYSAPI NTSTATUS WINAPI RtlNewSecurityObjectWithMultipleInheritance(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,
4647 GUID **,ULONG,BOOLEAN,ULONG,HANDLE,PGENERIC_MAPPING);
4648 NTSYSAPI PRTL_USER_PROCESS_PARAMETERS WINAPI RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
4649 NTSYSAPI NTSTATUS WINAPI RtlNormalizeString(ULONG,const WCHAR*,INT,WCHAR*,INT*);
4650 NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS);
4651 NTSYSAPI ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS);
4652 NTSYSAPI ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP);
4653 NTSYSAPI ULONG WINAPI RtlNumberOfClearBits(PCRTL_BITMAP);
4654 NTSYSAPI ULONG WINAPI RtlOemStringToUnicodeSize(const STRING*);
4655 NTSYSAPI NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
4656 NTSYSAPI NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
4657 NTSYSAPI NTSTATUS WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHANDLE);
4658 NTSYSAPI PVOID WINAPI RtlPcToFileHeader(PVOID,PVOID*);
4659 NTSYSAPI NTSTATUS WINAPI RtlPinAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
4660 NTSYSAPI void WINAPI RtlPopFrame(TEB_ACTIVE_FRAME*);
4661 NTSYSAPI BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
4662 NTSYSAPI BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
4663 NTSYSAPI void WINAPI RtlProcessFlsData(void*,ULONG);
4664 NTSYSAPI void WINAPI RtlPushFrame(TEB_ACTIVE_FRAME*);
4665 NTSYSAPI NTSTATUS WINAPI RtlQueryActivationContextApplicationSettings(DWORD,HANDLE,const WCHAR*,const WCHAR*,WCHAR*,SIZE_T,SIZE_T*);
4666 NTSYSAPI NTSTATUS WINAPI RtlQueryAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM,ULONG*,ULONG*,WCHAR*,ULONG*);
4667 NTSYSAPI NTSTATUS WINAPI RtlQueryDynamicTimeZoneInformation(RTL_DYNAMIC_TIME_ZONE_INFORMATION*);
4668 NTSYSAPI NTSTATUS WINAPI RtlQueryEnvironmentVariable(WCHAR*,const WCHAR*,SIZE_T,WCHAR*,SIZE_T,SIZE_T*);
4669 NTSYSAPI NTSTATUS WINAPI RtlQueryEnvironmentVariable_U(PWSTR,PUNICODE_STRING,PUNICODE_STRING);
4670 NTSYSAPI NTSTATUS WINAPI RtlQueryHeapInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T,PSIZE_T);
4671 NTSYSAPI NTSTATUS WINAPI RtlQueryInformationAcl(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
4672 NTSYSAPI NTSTATUS WINAPI RtlQueryInformationActivationContext(ULONG,HANDLE,PVOID,ULONG,PVOID,SIZE_T,SIZE_T*);
4673 NTSYSAPI NTSTATUS WINAPI RtlQueryPackageIdentity(HANDLE,WCHAR*,SIZE_T*,WCHAR*,SIZE_T*,BOOLEAN*);
4674 NTSYSAPI BOOL WINAPI RtlQueryPerformanceCounter(LARGE_INTEGER*);
4675 NTSYSAPI BOOL WINAPI RtlQueryPerformanceFrequency(LARGE_INTEGER*);
4676 NTSYSAPI NTSTATUS WINAPI RtlQueryProcessDebugInformation(ULONG,ULONG,PDEBUG_BUFFER);
4677 NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID);
4678 NTSYSAPI NTSTATUS WINAPI RtlQueryTimeZoneInformation(RTL_TIME_ZONE_INFORMATION*);
4679 NTSYSAPI BOOL WINAPI RtlQueryUnbiasedInterruptTime(ULONGLONG*);
4680 NTSYSAPI NTSTATUS WINAPI RtlQueueWorkItem(PRTL_WORK_ITEM_ROUTINE,PVOID,ULONG);
4681 NTSYSAPI void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
4682 NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlRaiseStatus(NTSTATUS);
4683 NTSYSAPI ULONG WINAPI RtlRandom(PULONG);
4684 NTSYSAPI ULONG WINAPI RtlRandomEx(PULONG);
4685 NTSYSAPI PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,SIZE_T) __WINE_ALLOC_SIZE(4) __WINE_DEALLOC(RtlFreeHeap,3);
4686 NTSYSAPI NTSTATUS WINAPI RtlRegisterWait(PHANDLE,HANDLE,RTL_WAITORTIMERCALLBACKFUNC,PVOID,ULONG,ULONG);
4687 NTSYSAPI void WINAPI RtlReleaseActivationContext(HANDLE);
4688 NTSYSAPI void WINAPI RtlReleasePath(PWSTR);
4689 NTSYSAPI void WINAPI RtlReleasePebLock(void);
4690 NTSYSAPI void WINAPI RtlReleaseRelativeName(RTL_RELATIVE_NAME*);
4691 NTSYSAPI void WINAPI RtlReleaseResource(LPRTL_RWLOCK);
4692 NTSYSAPI void WINAPI RtlReleaseSRWLockExclusive(RTL_SRWLOCK*);
4693 NTSYSAPI void WINAPI RtlReleaseSRWLockShared(RTL_SRWLOCK*);
4694 NTSYSAPI ULONG WINAPI RtlRemoveVectoredContinueHandler(PVOID);
4695 NTSYSAPI ULONG WINAPI RtlRemoveVectoredExceptionHandler(PVOID);
4696 NTSYSAPI void WINAPI RtlResetRtlTranslations(const NLSTABLEINFO*);
4697 NTSYSAPI void WINAPI RtlRestoreLastWin32Error(DWORD);
4698 NTSYSAPI void WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *);
4699 NTSYSAPI void WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *);
4700 NTSYSAPI NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD);
4701 NTSYSAPI void WINAPI RtlSetAllBits(PRTL_BITMAP);
4702 NTSYSAPI void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG);
4703 NTSYSAPI NTSTATUS WINAPI RtlSetControlSecurityDescriptor(PSECURITY_DESCRIPTOR,SECURITY_DESCRIPTOR_CONTROL,SECURITY_DESCRIPTOR_CONTROL);
4704 NTSYSAPI ULONG WINAPI RtlSetCriticalSectionSpinCount(RTL_CRITICAL_SECTION*,ULONG);
4705 NTSYSAPI NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING*);
4706 NTSYSAPI void WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*);
4707 NTSYSAPI BOOL WINAPI RtlSetCurrentTransaction(HANDLE);
4708 NTSYSAPI NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
4709 NTSYSAPI NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR*,PUNICODE_STRING,PUNICODE_STRING);
4710 NTSYSAPI void WINAPI RtlSetExtendedFeaturesMask(CONTEXT_EX*,ULONG64);
4711 NTSYSAPI NTSTATUS WINAPI RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
4712 NTSYSAPI NTSTATUS WINAPI RtlSetHeapInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T);
4713 NTSYSAPI NTSTATUS WINAPI RtlSetIoCompletionCallback(HANDLE,PRTL_OVERLAPPED_COMPLETION_ROUTINE,ULONG);
4714 NTSYSAPI void WINAPI RtlSetLastWin32Error(DWORD);
4715 NTSYSAPI void WINAPI RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS);
4716 NTSYSAPI NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
4717 NTSYSAPI NTSTATUS WINAPI RtlSetProcessPreferredUILanguages(DWORD,PCZZWSTR,ULONG*);
4718 NTSYSAPI NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
4719 NTSYSAPI NTSTATUS WINAPI RtlSetSearchPathMode(ULONG);
4720 NTSYSAPI NTSTATUS WINAPI RtlSetThreadErrorMode(DWORD,LPDWORD);
4721 NTSYSAPI NTSTATUS WINAPI RtlSetThreadPreferredUILanguages(DWORD,PCZZWSTR,ULONG*);
4722 NTSYSAPI NTSTATUS WINAPI RtlSetTimeZoneInformation(const RTL_TIME_ZONE_INFORMATION*);
4723 NTSYSAPI void WINAPI RtlSetUnhandledExceptionFilter(PRTL_EXCEPTION_FILTER);
4724 NTSYSAPI BOOLEAN WINAPI RtlSetUserFlagsHeap(HANDLE,ULONG,void*,ULONG,ULONG);
4725 NTSYSAPI BOOLEAN WINAPI RtlSetUserValueHeap(HANDLE,ULONG,void*,void*);
4726 NTSYSAPI SIZE_T WINAPI RtlSizeHeap(HANDLE,ULONG,const void*);
4727 NTSYSAPI NTSTATUS WINAPI RtlSleepConditionVariableCS(RTL_CONDITION_VARIABLE*,RTL_CRITICAL_SECTION*,const LARGE_INTEGER*);
4728 NTSYSAPI NTSTATUS WINAPI RtlSleepConditionVariableSRW(RTL_CONDITION_VARIABLE*,RTL_SRWLOCK*,const LARGE_INTEGER*,ULONG);
4729 NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID,PUNICODE_STRING);
4730 NTSYSAPI LPDWORD WINAPI RtlSubAuthoritySid(PSID,DWORD);
4731 NTSYSAPI LPBYTE WINAPI RtlSubAuthorityCountSid(PSID);
4732 NTSYSAPI NTSTATUS WINAPI RtlSystemTimeToLocalTime(const LARGE_INTEGER*,PLARGE_INTEGER);
4733 NTSYSAPI BOOLEAN WINAPI RtlTimeFieldsToTime(PTIME_FIELDS,PLARGE_INTEGER);
4734 NTSYSAPI void WINAPI RtlTimeToElapsedTimeFields(const LARGE_INTEGER *,PTIME_FIELDS);
4735 NTSYSAPI BOOLEAN WINAPI RtlTimeToSecondsSince1970(const LARGE_INTEGER *,LPDWORD);
4736 NTSYSAPI BOOLEAN WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *,LPDWORD);
4737 NTSYSAPI void WINAPI RtlTimeToTimeFields(const LARGE_INTEGER*,PTIME_FIELDS);
4738 NTSYSAPI BOOLEAN WINAPI RtlTryAcquireSRWLockExclusive(RTL_SRWLOCK *);
4739 NTSYSAPI BOOLEAN WINAPI RtlTryAcquireSRWLockShared(RTL_SRWLOCK *);
4740 NTSYSAPI BOOL WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *);
4741 NTSYSAPI NTSTATUS WINAPI RtlUTF8ToUnicodeN(WCHAR*,DWORD,DWORD*,const char*,DWORD);
4742 NTSYSAPI DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
4743 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING,PCUNICODE_STRING,BOOLEAN);
4744 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToInteger(const UNICODE_STRING *,ULONG,ULONG *);
4745 NTSYSAPI DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
4746 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToOemString(POEM_STRING,PCUNICODE_STRING,BOOLEAN);
4747 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToCustomCPN(CPTABLEINFO*,char*,DWORD,DWORD*,const WCHAR*,DWORD);
4748 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
4749 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToMultiByteSize(PULONG,PCWSTR,ULONG);
4750 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
4751 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToUTF8N(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
4752 NTSYSAPI ULONG WINAPI RtlUniform(PULONG);
4753 NTSYSAPI BOOLEAN WINAPI RtlUnlockHeap(HANDLE);
4754 NTSYSAPI void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID);
4755 NTSYSAPI WCHAR WINAPI RtlUpcaseUnicodeChar(WCHAR);
4756 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
4757 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
4758 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
4759 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
4760 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeToCustomCPN(CPTABLEINFO*,char*,DWORD,DWORD*,const WCHAR*,DWORD);
4761 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
4762 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
4763 NTSYSAPI NTSTATUS WINAPI RtlUpdateTimer(HANDLE, HANDLE, DWORD, DWORD);
4764 NTSYSAPI CHAR WINAPI RtlUpperChar(CHAR);
4765 NTSYSAPI void WINAPI RtlUpperString(STRING *,const STRING *);
4766 NTSYSAPI void WINAPI RtlUserThreadStart(PRTL_THREAD_START_ROUTINE,void*);
4767 NTSYSAPI BOOLEAN WINAPI RtlValidAcl(PACL);
4768 NTSYSAPI BOOLEAN WINAPI RtlValidRelativeSecurityDescriptor(PSECURITY_DESCRIPTOR,ULONG,SECURITY_INFORMATION);
4769 NTSYSAPI BOOLEAN WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
4770 NTSYSAPI BOOLEAN WINAPI RtlValidSid(PSID);
4771 NTSYSAPI BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
4772 NTSYSAPI NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
4773 NTSYSAPI NTSTATUS WINAPI RtlWaitOnAddress(const void *,const void *,SIZE_T,const LARGE_INTEGER *);
4774 NTSYSAPI void WINAPI RtlWakeAddressAll(const void *);
4775 NTSYSAPI void WINAPI RtlWakeAddressSingle(const void *);
4776 NTSYSAPI void WINAPI RtlWakeAllConditionVariable(RTL_CONDITION_VARIABLE *);
4777 NTSYSAPI void WINAPI RtlWakeConditionVariable(RTL_CONDITION_VARIABLE *);
4778 NTSYSAPI NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
4779 NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirection(BOOLEAN);
4780 NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx(ULONG,ULONG*);
4781 NTSYSAPI USHORT WINAPI RtlWow64GetCurrentMachine(void);
4782 NTSYSAPI NTSTATUS WINAPI RtlWow64GetProcessMachines(HANDLE,USHORT*,USHORT*);
4783 NTSYSAPI NTSTATUS WINAPI RtlWow64IsWowGuestMachineSupported(USHORT,BOOLEAN*);
4784 NTSYSAPI NTSTATUS WINAPI RtlWriteRegistryValue(ULONG,PCWSTR,PCWSTR,ULONG,PVOID,ULONG);
4785 NTSYSAPI NTSTATUS WINAPI RtlZombifyActivationContext(HANDLE);
4786 NTSYSAPI NTSTATUS WINAPI RtlpNtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
4787 NTSYSAPI NTSTATUS WINAPI RtlpNtEnumerateSubKey(HANDLE,UNICODE_STRING *, ULONG);
4788 NTSYSAPI NTSTATUS WINAPI RtlpNtMakeTemporaryKey(HANDLE);
4789 NTSYSAPI NTSTATUS WINAPI RtlpNtOpenKey(PHANDLE,ACCESS_MASK,OBJECT_ATTRIBUTES*);
4790 NTSYSAPI NTSTATUS WINAPI RtlpNtSetValueKey(HANDLE,ULONG,const void*,ULONG);
4791 NTSYSAPI NTSTATUS WINAPI RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION *);
4792 NTSYSAPI NTSTATUS WINAPI RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION *);
4793 NTSYSAPI NTSTATUS WINAPI TpAllocCleanupGroup(TP_CLEANUP_GROUP **);
4794 NTSYSAPI NTSTATUS WINAPI TpAllocIoCompletion(TP_IO **,HANDLE,PTP_IO_CALLBACK,void *,TP_CALLBACK_ENVIRON *);
4795 NTSYSAPI NTSTATUS WINAPI TpAllocPool(TP_POOL **,PVOID);
4796 NTSYSAPI NTSTATUS WINAPI TpAllocTimer(TP_TIMER **,PTP_TIMER_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
4797 NTSYSAPI NTSTATUS WINAPI TpAllocWait(TP_WAIT **,PTP_WAIT_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
4798 NTSYSAPI NTSTATUS WINAPI TpAllocWork(TP_WORK **,PTP_WORK_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
4799 NTSYSAPI void WINAPI TpCallbackLeaveCriticalSectionOnCompletion(TP_CALLBACK_INSTANCE *,RTL_CRITICAL_SECTION *);
4800 NTSYSAPI NTSTATUS WINAPI TpCallbackMayRunLong(TP_CALLBACK_INSTANCE *);
4801 NTSYSAPI void WINAPI TpCallbackReleaseMutexOnCompletion(TP_CALLBACK_INSTANCE *,HANDLE);
4802 NTSYSAPI void WINAPI TpCallbackReleaseSemaphoreOnCompletion(TP_CALLBACK_INSTANCE *,HANDLE,DWORD);
4803 NTSYSAPI void WINAPI TpCallbackSetEventOnCompletion(TP_CALLBACK_INSTANCE *,HANDLE);
4804 NTSYSAPI void WINAPI TpCallbackUnloadDllOnCompletion(TP_CALLBACK_INSTANCE *,HMODULE);
4805 NTSYSAPI void WINAPI TpCancelAsyncIoOperation(TP_IO *);
4806 NTSYSAPI void WINAPI TpDisassociateCallback(TP_CALLBACK_INSTANCE *);
4807 NTSYSAPI BOOL WINAPI TpIsTimerSet(TP_TIMER *);
4808 NTSYSAPI void WINAPI TpPostWork(TP_WORK *);
4809 NTSYSAPI NTSTATUS WINAPI TpQueryPoolStackInformation(TP_POOL *, TP_POOL_STACK_INFORMATION *stack_info);
4810 NTSYSAPI void WINAPI TpReleaseCleanupGroup(TP_CLEANUP_GROUP *);
4811 NTSYSAPI void WINAPI TpReleaseCleanupGroupMembers(TP_CLEANUP_GROUP *,BOOL,PVOID);
4812 NTSYSAPI void WINAPI TpReleaseIoCompletion(TP_IO *);
4813 NTSYSAPI void WINAPI TpReleasePool(TP_POOL *);
4814 NTSYSAPI void WINAPI TpReleaseTimer(TP_TIMER *);
4815 NTSYSAPI void WINAPI TpReleaseWait(TP_WAIT *);
4816 NTSYSAPI void WINAPI TpReleaseWork(TP_WORK *);
4817 NTSYSAPI void WINAPI TpSetPoolMaxThreads(TP_POOL *,DWORD);
4818 NTSYSAPI BOOL WINAPI TpSetPoolMinThreads(TP_POOL *,DWORD);
4819 NTSYSAPI NTSTATUS WINAPI TpSetPoolStackInformation(TP_POOL *, TP_POOL_STACK_INFORMATION *stack_info);
4820 NTSYSAPI void WINAPI TpSetTimer(TP_TIMER *, LARGE_INTEGER *,LONG,LONG);
4821 NTSYSAPI void WINAPI TpSetWait(TP_WAIT *,HANDLE,LARGE_INTEGER *);
4822 NTSYSAPI NTSTATUS WINAPI TpSimpleTryPost(PTP_SIMPLE_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
4823 NTSYSAPI void WINAPI TpStartAsyncIoOperation(TP_IO *);
4824 NTSYSAPI void WINAPI TpWaitForIoCompletion(TP_IO *,BOOL);
4825 NTSYSAPI void WINAPI TpWaitForTimer(TP_TIMER *,BOOL);
4826 NTSYSAPI void WINAPI TpWaitForWait(TP_WAIT *,BOOL);
4827 NTSYSAPI void WINAPI TpWaitForWork(TP_WORK *,BOOL);
4828 NTSYSAPI NTSTATUS WINAPI vDbgPrintEx(ULONG,ULONG,LPCSTR,__ms_va_list);
4829 NTSYSAPI NTSTATUS WINAPI vDbgPrintExWithPrefix(LPCSTR,ULONG,ULONG,LPCSTR,__ms_va_list);
4831 #ifndef __WINE_USE_MSVCRT
4832 NTSYSAPI int __cdecl _strnicmp(LPCSTR,LPCSTR,size_t);
4833 #endif
4835 /* 32-bit or 64-bit only functions */
4837 #ifdef _WIN64
4838 NTSYSAPI NTSTATUS WINAPI RtlWow64GetCpuAreaInfo(WOW64_CPURESERVED*,ULONG,WOW64_CPU_AREA_INFO*);
4839 NTSYSAPI NTSTATUS WINAPI RtlWow64GetCurrentCpuArea(USHORT*,void**,void**);
4840 NTSYSAPI NTSTATUS WINAPI RtlWow64GetThreadContext(HANDLE,WOW64_CONTEXT*);
4841 NTSYSAPI NTSTATUS WINAPI RtlWow64GetThreadSelectorEntry(HANDLE,THREAD_DESCRIPTOR_INFORMATION*,ULONG,ULONG*);
4842 NTSYSAPI NTSTATUS WINAPI RtlWow64SetThreadContext(HANDLE,const WOW64_CONTEXT*);
4843 #else
4844 NTSYSAPI NTSTATUS WINAPI NtWow64AllocateVirtualMemory64(HANDLE,ULONG64*,ULONG64,ULONG64*,ULONG,ULONG);
4845 NTSYSAPI NTSTATUS WINAPI NtWow64GetNativeSystemInformation(SYSTEM_INFORMATION_CLASS,void*,ULONG,ULONG*);
4846 NTSYSAPI NTSTATUS WINAPI NtWow64IsProcessorFeaturePresent(UINT);
4847 NTSYSAPI NTSTATUS WINAPI NtWow64ReadVirtualMemory64(HANDLE,ULONG64,void*,ULONG64,ULONG64*);
4848 NTSYSAPI NTSTATUS WINAPI NtWow64WriteVirtualMemory64(HANDLE,ULONG64,const void*,ULONG64,ULONG64*);
4849 NTSYSAPI LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
4850 NTSYSAPI ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
4851 NTSYSAPI LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
4852 NTSYSAPI ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
4853 NTSYSAPI UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
4854 NTSYSAPI LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
4855 NTSYSAPI LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
4856 NTSYSAPI LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
4857 NTSYSAPI LONGLONG WINAPI RtlInterlockedCompareExchange64(LONGLONG*,LONGLONG,LONGLONG);
4858 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
4859 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
4860 NTSYSAPI ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
4861 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerNegate(LONGLONG);
4862 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
4863 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
4864 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
4865 NTSYSAPI NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
4866 #endif
4868 /* Wine internal functions */
4870 NTSYSAPI NTSTATUS WINAPI wine_nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char *nameA, ULONG *size,
4871 UINT disposition );
4872 NTSYSAPI NTSTATUS WINAPI wine_unix_to_nt_file_name( const char *name, WCHAR *buffer, ULONG *size );
4875 /***********************************************************************
4876 * Inline functions
4879 #define InitializeObjectAttributes(p,n,a,r,s) \
4880 do { \
4881 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
4882 (p)->RootDirectory = r; \
4883 (p)->Attributes = a; \
4884 (p)->ObjectName = n; \
4885 (p)->SecurityDescriptor = s; \
4886 (p)->SecurityQualityOfService = NULL; \
4887 } while (0)
4889 #define NtCurrentProcess() ((HANDLE)~(ULONG_PTR)0)
4890 #define NtCurrentThread() ((HANDLE)~(ULONG_PTR)1)
4892 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
4893 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
4894 #define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
4895 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
4896 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
4897 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
4898 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
4900 static inline BOOLEAN RtlCheckBit(PCRTL_BITMAP lpBits, ULONG ulBit)
4902 if (lpBits && ulBit < lpBits->SizeOfBitMap &&
4903 lpBits->Buffer[ulBit >> 5] & (1 << (ulBit & 31)))
4904 return TRUE;
4905 return FALSE;
4908 /* These are implemented as __fastcall, so we can't let Winelib apps link with them.
4909 * Moreover, they're always inlined and not exported on 64bit systems.
4911 static inline USHORT RtlUshortByteSwap(USHORT s)
4913 return (s >> 8) | (s << 8);
4915 static inline ULONG RtlUlongByteSwap(ULONG i)
4917 return ((ULONG)RtlUshortByteSwap((USHORT)i) << 16) | RtlUshortByteSwap((USHORT)(i >> 16));
4919 static inline ULONGLONG RtlUlonglongByteSwap(ULONGLONG i)
4921 return ((ULONGLONG)RtlUlongByteSwap((ULONG)i) << 32) | RtlUlongByteSwap((ULONG)(i >> 32));
4924 /* list manipulation macros */
4925 #define InitializeListHead(le) (void)((le)->Flink = (le)->Blink = (le))
4926 #define InsertHeadList(le,e) do { PLIST_ENTRY f = (le)->Flink; (e)->Flink = f; (e)->Blink = (le); f->Blink = (e); (le)->Flink = (e); } while (0)
4927 #define InsertTailList(le,e) do { PLIST_ENTRY b = (le)->Blink; (e)->Flink = (le); (e)->Blink = b; b->Flink = (e); (le)->Blink = (e); } while (0)
4928 #define IsListEmpty(le) ((le)->Flink == (le))
4929 #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)
4930 static inline PLIST_ENTRY RemoveHeadList(PLIST_ENTRY le)
4932 PLIST_ENTRY f, b, e;
4934 e = le->Flink;
4935 f = le->Flink->Flink;
4936 b = le->Flink->Blink;
4937 f->Blink = b;
4938 b->Flink = f;
4940 if (e != le) e->Flink = e->Blink = NULL;
4941 return e;
4943 static inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le)
4945 PLIST_ENTRY f, b, e;
4947 e = le->Blink;
4948 f = le->Blink->Flink;
4949 b = le->Blink->Blink;
4950 f->Blink = b;
4951 b->Flink = f;
4953 if (e != le) e->Flink = e->Blink = NULL;
4954 return e;
4958 #ifdef __WINESRC__
4960 /* Wine internal functions */
4962 extern NTSTATUS WINAPI __wine_unix_spawnvp( char * const argv[], int wait );
4964 /* The thread information for 16-bit threads */
4965 /* NtCurrentTeb()->SubSystemTib points to this */
4966 typedef struct
4968 void *unknown; /* 00 unknown */
4969 UNICODE_STRING *exe_name; /* 04 exe module name */
4971 /* the following fields do not exist under Windows */
4972 UNICODE_STRING exe_str; /* exe name string pointed to by exe_name */
4973 CURDIR curdir; /* current directory */
4974 WCHAR curdir_buffer[MAX_PATH];
4975 } WIN16_SUBSYSTEM_TIB;
4977 /* Undocumented: layout of the locale data in the locale.nls file */
4979 typedef struct
4981 UINT sname; /* 000 LOCALE_SNAME */
4982 UINT sopentypelanguagetag; /* 004 LOCALE_SOPENTYPELANGUAGETAG */
4983 USHORT ilanguage; /* 008 LOCALE_ILANGUAGE */
4984 USHORT unique_lcid; /* 00a unique id if lcid == 0x1000 */
4985 USHORT idigits; /* 00c LOCALE_IDIGITS */
4986 USHORT inegnumber; /* 00e LOCALE_INEGNUMBER */
4987 USHORT icurrdigits; /* 010 LOCALE_ICURRDIGITS*/
4988 USHORT icurrency; /* 012 LOCALE_ICURRENCY */
4989 USHORT inegcurr; /* 014 LOCALE_INEGCURR */
4990 USHORT ilzero; /* 016 LOCALE_ILZERO */
4991 USHORT inotneutral; /* 018 LOCALE_INEUTRAL (inverted) */
4992 USHORT ifirstdayofweek; /* 01a LOCALE_IFIRSTDAYOFWEEK (monday=0) */
4993 USHORT ifirstweekofyear; /* 01c LOCALE_IFIRSTWEEKOFYEAR */
4994 USHORT icountry; /* 01e LOCALE_ICOUNTRY */
4995 USHORT imeasure; /* 020 LOCALE_IMEASURE */
4996 USHORT idigitsubstitution; /* 022 LOCALE_IDIGITSUBSTITUTION */
4997 UINT sgrouping; /* 024 LOCALE_SGROUPING (as binary string) */
4998 UINT smongrouping; /* 028 LOCALE_SMONGROUPING (as binary string) */
4999 UINT slist; /* 02c LOCALE_SLIST */
5000 UINT sdecimal; /* 030 LOCALE_SDECIMAL */
5001 UINT sthousand; /* 034 LOCALE_STHOUSAND */
5002 UINT scurrency; /* 038 LOCALE_SCURRENCY */
5003 UINT smondecimalsep; /* 03c LOCALE_SMONDECIMALSEP */
5004 UINT smonthousandsep; /* 040 LOCALE_SMONTHOUSANDSEP */
5005 UINT spositivesign; /* 044 LOCALE_SPOSITIVESIGN */
5006 UINT snegativesign; /* 048 LOCALE_SNEGATIVESIGN */
5007 UINT s1159; /* 04c LOCALE_S1159 */
5008 UINT s2359; /* 050 LOCALE_S2359 */
5009 UINT snativedigits; /* 054 LOCALE_SNATIVEDIGITS (array of single digits) */
5010 UINT stimeformat; /* 058 LOCALE_STIMEFORMAT (array of formats) */
5011 UINT sshortdate; /* 05c LOCALE_SSHORTDATE (array of formats) */
5012 UINT slongdate; /* 060 LOCALE_SLONGDATE (array of formats) */
5013 UINT syearmonth; /* 064 LOCALE_SYEARMONTH (array of formats) */
5014 UINT sduration; /* 068 LOCALE_SDURATION (array of formats) */
5015 USHORT idefaultlanguage; /* 06c LOCALE_IDEFAULTLANGUAGE */
5016 USHORT idefaultansicodepage; /* 06e LOCALE_IDEFAULTANSICODEPAGE */
5017 USHORT idefaultcodepage; /* 070 LOCALE_IDEFAULTCODEPAGE */
5018 USHORT idefaultmaccodepage; /* 072 LOCALE_IDEFAULTMACCODEPAGE */
5019 USHORT idefaultebcdiccodepage; /* 074 LOCALE_IDEFAULTEBCDICCODEPAGE */
5020 USHORT old_geoid; /* 076 LOCALE_IGEOID (older version?) */
5021 USHORT ipapersize; /* 078 LOCALE_IPAPERSIZE */
5022 BYTE islamic_cal[2]; /* 07a calendar id for islamic calendars (?) */
5023 UINT scalendartype; /* 07c string, first char is LOCALE_ICALENDARTYPE, next chars are LOCALE_IOPTIONALCALENDAR */
5024 UINT sabbrevlangname; /* 080 LOCALE_SABBREVLANGNAME */
5025 UINT siso639langname; /* 084 LOCALE_SISO639LANGNAME */
5026 UINT senglanguage; /* 088 LOCALE_SENGLANGUAGE */
5027 UINT snativelangname; /* 08c LOCALE_SNATIVELANGNAME */
5028 UINT sengcountry; /* 090 LOCALE_SENGCOUNTRY */
5029 UINT snativectryname; /* 094 LOCALE_SNATIVECTRYNAME */
5030 UINT sabbrevctryname; /* 098 LOCALE_SABBREVCTRYNAME */
5031 UINT siso3166ctryname; /* 09c LOCALE_SISO3166CTRYNAME */
5032 UINT sintlsymbol; /* 0a0 LOCALE_SINTLSYMBOL */
5033 UINT sengcurrname; /* 0a4 LOCALE_SENGCURRNAME */
5034 UINT snativecurrname; /* 0a8 LOCALE_SNATIVECURRNAME */
5035 UINT fontsignature; /* 0ac LOCALE_FONTSIGNATURE (binary string) */
5036 UINT siso639langname2; /* 0b0 LOCALE_SISO639LANGNAME2 */
5037 UINT siso3166ctryname2; /* 0b4 LOCALE_SISO3166CTRYNAME2 */
5038 UINT sparent; /* 0b8 LOCALE_SPARENT */
5039 UINT sdayname; /* 0bc LOCALE_SDAYNAME1 (array of days 1..7) */
5040 UINT sabbrevdayname; /* 0c0 LOCALE_SABBREVDAYNAME1 (array of days 1..7) */
5041 UINT smonthname; /* 0c4 LOCALE_SMONTHNAME1 (array of months 1..13) */
5042 UINT sabbrevmonthname; /* 0c8 LOCALE_SABBREVMONTHNAME1 (array of months 1..13) */
5043 UINT sgenitivemonth; /* 0cc equivalent of LOCALE_SMONTHNAME1 for genitive months */
5044 UINT sabbrevgenitivemonth; /* 0d0 equivalent of LOCALE_SABBREVMONTHNAME1 for genitive months */
5045 UINT calnames; /* 0d4 array of calendar names */
5046 UINT customsorts; /* 0d8 array of custom sort names */
5047 USHORT inegativepercent; /* 0dc LOCALE_INEGATIVEPERCENT */
5048 USHORT ipositivepercent; /* 0de LOCALE_IPOSITIVEPERCENT */
5049 USHORT unknown1; /* 0e0 */
5050 USHORT ireadinglayout; /* 0e2 LOCALE_IREADINGLAYOUT */
5051 USHORT unknown2[2]; /* 0e4 */
5052 UINT unused1; /* 0e8 unused? */
5053 UINT sengdisplayname; /* 0ec LOCALE_SENGLISHDISPLAYNAME */
5054 UINT snativedisplayname; /* 0f0 LOCALE_SNATIVEDISPLAYNAME */
5055 UINT spercent; /* 0f4 LOCALE_SPERCENT */
5056 UINT snan; /* 0f8 LOCALE_SNAN */
5057 UINT sposinfinity; /* 0fc LOCALE_SPOSINFINITY */
5058 UINT sneginfinity; /* 100 LOCALE_SNEGINFINITY */
5059 UINT unused2; /* 104 unused? */
5060 UINT serastring; /* 108 CAL_SERASTRING */
5061 UINT sabbreverastring; /* 10c CAL_SABBREVERASTRING */
5062 UINT unused3; /* 110 unused? */
5063 UINT sconsolefallbackname; /* 114 LOCALE_SCONSOLEFALLBACKNAME */
5064 UINT sshorttime; /* 118 LOCALE_SSHORTTIME (array of formats) */
5065 UINT sshortestdayname; /* 11c LOCALE_SSHORTESTDAYNAME1 (array of days 1..7) */
5066 UINT unused4; /* 120 unused? */
5067 UINT ssortlocale; /* 124 LOCALE_SSORTLOCALE */
5068 UINT skeyboardstoinstall; /* 128 LOCALE_SKEYBOARDSTOINSTALL */
5069 UINT sscripts; /* 12c LOCALE_SSCRIPTS */
5070 UINT srelativelongdate; /* 130 LOCALE_SRELATIVELONGDATE */
5071 UINT igeoid; /* 134 LOCALE_IGEOID */
5072 UINT sshortestam; /* 138 LOCALE_SSHORTESTAM */
5073 UINT sshortestpm; /* 13c LOCALE_SSHORTESTPM */
5074 UINT smonthday; /* 140 LOCALE_SMONTHDAY (array of formats) */
5075 UINT keyboard_layout; /* 144 keyboard layouts */
5076 } NLS_LOCALE_DATA;
5078 typedef struct
5080 UINT id; /* 00 lcid */
5081 USHORT idx; /* 04 index in locales array */
5082 USHORT name; /* 06 locale name */
5083 } NLS_LOCALE_LCID_INDEX;
5085 typedef struct
5087 USHORT name; /* 00 locale name */
5088 USHORT idx; /* 02 index in locales array */
5089 UINT id; /* 04 lcid */
5090 } NLS_LOCALE_LCNAME_INDEX;
5092 typedef struct
5094 UINT offset; /* 00 offset to version, always 8? */
5095 UINT unknown1; /* 04 */
5096 UINT version; /* 08 file format version */
5097 UINT magic; /* 0c magic 'NSDS' */
5098 UINT unknown2[3]; /* 10 */
5099 USHORT header_size; /* 1c size of this header (?) */
5100 USHORT nb_lcids; /* 1e number of lcids in index */
5101 USHORT nb_locales; /* 20 number of locales in array */
5102 USHORT locale_size; /* 22 size of NLS_LOCALE_DATA structure */
5103 UINT locales_offset; /* 24 offset of locales array */
5104 USHORT nb_lcnames; /* 28 number of lcnames in index */
5105 USHORT pad; /* 2a */
5106 UINT lcids_offset; /* 2c offset of lcids index */
5107 UINT lcnames_offset; /* 30 offset of lcnames index */
5108 UINT unknown3; /* 34 */
5109 USHORT nb_calendars; /* 38 number of calendars in array */
5110 USHORT calendar_size; /* 3a size of calendar structure */
5111 UINT calendars_offset; /* 3c offset of calendars array */
5112 UINT strings_offset; /* 40 offset of strings data */
5113 USHORT unknown4[4]; /* 44 */
5114 } NLS_LOCALE_HEADER;
5116 #endif /* __WINESRC__ */
5118 #ifdef __cplusplus
5119 } /* extern "C" */
5120 #endif /* defined(__cplusplus) */
5122 #endif /* __WINE_WINTERNL_H */