advapi32/tests: Rename test_acls() to test_InitializeAcl().
[wine/zf.git] / include / winternl.h
blob8bdeddd2fdac10ea10d60d747dd8500c08d698d4
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 EnvironmentSize;
203 ULONG EnvironmentVersion;
204 PVOID PackageDependencyData;
205 ULONG ProcessGroupId;
206 ULONG LoaderThreads;
207 } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
209 /* value for Flags field (FIXME: not the correct name) */
210 #define PROCESS_PARAMS_FLAG_NORMALIZED 1
212 typedef struct _PEB_LDR_DATA
214 ULONG Length;
215 BOOLEAN Initialized;
216 PVOID SsHandle;
217 LIST_ENTRY InLoadOrderModuleList;
218 LIST_ENTRY InMemoryOrderModuleList;
219 LIST_ENTRY InInitializationOrderModuleList;
220 PVOID EntryInProgress;
221 BOOLEAN ShutdownInProgress;
222 HANDLE ShutdownThreadId;
223 } PEB_LDR_DATA, *PPEB_LDR_DATA;
225 typedef struct _GDI_TEB_BATCH
227 ULONG Offset;
228 HANDLE HDC;
229 ULONG Buffer[0x136];
230 } GDI_TEB_BATCH;
232 typedef struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME
234 struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME *Previous;
235 struct _ACTIVATION_CONTEXT *ActivationContext;
236 ULONG Flags;
237 } RTL_ACTIVATION_CONTEXT_STACK_FRAME, *PRTL_ACTIVATION_CONTEXT_STACK_FRAME;
239 typedef struct _ACTIVATION_CONTEXT_STACK
241 RTL_ACTIVATION_CONTEXT_STACK_FRAME *ActiveFrame;
242 LIST_ENTRY FrameListCache;
243 ULONG Flags;
244 ULONG NextCookieSequenceNumber;
245 ULONG_PTR StackId;
246 } ACTIVATION_CONTEXT_STACK, *PACTIVATION_CONTEXT_STACK;
248 typedef struct _TEB_ACTIVE_FRAME_CONTEXT
250 ULONG Flags;
251 const char *FrameName;
252 } TEB_ACTIVE_FRAME_CONTEXT, *PTEB_ACTIVE_FRAME_CONTEXT;
254 typedef struct _TEB_ACTIVE_FRAME_CONTEXT_EX
256 TEB_ACTIVE_FRAME_CONTEXT BasicContext;
257 const char *SourceLocation;
258 } TEB_ACTIVE_FRAME_CONTEXT_EX, *PTEB_ACTIVE_FRAME_CONTEXT_EX;
260 typedef struct _TEB_ACTIVE_FRAME
262 ULONG Flags;
263 struct _TEB_ACTIVE_FRAME *Previous;
264 TEB_ACTIVE_FRAME_CONTEXT *Context;
265 } TEB_ACTIVE_FRAME, *PTEB_ACTIVE_FRAME;
267 typedef struct _TEB_ACTIVE_FRAME_EX
269 TEB_ACTIVE_FRAME BasicFrame;
270 void *ExtensionIdentifier;
271 } TEB_ACTIVE_FRAME_EX, *PTEB_ACTIVE_FRAME_EX;
273 typedef struct _FLS_CALLBACK
275 void *unknown;
276 PFLS_CALLBACK_FUNCTION callback; /* ~0 if NULL callback is set, NULL if FLS index is free. */
277 } FLS_CALLBACK, *PFLS_CALLBACK;
279 typedef struct _FLS_INFO_CHUNK
281 ULONG count; /* number of allocated FLS indexes in the chunk. */
282 FLS_CALLBACK callbacks[1]; /* the size is 0x10 for chunk 0 and is twice as
283 * the previous chunk size for the rest. */
284 } FLS_INFO_CHUNK, *PFLS_INFO_CHUNK;
286 typedef struct _GLOBAL_FLS_DATA
288 FLS_INFO_CHUNK *fls_callback_chunks[8];
289 LIST_ENTRY fls_list_head;
290 ULONG fls_high_index;
291 } GLOBAL_FLS_DATA, *PGLOBAL_FLS_DATA;
293 typedef struct _TEB_FLS_DATA
295 LIST_ENTRY fls_list_entry;
296 void **fls_data_chunks[8];
297 } TEB_FLS_DATA, *PTEB_FLS_DATA;
299 #define TEB_ACTIVE_FRAME_CONTEXT_FLAG_EXTENDED 0x00000001
300 #define TEB_ACTIVE_FRAME_FLAG_EXTENDED 0x00000001
302 /***********************************************************************
303 * PEB data structure
305 typedef struct _PEB
306 { /* win32/win64 */
307 BOOLEAN InheritedAddressSpace; /* 000/000 */
308 BOOLEAN ReadImageFileExecOptions; /* 001/001 */
309 BOOLEAN BeingDebugged; /* 002/002 */
310 BOOLEAN SpareBool; /* 003/003 */
311 HANDLE Mutant; /* 004/008 */
312 HMODULE ImageBaseAddress; /* 008/010 */
313 PPEB_LDR_DATA LdrData; /* 00c/018 */
314 RTL_USER_PROCESS_PARAMETERS *ProcessParameters; /* 010/020 */
315 PVOID SubSystemData; /* 014/028 */
316 HANDLE ProcessHeap; /* 018/030 */
317 PRTL_CRITICAL_SECTION FastPebLock; /* 01c/038 */
318 PVOID /*PPEBLOCKROUTINE*/ FastPebLockRoutine; /* 020/040 */
319 PVOID /*PPEBLOCKROUTINE*/ FastPebUnlockRoutine; /* 024/048 */
320 ULONG EnvironmentUpdateCount; /* 028/050 */
321 PVOID KernelCallbackTable; /* 02c/058 */
322 ULONG Reserved; /* 030/060 */
323 ULONG AtlThunkSListPtr32; /* 034/064 */
324 PVOID /*PPEB_FREE_BLOCK*/ FreeList; /* 038/068 */
325 ULONG TlsExpansionCounter; /* 03c/070 */
326 PRTL_BITMAP TlsBitmap; /* 040/078 */
327 ULONG TlsBitmapBits[2]; /* 044/080 */
328 PVOID ReadOnlySharedMemoryBase; /* 04c/088 */
329 PVOID ReadOnlySharedMemoryHeap; /* 050/090 */
330 PVOID *ReadOnlyStaticServerData; /* 054/098 */
331 PVOID AnsiCodePageData; /* 058/0a0 */
332 PVOID OemCodePageData; /* 05c/0a8 */
333 PVOID UnicodeCaseTableData; /* 060/0b0 */
334 ULONG NumberOfProcessors; /* 064/0b8 */
335 ULONG NtGlobalFlag; /* 068/0bc */
336 LARGE_INTEGER CriticalSectionTimeout; /* 070/0c0 */
337 SIZE_T HeapSegmentReserve; /* 078/0c8 */
338 SIZE_T HeapSegmentCommit; /* 07c/0d0 */
339 SIZE_T HeapDeCommitTotalFreeThreshold; /* 080/0d8 */
340 SIZE_T HeapDeCommitFreeBlockThreshold; /* 084/0e0 */
341 ULONG NumberOfHeaps; /* 088/0e8 */
342 ULONG MaximumNumberOfHeaps; /* 08c/0ec */
343 PVOID *ProcessHeaps; /* 090/0f0 */
344 PVOID GdiSharedHandleTable; /* 094/0f8 */
345 PVOID ProcessStarterHelper; /* 098/100 */
346 PVOID GdiDCAttributeList; /* 09c/108 */
347 PVOID LoaderLock; /* 0a0/110 */
348 ULONG OSMajorVersion; /* 0a4/118 */
349 ULONG OSMinorVersion; /* 0a8/11c */
350 ULONG OSBuildNumber; /* 0ac/120 */
351 ULONG OSPlatformId; /* 0b0/124 */
352 ULONG ImageSubSystem; /* 0b4/128 */
353 ULONG ImageSubSystemMajorVersion; /* 0b8/12c */
354 ULONG ImageSubSystemMinorVersion; /* 0bc/130 */
355 ULONG ImageProcessAffinityMask; /* 0c0/134 */
356 HANDLE GdiHandleBuffer[28]; /* 0c4/138 */
357 ULONG unknown[6]; /* 134/218 */
358 PVOID PostProcessInitRoutine; /* 14c/230 */
359 PRTL_BITMAP TlsExpansionBitmap; /* 150/238 */
360 ULONG TlsExpansionBitmapBits[32]; /* 154/240 */
361 ULONG SessionId; /* 1d4/2c0 */
362 ULARGE_INTEGER AppCompatFlags; /* 1d8/2c8 */
363 ULARGE_INTEGER AppCompatFlagsUser; /* 1e0/2d0 */
364 PVOID ShimData; /* 1e8/2d8 */
365 PVOID AppCompatInfo; /* 1ec/2e0 */
366 UNICODE_STRING CSDVersion; /* 1f0/2e8 */
367 PVOID ActivationContextData; /* 1f8/2f8 */
368 PVOID ProcessAssemblyStorageMap; /* 1fc/300 */
369 PVOID SystemDefaultActivationData; /* 200/308 */
370 PVOID SystemAssemblyStorageMap; /* 204/310 */
371 SIZE_T MinimumStackCommit; /* 208/318 */
372 PVOID *FlsCallback; /* 20c/320 */
373 LIST_ENTRY FlsListHead; /* 210/328 */
374 PRTL_BITMAP FlsBitmap; /* 218/338 */
375 ULONG FlsBitmapBits[4]; /* 21c/340 */
376 ULONG FlsHighIndex; /* 22c/350 */
377 PVOID WerRegistrationData; /* 230/358 */
378 PVOID WerShipAssertPtr; /* 234/360 */
379 PVOID pUnused; /* 238/368 */
380 PVOID pImageHeaderHash; /* 23c/370 */
381 ULONG TracingFlags; /* 240/378 */
382 ULONGLONG CsrServerReadOnlySharedMemoryBase; /* 248/380 */
383 ULONG TppWorkerpListLock; /* 250/388 */
384 LIST_ENTRY TppWorkerpList; /* 254/390 */
385 PVOID WaitOnAddressHashTable [0x80]; /* 25c/3a0 */
386 PVOID TelemetryCoverageHeader; /* 45c/7a0 */
387 ULONG CloudFileFlags; /* 460/7a8 */
388 ULONG CloudFileDiagFlags; /* 464/7ac */
389 CHAR PlaceholderCompatibilityMode; /* 468/7b0 */
390 CHAR PlaceholderCompatibilityModeReserved[7]; /* 469/7b1 */
391 PVOID LeapSecondData; /* 470/7b8 */
392 ULONG LeapSecondFlags; /* 474/7c0 */
393 ULONG NtGlobalFlag2; /* 478/7c4 */
394 } PEB, *PPEB;
397 /***********************************************************************
398 * TEB data structure
400 typedef struct _TEB
401 { /* win32/win64 */
402 NT_TIB Tib; /* 000/0000 */
403 PVOID EnvironmentPointer; /* 01c/0038 */
404 CLIENT_ID ClientId; /* 020/0040 */
405 PVOID ActiveRpcHandle; /* 028/0050 */
406 PVOID ThreadLocalStoragePointer; /* 02c/0058 */
407 PPEB Peb; /* 030/0060 */
408 ULONG LastErrorValue; /* 034/0068 */
409 ULONG CountOfOwnedCriticalSections; /* 038/006c */
410 PVOID CsrClientThread; /* 03c/0070 */
411 PVOID Win32ThreadInfo; /* 040/0078 */
412 ULONG User32Reserved[26]; /* 044/0080 */
413 ULONG UserReserved[5]; /* 0ac/00e8 */
414 PVOID WOW32Reserved; /* 0c0/0100 */
415 ULONG CurrentLocale; /* 0c4/0108 */
416 ULONG FpSoftwareStatusRegister; /* 0c8/010c */
417 PVOID ReservedForDebuggerInstrumentation[16]; /* 0cc/0110 */
418 #ifdef _WIN64
419 PVOID SystemReserved1[30]; /* /0190 */
420 #else
421 PVOID SystemReserved1[26]; /* 10c/ used for krnl386 private data in Wine */
422 #endif
423 char PlaceholderCompatibilityMode; /* 174/0280 */
424 char PlaceholderReserved[11]; /* 175/0281 */
425 DWORD ProxiedProcessId; /* 180/028c */
426 ACTIVATION_CONTEXT_STACK ActivationContextStack; /* 184/0290 */
427 UCHAR WorkingOnBehalfOfTicket[8]; /* 19c/02b8 */
428 LONG ExceptionCode; /* 1a4/02c0 */
429 ACTIVATION_CONTEXT_STACK *ActivationContextStackPointer; /* 1a8/02c8 */
430 ULONG_PTR InstrumentationCallbackSp; /* 1ac/02d0 */
431 ULONG_PTR InstrumentationCallbackPreviousPc; /* 1b0/02d8 */
432 ULONG_PTR InstrumentationCallbackPreviousSp; /* 1b4/02e0 */
433 #ifdef _WIN64
434 ULONG TxFsContext; /* /02e8 */
435 BOOLEAN InstrumentationCallbackDisabled; /* /02ec */
436 #else
437 BOOLEAN InstrumentationCallbackDisabled; /* 1b8/ */
438 BYTE SpareBytes1[23]; /* 1b9/ */
439 ULONG TxFsContext; /* 1d0/ */
440 #endif
441 GDI_TEB_BATCH GdiTebBatch; /* 1d4/02f0 used for ntdll private data in Wine */
442 CLIENT_ID RealClientId; /* 6b4/07d8 */
443 HANDLE GdiCachedProcessHandle; /* 6bc/07e8 */
444 ULONG GdiClientPID; /* 6c0/07f0 */
445 ULONG GdiClientTID; /* 6c4/07f4 */
446 PVOID GdiThreadLocaleInfo; /* 6c8/07f8 */
447 ULONG_PTR Win32ClientInfo[62]; /* 6cc/0800 used for user32 private data in Wine */
448 PVOID glDispatchTable[233]; /* 7c4/09f0 */
449 PVOID glReserved1[29]; /* b68/1138 */
450 PVOID glReserved2; /* bdc/1220 */
451 PVOID glSectionInfo; /* be0/1228 */
452 PVOID glSection; /* be4/1230 */
453 PVOID glTable; /* be8/1238 */
454 PVOID glCurrentRC; /* bec/1240 */
455 PVOID glContext; /* bf0/1248 */
456 ULONG LastStatusValue; /* bf4/1250 */
457 UNICODE_STRING StaticUnicodeString; /* bf8/1258 */
458 WCHAR StaticUnicodeBuffer[261]; /* c00/1268 */
459 PVOID DeallocationStack; /* e0c/1478 */
460 PVOID TlsSlots[64]; /* e10/1480 */
461 LIST_ENTRY TlsLinks; /* f10/1680 */
462 PVOID Vdm; /* f18/1690 */
463 PVOID ReservedForNtRpc; /* f1c/1698 */
464 PVOID DbgSsReserved[2]; /* f20/16a0 */
465 ULONG HardErrorDisabled; /* f28/16b0 */
466 PVOID Instrumentation[16]; /* f2c/16b8 */
467 PVOID WinSockData; /* f6c/1738 */
468 ULONG GdiBatchCount; /* f70/1740 */
469 ULONG Spare2; /* f74/1744 */
470 ULONG GuaranteedStackBytes; /* f78/1748 */
471 PVOID ReservedForPerf; /* f7c/1750 */
472 PVOID ReservedForOle; /* f80/1758 */
473 ULONG WaitingOnLoaderLock; /* f84/1760 */
474 PVOID Reserved5[3]; /* f88/1768 */
475 PVOID *TlsExpansionSlots; /* f94/1780 */
476 #ifdef _WIN64
477 PVOID DeallocationBStore; /* /1788 */
478 PVOID BStoreLimit; /* /1790 */
479 #endif
480 ULONG ImpersonationLocale; /* f98/1798 */
481 ULONG IsImpersonating; /* f9c/179c */
482 PVOID NlsCache; /* fa0/17a0 */
483 PVOID ShimData; /* fa4/17a8 */
484 ULONG HeapVirtualAffinity; /* fa8/17b0 */
485 PVOID CurrentTransactionHandle; /* fac/17b8 */
486 TEB_ACTIVE_FRAME *ActiveFrame; /* fb0/17c0 */
487 TEB_FLS_DATA *FlsSlots; /* fb4/17c8 */
488 PVOID PreferredLanguages; /* fb8/17d0 */
489 PVOID UserPrefLanguages; /* fbc/17d8 */
490 PVOID MergedPrefLanguages; /* fc0/17e0 */
491 ULONG MuiImpersonation; /* fc4/17e8 */
492 USHORT CrossTebFlags; /* fc8/17ec */
493 USHORT SameTebFlags; /* fca/17ee */
494 PVOID TxnScopeEnterCallback; /* fcc/17f0 */
495 PVOID TxnScopeExitCallback; /* fd0/17f8 */
496 PVOID TxnScopeContext; /* fd4/1800 */
497 ULONG LockCount; /* fd8/1808 */
498 LONG WowTebOffset; /* fdc/180c */
499 PVOID ResourceRetValue; /* fe0/1810 */
500 PVOID ReservedForWdf; /* fe4/1818 */
501 ULONGLONG ReservedForCrt; /* fe8/1820 */
502 GUID EffectiveContainerId; /* ff0/1828 */
503 } TEB, *PTEB;
506 /***********************************************************************
507 * The 64-bit version of the PEB and TEB for WoW64
509 #ifndef _WIN64
511 typedef struct _NT_TIB64
513 ULONG64 ExceptionList; /* 0000 */
514 ULONG64 StackBase; /* 0008 */
515 ULONG64 StackLimit; /* 0010 */
516 ULONG64 SubSystemTib; /* 0018 */
517 ULONG64 FiberData; /* 0020 */
518 ULONG64 ArbitraryUserPointer; /* 0028 */
519 ULONG64 Self; /* 0030 */
520 } NT_TIB64;
522 typedef struct _CLIENT_ID64
524 ULONG64 UniqueProcess;
525 ULONG64 UniqueThread;
526 } CLIENT_ID64;
528 typedef struct _LIST_ENTRY64
530 ULONG64 Flink;
531 ULONG64 Blink;
532 } LIST_ENTRY64;
534 typedef struct _UNICODE_STRING64
536 USHORT Length;
537 USHORT MaximumLength;
538 ULONG64 Buffer;
539 } UNICODE_STRING64;
541 typedef struct _ACTIVATION_CONTEXT_STACK64
543 ULONG64 ActiveFrame;
544 LIST_ENTRY64 FrameListCache;
545 ULONG Flags;
546 ULONG NextCookieSequenceNumber;
547 ULONG64 StackId;
548 } ACTIVATION_CONTEXT_STACK64;
550 typedef struct _PEB64
552 BOOLEAN InheritedAddressSpace; /* 0000 */
553 BOOLEAN ReadImageFileExecOptions; /* 0001 */
554 BOOLEAN BeingDebugged; /* 0002 */
555 BOOLEAN SpareBool; /* 0003 */
556 ULONG64 Mutant; /* 0008 */
557 ULONG64 ImageBaseAddress; /* 0010 */
558 ULONG64 LdrData; /* 0018 */
559 ULONG64 ProcessParameters; /* 0020 */
560 ULONG64 SubSystemData; /* 0028 */
561 ULONG64 ProcessHeap; /* 0030 */
562 ULONG64 FastPebLock; /* 0038 */
563 ULONG64 FastPebLockRoutine; /* 0040 */
564 ULONG64 FastPebUnlockRoutine; /* 0048 */
565 ULONG EnvironmentUpdateCount; /* 0050 */
566 ULONG64 KernelCallbackTable; /* 0058 */
567 ULONG Reserved; /* 0060 */
568 ULONG AtlThunkSListPtr32; /* 0064 */
569 ULONG64 FreeList; /* 0068 */
570 ULONG TlsExpansionCounter; /* 0070 */
571 ULONG64 TlsBitmap; /* 0078 */
572 ULONG TlsBitmapBits[2]; /* 0080 */
573 ULONG64 ReadOnlySharedMemoryBase; /* 0088 */
574 ULONG64 ReadOnlySharedMemoryHeap; /* 0090 */
575 ULONG64 ReadOnlyStaticServerData; /* 0098 */
576 ULONG64 AnsiCodePageData; /* 00a0 */
577 ULONG64 OemCodePageData; /* 00a8 */
578 ULONG64 UnicodeCaseTableData; /* 00b0 */
579 ULONG NumberOfProcessors; /* 00b8 */
580 ULONG NtGlobalFlag; /* 00bc */
581 LARGE_INTEGER CriticalSectionTimeout; /* 00c0 */
582 ULONG64 HeapSegmentReserve; /* 00c8 */
583 ULONG64 HeapSegmentCommit; /* 00d0 */
584 ULONG64 HeapDeCommitTotalFreeThreshold; /* 00d8 */
585 ULONG64 HeapDeCommitFreeBlockThreshold; /* 00e0 */
586 ULONG NumberOfHeaps; /* 00e8 */
587 ULONG MaximumNumberOfHeaps; /* 00ec */
588 ULONG64 ProcessHeaps; /* 00f0 */
589 ULONG64 GdiSharedHandleTable; /* 00f8 */
590 ULONG64 ProcessStarterHelper; /* 0100 */
591 ULONG64 GdiDCAttributeList; /* 0108 */
592 ULONG64 LoaderLock; /* 0110 */
593 ULONG OSMajorVersion; /* 0118 */
594 ULONG OSMinorVersion; /* 011c */
595 ULONG OSBuildNumber; /* 0120 */
596 ULONG OSPlatformId; /* 0124 */
597 ULONG ImageSubSystem; /* 0128 */
598 ULONG ImageSubSystemMajorVersion; /* 012c */
599 ULONG ImageSubSystemMinorVersion; /* 0130 */
600 ULONG ImageProcessAffinityMask; /* 0134 */
601 ULONG64 GdiHandleBuffer[28]; /* 0138 */
602 ULONG unknown[6]; /* 0218 */
603 ULONG64 PostProcessInitRoutine; /* 0230 */
604 ULONG64 TlsExpansionBitmap; /* 0238 */
605 ULONG TlsExpansionBitmapBits[32]; /* 0240 */
606 ULONG SessionId; /* 02c0 */
607 ULARGE_INTEGER AppCompatFlags; /* 02c8 */
608 ULARGE_INTEGER AppCompatFlagsUser; /* 02d0 */
609 ULONG64 ShimData; /* 02d8 */
610 ULONG64 AppCompatInfo; /* 02e0 */
611 UNICODE_STRING64 CSDVersion; /* 02e8 */
612 ULONG64 ActivationContextData; /* 02f8 */
613 ULONG64 ProcessAssemblyStorageMap; /* 0300 */
614 ULONG64 SystemDefaultActivationData; /* 0308 */
615 ULONG64 SystemAssemblyStorageMap; /* 0310 */
616 ULONG64 MinimumStackCommit; /* 0318 */
617 ULONG64 FlsCallback; /* 0320 */
618 LIST_ENTRY64 FlsListHead; /* 0328 */
619 ULONG64 FlsBitmap; /* 0338 */
620 ULONG FlsBitmapBits[4]; /* 0340 */
621 ULONG FlsHighIndex; /* 0350 */
622 ULONG64 WerRegistrationData; /* 0358 */
623 ULONG64 WerShipAssertPtr; /* 0360 */
624 ULONG64 pUnused; /* 0368 */
625 ULONG64 pImageHeaderHash; /* 0370 */
626 ULONG TracingFlags; /* 0378 */
627 ULONGLONG CsrServerReadOnlySharedMemoryBase; /* 0380 */
628 ULONG TppWorkerpListLock; /* 0388 */
629 LIST_ENTRY64 TppWorkerpList; /* 0390 */
630 ULONG64 WaitOnAddressHashTable [0x80]; /* 03a0 */
631 ULONG64 TelemetryCoverageHeader; /* 07a0 */
632 ULONG CloudFileFlags; /* 07a8 */
633 ULONG CloudFileDiagFlags; /* 07ac */
634 CHAR PlaceholderCompatibilityMode; /* 07b0 */
635 CHAR PlaceholderCompatibilityModeReserved[7]; /* 07b1 */
636 ULONG64 LeapSecondData; /* 07b8 */
637 ULONG LeapSecondFlags; /* 07c0 */
638 ULONG NtGlobalFlag2; /* 07c4 */
639 } PEB64;
641 typedef struct _TEB64
643 NT_TIB64 Tib; /* 0000 */
644 ULONG64 EnvironmentPointer; /* 0038 */
645 CLIENT_ID64 ClientId; /* 0040 */
646 ULONG64 ActiveRpcHandle; /* 0050 */
647 ULONG64 ThreadLocalStoragePointer; /* 0058 */
648 ULONG64 Peb; /* 0060 */
649 ULONG LastErrorValue; /* 0068 */
650 ULONG CountOfOwnedCriticalSections; /* 006c */
651 ULONG64 CsrClientThread; /* 0070 */
652 ULONG64 Win32ThreadInfo; /* 0078 */
653 ULONG User32Reserved[26]; /* 0080 */
654 ULONG UserReserved[5]; /* 00e8 */
655 ULONG64 WOW32Reserved; /* 0100 */
656 ULONG CurrentLocale; /* 0108 */
657 ULONG FpSoftwareStatusRegister; /* 010c */
658 ULONG64 ReservedForDebuggerInstrumentation[16]; /* 0110 */
659 ULONG64 SystemReserved1[30]; /* 0190 */
660 char PlaceholderCompatibilityMode; /* 0280 */
661 char PlaceholderReserved[11]; /* 0281 */
662 DWORD ProxiedProcessId; /* 028c */
663 ACTIVATION_CONTEXT_STACK64 ActivationContextStack; /* 0290 */
664 UCHAR WorkingOnBehalfOfTicket[8]; /* 02b8 */
665 LONG ExceptionCode; /* 02c0 */
666 ULONG64 ActivationContextStackPointer; /* 02c8 */
667 ULONG64 InstrumentationCallbackSp; /* 02d0 */
668 ULONG64 InstrumentationCallbackPreviousPc; /* 02d8 */
669 ULONG64 InstrumentationCallbackPreviousSp; /* 02e0 */
670 ULONG TxFsContext; /* 02e8 */
671 BOOLEAN InstrumentationCallbackDisabled; /* 02ec */
672 ULONG64 GdiTebBatch[0x9d]; /* 02f0 */
673 CLIENT_ID64 RealClientId; /* 07d8 */
674 ULONG64 GdiCachedProcessHandle; /* 07e8 */
675 ULONG GdiClientPID; /* 07f0 */
676 ULONG GdiClientTID; /* 07f4 */
677 ULONG64 GdiThreadLocaleInfo; /* 07f8 */
678 ULONG64 Win32ClientInfo[62]; /* 0800 */
679 ULONG64 glDispatchTable[233]; /* 09f0 */
680 ULONG64 glReserved1[29]; /* 1138 */
681 ULONG64 glReserved2; /* 1220 */
682 ULONG64 glSectionInfo; /* 1228 */
683 ULONG64 glSection; /* 1230 */
684 ULONG64 glTable; /* 1238 */
685 ULONG64 glCurrentRC; /* 1240 */
686 ULONG64 glContext; /* 1248 */
687 ULONG LastStatusValue; /* 1250 */
688 UNICODE_STRING64 StaticUnicodeString; /* 1258 */
689 WCHAR StaticUnicodeBuffer[261]; /* 1268 */
690 ULONG64 DeallocationStack; /* 1478 */
691 ULONG64 TlsSlots[64]; /* 1480 */
692 LIST_ENTRY64 TlsLinks; /* 1680 */
693 ULONG64 Vdm; /* 1690 */
694 ULONG64 ReservedForNtRpc; /* 1698 */
695 ULONG64 DbgSsReserved[2]; /* 16a0 */
696 ULONG HardErrorDisabled; /* 16b0 */
697 ULONG64 Instrumentation[16]; /* 16b8 */
698 ULONG64 WinSockData; /* 1738 */
699 ULONG GdiBatchCount; /* 1740 */
700 ULONG Spare2; /* 1744 */
701 ULONG GuaranteedStackBytes; /* 1748 */
702 ULONG64 ReservedForPerf; /* 1750 */
703 ULONG64 ReservedForOle; /* 1758 */
704 ULONG WaitingOnLoaderLock; /* 1760 */
705 ULONG64 Reserved5[3]; /* 1768 */
706 ULONG64 TlsExpansionSlots; /* 1780 */
707 ULONG64 DeallocationBStore; /* 1788 */
708 ULONG64 BStoreLimit; /* 1790 */
709 ULONG ImpersonationLocale; /* 1798 */
710 ULONG IsImpersonating; /* 179c */
711 ULONG64 NlsCache; /* 17a0 */
712 ULONG64 ShimData; /* 17a8 */
713 ULONG HeapVirtualAffinity; /* 17b0 */
714 ULONG64 CurrentTransactionHandle; /* 17b8 */
715 ULONG64 ActiveFrame; /* 17c0 */
716 ULONG64 FlsSlots; /* 17c8 */
717 ULONG64 PreferredLanguages; /* 17d0 */
718 ULONG64 UserPrefLanguages; /* 17d8 */
719 ULONG64 MergedPrefLanguages; /* 17e0 */
720 ULONG MuiImpersonation; /* 17e8 */
721 USHORT CrossTebFlags; /* 17ec */
722 USHORT SameTebFlags; /* 17ee */
723 ULONG64 TxnScopeEnterCallback; /* 17f0 */
724 ULONG64 TxnScopeExitCallback; /* 17f8 */
725 ULONG64 TxnScopeContext; /* 1800 */
726 ULONG LockCount; /* 1808 */
727 LONG WowTebOffset; /* 180c */
728 ULONG64 ResourceRetValue; /* 1810 */
729 ULONG64 ReservedForWdf; /* 1818 */
730 ULONGLONG ReservedForCrt; /* 1820 */
731 GUID EffectiveContainerId; /* 1828 */
732 } TEB64;
734 /* reserved TEB64 TLS slots for Wow64 */
735 #define WOW64_TLS_FILESYSREDIR 8
737 #endif /* _WIN64 */
739 /***********************************************************************
740 * Enums
743 typedef enum _FILE_INFORMATION_CLASS {
744 FileDirectoryInformation = 1,
745 FileFullDirectoryInformation,
746 FileBothDirectoryInformation,
747 FileBasicInformation,
748 FileStandardInformation,
749 FileInternalInformation,
750 FileEaInformation,
751 FileAccessInformation,
752 FileNameInformation,
753 FileRenameInformation,
754 FileLinkInformation,
755 FileNamesInformation,
756 FileDispositionInformation,
757 FilePositionInformation,
758 FileFullEaInformation,
759 FileModeInformation,
760 FileAlignmentInformation,
761 FileAllInformation,
762 FileAllocationInformation,
763 FileEndOfFileInformation,
764 FileAlternateNameInformation,
765 FileStreamInformation,
766 FilePipeInformation,
767 FilePipeLocalInformation,
768 FilePipeRemoteInformation,
769 FileMailslotQueryInformation,
770 FileMailslotSetInformation,
771 FileCompressionInformation,
772 FileObjectIdInformation,
773 FileCompletionInformation,
774 FileMoveClusterInformation,
775 FileQuotaInformation,
776 FileReparsePointInformation,
777 FileNetworkOpenInformation,
778 FileAttributeTagInformation,
779 FileTrackingInformation,
780 FileIdBothDirectoryInformation,
781 FileIdFullDirectoryInformation,
782 FileValidDataLengthInformation,
783 FileShortNameInformation,
784 FileIoCompletionNotificationInformation,
785 FileIoStatusBlockRangeInformation,
786 FileIoPriorityHintInformation,
787 FileSfioReserveInformation,
788 FileSfioVolumeInformation,
789 FileHardLinkInformation,
790 FileProcessIdsUsingFileInformation,
791 FileNormalizedNameInformation,
792 FileNetworkPhysicalNameInformation,
793 FileIdGlobalTxDirectoryInformation,
794 FileIsRemoteDeviceInformation,
795 FileAttributeCacheInformation,
796 FileNumaNodeInformation,
797 FileStandardLinkInformation,
798 FileRemoteProtocolInformation,
799 FileRenameInformationBypassAccessCheck,
800 FileLinkInformationBypassAccessCheck,
801 FileVolumeNameInformation,
802 FileIdInformation,
803 FileIdExtdDirectoryInformation,
804 FileReplaceCompletionInformation,
805 FileHardLinkFullIdInformation,
806 FileIdExtdBothDirectoryInformation,
807 FileMaximumInformation
808 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
810 typedef struct _FILE_DIRECTORY_INFORMATION {
811 ULONG NextEntryOffset;
812 ULONG FileIndex;
813 LARGE_INTEGER CreationTime;
814 LARGE_INTEGER LastAccessTime;
815 LARGE_INTEGER LastWriteTime;
816 LARGE_INTEGER ChangeTime;
817 LARGE_INTEGER EndOfFile;
818 LARGE_INTEGER AllocationSize;
819 ULONG FileAttributes;
820 ULONG FileNameLength;
821 WCHAR FileName[ANYSIZE_ARRAY];
822 } FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
824 typedef struct _FILE_FULL_DIRECTORY_INFORMATION {
825 ULONG NextEntryOffset;
826 ULONG FileIndex;
827 LARGE_INTEGER CreationTime;
828 LARGE_INTEGER LastAccessTime;
829 LARGE_INTEGER LastWriteTime;
830 LARGE_INTEGER ChangeTime;
831 LARGE_INTEGER EndOfFile;
832 LARGE_INTEGER AllocationSize;
833 ULONG FileAttributes;
834 ULONG FileNameLength;
835 ULONG EaSize;
836 WCHAR FileName[ANYSIZE_ARRAY];
837 } FILE_FULL_DIRECTORY_INFORMATION, *PFILE_FULL_DIRECTORY_INFORMATION,
838 FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION;
840 typedef struct _FILE_ID_FULL_DIRECTORY_INFORMATION {
841 ULONG NextEntryOffset;
842 ULONG FileIndex;
843 LARGE_INTEGER CreationTime;
844 LARGE_INTEGER LastAccessTime;
845 LARGE_INTEGER LastWriteTime;
846 LARGE_INTEGER ChangeTime;
847 LARGE_INTEGER EndOfFile;
848 LARGE_INTEGER AllocationSize;
849 ULONG FileAttributes;
850 ULONG FileNameLength;
851 ULONG EaSize;
852 LARGE_INTEGER FileId;
853 WCHAR FileName[ANYSIZE_ARRAY];
854 } FILE_ID_FULL_DIRECTORY_INFORMATION, *PFILE_ID_FULL_DIRECTORY_INFORMATION;
856 typedef struct _FILE_BOTH_DIRECTORY_INFORMATION {
857 ULONG NextEntryOffset;
858 ULONG FileIndex;
859 LARGE_INTEGER CreationTime;
860 LARGE_INTEGER LastAccessTime;
861 LARGE_INTEGER LastWriteTime;
862 LARGE_INTEGER ChangeTime;
863 LARGE_INTEGER EndOfFile;
864 LARGE_INTEGER AllocationSize;
865 ULONG FileAttributes;
866 ULONG FileNameLength;
867 ULONG EaSize;
868 CHAR ShortNameLength;
869 WCHAR ShortName[12];
870 WCHAR FileName[ANYSIZE_ARRAY];
871 } FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION,
872 FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
874 typedef struct _FILE_ID_BOTH_DIRECTORY_INFORMATION {
875 ULONG NextEntryOffset;
876 ULONG FileIndex;
877 LARGE_INTEGER CreationTime;
878 LARGE_INTEGER LastAccessTime;
879 LARGE_INTEGER LastWriteTime;
880 LARGE_INTEGER ChangeTime;
881 LARGE_INTEGER EndOfFile;
882 LARGE_INTEGER AllocationSize;
883 ULONG FileAttributes;
884 ULONG FileNameLength;
885 ULONG EaSize;
886 CHAR ShortNameLength;
887 WCHAR ShortName[12];
888 LARGE_INTEGER FileId;
889 WCHAR FileName[ANYSIZE_ARRAY];
890 } FILE_ID_BOTH_DIRECTORY_INFORMATION, *PFILE_ID_BOTH_DIRECTORY_INFORMATION;
892 typedef struct _FILE_ID_GLOBAL_TX_DIR_INFORMATION {
893 ULONG NextEntryOffset;
894 ULONG FileIndex;
895 LARGE_INTEGER CreationTime;
896 LARGE_INTEGER LastAccessTime;
897 LARGE_INTEGER LastWriteTime;
898 LARGE_INTEGER ChangeTime;
899 LARGE_INTEGER EndOfFile;
900 LARGE_INTEGER AllocationSize;
901 ULONG FileAttributes;
902 ULONG FileNameLength;
903 LARGE_INTEGER FileId;
904 GUID LockingTransactionId;
905 ULONG TxInfoFlags;
906 WCHAR FileName[ANYSIZE_ARRAY];
907 } FILE_ID_GLOBAL_TX_DIR_INFORMATION, *PFILE_ID_GLOBAL_TX_DIR_INFORMATION;
909 typedef struct _FILE_BASIC_INFORMATION {
910 LARGE_INTEGER CreationTime;
911 LARGE_INTEGER LastAccessTime;
912 LARGE_INTEGER LastWriteTime;
913 LARGE_INTEGER ChangeTime;
914 ULONG FileAttributes;
915 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
917 typedef struct _FILE_STANDARD_INFORMATION {
918 LARGE_INTEGER AllocationSize;
919 LARGE_INTEGER EndOfFile;
920 ULONG NumberOfLinks;
921 BOOLEAN DeletePending;
922 BOOLEAN Directory;
923 } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
925 typedef struct _FILE_INTERNAL_INFORMATION {
926 LARGE_INTEGER IndexNumber;
927 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
929 typedef struct _FILE_ID_128 {
930 UCHAR Identifier[16];
931 } FILE_ID_128, *PFILE_ID_128;
933 typedef struct _FILE_ID_INFORMATION {
934 ULONGLONG VolumeSerialNumber;
935 FILE_ID_128 FileId;
936 } FILE_ID_INFORMATION, *PFILE_ID_INFORMATION;
938 typedef struct _FILE_EA_INFORMATION {
939 ULONG EaSize;
940 } FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
942 typedef struct _FILE_ACCESS_INFORMATION {
943 ACCESS_MASK AccessFlags;
944 } FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
946 typedef struct _FILE_NAME_INFORMATION {
947 ULONG FileNameLength;
948 WCHAR FileName[1];
949 } FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
951 typedef struct _FILE_RENAME_INFORMATION {
952 BOOLEAN ReplaceIfExists;
953 HANDLE RootDirectory;
954 ULONG FileNameLength;
955 WCHAR FileName[1];
956 } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
958 typedef struct _FILE_LINK_INFORMATION {
959 BOOLEAN ReplaceIfExists;
960 HANDLE RootDirectory;
961 ULONG FileNameLength;
962 WCHAR FileName[1];
963 } FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION;
965 typedef struct _FILE_NAMES_INFORMATION {
966 ULONG NextEntryOffset;
967 ULONG FileIndex;
968 ULONG FileNameLength;
969 WCHAR FileName[1];
970 } FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
972 typedef struct _FILE_DISPOSITION_INFORMATION {
973 BOOLEAN DoDeleteFile;
974 } FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
976 typedef struct _FILE_POSITION_INFORMATION {
977 LARGE_INTEGER CurrentByteOffset;
978 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
980 typedef struct _FILE_ALIGNMENT_INFORMATION {
981 ULONG AlignmentRequirement;
982 } FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION;
984 typedef struct _FILE_ALLOCATION_INFORMATION {
985 LARGE_INTEGER AllocationSize;
986 } FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
988 typedef struct _FILE_END_OF_FILE_INFORMATION {
989 LARGE_INTEGER EndOfFile;
990 } FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
992 typedef struct _FILE_NETWORK_OPEN_INFORMATION {
993 LARGE_INTEGER CreationTime;
994 LARGE_INTEGER LastAccessTime;
995 LARGE_INTEGER LastWriteTime;
996 LARGE_INTEGER ChangeTime;
997 LARGE_INTEGER AllocationSize;
998 LARGE_INTEGER EndOfFile;
999 ULONG FileAttributes;
1000 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
1002 typedef struct _FILE_FULL_EA_INFORMATION {
1003 ULONG NextEntryOffset;
1004 UCHAR Flags;
1005 UCHAR EaNameLength;
1006 USHORT EaValueLength;
1007 CHAR EaName[1];
1008 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
1010 typedef struct _FILE_MODE_INFORMATION {
1011 ULONG Mode;
1012 } FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION;
1014 typedef struct _FILE_STREAM_INFORMATION
1016 ULONG NextEntryOffset;
1017 ULONG StreamNameLength;
1018 LARGE_INTEGER StreamSize;
1019 LARGE_INTEGER StreamAllocationSize;
1020 WCHAR StreamName[1];
1021 } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
1023 typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION
1025 ULONG FileAttributes;
1026 ULONG ReparseTag;
1027 } FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
1029 typedef struct _FILE_MAILSLOT_QUERY_INFORMATION {
1030 ULONG MaximumMessageSize;
1031 ULONG MailslotQuota;
1032 ULONG NextMessageSize;
1033 ULONG MessagesAvailable;
1034 LARGE_INTEGER ReadTimeout;
1035 } FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION;
1037 typedef struct _FILE_MAILSLOT_SET_INFORMATION {
1038 LARGE_INTEGER ReadTimeout;
1039 } FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
1041 typedef struct _FILE_PIPE_INFORMATION {
1042 ULONG ReadMode;
1043 ULONG CompletionMode;
1044 } FILE_PIPE_INFORMATION, *PFILE_PIPE_INFORMATION;
1046 typedef struct _FILE_PIPE_LOCAL_INFORMATION {
1047 ULONG NamedPipeType;
1048 ULONG NamedPipeConfiguration;
1049 ULONG MaximumInstances;
1050 ULONG CurrentInstances;
1051 ULONG InboundQuota;
1052 ULONG ReadDataAvailable;
1053 ULONG OutboundQuota;
1054 ULONG WriteQuotaAvailable;
1055 ULONG NamedPipeState;
1056 ULONG NamedPipeEnd;
1057 } FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
1059 #define FILE_PIPE_DISCONNECTED_STATE 0x00000001
1060 #define FILE_PIPE_LISTENING_STATE 0x00000002
1061 #define FILE_PIPE_CONNECTED_STATE 0x00000003
1062 #define FILE_PIPE_CLOSING_STATE 0x00000004
1064 typedef struct _FILE_OBJECTID_BUFFER
1066 BYTE ObjectId[16];
1067 union
1069 struct
1071 BYTE BirthVolumeId[16];
1072 BYTE BirthObjectId[16];
1073 BYTE DomainId[16];
1074 } DUMMYSTRUCTNAME;
1075 BYTE ExtendedInfo[48];
1076 } DUMMYUNIONNAME;
1077 } FILE_OBJECTID_BUFFER, *PFILE_OBJECTID_BUFFER;
1079 typedef struct _FILE_OBJECTID_INFORMATION {
1080 LONGLONG FileReference;
1081 UCHAR ObjectId[16];
1082 union {
1083 struct {
1084 UCHAR BirthVolumeId[16];
1085 UCHAR BirthObjectId[16];
1086 UCHAR DomainId[16];
1087 } DUMMYSTRUCTNAME;
1088 UCHAR ExtendedInfo[48];
1089 } DUMMYUNIONNAME;
1090 } FILE_OBJECTID_INFORMATION, *PFILE_OBJECTID_INFORMATION;
1092 typedef struct _FILE_QUOTA_INFORMATION {
1093 ULONG NextEntryOffset;
1094 ULONG SidLength;
1095 LARGE_INTEGER ChangeTime;
1096 LARGE_INTEGER QuotaUsed;
1097 LARGE_INTEGER QuotaThreshold;
1098 LARGE_INTEGER QuotaLimit;
1099 SID Sid;
1100 } FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION;
1102 typedef struct _FILE_REPARSE_POINT_INFORMATION {
1103 LONGLONG FileReference;
1104 ULONG Tag;
1105 } FILE_REPARSE_POINT_INFORMATION, *PFILE_REPARSE_POINT_INFORMATION;
1107 typedef struct _FILE_ALL_INFORMATION {
1108 FILE_BASIC_INFORMATION BasicInformation;
1109 FILE_STANDARD_INFORMATION StandardInformation;
1110 FILE_INTERNAL_INFORMATION InternalInformation;
1111 FILE_EA_INFORMATION EaInformation;
1112 FILE_ACCESS_INFORMATION AccessInformation;
1113 FILE_POSITION_INFORMATION PositionInformation;
1114 FILE_MODE_INFORMATION ModeInformation;
1115 FILE_ALIGNMENT_INFORMATION AlignmentInformation;
1116 FILE_NAME_INFORMATION NameInformation;
1117 } FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION;
1119 typedef struct _FILE_IO_COMPLETION_NOTIFICATION_INFORMATION {
1120 ULONG Flags;
1121 } FILE_IO_COMPLETION_NOTIFICATION_INFORMATION, *PFILE_IO_COMPLETION_NOTIFICATION_INFORMATION;
1123 #define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS 0x1
1124 #define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2
1125 #define FILE_SKIP_SET_USER_EVENT_ON_FAST_IO 0x4
1127 typedef enum _FSINFOCLASS {
1128 FileFsVolumeInformation = 1,
1129 FileFsLabelInformation,
1130 FileFsSizeInformation,
1131 FileFsDeviceInformation,
1132 FileFsAttributeInformation,
1133 FileFsControlInformation,
1134 FileFsFullSizeInformation,
1135 FileFsObjectIdInformation,
1136 FileFsMaximumInformation
1137 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
1139 typedef enum _KEY_INFORMATION_CLASS {
1140 KeyBasicInformation,
1141 KeyNodeInformation,
1142 KeyFullInformation,
1143 KeyNameInformation,
1144 KeyCachedInformation,
1145 KeyFlagsInformation,
1146 KeyVirtualizationInformation,
1147 KeyHandleTagsInformation,
1148 MaxKeyInfoClass
1149 } KEY_INFORMATION_CLASS;
1151 typedef enum _KEY_VALUE_INFORMATION_CLASS {
1152 KeyValueBasicInformation,
1153 KeyValueFullInformation,
1154 KeyValuePartialInformation,
1155 KeyValueFullInformationAlign64,
1156 KeyValuePartialInformationAlign64
1157 } KEY_VALUE_INFORMATION_CLASS;
1159 typedef enum _OBJECT_INFORMATION_CLASS {
1160 ObjectBasicInformation,
1161 ObjectNameInformation,
1162 ObjectTypeInformation,
1163 ObjectTypesInformation,
1164 ObjectDataInformation
1165 } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
1167 typedef enum _PROCESSINFOCLASS {
1168 ProcessBasicInformation = 0,
1169 ProcessQuotaLimits = 1,
1170 ProcessIoCounters = 2,
1171 ProcessVmCounters = 3,
1172 ProcessTimes = 4,
1173 ProcessBasePriority = 5,
1174 ProcessRaisePriority = 6,
1175 ProcessDebugPort = 7,
1176 ProcessExceptionPort = 8,
1177 ProcessAccessToken = 9,
1178 ProcessLdtInformation = 10,
1179 ProcessLdtSize = 11,
1180 ProcessDefaultHardErrorMode = 12,
1181 ProcessIoPortHandlers = 13,
1182 ProcessPooledUsageAndLimits = 14,
1183 ProcessWorkingSetWatch = 15,
1184 ProcessUserModeIOPL = 16,
1185 ProcessEnableAlignmentFaultFixup = 17,
1186 ProcessPriorityClass = 18,
1187 ProcessWx86Information = 19,
1188 ProcessHandleCount = 20,
1189 ProcessAffinityMask = 21,
1190 ProcessPriorityBoost = 22,
1191 ProcessDeviceMap = 23,
1192 ProcessSessionInformation = 24,
1193 ProcessForegroundInformation = 25,
1194 ProcessWow64Information = 26,
1195 ProcessImageFileName = 27,
1196 ProcessLUIDDeviceMapsEnabled = 28,
1197 ProcessBreakOnTermination = 29,
1198 ProcessDebugObjectHandle = 30,
1199 ProcessDebugFlags = 31,
1200 ProcessHandleTracing = 32,
1201 ProcessIoPriority = 33,
1202 ProcessExecuteFlags = 34,
1203 ProcessTlsInformation = 35,
1204 ProcessCookie = 36,
1205 ProcessImageInformation = 37,
1206 ProcessCycleTime = 38,
1207 ProcessPagePriority = 39,
1208 ProcessInstrumentationCallback = 40,
1209 ProcessThreadStackAllocation = 41,
1210 ProcessWorkingSetWatchEx = 42,
1211 ProcessImageFileNameWin32 = 43,
1212 MaxProcessInfoClass
1213 } PROCESSINFOCLASS, PROCESS_INFORMATION_CLASS;
1215 #define MEM_EXECUTE_OPTION_DISABLE 0x01
1216 #define MEM_EXECUTE_OPTION_ENABLE 0x02
1217 #define MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION 0x04
1218 #define MEM_EXECUTE_OPTION_PERMANENT 0x08
1220 typedef enum _SECTION_INHERIT {
1221 ViewShare = 1,
1222 ViewUnmap = 2
1223 } SECTION_INHERIT;
1225 typedef enum _SYSTEM_INFORMATION_CLASS {
1226 SystemBasicInformation = 0,
1227 SystemCpuInformation = 1,
1228 SystemPerformanceInformation = 2,
1229 SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
1230 Unknown4,
1231 SystemProcessInformation = 5,
1232 Unknown6,
1233 Unknown7,
1234 SystemProcessorPerformanceInformation = 8,
1235 Unknown9,
1236 Unknown10,
1237 SystemModuleInformation = 11,
1238 Unknown12,
1239 Unknown13,
1240 Unknown14,
1241 Unknown15,
1242 SystemHandleInformation = 16,
1243 Unknown17,
1244 SystemPageFileInformation = 18,
1245 Unknown19,
1246 Unknown20,
1247 SystemCacheInformation = 21,
1248 Unknown22,
1249 SystemInterruptInformation = 23,
1250 SystemDpcBehaviourInformation = 24,
1251 SystemFullMemoryInformation = 25,
1252 SystemNotImplemented6 = 25,
1253 SystemLoadImage = 26,
1254 SystemUnloadImage = 27,
1255 SystemTimeAdjustmentInformation = 28,
1256 SystemTimeAdjustment = 28,
1257 SystemSummaryMemoryInformation = 29,
1258 SystemNotImplemented7 = 29,
1259 SystemNextEventIdInformation = 30,
1260 SystemNotImplemented8 = 30,
1261 SystemEventIdsInformation = 31,
1262 SystemCrashDumpInformation = 32,
1263 SystemExceptionInformation = 33,
1264 SystemCrashDumpStateInformation = 34,
1265 SystemKernelDebuggerInformation = 35,
1266 SystemContextSwitchInformation = 36,
1267 SystemRegistryQuotaInformation = 37,
1268 SystemCurrentTimeZoneInformation = 44,
1269 SystemTimeZoneInformation = 44,
1270 SystemLookasideInformation = 45,
1271 SystemSetTimeSlipEvent = 46,
1272 SystemCreateSession = 47,
1273 SystemDeleteSession = 48,
1274 SystemInvalidInfoClass4 = 49,
1275 SystemRangeStartInformation = 50,
1276 SystemVerifierInformation = 51,
1277 SystemAddVerifier = 52,
1278 SystemSessionProcessesInformation = 53,
1279 SystemLoadGdiDriverInSystemSpace = 54,
1280 SystemNumaProcessorMap = 55,
1281 SystemPrefetcherInformation = 56,
1282 SystemExtendedProcessInformation = 57,
1283 SystemRecommendedSharedDataAlignment = 58,
1284 SystemComPlusPackage = 59,
1285 SystemNumaAvailableMemory = 60,
1286 SystemProcessorPowerInformation = 61,
1287 SystemEmulationBasicInformation = 62,
1288 SystemEmulationProcessorInformation = 63,
1289 SystemExtendedHandleInformation = 64,
1290 SystemLostDelayedWriteInformation = 65,
1291 SystemBigPoolInformation = 66,
1292 SystemSessionPoolTagInformation = 67,
1293 SystemSessionMappedViewInformation = 68,
1294 SystemHotpatchInformation = 69,
1295 SystemObjectSecurityMode = 70,
1296 SystemWatchdogTimerHandler = 71,
1297 SystemWatchdogTimerInformation = 72,
1298 SystemLogicalProcessorInformation = 73,
1299 SystemWow64SharedInformation = 74,
1300 SystemRegisterFirmwareTableInformationHandler = 75,
1301 SystemFirmwareTableInformation = 76,
1302 SystemModuleInformationEx = 77,
1303 SystemVerifierTriageInformation = 78,
1304 SystemSuperfetchInformation = 79,
1305 SystemMemoryListInformation = 80,
1306 SystemFileCacheInformationEx = 81,
1307 SystemDynamicTimeZoneInformation = 102,
1308 SystemLogicalProcessorInformationEx = 107,
1309 SystemInformationClassMax
1310 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
1312 typedef enum _THREADINFOCLASS {
1313 ThreadBasicInformation = 0,
1314 ThreadTimes,
1315 ThreadPriority,
1316 ThreadBasePriority,
1317 ThreadAffinityMask,
1318 ThreadImpersonationToken,
1319 ThreadDescriptorTableEntry,
1320 ThreadEnableAlignmentFaultFixup,
1321 ThreadEventPair_Reusable,
1322 ThreadQuerySetWin32StartAddress,
1323 ThreadZeroTlsCell,
1324 ThreadPerformanceCount,
1325 ThreadAmILastThread,
1326 ThreadIdealProcessor,
1327 ThreadPriorityBoost,
1328 ThreadSetTlsArrayAddress,
1329 ThreadIsIoPending,
1330 ThreadHideFromDebugger,
1331 ThreadBreakOnTermination,
1332 ThreadSwitchLegacyState,
1333 ThreadIsTerminated,
1334 ThreadLastSystemCall,
1335 ThreadIoPriority,
1336 ThreadCycleTime,
1337 ThreadPagePriority,
1338 ThreadActualBasePriority,
1339 ThreadTebInformation,
1340 ThreadCSwitchMon,
1341 ThreadCSwitchPmu,
1342 ThreadWow64Context,
1343 ThreadGroupInformation,
1344 ThreadUmsInformation,
1345 ThreadCounterProfiling,
1346 ThreadIdealProcessorEx,
1347 ThreadSuspendCount = 35,
1348 ThreadDescription = 38,
1349 MaxThreadInfoClass
1350 } THREADINFOCLASS;
1352 typedef struct _THREAD_BASIC_INFORMATION
1354 NTSTATUS ExitStatus;
1355 PVOID TebBaseAddress;
1356 CLIENT_ID ClientId;
1357 ULONG_PTR AffinityMask;
1358 LONG Priority;
1359 LONG BasePriority;
1360 } THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
1362 typedef struct _THREAD_DESCRIPTOR_INFORMATION
1364 DWORD Selector;
1365 LDT_ENTRY Entry;
1366 } THREAD_DESCRIPTOR_INFORMATION, *PTHREAD_DESCRIPTOR_INFORMATION;
1368 typedef struct _THREAD_DESCRIPTION_INFORMATION
1370 UNICODE_STRING Description;
1371 } THREAD_DESCRIPTION_INFORMATION, *PTHREAD_DESCRIPTION_INFORMATION;
1373 typedef struct _KERNEL_USER_TIMES {
1374 LARGE_INTEGER CreateTime;
1375 LARGE_INTEGER ExitTime;
1376 LARGE_INTEGER KernelTime;
1377 LARGE_INTEGER UserTime;
1378 } KERNEL_USER_TIMES, *PKERNEL_USER_TIMES;
1380 typedef enum _WINSTATIONINFOCLASS {
1381 WinStationInformation = 8
1382 } WINSTATIONINFOCLASS;
1384 typedef enum _MEMORY_INFORMATION_CLASS {
1385 MemoryBasicInformation,
1386 MemoryWorkingSetList,
1387 MemorySectionName,
1388 MemoryBasicVlmInformation,
1389 MemoryWorkingSetExInformation
1390 } MEMORY_INFORMATION_CLASS;
1392 typedef struct _MEMORY_SECTION_NAME
1394 UNICODE_STRING SectionFileName;
1395 } MEMORY_SECTION_NAME, *PMEMORY_SECTION_NAME;
1397 typedef union _MEMORY_WORKING_SET_EX_BLOCK {
1398 ULONG_PTR Flags;
1399 struct {
1400 ULONG_PTR Valid : 1;
1401 ULONG_PTR ShareCount : 3;
1402 ULONG_PTR Win32Protection : 11;
1403 ULONG_PTR Shared : 1;
1404 ULONG_PTR Node : 6;
1405 ULONG_PTR Locked : 1;
1406 ULONG_PTR LargePage : 1;
1407 } DUMMYSTRUCTNAME;
1408 } MEMORY_WORKING_SET_EX_BLOCK, *PMEMORY_WORKING_SET_EX_BLOCK;
1410 typedef struct _MEMORY_WORKING_SET_EX_INFORMATION {
1411 PVOID VirtualAddress;
1412 MEMORY_WORKING_SET_EX_BLOCK VirtualAttributes;
1413 } MEMORY_WORKING_SET_EX_INFORMATION, *PMEMORY_WORKING_SET_EX_INFORMATION;
1415 typedef enum _MUTANT_INFORMATION_CLASS
1417 MutantBasicInformation
1418 } MUTANT_INFORMATION_CLASS, *PMUTANT_INFORMATION_CLASS;
1420 typedef struct _MUTANT_BASIC_INFORMATION {
1421 LONG CurrentCount;
1422 BOOLEAN OwnedByCaller;
1423 BOOLEAN AbandonedState;
1424 } MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION;
1426 typedef enum _TIMER_INFORMATION_CLASS
1428 TimerBasicInformation = 0
1429 } TIMER_INFORMATION_CLASS;
1431 typedef struct _TIMER_BASIC_INFORMATION
1433 LARGE_INTEGER RemainingTime;
1434 BOOLEAN TimerState;
1435 } TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION;
1438 /* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
1439 typedef enum
1441 INVALID_PATH = 0,
1442 UNC_PATH, /* "//foo" */
1443 ABSOLUTE_DRIVE_PATH, /* "c:/foo" */
1444 RELATIVE_DRIVE_PATH, /* "c:foo" */
1445 ABSOLUTE_PATH, /* "/foo" */
1446 RELATIVE_PATH, /* "foo" */
1447 DEVICE_PATH, /* "//./foo" */
1448 UNC_DOT_PATH /* "//." */
1449 } DOS_PATHNAME_TYPE;
1452 /***********************************************************************
1453 * Types and data structures
1456 /* This is used by NtQuerySystemInformation */
1457 typedef struct _SYSTEM_THREAD_INFORMATION
1458 { /* win32/win64 */
1459 LARGE_INTEGER KernelTime; /* 00/00 */
1460 LARGE_INTEGER UserTime; /* 08/08 */
1461 LARGE_INTEGER CreateTime; /* 10/10 */
1462 DWORD dwTickCount; /* 18/18 */
1463 LPVOID StartAddress; /* 1c/20 */
1464 CLIENT_ID ClientId; /* 20/28 */
1465 DWORD dwCurrentPriority; /* 28/38 */
1466 DWORD dwBasePriority; /* 2c/3c */
1467 DWORD dwContextSwitches; /* 30/40 */
1468 DWORD dwThreadState; /* 34/44 */
1469 DWORD dwWaitReason; /* 38/48 */
1470 DWORD dwUnknown; /* 3c/4c */
1471 } SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION;
1473 typedef struct _IO_STATUS_BLOCK {
1474 union {
1475 NTSTATUS Status;
1476 PVOID Pointer;
1477 } DUMMYUNIONNAME;
1479 ULONG_PTR Information;
1480 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
1482 typedef void (WINAPI * PIO_APC_ROUTINE)(PVOID,PIO_STATUS_BLOCK,ULONG);
1484 typedef struct _KEY_BASIC_INFORMATION {
1485 LARGE_INTEGER LastWriteTime;
1486 ULONG TitleIndex;
1487 ULONG NameLength;
1488 WCHAR Name[1];
1489 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
1491 typedef struct _KEY_NODE_INFORMATION
1493 LARGE_INTEGER LastWriteTime;
1494 ULONG TitleIndex;
1495 ULONG ClassOffset;
1496 ULONG ClassLength;
1497 ULONG NameLength;
1498 WCHAR Name[1];
1499 /* Class[1]; */
1500 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
1502 typedef struct _KEY_FULL_INFORMATION
1504 LARGE_INTEGER LastWriteTime;
1505 ULONG TitleIndex;
1506 ULONG ClassOffset;
1507 ULONG ClassLength;
1508 ULONG SubKeys;
1509 ULONG MaxNameLen;
1510 ULONG MaxClassLen;
1511 ULONG Values;
1512 ULONG MaxValueNameLen;
1513 ULONG MaxValueDataLen;
1514 WCHAR Class[1];
1515 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
1517 typedef struct _KEY_NAME_INFORMATION {
1518 ULONG NameLength;
1519 WCHAR Name[1];
1520 } KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION;
1522 typedef struct _KEY_CACHED_INFORMATION
1524 LARGE_INTEGER LastWriteTime;
1525 ULONG TitleIndex;
1526 ULONG SubKeys;
1527 ULONG MaxNameLen;
1528 ULONG Values;
1529 ULONG MaxValueNameLen;
1530 ULONG MaxValueDataLen;
1531 ULONG NameLength;
1532 } KEY_CACHED_INFORMATION, *PKEY_CACHED_INFORMATION;
1534 typedef struct _KEY_VALUE_ENTRY
1536 PUNICODE_STRING ValueName;
1537 ULONG DataLength;
1538 ULONG DataOffset;
1539 ULONG Type;
1540 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
1542 typedef struct _KEY_VALUE_BASIC_INFORMATION {
1543 ULONG TitleIndex;
1544 ULONG Type;
1545 ULONG NameLength;
1546 WCHAR Name[1];
1547 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
1549 typedef struct _KEY_VALUE_FULL_INFORMATION {
1550 ULONG TitleIndex;
1551 ULONG Type;
1552 ULONG DataOffset;
1553 ULONG DataLength;
1554 ULONG NameLength;
1555 WCHAR Name[1];
1556 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
1558 typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
1559 ULONG TitleIndex;
1560 ULONG Type;
1561 ULONG DataLength;
1562 UCHAR Data[1];
1563 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
1565 #ifndef __OBJECT_ATTRIBUTES_DEFINED__
1566 #define __OBJECT_ATTRIBUTES_DEFINED__
1567 typedef struct _OBJECT_ATTRIBUTES {
1568 ULONG Length;
1569 HANDLE RootDirectory;
1570 PUNICODE_STRING ObjectName;
1571 ULONG Attributes;
1572 PVOID SecurityDescriptor; /* type SECURITY_DESCRIPTOR */
1573 PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
1574 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
1575 #endif
1577 typedef struct _OBJECT_DATA_INFORMATION {
1578 BOOLEAN InheritHandle;
1579 BOOLEAN ProtectFromClose;
1580 } OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION;
1582 typedef struct _OBJECT_BASIC_INFORMATION {
1583 ULONG Attributes;
1584 ACCESS_MASK GrantedAccess;
1585 ULONG HandleCount;
1586 ULONG PointerCount;
1587 ULONG PagedPoolUsage;
1588 ULONG NonPagedPoolUsage;
1589 ULONG Reserved[3];
1590 ULONG NameInformationLength;
1591 ULONG TypeInformationLength;
1592 ULONG SecurityDescriptorLength;
1593 LARGE_INTEGER CreateTime;
1594 } OBJECT_BASIC_INFORMATION, *POBJECT_BASIC_INFORMATION;
1596 typedef struct _OBJECT_NAME_INFORMATION {
1597 UNICODE_STRING Name;
1598 } OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;
1600 typedef struct __OBJECT_TYPE_INFORMATION {
1601 UNICODE_STRING TypeName;
1602 ULONG TotalNumberOfObjects;
1603 ULONG TotalNumberOfHandles;
1604 ULONG TotalPagedPoolUsage;
1605 ULONG TotalNonPagedPoolUsage;
1606 ULONG TotalNamePoolUsage;
1607 ULONG TotalHandleTableUsage;
1608 ULONG HighWaterNumberOfObjects;
1609 ULONG HighWaterNumberOfHandles;
1610 ULONG HighWaterPagedPoolUsage;
1611 ULONG HighWaterNonPagedPoolUsage;
1612 ULONG HighWaterNamePoolUsage;
1613 ULONG HighWaterHandleTableUsage;
1614 ULONG InvalidAttributes;
1615 GENERIC_MAPPING GenericMapping;
1616 ULONG ValidAccessMask;
1617 BOOLEAN SecurityRequired;
1618 BOOLEAN MaintainHandleCount;
1619 UCHAR TypeIndex;
1620 CHAR ReservedByte;
1621 ULONG PoolType;
1622 ULONG DefaultPagedPoolCharge;
1623 ULONG DefaultNonPagedPoolCharge;
1624 } OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION;
1626 typedef struct _OBJECT_TYPES_INFORMATION
1628 ULONG NumberOfTypes;
1629 } OBJECT_TYPES_INFORMATION, *POBJECT_TYPES_INFORMATION;
1631 typedef struct _PROCESS_BASIC_INFORMATION {
1632 #ifdef __WINESRC__
1633 DWORD_PTR ExitStatus;
1634 PPEB PebBaseAddress;
1635 DWORD_PTR AffinityMask;
1636 DWORD_PTR BasePriority;
1637 ULONG_PTR UniqueProcessId;
1638 ULONG_PTR InheritedFromUniqueProcessId;
1639 #else
1640 PVOID Reserved1;
1641 PPEB PebBaseAddress;
1642 PVOID Reserved2[2];
1643 ULONG_PTR UniqueProcessId;
1644 PVOID Reserved3;
1645 #endif
1646 } PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION;
1648 #define PROCESS_PRIOCLASS_IDLE 1
1649 #define PROCESS_PRIOCLASS_NORMAL 2
1650 #define PROCESS_PRIOCLASS_HIGH 3
1651 #define PROCESS_PRIOCLASS_REALTIME 4
1652 #define PROCESS_PRIOCLASS_BELOW_NORMAL 5
1653 #define PROCESS_PRIOCLASS_ABOVE_NORMAL 6
1655 typedef struct _PROCESS_PRIORITY_CLASS {
1656 BOOLEAN Foreground;
1657 UCHAR PriorityClass;
1658 } PROCESS_PRIORITY_CLASS, *PPROCESS_PRIORITY_CLASS;
1660 typedef struct _PROCESS_STACK_ALLOCATION_INFORMATION
1662 SIZE_T ReserveSize;
1663 SIZE_T ZeroBits;
1664 PVOID StackBase;
1665 } PROCESS_STACK_ALLOCATION_INFORMATION, *PPROCESS_STACK_ALLOCATION_INFORMATION;
1667 typedef struct _PROCESS_STACK_ALLOCATION_INFORMATION_EX
1669 ULONG PreferredNode;
1670 ULONG Reserved0;
1671 ULONG Reserved1;
1672 ULONG Reserved2;
1673 PROCESS_STACK_ALLOCATION_INFORMATION AllocInfo;
1674 } PROCESS_STACK_ALLOCATION_INFORMATION_EX, *PPROCESS_STACK_ALLOCATION_INFORMATION_EX;
1676 typedef struct _RTL_HEAP_DEFINITION {
1677 ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
1679 ULONG Unknown[11];
1680 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
1682 typedef struct _RTL_RWLOCK {
1683 RTL_CRITICAL_SECTION rtlCS;
1685 HANDLE hSharedReleaseSemaphore;
1686 UINT uSharedWaiters;
1688 HANDLE hExclusiveReleaseSemaphore;
1689 UINT uExclusiveWaiters;
1691 INT iNumberActive;
1692 HANDLE hOwningThreadId;
1693 DWORD dwTimeoutBoost;
1694 PVOID pDebugInfo;
1695 } RTL_RWLOCK, *LPRTL_RWLOCK;
1697 /* System Information Class 0x00 */
1699 typedef struct _SYSTEM_BASIC_INFORMATION {
1700 #ifdef __WINESRC__
1701 DWORD unknown;
1702 ULONG KeMaximumIncrement;
1703 ULONG PageSize;
1704 ULONG MmNumberOfPhysicalPages;
1705 ULONG MmLowestPhysicalPage;
1706 ULONG MmHighestPhysicalPage;
1707 ULONG_PTR AllocationGranularity;
1708 PVOID LowestUserAddress;
1709 PVOID HighestUserAddress;
1710 ULONG_PTR ActiveProcessorsAffinityMask;
1711 BYTE NumberOfProcessors;
1712 #else
1713 BYTE Reserved1[24];
1714 PVOID Reserved2[4];
1715 CCHAR NumberOfProcessors;
1716 #endif
1717 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
1719 /* System Information Class 0x01 */
1721 typedef struct _SYSTEM_CPU_INFORMATION {
1722 WORD Architecture;
1723 WORD Level;
1724 WORD Revision; /* combination of CPU model and stepping */
1725 WORD Reserved; /* always zero */
1726 DWORD FeatureSet; /* see bit flags below */
1727 } SYSTEM_CPU_INFORMATION, *PSYSTEM_CPU_INFORMATION;
1729 /* definitions of bits in the Feature set for the x86 processors */
1730 #define CPU_FEATURE_VME 0x00000005 /* Virtual 86 Mode Extensions */
1731 #define CPU_FEATURE_TSC 0x00000002 /* Time Stamp Counter available */
1732 #define CPU_FEATURE_CMOV 0x00000008 /* Conditional Move instruction*/
1733 #define CPU_FEATURE_PGE 0x00000014 /* Page table Entry Global bit */
1734 #define CPU_FEATURE_PSE 0x00000024 /* Page Size Extension */
1735 #define CPU_FEATURE_MTRR 0x00000040 /* Memory Type Range Registers */
1736 #define CPU_FEATURE_CX8 0x00000080 /* Compare and eXchange 8 byte instr. */
1737 #define CPU_FEATURE_MMX 0x00000100 /* Multi Media eXtensions */
1738 #define CPU_FEATURE_X86 0x00000200 /* seems to be always ON, on the '86 */
1739 #define CPU_FEATURE_PAT 0x00000400 /* Page Attribute Table */
1740 #define CPU_FEATURE_FXSR 0x00000800 /* FXSAVE and FXSTORE instructions */
1741 #define CPU_FEATURE_SEP 0x00001000 /* SYSENTER and SYSEXIT instructions */
1742 #define CPU_FEATURE_SSE 0x00002000 /* SSE extensions (ext. MMX) */
1743 #define CPU_FEATURE_3DNOW 0x00004000 /* 3DNOW instructions available */
1744 #define CPU_FEATURE_SSE2 0x00010000 /* SSE2 extensions (XMMI64) */
1745 #define CPU_FEATURE_DS 0x00020000 /* Debug Store */
1746 #define CPU_FEATURE_HTT 0x00040000 /* Hyper Threading Technology */
1747 #define CPU_FEATURE_SSE3 0x00080000 /* SSE3 extensions */
1748 #define CPU_FEATURE_CX128 0x00100000 /* cmpxchg16b instruction */
1749 #define CPU_FEATURE_XSAVE 0x00800000 /* XSAVE instructions */
1750 #define CPU_FEATURE_2NDLEV 0x04000000 /* Second-level address translation */
1751 #define CPU_FEATURE_VIRT 0x08000000 /* Virtualization support */
1752 #define CPU_FEATURE_RDFS 0x10000000 /* RDFSBASE etc. instructions */
1753 #define CPU_FEATURE_NX 0x20000000 /* Data execution prevention */
1755 /* FIXME: following values are made up, actual flags are unknown */
1756 #define CPU_FEATURE_SSSE3 0x00008000 /* SSSE3 instructions */
1757 #define CPU_FEATURE_SSE41 0x01000000 /* SSE41 instructions */
1758 #define CPU_FEATURE_SSE42 0x02000000 /* SSE42 instructions */
1759 #define CPU_FEATURE_AVX 0x40000000 /* AVX instructions */
1760 #define CPU_FEATURE_AVX2 0x80000000 /* AVX2 instructions */
1762 #define CPU_FEATURE_PAE 0x00200000
1763 #define CPU_FEATURE_DAZ 0x00400000
1764 #define CPU_FEATURE_ARM_VFP_32 0x00000001
1765 #define CPU_FEATURE_ARM_NEON 0x00000002
1766 #define CPU_FEATURE_ARM_V8_CRC32 0x00000004
1767 #define CPU_FEATURE_ARM_V8_CRYPTO 0x00000008
1769 /* System Information Class 0x02 */
1771 /* Documented in "Windows NT/2000 Native API Reference" by Gary Nebbett. */
1772 typedef struct _SYSTEM_PERFORMANCE_INFORMATION {
1773 LARGE_INTEGER IdleTime;
1774 LARGE_INTEGER ReadTransferCount;
1775 LARGE_INTEGER WriteTransferCount;
1776 LARGE_INTEGER OtherTransferCount;
1777 ULONG ReadOperationCount;
1778 ULONG WriteOperationCount;
1779 ULONG OtherOperationCount;
1780 ULONG AvailablePages;
1781 ULONG TotalCommittedPages;
1782 ULONG TotalCommitLimit;
1783 ULONG PeakCommitment;
1784 ULONG PageFaults;
1785 ULONG WriteCopyFaults;
1786 ULONG TransitionFaults;
1787 ULONG Reserved1;
1788 ULONG DemandZeroFaults;
1789 ULONG PagesRead;
1790 ULONG PageReadIos;
1791 ULONG Reserved2[2];
1792 ULONG PagefilePagesWritten;
1793 ULONG PagefilePageWriteIos;
1794 ULONG MappedFilePagesWritten;
1795 ULONG MappedFilePageWriteIos;
1796 ULONG PagedPoolUsage;
1797 ULONG NonPagedPoolUsage;
1798 ULONG PagedPoolAllocs;
1799 ULONG PagedPoolFrees;
1800 ULONG NonPagedPoolAllocs;
1801 ULONG NonPagedPoolFrees;
1802 ULONG TotalFreeSystemPtes;
1803 ULONG SystemCodePage;
1804 ULONG TotalSystemDriverPages;
1805 ULONG TotalSystemCodePages;
1806 ULONG SmallNonPagedLookasideListAllocateHits;
1807 ULONG SmallPagedLookasideListAllocateHits;
1808 ULONG Reserved3;
1809 ULONG MmSystemCachePage;
1810 ULONG PagedPoolPage;
1811 ULONG SystemDriverPage;
1812 ULONG FastReadNoWait;
1813 ULONG FastReadWait;
1814 ULONG FastReadResourceMiss;
1815 ULONG FastReadNotPossible;
1816 ULONG FastMdlReadNoWait;
1817 ULONG FastMdlReadWait;
1818 ULONG FastMdlReadResourceMiss;
1819 ULONG FastMdlReadNotPossible;
1820 ULONG MapDataNoWait;
1821 ULONG MapDataWait;
1822 ULONG MapDataNoWaitMiss;
1823 ULONG MapDataWaitMiss;
1824 ULONG PinMappedDataCount;
1825 ULONG PinReadNoWait;
1826 ULONG PinReadWait;
1827 ULONG PinReadNoWaitMiss;
1828 ULONG PinReadWaitMiss;
1829 ULONG CopyReadNoWait;
1830 ULONG CopyReadWait;
1831 ULONG CopyReadNoWaitMiss;
1832 ULONG CopyReadWaitMiss;
1833 ULONG MdlReadNoWait;
1834 ULONG MdlReadWait;
1835 ULONG MdlReadNoWaitMiss;
1836 ULONG MdlReadWaitMiss;
1837 ULONG ReadAheadIos;
1838 ULONG LazyWriteIos;
1839 ULONG LazyWritePages;
1840 ULONG DataFlushes;
1841 ULONG DataPages;
1842 ULONG ContextSwitches;
1843 ULONG FirstLevelTbFills;
1844 ULONG SecondLevelTbFills;
1845 ULONG SystemCalls;
1846 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
1848 /* System Information Class 0x03 */
1850 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
1851 #ifdef __WINESRC__
1852 LARGE_INTEGER BootTime;
1853 LARGE_INTEGER SystemTime;
1854 LARGE_INTEGER TimeZoneBias;
1855 ULONG TimeZoneId;
1856 ULONG Reserved;
1857 ULONGLONG BootTimeBias;
1858 ULONGLONG SleepTimeBias;
1859 #else
1860 BYTE Reserved1[48];
1861 #endif
1862 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; /* was SYSTEM_TIME_INFORMATION */
1864 /* System Information Class 0x08 */
1866 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
1867 LARGE_INTEGER IdleTime;
1868 LARGE_INTEGER KernelTime;
1869 LARGE_INTEGER UserTime;
1870 LARGE_INTEGER Reserved1[2];
1871 ULONG Reserved2;
1872 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
1874 /* System Information Class 0x0b */
1876 typedef struct _SYSTEM_DRIVER_INFORMATION {
1877 PVOID pvAddress;
1878 DWORD dwUnknown1;
1879 DWORD dwUnknown2;
1880 DWORD dwEntryIndex;
1881 DWORD dwUnknown3;
1882 char szName[MAX_PATH + 1];
1883 } SYSTEM_DRIVER_INFORMATION, *PSYSTEM_DRIVER_INFORMATION;
1885 /* System Information Class 0x10 */
1887 typedef struct _SYSTEM_HANDLE_ENTRY {
1888 ULONG OwnerPid;
1889 BYTE ObjectType;
1890 BYTE HandleFlags;
1891 USHORT HandleValue;
1892 PVOID ObjectPointer;
1893 ULONG AccessMask;
1894 } SYSTEM_HANDLE_ENTRY, *PSYSTEM_HANDLE_ENTRY;
1896 typedef struct _SYSTEM_HANDLE_INFORMATION {
1897 ULONG Count;
1898 SYSTEM_HANDLE_ENTRY Handle[1];
1899 } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
1901 /* System Information Class 0x15 */
1903 typedef struct _SYSTEM_CACHE_INFORMATION {
1904 ULONG CurrentSize;
1905 ULONG PeakSize;
1906 ULONG PageFaultCount;
1907 ULONG MinimumWorkingSet;
1908 ULONG MaximumWorkingSet;
1909 ULONG unused[4];
1910 #ifdef _WIN64
1911 ULONG unknown64[7];
1912 #endif
1913 } SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION;
1915 /* System Information Class 0x17 */
1917 typedef struct _SYSTEM_INTERRUPT_INFORMATION {
1918 BYTE Reserved1[24];
1919 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
1921 typedef struct _SYSTEM_CONFIGURATION_INFO {
1922 union {
1923 ULONG OemId;
1924 struct {
1925 WORD ProcessorArchitecture;
1926 WORD Reserved;
1927 } tag1;
1928 } tag2;
1929 ULONG PageSize;
1930 PVOID MinimumApplicationAddress;
1931 PVOID MaximumApplicationAddress;
1932 ULONG ActiveProcessorMask;
1933 ULONG NumberOfProcessors;
1934 ULONG ProcessorType;
1935 ULONG AllocationGranularity;
1936 WORD ProcessorLevel;
1937 WORD ProcessorRevision;
1938 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
1940 typedef struct _SYSTEM_EXCEPTION_INFORMATION {
1941 BYTE Reserved1[16];
1942 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
1944 typedef struct _SYSTEM_LOOKASIDE_INFORMATION {
1945 BYTE Reserved1[32];
1946 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
1948 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION {
1949 BOOLEAN DebuggerEnabled;
1950 BOOLEAN DebuggerNotPresent;
1951 } SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
1953 typedef struct _VM_COUNTERS
1955 SIZE_T PeakVirtualSize;
1956 SIZE_T VirtualSize;
1957 ULONG PageFaultCount;
1958 SIZE_T PeakWorkingSetSize;
1959 SIZE_T WorkingSetSize;
1960 SIZE_T QuotaPeakPagedPoolUsage;
1961 SIZE_T QuotaPagedPoolUsage;
1962 SIZE_T QuotaPeakNonPagedPoolUsage;
1963 SIZE_T QuotaNonPagedPoolUsage;
1964 SIZE_T PagefileUsage;
1965 SIZE_T PeakPagefileUsage;
1966 } VM_COUNTERS, *PVM_COUNTERS;
1968 typedef struct _VM_COUNTERS_EX
1970 SIZE_T PeakVirtualSize;
1971 SIZE_T VirtualSize;
1972 ULONG PageFaultCount;
1973 SIZE_T PeakWorkingSetSize;
1974 SIZE_T WorkingSetSize;
1975 SIZE_T QuotaPeakPagedPoolUsage;
1976 SIZE_T QuotaPagedPoolUsage;
1977 SIZE_T QuotaPeakNonPagedPoolUsage;
1978 SIZE_T QuotaNonPagedPoolUsage;
1979 SIZE_T PagefileUsage;
1980 SIZE_T PeakPagefileUsage;
1981 SIZE_T PrivateUsage;
1982 } VM_COUNTERS_EX, *PVM_COUNTERS_EX;
1984 typedef struct _SYSTEM_PROCESS_INFORMATION {
1985 #ifdef __WINESRC__ /* win32/win64 */
1986 ULONG NextEntryOffset; /* 00/00 */
1987 DWORD dwThreadCount; /* 04/04 */
1988 DWORD dwUnknown1[6]; /* 08/08 */
1989 LARGE_INTEGER CreationTime; /* 20/20 */
1990 LARGE_INTEGER UserTime; /* 28/28 */
1991 LARGE_INTEGER KernelTime; /* 30/30 */
1992 UNICODE_STRING ProcessName; /* 38/38 */
1993 DWORD dwBasePriority; /* 40/48 */
1994 HANDLE UniqueProcessId; /* 44/50 */
1995 HANDLE ParentProcessId; /* 48/58 */
1996 ULONG HandleCount; /* 4c/60 */
1997 ULONG SessionId; /* 50/64 */
1998 DWORD dwUnknown4; /* 54/68 */
1999 VM_COUNTERS_EX vmCounters; /* 58/70 */
2000 IO_COUNTERS ioCounters; /* 88/d0 */
2001 SYSTEM_THREAD_INFORMATION ti[1]; /* b8/100 */
2002 #else
2003 ULONG NextEntryOffset; /* 00/00 */
2004 BYTE Reserved1[52]; /* 04/04 */
2005 PVOID Reserved2[3]; /* 38/38 */
2006 HANDLE UniqueProcessId; /* 44/50 */
2007 PVOID Reserved3; /* 48/58 */
2008 ULONG HandleCount; /* 4c/60 */
2009 BYTE Reserved4[4]; /* 50/64 */
2010 PVOID Reserved5[11]; /* 54/68 */
2011 SIZE_T PeakPagefileUsage; /* 80/c0 */
2012 SIZE_T PrivatePageCount; /* 84/c8 */
2013 LARGE_INTEGER Reserved6[6]; /* 88/d0 */
2014 #endif
2015 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
2017 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION {
2018 ULONG RegistryQuotaAllowed;
2019 ULONG RegistryQuotaUsed;
2020 PVOID Reserved1;
2021 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
2023 typedef struct _SYSTEM_TIME_ADJUSTMENT_QUERY {
2024 ULONG TimeAdjustment;
2025 ULONG TimeIncrement;
2026 BOOLEAN TimeAdjustmentDisabled;
2027 } SYSTEM_TIME_ADJUSTMENT_QUERY, *PSYSTEM_TIME_ADJUSTMENT_QUERY;
2029 typedef struct _SYSTEM_TIME_ADJUSTMENT {
2030 ULONG TimeAdjustment;
2031 BOOLEAN TimeAdjustmentDisabled;
2032 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
2034 typedef enum _SYSTEM_FIRMWARE_TABLE_ACTION
2036 SystemFirmwareTable_Enumerate = 0,
2037 SystemFirmwareTable_Get = 1
2038 } SYSTEM_FIRMWARE_TABLE_ACTION, *PSYSTEM_FIRMWARE_TABLE_ACTION;
2040 /* System Information Class 0x4C */
2042 typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
2044 ULONG ProviderSignature;
2045 SYSTEM_FIRMWARE_TABLE_ACTION Action;
2046 ULONG TableID;
2047 ULONG TableBufferLength;
2048 UCHAR TableBuffer[1];
2049 } SYSTEM_FIRMWARE_TABLE_INFORMATION, *PSYSTEM_FIRMWARE_TABLE_INFORMATION;
2051 typedef struct _TIME_FIELDS
2052 { CSHORT Year;
2053 CSHORT Month;
2054 CSHORT Day;
2055 CSHORT Hour;
2056 CSHORT Minute;
2057 CSHORT Second;
2058 CSHORT Milliseconds;
2059 CSHORT Weekday;
2060 } TIME_FIELDS, *PTIME_FIELDS;
2062 typedef struct _WINSTATIONINFORMATIONW {
2063 BYTE Reserved2[70];
2064 ULONG LogonId;
2065 BYTE Reserved3[1140];
2066 } WINSTATIONINFORMATIONW, *PWINSTATIONINFORMATIONW;
2068 typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONW)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
2070 typedef struct _LDR_RESOURCE_INFO
2072 ULONG_PTR Type;
2073 ULONG_PTR Name;
2074 ULONG Language;
2075 } LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO;
2078 /* debug buffer definitions */
2080 typedef struct _DEBUG_BUFFER {
2081 HANDLE SectionHandle;
2082 PVOID SectionBase;
2083 PVOID RemoteSectionBase;
2084 ULONG SectionBaseDelta;
2085 HANDLE EventPairHandle;
2086 ULONG Unknown[2];
2087 HANDLE RemoteThreadHandle;
2088 ULONG InfoClassMask;
2089 ULONG SizeOfInfo;
2090 ULONG AllocatedSize;
2091 ULONG SectionSize;
2092 PVOID ModuleInformation;
2093 PVOID BackTraceInformation;
2094 PVOID HeapInformation;
2095 PVOID LockInformation;
2096 PVOID Reserved[8];
2097 } DEBUG_BUFFER, *PDEBUG_BUFFER;
2099 #define PDI_MODULES 0x01
2100 #define PDI_BACKTRACE 0x02
2101 #define PDI_HEAPS 0x04
2102 #define PDI_HEAP_TAGS 0x08
2103 #define PDI_HEAP_BLOCKS 0x10
2104 #define PDI_LOCKS 0x20
2106 typedef struct _DEBUG_MODULE_INFORMATION {
2107 ULONG Reserved[2];
2108 ULONG Base;
2109 ULONG Size;
2110 ULONG Flags;
2111 USHORT Index;
2112 USHORT Unknown;
2113 USHORT LoadCount;
2114 USHORT ModuleNameOffset;
2115 CHAR ImageName[256];
2116 } DEBUG_MODULE_INFORMATION, *PDEBUG_MODULE_INFORMATION;
2118 typedef struct _DEBUG_HEAP_INFORMATION {
2119 ULONG Base;
2120 ULONG Flags;
2121 USHORT Granularity;
2122 USHORT Unknown;
2123 ULONG Allocated;
2124 ULONG Committed;
2125 ULONG TagCount;
2126 ULONG BlockCount;
2127 ULONG Reserved[7];
2128 PVOID Tags;
2129 PVOID Blocks;
2130 } DEBUG_HEAP_INFORMATION, *PDEBUG_HEAP_INFORMATION;
2132 typedef struct _DEBUG_LOCK_INFORMATION {
2133 PVOID Address;
2134 USHORT Type;
2135 USHORT CreatorBackTraceIndex;
2136 ULONG OwnerThreadId;
2137 ULONG ActiveCount;
2138 ULONG ContentionCount;
2139 ULONG EntryCount;
2140 ULONG RecursionCount;
2141 ULONG NumberOfSharedWaiters;
2142 ULONG NumberOfExclusiveWaiters;
2143 } DEBUG_LOCK_INFORMATION, *PDEBUG_LOCK_INFORMATION;
2145 typedef struct _PORT_MESSAGE_HEADER {
2146 USHORT DataSize;
2147 USHORT MessageSize;
2148 USHORT MessageType;
2149 USHORT VirtualRangesOffset;
2150 CLIENT_ID ClientId;
2151 ULONG MessageId;
2152 ULONG SectionSize;
2153 } PORT_MESSAGE_HEADER, *PPORT_MESSAGE_HEADER, PORT_MESSAGE, *PPORT_MESSAGE;
2155 typedef unsigned short RTL_ATOM, *PRTL_ATOM;
2157 /* Wine doesn't implement atom table as NT does:
2158 * - in NT, atom tables are user space tables, which ntdll directly accesses
2159 * - on Wine, (even local) atom tables are wineserver objects, hence a HANDLE
2161 typedef struct atom_table *RTL_ATOM_TABLE, **PRTL_ATOM_TABLE;
2163 typedef enum _ATOM_INFORMATION_CLASS {
2164 AtomBasicInformation = 0,
2165 AtomTableInformation = 1,
2166 } ATOM_INFORMATION_CLASS;
2168 typedef struct _ATOM_BASIC_INFORMATION {
2169 USHORT ReferenceCount;
2170 USHORT Pinned;
2171 USHORT NameLength;
2172 WCHAR Name[1];
2173 } ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION;
2175 /* FIXME: names probably not correct */
2176 typedef struct _RTL_HANDLE
2178 struct _RTL_HANDLE * Next;
2179 } RTL_HANDLE;
2181 /* FIXME: names probably not correct */
2182 typedef struct _RTL_HANDLE_TABLE
2184 ULONG MaxHandleCount; /* 0x00 */
2185 ULONG HandleSize; /* 0x04 */
2186 ULONG Unused[2]; /* 0x08-0x0c */
2187 PVOID NextFree; /* 0x10 */
2188 PVOID FirstHandle; /* 0x14 */
2189 PVOID ReservedMemory; /* 0x18 */
2190 PVOID MaxHandle; /* 0x1c */
2191 } RTL_HANDLE_TABLE;
2193 /***********************************************************************
2194 * Defines
2197 /* flags for NtCreateFile and NtOpenFile */
2198 #define FILE_DIRECTORY_FILE 0x00000001
2199 #define FILE_WRITE_THROUGH 0x00000002
2200 #define FILE_SEQUENTIAL_ONLY 0x00000004
2201 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
2202 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
2203 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
2204 #define FILE_NON_DIRECTORY_FILE 0x00000040
2205 #define FILE_CREATE_TREE_CONNECTION 0x00000080
2206 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
2207 #define FILE_NO_EA_KNOWLEDGE 0x00000200
2208 #define FILE_OPEN_FOR_RECOVERY 0x00000400
2209 #define FILE_RANDOM_ACCESS 0x00000800
2210 #define FILE_DELETE_ON_CLOSE 0x00001000
2211 #define FILE_OPEN_BY_FILE_ID 0x00002000
2212 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
2213 #define FILE_NO_COMPRESSION 0x00008000
2214 #define FILE_RESERVE_OPFILTER 0x00100000
2215 #define FILE_OPEN_REPARSE_POINT 0x00200000
2216 #define FILE_OPEN_OFFLINE_FILE 0x00400000
2217 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
2219 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
2220 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
2222 /* status for NtCreateFile or NtOpenFile */
2223 #define FILE_SUPERSEDED 0
2224 #define FILE_OPENED 1
2225 #define FILE_CREATED 2
2226 #define FILE_OVERWRITTEN 3
2227 #define FILE_EXISTS 4
2228 #define FILE_DOES_NOT_EXIST 5
2230 /* disposition for NtCreateFile */
2231 #define FILE_SUPERSEDE 0
2232 #define FILE_OPEN 1
2233 #define FILE_CREATE 2
2234 #define FILE_OPEN_IF 3
2235 #define FILE_OVERWRITE 4
2236 #define FILE_OVERWRITE_IF 5
2237 #define FILE_MAXIMUM_DISPOSITION 5
2239 /* Characteristics of a File System */
2240 #define FILE_REMOVABLE_MEDIA 0x00000001
2241 #define FILE_READ_ONLY_DEVICE 0x00000002
2242 #define FILE_FLOPPY_DISKETTE 0x00000004
2243 #define FILE_WRITE_ONE_MEDIA 0x00000008
2244 #define FILE_REMOTE_DEVICE 0x00000010
2245 #define FILE_DEVICE_IS_MOUNTED 0x00000020
2246 #define FILE_VIRTUAL_VOLUME 0x00000040
2247 #define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
2248 #define FILE_DEVICE_SECURE_OPEN 0x00000100
2249 #define FILE_CHARACTERISTIC_PNP_DEVICE 0x00000800
2250 #define FILE_CHARACTERISTIC_TS_DEVICE 0x00001000
2251 #define FILE_CHARACTERISTIC_WEBDAV_DEVICE 0x00002000
2252 #define FILE_CHARACTERISTIC_CSV 0x00010000
2253 #define FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL 0x00020000
2254 #define FILE_PORTABLE_DEVICE 0x00040000
2256 /* options for NtCreateNamedPipeFile */
2257 #define FILE_PIPE_INBOUND 0x00000000
2258 #define FILE_PIPE_OUTBOUND 0x00000001
2259 #define FILE_PIPE_FULL_DUPLEX 0x00000002
2261 /* options for pipe's type */
2262 #define FILE_PIPE_TYPE_MESSAGE 0x00000001
2263 #define FILE_PIPE_TYPE_BYTE 0x00000000
2264 /* options for pipe's message mode */
2265 #define FILE_PIPE_MESSAGE_MODE 0x00000001
2266 #define FILE_PIPE_BYTE_STREAM_MODE 0x00000000
2267 /* options for pipe's blocking mode */
2268 #define FILE_PIPE_COMPLETE_OPERATION 0x00000001
2269 #define FILE_PIPE_QUEUE_OPERATION 0x00000000
2270 /* and client / server end */
2271 #define FILE_PIPE_SERVER_END 0x00000001
2272 #define FILE_PIPE_CLIENT_END 0x00000000
2274 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
2276 #define LOGONID_CURRENT ((ULONG)-1)
2278 #define OBJ_INHERIT 0x00000002
2279 #define OBJ_PERMANENT 0x00000010
2280 #define OBJ_EXCLUSIVE 0x00000020
2281 #define OBJ_CASE_INSENSITIVE 0x00000040
2282 #define OBJ_OPENIF 0x00000080
2283 #define OBJ_OPENLINK 0x00000100
2284 #define OBJ_KERNEL_HANDLE 0x00000200
2285 #define OBJ_VALID_ATTRIBUTES 0x000003F2
2287 #define SERVERNAME_CURRENT ((HANDLE)NULL)
2289 typedef void (CALLBACK *PNTAPCFUNC)(ULONG_PTR,ULONG_PTR,ULONG_PTR); /* FIXME: not the right name */
2290 typedef void (CALLBACK *PRTL_THREAD_START_ROUTINE)(LPVOID); /* FIXME: not the right name */
2291 typedef DWORD (CALLBACK *PRTL_WORK_ITEM_ROUTINE)(LPVOID); /* FIXME: not the right name */
2292 typedef void (NTAPI *RTL_WAITORTIMERCALLBACKFUNC)(PVOID,BOOLEAN); /* FIXME: not the right name */
2295 /* DbgPrintEx default levels */
2296 #define DPFLTR_ERROR_LEVEL 0
2297 #define DPFLTR_WARNING_LEVEL 1
2298 #define DPFLTR_TRACE_LEVEL 2
2299 #define DPFLTR_INFO_LEVEL 3
2300 #define DPFLTR_MASK 0x8000000
2302 /* Well-known LUID values */
2303 #define SE_MIN_WELL_KNOWN_PRIVILEGE 2
2304 #define SE_CREATE_TOKEN_PRIVILEGE 2
2305 #define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3
2306 #define SE_LOCK_MEMORY_PRIVILEGE 4
2307 #define SE_INCREASE_QUOTA_PRIVILEGE 5
2308 #define SE_UNSOLICITED_INPUT_PRIVILEGE 6 /* obsolete */
2309 #define SE_MACHINE_ACCOUNT_PRIVILEGE 6
2310 #define SE_TCB_PRIVILEGE 7
2311 #define SE_SECURITY_PRIVILEGE 8
2312 #define SE_TAKE_OWNERSHIP_PRIVILEGE 9
2313 #define SE_LOAD_DRIVER_PRIVILEGE 10
2314 #define SE_SYSTEM_PROFILE_PRIVILEGE 11
2315 #define SE_SYSTEMTIME_PRIVILEGE 12
2316 #define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13
2317 #define SE_INC_BASE_PRIORITY_PRIVILEGE 14
2318 #define SE_CREATE_PAGEFILE_PRIVILEGE 15
2319 #define SE_CREATE_PERMANENT_PRIVILEGE 16
2320 #define SE_BACKUP_PRIVILEGE 17
2321 #define SE_RESTORE_PRIVILEGE 18
2322 #define SE_SHUTDOWN_PRIVILEGE 19
2323 #define SE_DEBUG_PRIVILEGE 20
2324 #define SE_AUDIT_PRIVILEGE 21
2325 #define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22
2326 #define SE_CHANGE_NOTIFY_PRIVILEGE 23
2327 #define SE_REMOTE_SHUTDOWN_PRIVILEGE 24
2328 #define SE_UNDOCK_PRIVILEGE 25
2329 #define SE_SYNC_AGENT_PRIVILEGE 26
2330 #define SE_ENABLE_DELEGATION_PRIVILEGE 27
2331 #define SE_MANAGE_VOLUME_PRIVILEGE 28
2332 #define SE_IMPERSONATE_PRIVILEGE 29
2333 #define SE_CREATE_GLOBAL_PRIVILEGE 30
2334 #define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_GLOBAL_PRIVILEGE
2336 /* NtGlobalFlag bits */
2337 #define FLG_STOP_ON_EXCEPTION 0x00000001
2338 #define FLG_SHOW_LDR_SNAPS 0x00000002
2339 #define FLG_DEBUG_INITIAL_COMMAND 0x00000004
2340 #define FLG_STOP_ON_HUNG_GUI 0x00000008
2341 #define FLG_HEAP_ENABLE_TAIL_CHECK 0x00000010
2342 #define FLG_HEAP_ENABLE_FREE_CHECK 0x00000020
2343 #define FLG_HEAP_VALIDATE_PARAMETERS 0x00000040
2344 #define FLG_HEAP_VALIDATE_ALL 0x00000080
2345 #define FLG_APPLICATION_VERIFIER 0x00000100
2346 #define FLG_POOL_ENABLE_TAGGING 0x00000400
2347 #define FLG_HEAP_ENABLE_TAGGING 0x00000800
2348 #define FLG_USER_STACK_TRACE_DB 0x00001000
2349 #define FLG_KERNEL_STACK_TRACE_DB 0x00002000
2350 #define FLG_MAINTAIN_OBJECT_TYPELIST 0x00004000
2351 #define FLG_HEAP_ENABLE_TAG_BY_DLL 0x00008000
2352 #define FLG_DISABLE_STACK_EXTENSION 0x00010000
2353 #define FLG_ENABLE_CSRDEBUG 0x00020000
2354 #define FLG_ENABLE_KDEBUG_SYMBOL_LOAD 0x00040000
2355 #define FLG_DISABLE_PAGE_KERNEL_STACKS 0x00080000
2356 #define FLG_ENABLE_SYSTEM_CRIT_BREAKS 0x00100000
2357 #define FLG_HEAP_DISABLE_COALESCING 0x00200000
2358 #define FLG_ENABLE_CLOSE_EXCEPTIONS 0x00400000
2359 #define FLG_ENABLE_EXCEPTION_LOGGING 0x00800000
2360 #define FLG_ENABLE_HANDLE_TYPE_TAGGING 0x01000000
2361 #define FLG_HEAP_PAGE_ALLOCS 0x02000000
2362 #define FLG_DEBUG_INITIAL_COMMAND_EX 0x04000000
2363 #define FLG_DISABLE_DBGPRINT 0x08000000
2364 #define FLG_CRITSEC_EVENT_CREATION 0x10000000
2365 #define FLG_LDR_TOP_DOWN 0x20000000
2366 #define FLG_ENABLE_HANDLE_EXCEPTIONS 0x40000000
2367 #define FLG_DISABLE_PROTDLLS 0x80000000
2369 /* Rtl*Registry* functions structs and defines */
2370 #define RTL_REGISTRY_ABSOLUTE 0
2371 #define RTL_REGISTRY_SERVICES 1
2372 #define RTL_REGISTRY_CONTROL 2
2373 #define RTL_REGISTRY_WINDOWS_NT 3
2374 #define RTL_REGISTRY_DEVICEMAP 4
2375 #define RTL_REGISTRY_USER 5
2377 #define RTL_REGISTRY_HANDLE 0x40000000
2378 #define RTL_REGISTRY_OPTIONAL 0x80000000
2380 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
2381 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
2382 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
2383 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
2384 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
2385 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
2386 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
2387 #define RTL_QUERY_REGISTRY_TYPECHECK 0x00000100
2389 #define RTL_QUERY_REGISTRY_TYPECHECK_SHIFT 24
2391 typedef NTSTATUS (WINAPI *PRTL_QUERY_REGISTRY_ROUTINE)( PCWSTR ValueName,
2392 ULONG ValueType,
2393 PVOID ValueData,
2394 ULONG ValueLength,
2395 PVOID Context,
2396 PVOID EntryContext);
2398 typedef struct _RTL_QUERY_REGISTRY_TABLE
2400 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
2401 ULONG Flags;
2402 PWSTR Name;
2403 PVOID EntryContext;
2404 ULONG DefaultType;
2405 PVOID DefaultData;
2406 ULONG DefaultLength;
2407 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
2409 typedef struct _KEY_MULTIPLE_VALUE_INFORMATION
2411 PUNICODE_STRING ValueName;
2412 ULONG DataLength;
2413 ULONG DataOffset;
2414 ULONG Type;
2415 } KEY_MULTIPLE_VALUE_INFORMATION, *PKEY_MULTIPLE_VALUE_INFORMATION;
2417 typedef VOID (CALLBACK *PRTL_OVERLAPPED_COMPLETION_ROUTINE)(DWORD,DWORD,LPVOID);
2419 typedef VOID (CALLBACK *PTIMER_APC_ROUTINE) ( PVOID, ULONG, LONG );
2421 typedef enum _EVENT_INFORMATION_CLASS {
2422 EventBasicInformation
2423 } EVENT_INFORMATION_CLASS, *PEVENT_INFORMATION_CLASS;
2425 typedef struct _EVENT_BASIC_INFORMATION {
2426 EVENT_TYPE EventType;
2427 LONG EventState;
2428 } EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION;
2430 typedef enum _SEMAPHORE_INFORMATION_CLASS {
2431 SemaphoreBasicInformation
2432 } SEMAPHORE_INFORMATION_CLASS, *PSEMAPHORE_INFORMATION_CLASS;
2434 typedef struct _SEMAPHORE_BASIC_INFORMATION {
2435 ULONG CurrentCount;
2436 ULONG MaximumCount;
2437 } SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION;
2439 typedef enum _SECTION_INFORMATION_CLASS
2441 SectionBasicInformation,
2442 SectionImageInformation,
2443 SectionRelocationInformation,
2444 SectionOriginalBaseInformation,
2445 SectionInternalImageInformation
2446 } SECTION_INFORMATION_CLASS;
2448 typedef struct _SECTION_BASIC_INFORMATION {
2449 PVOID BaseAddress;
2450 ULONG Attributes;
2451 LARGE_INTEGER Size;
2452 } SECTION_BASIC_INFORMATION, *PSECTION_BASIC_INFORMATION;
2454 typedef struct _SECTION_IMAGE_INFORMATION {
2455 PVOID TransferAddress;
2456 ULONG ZeroBits;
2457 SIZE_T MaximumStackSize;
2458 SIZE_T CommittedStackSize;
2459 ULONG SubSystemType;
2460 USHORT MinorSubsystemVersion;
2461 USHORT MajorSubsystemVersion;
2462 USHORT MajorOperatingSystemVersion;
2463 USHORT MinorOperatingSystemVersion;
2464 USHORT ImageCharacteristics;
2465 USHORT DllCharacteristics;
2466 USHORT Machine;
2467 BOOLEAN ImageContainsCode;
2468 union
2470 UCHAR ImageFlags;
2471 struct
2473 UCHAR ComPlusNativeReady : 1;
2474 UCHAR ComPlusILOnly : 1;
2475 UCHAR ImageDynamicallyRelocated : 1;
2476 UCHAR ImageMappedFlat : 1;
2477 UCHAR BaseBelow4gb : 1;
2478 UCHAR ComPlusPrefer32bit : 1;
2479 UCHAR Reserved : 2;
2480 } DUMMYSTRUCTNAME;
2481 } DUMMYUNIONNAME;
2482 ULONG LoaderFlags;
2483 ULONG ImageFileSize;
2484 ULONG CheckSum;
2485 } SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION;
2487 typedef struct _LPC_SECTION_WRITE {
2488 ULONG Length;
2489 HANDLE SectionHandle;
2490 ULONG SectionOffset;
2491 ULONG ViewSize;
2492 PVOID ViewBase;
2493 PVOID TargetViewBase;
2494 } LPC_SECTION_WRITE, *PLPC_SECTION_WRITE;
2496 typedef struct _LPC_SECTION_READ {
2497 ULONG Length;
2498 ULONG ViewSize;
2499 PVOID ViewBase;
2500 } LPC_SECTION_READ, *PLPC_SECTION_READ;
2502 typedef struct _LPC_MESSAGE {
2503 USHORT DataSize;
2504 USHORT MessageSize;
2505 USHORT MessageType;
2506 USHORT VirtualRangesOffset;
2507 CLIENT_ID ClientId;
2508 ULONG_PTR MessageId;
2509 ULONG_PTR SectionSize;
2510 UCHAR Data[ANYSIZE_ARRAY];
2511 } LPC_MESSAGE, *PLPC_MESSAGE;
2513 typedef struct _RTL_USER_PROCESS_INFORMATION
2515 ULONG Length;
2516 HANDLE Process;
2517 HANDLE Thread;
2518 CLIENT_ID ClientId;
2519 SECTION_IMAGE_INFORMATION ImageInformation;
2520 } RTL_USER_PROCESS_INFORMATION, *PRTL_USER_PROCESS_INFORMATION;
2522 typedef enum _SHUTDOWN_ACTION {
2523 ShutdownNoReboot,
2524 ShutdownReboot,
2525 ShutdownPowerOff
2526 } SHUTDOWN_ACTION, *PSHUTDOWN_ACTION;
2528 typedef struct _COUNTED_REASON_CONTEXT
2530 ULONG Version;
2531 ULONG Flags;
2532 union
2534 struct
2536 UNICODE_STRING ResourceFileName;
2537 USHORT ResourceReasonId;
2538 ULONG StringCount;
2539 UNICODE_STRING *ReasonStrings;
2540 } DUMMYSTRUCTNAME;
2541 UNICODE_STRING SimpleString;
2542 } DUMMYUNIONNAME;
2543 } COUNTED_REASON_CONTEXT, *PCOUNTED_REASON_CONTEXT;
2545 typedef enum _KPROFILE_SOURCE {
2546 ProfileTime,
2547 ProfileAlignmentFixup,
2548 ProfileTotalIssues,
2549 ProfilePipelineDry,
2550 ProfileLoadInstructions,
2551 ProfilePipelineFrozen,
2552 ProfileBranchInstructions,
2553 ProfileTotalNonissues,
2554 ProfileDcacheMisses,
2555 ProfileIcacheMisses,
2556 ProfileCacheMisses,
2557 ProfileBranchMispredictions,
2558 ProfileStoreInstructions,
2559 ProfileFpInstructions,
2560 ProfileIntegerInstructions,
2561 Profile2Issue,
2562 Profile3Issue,
2563 Profile4Issue,
2564 ProfileSpecialInstructions,
2565 ProfileTotalCycles,
2566 ProfileIcacheIssues,
2567 ProfileDcacheAccesses,
2568 ProfileMemoryBarrierCycles,
2569 ProfileLoadLinkedIssues,
2570 ProfileMaximum
2571 } KPROFILE_SOURCE, *PKPROFILE_SOURCE;
2573 typedef struct _DIRECTORY_BASIC_INFORMATION {
2574 UNICODE_STRING ObjectName;
2575 UNICODE_STRING ObjectTypeName;
2576 } DIRECTORY_BASIC_INFORMATION, *PDIRECTORY_BASIC_INFORMATION;
2578 typedef struct _INITIAL_TEB {
2579 void *OldStackBase;
2580 void *OldStackLimit;
2581 void *StackBase;
2582 void *StackLimit;
2583 void *DeallocationStack;
2584 } INITIAL_TEB, *PINITIAL_TEB;
2586 typedef enum _PORT_INFORMATION_CLASS {
2587 PortNoInformation
2588 } PORT_INFORMATION_CLASS, *PPORT_INFORMATION_CLASS;
2590 typedef enum _IO_COMPLETION_INFORMATION_CLASS {
2591 IoCompletionBasicInformation
2592 } IO_COMPLETION_INFORMATION_CLASS, *PIO_COMPLETION_INFORMATION_CLASS;
2594 typedef struct _FILE_COMPLETION_INFORMATION {
2595 HANDLE CompletionPort;
2596 ULONG_PTR CompletionKey;
2597 } FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION;
2599 #define IO_COMPLETION_QUERY_STATE 0x0001
2600 #define IO_COMPLETION_MODIFY_STATE 0x0002
2601 #define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
2603 typedef struct _FILE_IO_COMPLETION_INFORMATION {
2604 ULONG_PTR CompletionKey;
2605 ULONG_PTR CompletionValue;
2606 IO_STATUS_BLOCK IoStatusBlock;
2607 } FILE_IO_COMPLETION_INFORMATION, *PFILE_IO_COMPLETION_INFORMATION;
2609 typedef enum _HARDERROR_RESPONSE_OPTION {
2610 OptionAbortRetryIgnore,
2611 OptionOk,
2612 OptionOkCancel,
2613 OptionRetryCancel,
2614 OptionYesNo,
2615 OptionYesNoCancel,
2616 OptionShutdownSystem
2617 } HARDERROR_RESPONSE_OPTION, *PHARDERROR_RESPONSE_OPTION;
2619 typedef enum _HARDERROR_RESPONSE {
2620 ResponseReturnToCaller,
2621 ResponseNotHandled,
2622 ResponseAbort,
2623 ResponseCancel,
2624 ResponseIgnore,
2625 ResponseNo,
2626 ResponseOk,
2627 ResponseRetry,
2628 ResponseYes
2629 } HARDERROR_RESPONSE, *PHARDERROR_RESPONSE;
2631 typedef enum _SYSDBG_COMMAND {
2632 SysDbgQueryModuleInformation,
2633 SysDbgQueryTraceInformation,
2634 SysDbgSetTracepoint,
2635 SysDbgSetSpecialCall,
2636 SysDbgClearSpecialCalls,
2637 SysDbgQuerySpecialCalls,
2638 SysDbgBreakPoint,
2639 SysDbgQueryVersion,
2640 SysDbgReadVirtual,
2641 SysDbgWriteVirtual,
2642 SysDbgReadPhysical,
2643 SysDbgWritePhysical,
2644 SysDbgReadControlSpace,
2645 SysDbgWriteControlSpace,
2646 SysDbgReadIoSpace,
2647 SysDbgWriteIoSpace,
2648 SysDbgReadMsr,
2649 SysDbgWriteMsr,
2650 SysDbgReadBusData,
2651 SysDbgWriteBusData
2652 } SYSDBG_COMMAND, *PSYSDBG_COMMAND;
2654 typedef struct _CPTABLEINFO
2656 USHORT CodePage;
2657 USHORT MaximumCharacterSize;
2658 USHORT DefaultChar;
2659 USHORT UniDefaultChar;
2660 USHORT TransDefaultChar;
2661 USHORT TransUniDefaultChar;
2662 USHORT DBCSCodePage;
2663 UCHAR LeadByte[12];
2664 USHORT *MultiByteTable;
2665 void *WideCharTable;
2666 USHORT *DBCSRanges;
2667 USHORT *DBCSOffsets;
2668 } CPTABLEINFO, *PCPTABLEINFO;
2670 typedef struct _NLSTABLEINFO
2672 CPTABLEINFO OemTableInfo;
2673 CPTABLEINFO AnsiTableInfo;
2674 USHORT *UpperCaseTable;
2675 USHORT *LowerCaseTable;
2676 } NLSTABLEINFO, *PNLSTABLEINFO;
2678 /*************************************************************************
2679 * Loader structures
2681 * Those are not part of standard Winternl.h
2684 typedef struct _LDR_SERVICE_TAG_RECORD
2686 struct _LDR_SERVICE_TAG_RECORD *Next;
2687 ULONG ServiceTag;
2688 } LDR_SERVICE_TAG_RECORD, *PLDR_SERVICE_TAG_RECORD;
2690 typedef struct _LDRP_CSLIST
2692 SINGLE_LIST_ENTRY *Tail;
2693 } LDRP_CSLIST, *PLDRP_CSLIST;
2695 typedef enum _LDR_DDAG_STATE
2697 LdrModulesMerged = -5,
2698 LdrModulesInitError = -4,
2699 LdrModulesSnapError = -3,
2700 LdrModulesUnloaded = -2,
2701 LdrModulesUnloading = -1,
2702 LdrModulesPlaceHolder = 0,
2703 LdrModulesMapping = 1,
2704 LdrModulesMapped = 2,
2705 LdrModulesWaitingForDependencies = 3,
2706 LdrModulesSnapping = 4,
2707 LdrModulesSnapped = 5,
2708 LdrModulesCondensed = 6,
2709 LdrModulesReadyToInit = 7,
2710 LdrModulesInitializing = 8,
2711 LdrModulesReadyToRun = 9,
2712 } LDR_DDAG_STATE;
2714 typedef struct _LDR_DDAG_NODE
2716 LIST_ENTRY Modules;
2717 LDR_SERVICE_TAG_RECORD *ServiceTagList;
2718 ULONG LoadCount;
2719 ULONG ReferenceCount;
2720 ULONG DependencyCount;
2721 union
2723 LDRP_CSLIST Dependencies;
2724 SINGLE_LIST_ENTRY RemovalLink;
2726 LDRP_CSLIST IncomingDependencies;
2727 LDR_DDAG_STATE State;
2728 SINGLE_LIST_ENTRY CondenseLink;
2729 ULONG PreorderNumber;
2730 ULONG LowestLink;
2731 } LDR_DDAG_NODE, *PLDR_DDAG_NODE;
2733 typedef enum _LDR_DLL_LOAD_REASON
2735 LoadReasonStaticDependency,
2736 LoadReasonStaticForwarderDependency,
2737 LoadReasonDynamicForwarderDependency,
2738 LoadReasonDelayloadDependency,
2739 LoadReasonDynamicLoad,
2740 LoadReasonAsImageLoad,
2741 LoadReasonAsDataLoad,
2742 LoadReasonUnknown = -1
2743 } LDR_DLL_LOAD_REASON, *PLDR_DLL_LOAD_REASON;
2745 typedef struct _LDR_DATA_TABLE_ENTRY
2747 LIST_ENTRY InLoadOrderLinks;
2748 LIST_ENTRY InMemoryOrderLinks;
2749 LIST_ENTRY InInitializationOrderLinks;
2750 void* DllBase;
2751 void* EntryPoint;
2752 ULONG SizeOfImage;
2753 UNICODE_STRING FullDllName;
2754 UNICODE_STRING BaseDllName;
2755 ULONG Flags;
2756 SHORT LoadCount;
2757 SHORT TlsIndex;
2758 HANDLE SectionHandle;
2759 ULONG CheckSum;
2760 ULONG TimeDateStamp;
2761 HANDLE ActivationContext;
2762 void* Lock;
2763 LDR_DDAG_NODE* DdagNode;
2764 LIST_ENTRY NodeModuleLink;
2765 struct _LDRP_LOAD_CONTEXT *LoadContext;
2766 void* ParentDllBase;
2767 void* SwitchBackContext;
2768 RTL_BALANCED_NODE BaseAddressIndexNode;
2769 RTL_BALANCED_NODE MappingInfoIndexNode;
2770 ULONG_PTR OriginalBase;
2771 LARGE_INTEGER LoadTime;
2772 ULONG BaseNameHashValue;
2773 LDR_DLL_LOAD_REASON LoadReason;
2774 ULONG ImplicitPathOptions;
2775 ULONG ReferenceCount;
2776 } LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY;
2778 typedef struct _LDR_DLL_LOADED_NOTIFICATION_DATA
2780 ULONG Flags;
2781 const UNICODE_STRING *FullDllName;
2782 const UNICODE_STRING *BaseDllName;
2783 void *DllBase;
2784 ULONG SizeOfImage;
2785 } LDR_DLL_LOADED_NOTIFICATION_DATA, *PLDR_DLL_LOADED_NOTIFICATION_DATA;
2787 typedef struct _LDR_DLL_UNLOADED_NOTIFICATION_DATA
2789 ULONG Flags;
2790 const UNICODE_STRING *FullDllName;
2791 const UNICODE_STRING *BaseDllName;
2792 void *DllBase;
2793 ULONG SizeOfImage;
2794 } LDR_DLL_UNLOADED_NOTIFICATION_DATA, *PLDR_DLL_UNLOADED_NOTIFICATION_DATA;
2796 typedef union _LDR_DLL_NOTIFICATION_DATA
2798 LDR_DLL_LOADED_NOTIFICATION_DATA Loaded;
2799 LDR_DLL_UNLOADED_NOTIFICATION_DATA Unloaded;
2800 } LDR_DLL_NOTIFICATION_DATA, *PLDR_DLL_NOTIFICATION_DATA;
2802 typedef void (CALLBACK *PLDR_DLL_NOTIFICATION_FUNCTION)(ULONG, LDR_DLL_NOTIFICATION_DATA*, void*);
2804 /* those defines are (some of the) regular LDR_DATA_TABLE_ENTRY.Flags values */
2805 #define LDR_IMAGE_IS_DLL 0x00000004
2806 #define LDR_LOAD_IN_PROGRESS 0x00001000
2807 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
2808 #define LDR_NO_DLL_CALLS 0x00040000
2809 #define LDR_PROCESS_ATTACHED 0x00080000
2810 #define LDR_COR_IMAGE 0x00400000
2811 #define LDR_COR_ILONLY 0x01000000
2813 /* these ones is Wine specific */
2814 #define LDR_DONT_RESOLVE_REFS 0x40000000
2815 #define LDR_WINE_INTERNAL 0x80000000
2817 /* flag for LdrAddRefDll */
2818 #define LDR_ADDREF_DLL_PIN 0x00000001
2820 #define LDR_DLL_NOTIFICATION_REASON_LOADED 1
2821 #define LDR_DLL_NOTIFICATION_REASON_UNLOADED 2
2823 /* FIXME: to be checked */
2824 #define MAXIMUM_FILENAME_LENGTH 256
2826 typedef struct _SYSTEM_MODULE
2828 PVOID Section; /* 00/00 */
2829 PVOID MappedBaseAddress; /* 04/08 */
2830 PVOID ImageBaseAddress; /* 08/10 */
2831 ULONG ImageSize; /* 0c/18 */
2832 ULONG Flags; /* 10/1c */
2833 WORD LoadOrderIndex; /* 14/20 */
2834 WORD InitOrderIndex; /* 16/22 */
2835 WORD LoadCount; /* 18/24 */
2836 WORD NameOffset; /* 1a/26 */
2837 BYTE Name[MAXIMUM_FILENAME_LENGTH]; /* 1c/28 */
2838 } SYSTEM_MODULE, *PSYSTEM_MODULE;
2840 typedef struct _SYSTEM_MODULE_INFORMATION
2842 ULONG ModulesCount;
2843 SYSTEM_MODULE Modules[1]; /* FIXME: should be Modules[0] */
2844 } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
2846 #define PROCESS_CREATE_FLAGS_BREAKAWAY 0x00000001
2847 #define PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT 0x00000002
2848 #define PROCESS_CREATE_FLAGS_INHERIT_HANDLES 0x00000004
2849 #define PROCESS_CREATE_FLAGS_OVERRIDE_ADDRESS_SPACE 0x00000008
2850 #define PROCESS_CREATE_FLAGS_LARGE_PAGES 0x00000010
2851 #define PROCESS_CREATE_FLAGS_LARGE_PAGE_SYSTEM_DLL 0x00000020
2852 #define PROCESS_CREATE_FLAGS_PROTECTED_PROCESS 0x00000040
2853 #define PROCESS_CREATE_FLAGS_CREATE_SESSION 0x00000080
2854 #define PROCESS_CREATE_FLAGS_INHERIT_FROM_PARENT 0x00000100
2855 #define PROCESS_CREATE_FLAGS_SUSPENDED 0x00000200
2856 #define PROCESS_CREATE_FLAGS_EXTENDED_UNKNOWN 0x00000400
2858 typedef struct _RTL_PROCESS_MODULE_INFORMATION_EX
2860 USHORT NextOffset;
2861 SYSTEM_MODULE BaseInfo;
2862 ULONG ImageCheckSum;
2863 ULONG TimeDateStamp;
2864 void *DefaultBase;
2865 } RTL_PROCESS_MODULE_INFORMATION_EX;
2867 #define THREAD_CREATE_FLAGS_CREATE_SUSPENDED 0x00000001
2868 #define THREAD_CREATE_FLAGS_SKIP_THREAD_ATTACH 0x00000002
2869 #define THREAD_CREATE_FLAGS_HIDE_FROM_DEBUGGER 0x00000004
2870 #define THREAD_CREATE_FLAGS_HAS_SECURITY_DESCRIPTOR 0x00000010
2871 #define THREAD_CREATE_FLAGS_ACCESS_CHECK_IN_TARGET 0x00000020
2872 #define THREAD_CREATE_FLAGS_INITIAL_THREAD 0x00000080
2874 typedef LONG (CALLBACK *PRTL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS);
2876 typedef void (CALLBACK *PTP_IO_CALLBACK)(PTP_CALLBACK_INSTANCE,void*,void*,IO_STATUS_BLOCK*,PTP_IO);
2878 #define PS_ATTRIBUTE_THREAD 0x00010000
2879 #define PS_ATTRIBUTE_INPUT 0x00020000
2880 #define PS_ATTRIBUTE_ADDITIVE 0x00040000
2882 typedef enum _PS_ATTRIBUTE_NUM
2884 PsAttributeParentProcess,
2885 PsAttributeDebugPort,
2886 PsAttributeToken,
2887 PsAttributeClientId,
2888 PsAttributeTebAddress,
2889 PsAttributeImageName,
2890 PsAttributeImageInfo,
2891 PsAttributeMemoryReserve,
2892 PsAttributePriorityClass,
2893 PsAttributeErrorMode,
2894 PsAttributeStdHandleInfo,
2895 PsAttributeHandleList,
2896 PsAttributeGroupAffinity,
2897 PsAttributePreferredNode,
2898 PsAttributeIdealProcessor,
2899 PsAttributeUmsThread,
2900 PsAttributeMitigationOptions,
2901 PsAttributeProtectionLevel,
2902 PsAttributeSecureProcess,
2903 PsAttributeJobList,
2904 PsAttributeChildProcessPolicy,
2905 PsAttributeAllApplicationPackagesPolicy,
2906 PsAttributeWin32kFilter,
2907 PsAttributeSafeOpenPromptOriginClaim,
2908 PsAttributeBnoIsolation,
2909 PsAttributeDesktopAppPolicy,
2910 PsAttributeChpe,
2911 PsAttributeMax
2912 } PS_ATTRIBUTE_NUM;
2914 #define PS_ATTRIBUTE_PARENT_PROCESS (PsAttributeParentProcess | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_ADDITIVE)
2915 #define PS_ATTRIBUTE_DEBUG_PORT (PsAttributeDebugPort | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_ADDITIVE)
2916 #define PS_ATTRIBUTE_TOKEN (PsAttributeToken | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_ADDITIVE)
2917 #define PS_ATTRIBUTE_CLIENT_ID (PsAttributeClientId | PS_ATTRIBUTE_THREAD)
2918 #define PS_ATTRIBUTE_TEB_ADDRESS (PsAttributeTebAddress | PS_ATTRIBUTE_THREAD)
2919 #define PS_ATTRIBUTE_IMAGE_NAME (PsAttributeImageName | PS_ATTRIBUTE_INPUT)
2920 #define PS_ATTRIBUTE_IMAGE_INFO (PsAttributeImageInfo)
2921 #define PS_ATTRIBUTE_MEMORY_RESERVE (PsAttributeMemoryReserve | PS_ATTRIBUTE_INPUT)
2922 #define PS_ATTRIBUTE_PRIORITY_CLASS (PsAttributePriorityClass | PS_ATTRIBUTE_INPUT)
2923 #define PS_ATTRIBUTE_ERROR_MODE (PsAttributeErrorMode | PS_ATTRIBUTE_INPUT)
2924 #define PS_ATTRIBUTE_STD_HANDLE_INFO (PsAttributeStdHandleInfo | PS_ATTRIBUTE_INPUT)
2925 #define PS_ATTRIBUTE_HANDLE_LIST (PsAttributeHandleList | PS_ATTRIBUTE_INPUT)
2926 #define PS_ATTRIBUTE_GROUP_AFFINITY (PsAttributeGroupAffinity | PS_ATTRIBUTE_THREAD | PS_ATTRIBUTE_INPUT)
2927 #define PS_ATTRIBUTE_PREFERRED_NODE (PsAttributePreferredNode | PS_ATTRIBUTE_INPUT)
2928 #define PS_ATTRIBUTE_IDEAL_PROCESSOR (PsAttributeIdealProcessor | PS_ATTRIBUTE_THREAD | PS_ATTRIBUTE_INPUT)
2929 #define PS_ATTRIBUTE_MITIGATION_OPTIONS (PsAttributeMitigationOptions | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_UNKNOWN)
2930 #define PS_ATTRIBUTE_PROTECTION_LEVEL (PsAttributeProtectionLevel | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_UNKNOWN)
2931 #define PS_ATTRIBUTE_SECURE_PROCESS (PsAttributeSecureProcess | PS_ATTRIBUTE_INPUT)
2932 #define PS_ATTRIBUTE_JOB_LIST (PsAttributeJobList | PS_ATTRIBUTE_INPUT)
2933 #define PS_ATTRIBUTE_CHILD_PROCESS_POLICY (PsAttributeChildProcessPolicy | PS_ATTRIBUTE_INPUT)
2934 #define PS_ATTRIBUTE_ALL_APPLICATION_PACKAGES_POLICY (PsAttributeAllApplicationPackagesPolicy | PS_ATTRIBUTE_INPUT)
2935 #define PS_ATTRIBUTE_WIN32K_FILTER (PsAttributeWin32kFilter | PS_ATTRIBUTE_INPUT)
2936 #define PS_ATTRIBUTE_SAFE_OPEN_PROMPT_ORIGIN_CLAIM (PsAttributeSafeOpenPromptOriginClaim | PS_ATTRIBUTE_INPUT)
2937 #define PS_ATTRIBUTE_BNO_ISOLATION (PsAttributeBnoIsolation | PS_ATTRIBUTE_INPUT)
2938 #define PS_ATTRIBUTE_DESKTOP_APP_POLICY (PsAttributeDesktopAppPolicy | PS_ATTRIBUTE_INPUT)
2940 typedef struct _PS_ATTRIBUTE
2942 ULONG_PTR Attribute;
2943 SIZE_T Size;
2944 union
2946 ULONG_PTR Value;
2947 void *ValuePtr;
2949 SIZE_T *ReturnLength;
2950 } PS_ATTRIBUTE;
2952 typedef struct _PS_ATTRIBUTE_LIST
2954 SIZE_T TotalLength;
2955 PS_ATTRIBUTE Attributes[1];
2956 } PS_ATTRIBUTE_LIST, *PPS_ATTRIBUTE_LIST;
2958 typedef enum _PS_CREATE_STATE
2960 PsCreateInitialState,
2961 PsCreateFailOnFileOpen,
2962 PsCreateFailOnSectionCreate,
2963 PsCreateFailExeFormat,
2964 PsCreateFailMachineMismatch,
2965 PsCreateFailExeName,
2966 PsCreateSuccess,
2967 PsCreateMaximumStates
2968 } PS_CREATE_STATE;
2970 typedef struct _PS_CREATE_INFO
2972 SIZE_T Size;
2973 PS_CREATE_STATE State;
2974 union
2976 struct
2978 union
2980 ULONG InitFlags;
2981 struct
2983 UCHAR WriteOutputOnExit : 1;
2984 UCHAR DetectManifest : 1;
2985 UCHAR IFEOSkipDebugger : 1;
2986 UCHAR IFEODoNotPropagateKeyState : 1;
2987 UCHAR SpareBits1 : 4;
2988 UCHAR SpareBits2 : 8;
2989 USHORT ProhibitedImageCharacteristics : 16;
2992 ACCESS_MASK AdditionalFileAccess;
2993 } InitState;
2994 struct
2996 HANDLE FileHandle;
2997 } FailSection;
2998 struct
3000 USHORT DllCharacteristics;
3001 } ExeFormat;
3002 struct
3004 HANDLE IFEOKey;
3005 } ExeName;
3006 struct
3008 union
3010 ULONG OutputFlags;
3011 struct
3013 UCHAR ProtectedProcess : 1;
3014 UCHAR AddressSpaceOverride : 1;
3015 UCHAR DevOverrideEnabled : 1;
3016 UCHAR ManifestDetected : 1;
3017 UCHAR ProtectedProcessLight : 1;
3018 UCHAR SpareBits1 : 3;
3019 UCHAR SpareBits2 : 8;
3020 USHORT SpareBits3 : 16;
3023 HANDLE FileHandle;
3024 HANDLE SectionHandle;
3025 ULONGLONG UserProcessParametersNative;
3026 ULONG UserProcessParametersWow64;
3027 ULONG CurrentParameterFlags;
3028 ULONGLONG PebAddressNative;
3029 ULONG PebAddressWow64;
3030 ULONGLONG ManifestAddress;
3031 ULONG ManifestSize;
3032 } SuccessState;
3034 } PS_CREATE_INFO, *PPS_CREATE_INFO;
3036 typedef struct _DBGKM_EXCEPTION
3038 EXCEPTION_RECORD ExceptionRecord;
3039 ULONG FirstChance;
3040 } DBGKM_EXCEPTION, *PDBGKM_EXCEPTION;
3042 typedef struct _DBGKM_CREATE_THREAD
3044 ULONG SubSystemKey;
3045 PVOID StartAddress;
3046 } DBGKM_CREATE_THREAD, *PDBGKM_CREATE_THREAD;
3048 typedef struct _DBGKM_CREATE_PROCESS
3050 ULONG SubSystemKey;
3051 HANDLE FileHandle;
3052 PVOID BaseOfImage;
3053 ULONG DebugInfoFileOffset;
3054 ULONG DebugInfoSize;
3055 DBGKM_CREATE_THREAD InitialThread;
3056 } DBGKM_CREATE_PROCESS, *PDBGKM_CREATE_PROCESS;
3058 typedef struct _DBGKM_EXIT_THREAD
3060 NTSTATUS ExitStatus;
3061 } DBGKM_EXIT_THREAD, *PDBGKM_EXIT_THREAD;
3063 typedef struct _DBGKM_EXIT_PROCESS
3065 NTSTATUS ExitStatus;
3066 } DBGKM_EXIT_PROCESS, *PDBGKM_EXIT_PROCESS;
3068 typedef struct _DBGKM_LOAD_DLL
3070 HANDLE FileHandle;
3071 PVOID BaseOfDll;
3072 ULONG DebugInfoFileOffset;
3073 ULONG DebugInfoSize;
3074 PVOID NamePointer;
3075 } DBGKM_LOAD_DLL, *PDBGKM_LOAD_DLL;
3077 typedef struct _DBGKM_UNLOAD_DLL
3079 PVOID BaseAddress;
3080 } DBGKM_UNLOAD_DLL, *PDBGKM_UNLOAD_DLL;
3082 typedef enum _DBG_STATE
3084 DbgIdle,
3085 DbgReplyPending,
3086 DbgCreateThreadStateChange,
3087 DbgCreateProcessStateChange,
3088 DbgExitThreadStateChange,
3089 DbgExitProcessStateChange,
3090 DbgExceptionStateChange,
3091 DbgBreakpointStateChange,
3092 DbgSingleStepStateChange,
3093 DbgLoadDllStateChange,
3094 DbgUnloadDllStateChange
3095 } DBG_STATE, *PDBG_STATE;
3097 typedef struct _DBGUI_CREATE_THREAD
3099 HANDLE HandleToThread;
3100 DBGKM_CREATE_THREAD NewThread;
3101 } DBGUI_CREATE_THREAD, *PDBGUI_CREATE_THREAD;
3103 typedef struct _DBGUI_CREATE_PROCESS
3105 HANDLE HandleToProcess;
3106 HANDLE HandleToThread;
3107 DBGKM_CREATE_PROCESS NewProcess;
3108 } DBGUI_CREATE_PROCESS, *PDBGUI_CREATE_PROCESS;
3110 typedef struct _DBGUI_WAIT_STATE_CHANGE
3112 DBG_STATE NewState;
3113 CLIENT_ID AppClientId;
3114 union
3116 DBGKM_EXCEPTION Exception;
3117 DBGUI_CREATE_THREAD CreateThread;
3118 DBGUI_CREATE_PROCESS CreateProcessInfo;
3119 DBGKM_EXIT_THREAD ExitThread;
3120 DBGKM_EXIT_PROCESS ExitProcess;
3121 DBGKM_LOAD_DLL LoadDll;
3122 DBGKM_UNLOAD_DLL UnloadDll;
3123 } StateInfo;
3124 } DBGUI_WAIT_STATE_CHANGE, *PDBGUI_WAIT_STATE_CHANGE;
3126 struct _DEBUG_EVENT;
3128 #define DEBUG_READ_EVENT 0x0001
3129 #define DEBUG_PROCESS_ASSIGN 0x0002
3130 #define DEBUG_SET_INFORMATION 0x0004
3131 #define DEBUG_QUERY_INFORMATION 0x0008
3132 #define DEBUG_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x0f)
3134 #define DEBUG_KILL_ON_CLOSE 0x1
3136 typedef enum _DEBUGOBJECTINFOCLASS
3138 DebugObjectKillProcessOnExitInformation = 1,
3139 MaxDebugObjectInfoClass
3140 } DEBUGOBJECTINFOCLASS, *PDEBUGOBJECTINFOCLASS;
3142 /***********************************************************************
3143 * Function declarations
3146 NTSYSAPI void WINAPI DbgBreakPoint(void);
3147 NTSYSAPI NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
3148 NTSYSAPI NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
3149 NTSYSAPI NTSTATUS WINAPI DbgUiConnectToDbg(void);
3150 NTSYSAPI NTSTATUS WINAPI DbgUiContinue(CLIENT_ID*,NTSTATUS);
3151 NTSYSAPI NTSTATUS WINAPI DbgUiConvertStateChangeStructure(DBGUI_WAIT_STATE_CHANGE*,struct _DEBUG_EVENT*);
3152 NTSYSAPI NTSTATUS WINAPI DbgUiDebugActiveProcess(HANDLE);
3153 NTSYSAPI HANDLE WINAPI DbgUiGetThreadDebugObject(void);
3154 NTSYSAPI NTSTATUS WINAPI DbgUiIssueRemoteBreakin(HANDLE);
3155 NTSYSAPI void WINAPI DbgUiRemoteBreakin(void*);
3156 NTSYSAPI void WINAPI DbgUiSetThreadDebugObject(HANDLE);
3157 NTSYSAPI NTSTATUS WINAPI DbgUiStopDebugging(HANDLE);
3158 NTSYSAPI NTSTATUS WINAPI DbgUiWaitStateChange(DBGUI_WAIT_STATE_CHANGE*,LARGE_INTEGER*);
3159 NTSYSAPI void WINAPI DbgUserBreakPoint(void);
3160 NTSYSAPI NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
3161 NTSYSAPI NTSTATUS WINAPI LdrAddDllDirectory(const UNICODE_STRING*,void**);
3162 NTSYSAPI NTSTATUS WINAPI LdrAddRefDll(ULONG,HMODULE);
3163 NTSYSAPI NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
3164 NTSYSAPI NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_DATA_TABLE_ENTRY*);
3165 NTSYSAPI NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
3166 NTSYSAPI NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
3167 NTSYSAPI NTSTATUS WINAPI LdrGetDllDirectory(UNICODE_STRING*);
3168 NTSYSAPI NTSTATUS WINAPI LdrGetDllHandle(LPCWSTR, ULONG, const UNICODE_STRING*, HMODULE*);
3169 NTSYSAPI NTSTATUS WINAPI LdrGetDllPath(PCWSTR,ULONG,PWSTR*,PWSTR*);
3170 NTSYSAPI NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
3171 NTSYSAPI NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
3172 NTSYSAPI NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG_PTR*);
3173 IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock(void*,UINT,USHORT*,INT_PTR);
3174 NTSYSAPI NTSTATUS WINAPI LdrQueryImageFileExecutionOptions(const UNICODE_STRING*,LPCWSTR,ULONG,void*,ULONG,ULONG*);
3175 NTSYSAPI NTSTATUS WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*);
3176 NTSYSAPI NTSTATUS WINAPI LdrRegisterDllNotification(ULONG,PLDR_DLL_NOTIFICATION_FUNCTION,void*,void**);
3177 NTSYSAPI NTSTATUS WINAPI LdrRemoveDllDirectory(void*);
3178 NTSYSAPI NTSTATUS WINAPI LdrSetDefaultDllDirectories(ULONG);
3179 NTSYSAPI NTSTATUS WINAPI LdrSetDllDirectory(const UNICODE_STRING*);
3180 NTSYSAPI void WINAPI LdrShutdownProcess(void);
3181 NTSYSAPI void WINAPI LdrShutdownThread(void);
3182 NTSYSAPI NTSTATUS WINAPI LdrUnloadDll(HMODULE);
3183 NTSYSAPI NTSTATUS WINAPI LdrUnlockLoaderLock(ULONG,ULONG_PTR);
3184 NTSYSAPI NTSTATUS WINAPI LdrUnregisterDllNotification(void*);
3185 NTSYSAPI NTSTATUS WINAPI NtAcceptConnectPort(PHANDLE,ULONG,PLPC_MESSAGE,BOOLEAN,PLPC_SECTION_WRITE,PLPC_SECTION_READ);
3186 NTSYSAPI NTSTATUS WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,NTSTATUS*);
3187 NTSYSAPI NTSTATUS WINAPI NtAccessCheckAndAuditAlarm(PUNICODE_STRING,HANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,ACCESS_MASK,PGENERIC_MAPPING,BOOLEAN,PACCESS_MASK,PBOOLEAN,PBOOLEAN);
3188 NTSYSAPI NTSTATUS WINAPI NtAddAtom(const WCHAR*,ULONG,RTL_ATOM*);
3189 NTSYSAPI NTSTATUS WINAPI NtAdjustGroupsToken(HANDLE,BOOLEAN,PTOKEN_GROUPS,ULONG,PTOKEN_GROUPS,PULONG);
3190 NTSYSAPI NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
3191 NTSYSAPI NTSTATUS WINAPI NtAlertResumeThread(HANDLE,PULONG);
3192 NTSYSAPI NTSTATUS WINAPI NtAlertThread(HANDLE ThreadHandle);
3193 NTSYSAPI NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID lpLuid);
3194 NTSYSAPI NTSTATUS WINAPI NtAllocateUuids(PULARGE_INTEGER,PULONG,PULONG,PUCHAR);
3195 NTSYSAPI NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,ULONG_PTR,SIZE_T*,ULONG,ULONG);
3196 NTSYSAPI NTSTATUS WINAPI NtAllocateVirtualMemoryEx(HANDLE,PVOID*,SIZE_T*,ULONG,ULONG,MEM_EXTENDED_PARAMETER*,ULONG);
3197 NTSYSAPI NTSTATUS WINAPI NtAreMappedFilesTheSame(PVOID,PVOID);
3198 NTSYSAPI NTSTATUS WINAPI NtAssignProcessToJobObject(HANDLE,HANDLE);
3199 NTSYSAPI NTSTATUS WINAPI NtCallbackReturn(PVOID,ULONG,NTSTATUS);
3200 NTSYSAPI NTSTATUS WINAPI NtCancelIoFile(HANDLE,PIO_STATUS_BLOCK);
3201 NTSYSAPI NTSTATUS WINAPI NtCancelIoFileEx(HANDLE,PIO_STATUS_BLOCK,PIO_STATUS_BLOCK);
3202 NTSYSAPI NTSTATUS WINAPI NtCancelTimer(HANDLE, BOOLEAN*);
3203 NTSYSAPI NTSTATUS WINAPI NtClearEvent(HANDLE);
3204 NTSYSAPI NTSTATUS WINAPI NtClearPowerRequest(HANDLE,POWER_REQUEST_TYPE);
3205 NTSYSAPI NTSTATUS WINAPI NtClose(HANDLE);
3206 NTSYSAPI NTSTATUS WINAPI NtCloseObjectAuditAlarm(PUNICODE_STRING,HANDLE,BOOLEAN);
3207 NTSYSAPI NTSTATUS WINAPI NtCompleteConnectPort(HANDLE);
3208 NTSYSAPI NTSTATUS WINAPI NtConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
3209 NTSYSAPI NTSTATUS WINAPI NtContinue(PCONTEXT,BOOLEAN);
3210 NTSYSAPI NTSTATUS WINAPI NtCreateDebugObject(HANDLE*,ACCESS_MASK,OBJECT_ATTRIBUTES*,ULONG);
3211 NTSYSAPI NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
3212 NTSYSAPI NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,EVENT_TYPE,BOOLEAN);
3213 NTSYSAPI NTSTATUS WINAPI NtCreateEventPair(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
3214 NTSYSAPI NTSTATUS WINAPI NtCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
3215 NTSYSAPI NTSTATUS WINAPI NtCreateIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,ULONG);
3216 NTSYSAPI NTSTATUS WINAPI NtCreateJobObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3217 NTSYSAPI NTSTATUS WINAPI NtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
3218 NTSYSAPI NTSTATUS WINAPI NtCreateKeyTransacted(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,HANDLE,ULONG*);
3219 NTSYSAPI NTSTATUS WINAPI NtCreateKeyedEvent(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG);
3220 NTSYSAPI NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,PLARGE_INTEGER);
3221 NTSYSAPI NTSTATUS WINAPI NtCreateMutant(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,BOOLEAN);
3222 NTSYSAPI NTSTATUS WINAPI NtCreateNamedPipeFile(PHANDLE,ULONG,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,PLARGE_INTEGER);
3223 NTSYSAPI NTSTATUS WINAPI NtCreatePagingFile(PUNICODE_STRING,PLARGE_INTEGER,PLARGE_INTEGER,PLARGE_INTEGER);
3224 NTSYSAPI NTSTATUS WINAPI NtCreatePort(PHANDLE,POBJECT_ATTRIBUTES,ULONG,ULONG,PULONG);
3225 NTSYSAPI NTSTATUS WINAPI NtCreatePowerRequest(HANDLE*,COUNTED_REASON_CONTEXT*);
3226 NTSYSAPI NTSTATUS WINAPI NtCreateProcess(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,BOOLEAN,HANDLE,HANDLE,HANDLE);
3227 NTSYSAPI NTSTATUS WINAPI NtCreateProfile(PHANDLE,HANDLE,PVOID,ULONG,ULONG,PVOID,ULONG,KPROFILE_SOURCE,KAFFINITY);
3228 NTSYSAPI NTSTATUS WINAPI NtCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
3229 NTSYSAPI NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,LONG,LONG);
3230 NTSYSAPI NTSTATUS WINAPI NtCreateSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PUNICODE_STRING);
3231 NTSYSAPI NTSTATUS WINAPI NtCreateThread(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,PCLIENT_ID,PCONTEXT,PINITIAL_TEB,BOOLEAN);
3232 NTSYSAPI NTSTATUS WINAPI NtCreateThreadEx(HANDLE*,ACCESS_MASK,OBJECT_ATTRIBUTES*,HANDLE,PRTL_THREAD_START_ROUTINE,void*,ULONG,SIZE_T,SIZE_T,SIZE_T,PS_ATTRIBUTE_LIST*);
3233 NTSYSAPI NTSTATUS WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
3234 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);
3235 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*);
3236 NTSYSAPI NTSTATUS WINAPI NtDebugActiveProcess(HANDLE,HANDLE);
3237 NTSYSAPI NTSTATUS WINAPI NtDebugContinue(HANDLE,CLIENT_ID*,NTSTATUS);
3238 NTSYSAPI NTSTATUS WINAPI NtDelayExecution(BOOLEAN,const LARGE_INTEGER*);
3239 NTSYSAPI NTSTATUS WINAPI NtDeleteAtom(RTL_ATOM);
3240 NTSYSAPI NTSTATUS WINAPI NtDeleteFile(POBJECT_ATTRIBUTES);
3241 NTSYSAPI NTSTATUS WINAPI NtDeleteKey(HANDLE);
3242 NTSYSAPI NTSTATUS WINAPI NtDeleteValueKey(HANDLE,const UNICODE_STRING *);
3243 NTSYSAPI NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
3244 NTSYSAPI NTSTATUS WINAPI NtDisplayString(PUNICODE_STRING);
3245 NTSYSAPI NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
3246 NTSYSAPI NTSTATUS WINAPI NtDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE);
3247 NTSYSAPI NTSTATUS WINAPI NtEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
3248 NTSYSAPI NTSTATUS WINAPI NtEnumerateValueKey(HANDLE,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3249 NTSYSAPI NTSTATUS WINAPI NtExtendSection(HANDLE,PLARGE_INTEGER);
3250 NTSYSAPI NTSTATUS WINAPI NtFilterToken(HANDLE,ULONG,TOKEN_GROUPS*,TOKEN_PRIVILEGES*,TOKEN_GROUPS*,HANDLE*);
3251 NTSYSAPI NTSTATUS WINAPI NtFindAtom(const WCHAR*,ULONG,RTL_ATOM*);
3252 NTSYSAPI NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
3253 NTSYSAPI NTSTATUS WINAPI NtFlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
3254 NTSYSAPI NTSTATUS WINAPI NtFlushKey(HANDLE);
3255 NTSYSAPI void WINAPI NtFlushProcessWriteBuffers(void);
3256 NTSYSAPI NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,SIZE_T*,ULONG);
3257 NTSYSAPI NTSTATUS WINAPI NtFlushWriteBuffer(VOID);
3258 NTSYSAPI NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
3259 NTSYSAPI NTSTATUS WINAPI NtFsControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
3260 NTSYSAPI NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*);
3261 NTSYSAPI ULONG WINAPI NtGetCurrentProcessorNumber(void);
3262 NTSYSAPI NTSTATUS WINAPI NtGetNlsSectionPtr(ULONG,ULONG,void*,void**,SIZE_T*);
3263 NTSYSAPI NTSTATUS WINAPI NtGetPlugPlayEvent(ULONG,ULONG,PVOID,ULONG);
3264 NTSYSAPI ULONG WINAPI NtGetTickCount(VOID);
3265 NTSYSAPI NTSTATUS WINAPI NtGetWriteWatch(HANDLE,ULONG,PVOID,SIZE_T,PVOID*,ULONG_PTR*,ULONG*);
3266 NTSYSAPI NTSTATUS WINAPI NtImpersonateAnonymousToken(HANDLE);
3267 NTSYSAPI NTSTATUS WINAPI NtImpersonateClientOfPort(HANDLE,PPORT_MESSAGE);
3268 NTSYSAPI NTSTATUS WINAPI NtImpersonateThread(HANDLE,HANDLE,PSECURITY_QUALITY_OF_SERVICE);
3269 NTSYSAPI NTSTATUS WINAPI NtInitializeRegistry(BOOLEAN);
3270 NTSYSAPI NTSTATUS WINAPI NtInitiatePowerAction(POWER_ACTION,SYSTEM_POWER_STATE,ULONG,BOOLEAN);
3271 NTSYSAPI NTSTATUS WINAPI NtIsProcessInJob(HANDLE,HANDLE);
3272 NTSYSAPI NTSTATUS WINAPI NtListenPort(HANDLE,PLPC_MESSAGE);
3273 NTSYSAPI NTSTATUS WINAPI NtLoadDriver(const UNICODE_STRING *);
3274 NTSYSAPI NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *);
3275 NTSYSAPI NTSTATUS WINAPI NtLockFile(HANDLE,HANDLE,PIO_APC_ROUTINE,void*,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,ULONG*,BOOLEAN,BOOLEAN);
3276 NTSYSAPI NTSTATUS WINAPI NtLockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
3277 NTSYSAPI NTSTATUS WINAPI NtMakeTemporaryObject(HANDLE);
3278 NTSYSAPI NTSTATUS WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG_PTR,SIZE_T,const LARGE_INTEGER*,SIZE_T*,SECTION_INHERIT,ULONG,ULONG);
3279 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,ULONG,BOOLEAN);
3280 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeKey(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
3281 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeMultipleKeys(HANDLE,ULONG,OBJECT_ATTRIBUTES*,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
3282 NTSYSAPI NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3283 NTSYSAPI NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
3284 NTSYSAPI NTSTATUS WINAPI NtOpenEventPair(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3285 NTSYSAPI NTSTATUS WINAPI NtOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
3286 NTSYSAPI NTSTATUS WINAPI NtOpenIoCompletion(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3287 NTSYSAPI NTSTATUS WINAPI NtOpenJobObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3288 NTSYSAPI NTSTATUS WINAPI NtOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
3289 NTSYSAPI NTSTATUS WINAPI NtOpenKeyEx(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG);
3290 NTSYSAPI NTSTATUS WINAPI NtOpenKeyTransacted(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,HANDLE);
3291 NTSYSAPI NTSTATUS WINAPI NtOpenKeyTransactedEx(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,HANDLE);
3292 NTSYSAPI NTSTATUS WINAPI NtOpenKeyedEvent(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3293 NTSYSAPI NTSTATUS WINAPI NtOpenMutant(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3294 NTSYSAPI NTSTATUS WINAPI NtOpenObjectAuditAlarm(PUNICODE_STRING,PHANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,ACCESS_MASK,PPRIVILEGE_SET,BOOLEAN,BOOLEAN,PBOOLEAN);
3295 NTSYSAPI NTSTATUS WINAPI NtOpenProcess(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
3296 NTSYSAPI NTSTATUS WINAPI NtOpenProcessToken(HANDLE,DWORD,HANDLE *);
3297 NTSYSAPI NTSTATUS WINAPI NtOpenProcessTokenEx(HANDLE,DWORD,DWORD,HANDLE *);
3298 NTSYSAPI NTSTATUS WINAPI NtOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3299 NTSYSAPI NTSTATUS WINAPI NtOpenSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3300 NTSYSAPI NTSTATUS WINAPI NtOpenSymbolicLinkObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
3301 NTSYSAPI NTSTATUS WINAPI NtOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
3302 NTSYSAPI NTSTATUS WINAPI NtOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
3303 NTSYSAPI NTSTATUS WINAPI NtOpenThreadTokenEx(HANDLE,DWORD,BOOLEAN,DWORD,HANDLE *);
3304 NTSYSAPI NTSTATUS WINAPI NtOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
3305 NTSYSAPI NTSTATUS WINAPI NtPowerInformation(POWER_INFORMATION_LEVEL,PVOID,ULONG,PVOID,ULONG);
3306 NTSYSAPI NTSTATUS WINAPI NtPrivilegeCheck(HANDLE,PPRIVILEGE_SET,PBOOLEAN);
3307 NTSYSAPI NTSTATUS WINAPI NtPrivilegeObjectAuditAlarm(PUNICODE_STRING,HANDLE,HANDLE,ULONG,PPRIVILEGE_SET,BOOLEAN);
3308 NTSYSAPI NTSTATUS WINAPI NtPrivilegedServiceAuditAlarm(PUNICODE_STRING,PUNICODE_STRING,HANDLE,PPRIVILEGE_SET,BOOLEAN);
3309 NTSYSAPI NTSTATUS WINAPI NtProtectVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG,ULONG*);
3310 NTSYSAPI NTSTATUS WINAPI NtPulseEvent(HANDLE,LONG*);
3311 NTSYSAPI NTSTATUS WINAPI NtQueueApcThread(HANDLE,PNTAPCFUNC,ULONG_PTR,ULONG_PTR,ULONG_PTR);
3312 NTSYSAPI NTSTATUS WINAPI NtQueryAttributesFile(const OBJECT_ATTRIBUTES*,FILE_BASIC_INFORMATION*);
3313 NTSYSAPI NTSTATUS WINAPI NtQueryDefaultLocale(BOOLEAN,LCID*);
3314 NTSYSAPI NTSTATUS WINAPI NtQueryDefaultUILanguage(LANGID*);
3315 NTSYSAPI NTSTATUS WINAPI NtQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
3316 NTSYSAPI NTSTATUS WINAPI NtQueryDirectoryObject(HANDLE,PDIRECTORY_BASIC_INFORMATION,ULONG,BOOLEAN,BOOLEAN,PULONG,PULONG);
3317 NTSYSAPI NTSTATUS WINAPI NtQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PULONG,BOOLEAN);
3318 NTSYSAPI NTSTATUS WINAPI NtQueryEvent(HANDLE,EVENT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3319 NTSYSAPI NTSTATUS WINAPI NtQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*);
3320 NTSYSAPI NTSTATUS WINAPI NtQueryInformationAtom(RTL_ATOM,ATOM_INFORMATION_CLASS,PVOID,ULONG,ULONG*);
3321 NTSYSAPI NTSTATUS WINAPI NtQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS);
3322 NTSYSAPI NTSTATUS WINAPI NtQueryInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,PVOID,ULONG,PULONG);
3323 NTSYSAPI NTSTATUS WINAPI NtQueryInformationPort(HANDLE,PORT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3324 NTSYSAPI NTSTATUS WINAPI NtQueryInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG,PULONG);
3325 NTSYSAPI NTSTATUS WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
3326 NTSYSAPI NTSTATUS WINAPI NtQueryInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3327 NTSYSAPI NTSTATUS WINAPI NtQueryInstallUILanguage(LANGID*);
3328 NTSYSAPI NTSTATUS WINAPI NtQueryIntervalProfile(KPROFILE_SOURCE,PULONG);
3329 NTSYSAPI NTSTATUS WINAPI NtQueryIoCompletion(HANDLE,IO_COMPLETION_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3330 NTSYSAPI NTSTATUS WINAPI NtQueryKey(HANDLE,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
3331 NTSYSAPI NTSTATUS WINAPI NtQueryMultipleValueKey(HANDLE,PKEY_MULTIPLE_VALUE_INFORMATION,ULONG,PVOID,ULONG,PULONG);
3332 NTSYSAPI NTSTATUS WINAPI NtQueryMutant(HANDLE,MUTANT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3333 NTSYSAPI NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
3334 NTSYSAPI NTSTATUS WINAPI NtQueryOpenSubKeys(POBJECT_ATTRIBUTES,PULONG);
3335 NTSYSAPI NTSTATUS WINAPI NtQueryPerformanceCounter(PLARGE_INTEGER, PLARGE_INTEGER);
3336 NTSYSAPI NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
3337 NTSYSAPI NTSTATUS WINAPI NtQuerySection(HANDLE,SECTION_INFORMATION_CLASS,PVOID,SIZE_T,SIZE_T*);
3338 NTSYSAPI NTSTATUS WINAPI NtQuerySemaphore(HANDLE,SEMAPHORE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3339 NTSYSAPI NTSTATUS WINAPI NtQuerySymbolicLinkObject(HANDLE,PUNICODE_STRING,PULONG);
3340 NTSYSAPI NTSTATUS WINAPI NtQuerySystemEnvironmentValue(PUNICODE_STRING,PWCHAR,ULONG,PULONG);
3341 NTSYSAPI NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3342 NTSYSAPI NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS,void*,ULONG,void*,ULONG,ULONG*);
3343 NTSYSAPI NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER);
3344 NTSYSAPI NTSTATUS WINAPI NtQueryTimer(HANDLE,TIMER_INFORMATION_CLASS,PVOID,ULONG,PULONG);
3345 NTSYSAPI NTSTATUS WINAPI NtQueryTimerResolution(PULONG,PULONG,PULONG);
3346 NTSYSAPI NTSTATUS WINAPI NtQueryValueKey(HANDLE,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
3347 NTSYSAPI NTSTATUS WINAPI NtQueryLicenseValue(const UNICODE_STRING *,ULONG *,PVOID,ULONG,ULONG *);
3348 NTSYSAPI NTSTATUS WINAPI NtQueryVirtualMemory(HANDLE,LPCVOID,MEMORY_INFORMATION_CLASS,PVOID,SIZE_T,SIZE_T*);
3349 NTSYSAPI NTSTATUS WINAPI NtQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
3350 NTSYSAPI NTSTATUS WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
3351 NTSYSAPI NTSTATUS WINAPI NtRaiseHardError(NTSTATUS,ULONG,PUNICODE_STRING,PVOID*,HARDERROR_RESPONSE_OPTION,PHARDERROR_RESPONSE);
3352 NTSYSAPI NTSTATUS WINAPI NtReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
3353 NTSYSAPI NTSTATUS WINAPI NtReadFileScatter(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT*,ULONG,PLARGE_INTEGER,PULONG);
3354 NTSYSAPI NTSTATUS WINAPI NtReadRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
3355 NTSYSAPI NTSTATUS WINAPI NtReadVirtualMemory(HANDLE,const void*,void*,SIZE_T,SIZE_T*);
3356 NTSYSAPI NTSTATUS WINAPI NtRegisterThreadTerminatePort(HANDLE);
3357 NTSYSAPI NTSTATUS WINAPI NtReleaseKeyedEvent(HANDLE,const void*,BOOLEAN,const LARGE_INTEGER*);
3358 NTSYSAPI NTSTATUS WINAPI NtReleaseMutant(HANDLE,PLONG);
3359 NTSYSAPI NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
3360 NTSYSAPI NTSTATUS WINAPI NtRemoveIoCompletion(HANDLE,PULONG_PTR,PULONG_PTR,PIO_STATUS_BLOCK,PLARGE_INTEGER);
3361 NTSYSAPI NTSTATUS WINAPI NtRemoveIoCompletionEx(HANDLE,FILE_IO_COMPLETION_INFORMATION*,ULONG,ULONG*,LARGE_INTEGER*,BOOLEAN);
3362 NTSYSAPI NTSTATUS WINAPI NtRemoveProcessDebug(HANDLE,HANDLE);
3363 NTSYSAPI NTSTATUS WINAPI NtRenameKey(HANDLE,UNICODE_STRING*);
3364 NTSYSAPI NTSTATUS WINAPI NtReplaceKey(POBJECT_ATTRIBUTES,HANDLE,POBJECT_ATTRIBUTES);
3365 NTSYSAPI NTSTATUS WINAPI NtReplyPort(HANDLE,PLPC_MESSAGE);
3366 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReceivePort(HANDLE,PULONG,PLPC_MESSAGE,PLPC_MESSAGE);
3367 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReceivePortEx(HANDLE,PVOID*,PPORT_MESSAGE,PPORT_MESSAGE,PLARGE_INTEGER);
3368 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReplyPort(HANDLE,PLPC_MESSAGE);
3369 NTSYSAPI NTSTATUS WINAPI NtRequestPort(HANDLE,PLPC_MESSAGE);
3370 NTSYSAPI NTSTATUS WINAPI NtRequestWaitReplyPort(HANDLE,PLPC_MESSAGE,PLPC_MESSAGE);
3371 NTSYSAPI NTSTATUS WINAPI NtResetEvent(HANDLE,LONG*);
3372 NTSYSAPI NTSTATUS WINAPI NtResetWriteWatch(HANDLE,PVOID,SIZE_T);
3373 NTSYSAPI NTSTATUS WINAPI NtRestoreKey(HANDLE,HANDLE,ULONG);
3374 NTSYSAPI NTSTATUS WINAPI NtResumeProcess(HANDLE);
3375 NTSYSAPI NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG);
3376 NTSYSAPI NTSTATUS WINAPI NtSaveKey(HANDLE,HANDLE);
3377 NTSYSAPI NTSTATUS WINAPI NtSecureConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PSID,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
3378 NTSYSAPI NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
3379 NTSYSAPI NTSTATUS WINAPI NtSetDefaultHardErrorPort(HANDLE);
3380 NTSYSAPI NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID);
3381 NTSYSAPI NTSTATUS WINAPI NtSetDefaultUILanguage(LANGID);
3382 NTSYSAPI NTSTATUS WINAPI NtSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG);
3383 NTSYSAPI NTSTATUS WINAPI NtSetEvent(HANDLE,LONG*);
3384 NTSYSAPI NTSTATUS WINAPI NtSetHighEventPair(HANDLE);
3385 NTSYSAPI NTSTATUS WINAPI NtSetHighWaitLowEventPair(HANDLE);
3386 NTSYSAPI NTSTATUS WINAPI NtSetHighWaitLowThread(VOID);
3387 NTSYSAPI NTSTATUS WINAPI NtSetInformationDebugObject(HANDLE,DEBUGOBJECTINFOCLASS,PVOID,ULONG,ULONG*);
3388 NTSYSAPI NTSTATUS WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
3389 NTSYSAPI NTSTATUS WINAPI NtSetInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,PVOID,ULONG);
3390 NTSYSAPI NTSTATUS WINAPI NtSetInformationKey(HANDLE,const int,PVOID,ULONG);
3391 NTSYSAPI NTSTATUS WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
3392 NTSYSAPI NTSTATUS WINAPI NtSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLASS,PVOID,ULONG);
3393 NTSYSAPI NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
3394 NTSYSAPI NTSTATUS WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG);
3395 NTSYSAPI NTSTATUS WINAPI NtSetIntervalProfile(ULONG,KPROFILE_SOURCE);
3396 NTSYSAPI NTSTATUS WINAPI NtSetIoCompletion(HANDLE,ULONG_PTR,ULONG_PTR,NTSTATUS,SIZE_T);
3397 NTSYSAPI NTSTATUS WINAPI NtSetLdtEntries(ULONG,LDT_ENTRY,ULONG,LDT_ENTRY);
3398 NTSYSAPI NTSTATUS WINAPI NtSetLowEventPair(HANDLE);
3399 NTSYSAPI NTSTATUS WINAPI NtSetLowWaitHighEventPair(HANDLE);
3400 NTSYSAPI NTSTATUS WINAPI NtSetLowWaitHighThread(VOID);
3401 NTSYSAPI NTSTATUS WINAPI NtSetPowerRequest(HANDLE,POWER_REQUEST_TYPE);
3402 NTSYSAPI NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
3403 NTSYSAPI NTSTATUS WINAPI NtSetSystemEnvironmentValue(PUNICODE_STRING,PUNICODE_STRING);
3404 NTSYSAPI NTSTATUS WINAPI NtSetSystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG);
3405 NTSYSAPI NTSTATUS WINAPI NtSetSystemPowerState(POWER_ACTION,SYSTEM_POWER_STATE,ULONG);
3406 NTSYSAPI NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
3407 NTSYSAPI NTSTATUS WINAPI NtSetThreadExecutionState(EXECUTION_STATE,EXECUTION_STATE*);
3408 NTSYSAPI NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMER_APC_ROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
3409 NTSYSAPI NTSTATUS WINAPI NtSetTimerResolution(ULONG,BOOLEAN,PULONG);
3410 NTSYSAPI NTSTATUS WINAPI NtSetValueKey(HANDLE,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
3411 NTSYSAPI NTSTATUS WINAPI NtSetVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
3412 NTSYSAPI NTSTATUS WINAPI NtSignalAndWaitForSingleObject(HANDLE,HANDLE,BOOLEAN,const LARGE_INTEGER*);
3413 NTSYSAPI NTSTATUS WINAPI NtShutdownSystem(SHUTDOWN_ACTION);
3414 NTSYSAPI NTSTATUS WINAPI NtStartProfile(HANDLE);
3415 NTSYSAPI NTSTATUS WINAPI NtStopProfile(HANDLE);
3416 NTSYSAPI NTSTATUS WINAPI NtSuspendProcess(HANDLE);
3417 NTSYSAPI NTSTATUS WINAPI NtSuspendThread(HANDLE,PULONG);
3418 NTSYSAPI NTSTATUS WINAPI NtSystemDebugControl(SYSDBG_COMMAND,PVOID,ULONG,PVOID,ULONG,PULONG);
3419 NTSYSAPI NTSTATUS WINAPI NtTerminateJobObject(HANDLE,NTSTATUS);
3420 NTSYSAPI NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG);
3421 NTSYSAPI NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG);
3422 NTSYSAPI NTSTATUS WINAPI NtTestAlert(VOID);
3423 NTSYSAPI NTSTATUS WINAPI NtUnloadDriver(const UNICODE_STRING *);
3424 NTSYSAPI NTSTATUS WINAPI NtUnloadKey(POBJECT_ATTRIBUTES);
3425 NTSYSAPI NTSTATUS WINAPI NtUnloadKeyEx(POBJECT_ATTRIBUTES,HANDLE);
3426 NTSYSAPI NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
3427 NTSYSAPI NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
3428 NTSYSAPI NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
3429 NTSYSAPI NTSTATUS WINAPI NtVdmControl(ULONG,PVOID);
3430 NTSYSAPI NTSTATUS WINAPI NtWaitForDebugEvent(HANDLE,BOOLEAN,LARGE_INTEGER*,DBGUI_WAIT_STATE_CHANGE*);
3431 NTSYSAPI NTSTATUS WINAPI NtWaitForKeyedEvent(HANDLE,const void*,BOOLEAN,const LARGE_INTEGER*);
3432 NTSYSAPI NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
3433 NTSYSAPI NTSTATUS WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
3434 NTSYSAPI NTSTATUS WINAPI NtWaitHighEventPair(HANDLE);
3435 NTSYSAPI NTSTATUS WINAPI NtWaitLowEventPair(HANDLE);
3436 NTSYSAPI NTSTATUS WINAPI NtWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
3437 NTSYSAPI NTSTATUS WINAPI NtWriteFileGather(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT*,ULONG,PLARGE_INTEGER,PULONG);
3438 NTSYSAPI NTSTATUS WINAPI NtWriteRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
3439 NTSYSAPI NTSTATUS WINAPI NtWriteVirtualMemory(HANDLE,void*,const void*,SIZE_T,SIZE_T*);
3440 NTSYSAPI NTSTATUS WINAPI NtYieldExecution(void);
3442 NTSYSAPI NTSTATUS WINAPI RtlAbsoluteToSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PULONG);
3443 NTSYSAPI void WINAPI RtlAcquirePebLock(void);
3444 NTSYSAPI BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK,BYTE);
3445 NTSYSAPI BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK,BYTE);
3446 NTSYSAPI void WINAPI RtlAcquireSRWLockExclusive(RTL_SRWLOCK*);
3447 NTSYSAPI void WINAPI RtlAcquireSRWLockShared(RTL_SRWLOCK*);
3448 NTSYSAPI NTSTATUS WINAPI RtlActivateActivationContext(DWORD,HANDLE,ULONG_PTR*);
3449 NTSYSAPI NTSTATUS WINAPI RtlActivateActivationContextEx(ULONG,TEB*,HANDLE,ULONG_PTR*);
3450 NTSYSAPI NTSTATUS WINAPI RtlAddAce(PACL,DWORD,DWORD,PACE_HEADER,DWORD);
3451 NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
3452 NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
3453 NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID);
3454 NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
3455 NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
3456 NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID);
3457 NTSYSAPI NTSTATUS WINAPI RtlAddAtomToAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
3458 NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL);
3459 NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAceEx(PACL,DWORD,DWORD,DWORD,PSID,BOOL,BOOL);
3460 NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID,BOOL,BOOL);
3461 NTSYSAPI NTSTATUS WINAPI RtlAddMandatoryAce(PACL,DWORD,DWORD,DWORD,DWORD,PSID);
3462 NTSYSAPI void WINAPI RtlAddRefActivationContext(HANDLE);
3463 NTSYSAPI PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
3464 NTSYSAPI NTSTATUS WINAPI RtlAdjustPrivilege(ULONG,BOOLEAN,BOOLEAN,PBOOLEAN);
3465 NTSYSAPI NTSTATUS WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
3466 NTSYSAPI RTL_HANDLE * WINAPI RtlAllocateHandle(RTL_HANDLE_TABLE *,ULONG *);
3467 NTSYSAPI PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,SIZE_T) __WINE_ALLOC_SIZE(3);
3468 NTSYSAPI WCHAR WINAPI RtlAnsiCharToUnicodeChar(LPSTR *);
3469 NTSYSAPI DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING *);
3470 NTSYSAPI NTSTATUS WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING,PCANSI_STRING,BOOLEAN);
3471 NTSYSAPI NTSTATUS WINAPI RtlAppendAsciizToString(STRING *,LPCSTR);
3472 NTSYSAPI NTSTATUS WINAPI RtlAppendStringToString(STRING *,const STRING *);
3473 NTSYSAPI NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING *,const UNICODE_STRING *);
3474 NTSYSAPI NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING *,LPCWSTR);
3475 NTSYSAPI BOOLEAN WINAPI RtlAreAllAccessesGranted(ACCESS_MASK,ACCESS_MASK);
3476 NTSYSAPI BOOLEAN WINAPI RtlAreAnyAccessesGranted(ACCESS_MASK,ACCESS_MASK);
3477 NTSYSAPI BOOLEAN WINAPI RtlAreBitsSet(PCRTL_BITMAP,ULONG,ULONG);
3478 NTSYSAPI BOOLEAN WINAPI RtlAreBitsClear(PCRTL_BITMAP,ULONG,ULONG);
3479 NTSYSAPI NTSTATUS WINAPI RtlCharToInteger(PCSZ,ULONG,PULONG);
3480 NTSYSAPI NTSTATUS WINAPI RtlCheckRegistryKey(ULONG, PWSTR);
3481 NTSYSAPI void WINAPI RtlClearAllBits(PRTL_BITMAP);
3482 NTSYSAPI void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
3483 NTSYSAPI NTSTATUS WINAPI RtlCreateActivationContext(HANDLE*,const void*);
3484 NTSYSAPI PDEBUG_BUFFER WINAPI RtlCreateQueryDebugBuffer(ULONG,BOOLEAN);
3485 NTSYSAPI NTSTATUS WINAPI RtlCreateRegistryKey(ULONG,PWSTR);
3486 NTSYSAPI ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
3487 NTSYSAPI LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
3488 NTSYSAPI LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
3489 NTSYSAPI LONG WINAPI RtlCompareUnicodeStrings(const WCHAR*,SIZE_T,const WCHAR*,SIZE_T,BOOLEAN);
3490 NTSYSAPI NTSTATUS WINAPI RtlCompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,ULONG,PULONG,PVOID);
3491 NTSYSAPI DWORD WINAPI RtlComputeCrc32(DWORD,const BYTE*,INT);
3492 NTSYSAPI NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
3493 NTSYSAPI NTSTATUS WINAPI RtlConvertToAutoInheritSecurityObject(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,GUID*,BOOL,PGENERIC_MAPPING);
3494 NTSYSAPI void WINAPI RtlCopyLuid(PLUID,const LUID*);
3495 NTSYSAPI void WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
3496 NTSYSAPI BOOLEAN WINAPI RtlCopySid(DWORD,PSID,PSID);
3497 NTSYSAPI NTSTATUS WINAPI RtlCopySecurityDescriptor(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR);
3498 NTSYSAPI void WINAPI RtlCopyString(STRING*,const STRING*);
3499 NTSYSAPI void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
3500 NTSYSAPI NTSTATUS WINAPI RtlCreateAcl(PACL,DWORD,DWORD);
3501 NTSYSAPI NTSTATUS WINAPI RtlCreateAtomTable(ULONG,RTL_ATOM_TABLE*);
3502 NTSYSAPI NTSTATUS WINAPI RtlCreateEnvironment(BOOLEAN, PWSTR*);
3503 NTSYSAPI HANDLE WINAPI RtlCreateHeap(ULONG,PVOID,SIZE_T,SIZE_T,PVOID,PRTL_HEAP_DEFINITION);
3504 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*);
3505 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);
3506 NTSYSAPI NTSTATUS WINAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
3507 NTSYSAPI NTSTATUS WINAPI RtlCreateTimerQueue(PHANDLE);
3508 NTSYSAPI NTSTATUS WINAPI RtlCreateTimer(PHANDLE, HANDLE, RTL_WAITORTIMERCALLBACKFUNC, PVOID, DWORD, DWORD, ULONG);
3509 NTSYSAPI BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
3510 NTSYSAPI BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
3511 NTSYSAPI NTSTATUS WINAPI RtlCreateUserProcess(UNICODE_STRING*,ULONG,RTL_USER_PROCESS_PARAMETERS*,SECURITY_DESCRIPTOR*,SECURITY_DESCRIPTOR*,HANDLE,BOOLEAN,HANDLE,HANDLE,RTL_USER_PROCESS_INFORMATION*);
3512 NTSYSAPI NTSTATUS WINAPI RtlCreateUserThread(HANDLE,SECURITY_DESCRIPTOR*,BOOLEAN,PVOID,SIZE_T,SIZE_T,PRTL_THREAD_START_ROUTINE,void*,HANDLE*,CLIENT_ID*);
3513 NTSYSAPI NTSTATUS WINAPI RtlCreateUserStack(SIZE_T,SIZE_T,ULONG,SIZE_T,SIZE_T,INITIAL_TEB*);
3514 NTSYSAPI NTSTATUS WINAPI RtlCustomCPToUnicodeN(CPTABLEINFO*,WCHAR*,DWORD,DWORD*,const char*,DWORD);
3515 NTSYSAPI void WINAPI RtlDeactivateActivationContext(DWORD,ULONG_PTR);
3516 NTSYSAPI PVOID WINAPI RtlDecodePointer(PVOID);
3517 NTSYSAPI NTSTATUS WINAPI RtlDecompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,PULONG);
3518 NTSYSAPI NTSTATUS WINAPI RtlDecompressFragment(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,ULONG,PULONG,PVOID);
3519 NTSYSAPI NTSTATUS WINAPI RtlDeleteAce(PACL,DWORD);
3520 NTSYSAPI NTSTATUS WINAPI RtlDeleteAtomFromAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
3521 NTSYSAPI NTSTATUS WINAPI RtlDeleteCriticalSection(RTL_CRITICAL_SECTION *);
3522 NTSYSAPI NTSTATUS WINAPI RtlDeleteRegistryValue(ULONG, PCWSTR, PCWSTR);
3523 NTSYSAPI void WINAPI RtlDeleteResource(LPRTL_RWLOCK);
3524 NTSYSAPI NTSTATUS WINAPI RtlDeleteSecurityObject(PSECURITY_DESCRIPTOR*);
3525 NTSYSAPI NTSTATUS WINAPI RtlDeleteTimer(HANDLE, HANDLE, HANDLE);
3526 NTSYSAPI NTSTATUS WINAPI RtlDeleteTimerQueueEx(HANDLE, HANDLE);
3527 NTSYSAPI PRTL_USER_PROCESS_PARAMETERS WINAPI RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
3528 NTSYSAPI NTSTATUS WINAPI RtlDeregisterWait(HANDLE);
3529 NTSYSAPI NTSTATUS WINAPI RtlDeregisterWaitEx(HANDLE,HANDLE);
3530 NTSYSAPI NTSTATUS WINAPI RtlDestroyAtomTable(RTL_ATOM_TABLE);
3531 NTSYSAPI NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR);
3532 NTSYSAPI NTSTATUS WINAPI RtlDestroyHandleTable(RTL_HANDLE_TABLE *);
3533 NTSYSAPI HANDLE WINAPI RtlDestroyHeap(HANDLE);
3534 NTSYSAPI void WINAPI RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS*);
3535 NTSYSAPI NTSTATUS WINAPI RtlDestroyQueryDebugBuffer(PDEBUG_BUFFER);
3536 NTSYSAPI DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
3537 NTSYSAPI BOOLEAN WINAPI RtlDllShutdownInProgress(void);
3538 NTSYSAPI BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR);
3539 NTSYSAPI BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(PCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
3540 NTSYSAPI NTSTATUS WINAPI RtlDosPathNameToNtPathName_U_WithStatus(PCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
3541 NTSYSAPI ULONG WINAPI RtlDosSearchPath_U(LPCWSTR, LPCWSTR, LPCWSTR, ULONG, LPWSTR, LPWSTR*);
3542 NTSYSAPI WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
3543 NTSYSAPI NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
3544 NTSYSAPI void WINAPI RtlDumpResource(LPRTL_RWLOCK);
3545 NTSYSAPI NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
3546 NTSYSAPI NTSTATUS WINAPI RtlEmptyAtomTable(RTL_ATOM_TABLE,BOOLEAN);
3547 NTSYSAPI PVOID WINAPI RtlEncodePointer(PVOID);
3548 NTSYSAPI NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
3549 NTSYSAPI void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
3550 NTSYSAPI NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
3551 NTSYSAPI NTSTATUS WINAPI RtlEqualDomainName(const UNICODE_STRING*,const UNICODE_STRING*);
3552 NTSYSAPI BOOLEAN WINAPI RtlEqualLuid(const LUID*,const LUID*);
3553 NTSYSAPI BOOL WINAPI RtlEqualPrefixSid(PSID,PSID);
3554 NTSYSAPI BOOL WINAPI RtlEqualSid(PSID,PSID);
3555 NTSYSAPI BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
3556 NTSYSAPI BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
3557 NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlExitUserProcess(ULONG);
3558 NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlExitUserThread(ULONG);
3559 NTSYSAPI NTSTATUS WINAPI RtlExpandEnvironmentStrings(const WCHAR*,WCHAR*,SIZE_T,WCHAR*,SIZE_T,SIZE_T*);
3560 NTSYSAPI NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PCWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*);
3561 NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionString(ULONG,const GUID*,ULONG,const UNICODE_STRING*,PVOID);
3562 NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionGuid(ULONG,const GUID*,ULONG,const GUID*,PVOID);
3563 NTSYSAPI NTSTATUS WINAPI RtlFindCharInUnicodeString(int,const UNICODE_STRING*,const UNICODE_STRING*,USHORT*);
3564 NTSYSAPI ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
3565 NTSYSAPI ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
3566 NTSYSAPI ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
3567 NTSYSAPI ULONG WINAPI RtlFindLastBackwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
3568 NTSYSAPI ULONG WINAPI RtlFindLastBackwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
3569 NTSYSAPI CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG);
3570 NTSYSAPI ULONG WINAPI RtlFindLongestRunSet(PCRTL_BITMAP,PULONG);
3571 NTSYSAPI ULONG WINAPI RtlFindLongestRunClear(PCRTL_BITMAP,PULONG);
3572 NTSYSAPI NTSTATUS WINAPI RtlFindMessage(HMODULE,ULONG,ULONG,ULONG,const MESSAGE_RESOURCE_ENTRY**);
3573 NTSYSAPI CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG);
3574 NTSYSAPI ULONG WINAPI RtlFindNextForwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
3575 NTSYSAPI ULONG WINAPI RtlFindNextForwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
3576 NTSYSAPI ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP,ULONG,ULONG);
3577 NTSYSAPI ULONG WINAPI RtlFindSetBitsAndClear(PRTL_BITMAP,ULONG,ULONG);
3578 NTSYSAPI ULONG WINAPI RtlFindSetRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
3579 NTSYSAPI BOOLEAN WINAPI RtlFirstFreeAce(PACL,PACE_HEADER *);
3580 NTSYSAPI NTSTATUS WINAPI RtlFlsAlloc(PFLS_CALLBACK_FUNCTION,ULONG *);
3581 NTSYSAPI NTSTATUS WINAPI RtlFlsFree(ULONG);
3582 NTSYSAPI NTSTATUS WINAPI RtlFlsGetValue(ULONG,void **);
3583 NTSYSAPI NTSTATUS WINAPI RtlFlsSetValue(ULONG,void *);
3584 NTSYSAPI NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING);
3585 NTSYSAPI NTSTATUS WINAPI RtlFormatMessage(LPCWSTR,ULONG,BOOLEAN,BOOLEAN,BOOLEAN,__ms_va_list *,LPWSTR,ULONG,ULONG*);
3586 NTSYSAPI NTSTATUS WINAPI RtlFormatMessageEx(LPCWSTR,ULONG,BOOLEAN,BOOLEAN,BOOLEAN,__ms_va_list *,LPWSTR,ULONG,ULONG*,ULONG);
3587 NTSYSAPI void WINAPI RtlFreeAnsiString(PANSI_STRING);
3588 NTSYSAPI BOOLEAN WINAPI RtlFreeHandle(RTL_HANDLE_TABLE *,RTL_HANDLE *);
3589 NTSYSAPI BOOLEAN WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
3590 NTSYSAPI void WINAPI RtlFreeOemString(POEM_STRING);
3591 NTSYSAPI DWORD WINAPI RtlFreeSid(PSID);
3592 NTSYSAPI void WINAPI RtlFreeThreadActivationContextStack(void);
3593 NTSYSAPI void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
3594 NTSYSAPI void WINAPI RtlFreeUserStack(void*);
3595 NTSYSAPI NTSTATUS WINAPI RtlGetAce(PACL,DWORD,LPVOID *);
3596 NTSYSAPI NTSTATUS WINAPI RtlGetActiveActivationContext(HANDLE*);
3597 NTSYSAPI NTSTATUS WINAPI RtlGetCompressionWorkSpaceSize(USHORT,PULONG,PULONG);
3598 NTSYSAPI NTSTATUS WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
3599 NTSYSAPI ULONG WINAPI RtlGetCurrentDirectory_U(ULONG, LPWSTR);
3600 NTSYSAPI PEB * WINAPI RtlGetCurrentPeb(void);
3601 NTSYSAPI NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
3602 NTSYSAPI NTSTATUS WINAPI RtlGetExePath(PCWSTR,PWSTR*);
3603 NTSYSAPI TEB_ACTIVE_FRAME * WINAPI RtlGetFrame(void);
3604 NTSYSAPI ULONG WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*);
3605 NTSYSAPI NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
3606 NTSYSAPI NTSTATUS WINAPI RtlGetLastNtStatus(void);
3607 NTSYSAPI DWORD WINAPI RtlGetLastWin32Error(void);
3608 NTSYSAPI DWORD WINAPI RtlGetLongestNtPathLength(void);
3609 NTSYSAPI ULONG WINAPI RtlGetNtGlobalFlags(void);
3610 NTSYSAPI BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
3611 NTSYSAPI NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
3612 NTSYSAPI ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
3613 NTSYSAPI NTSTATUS WINAPI RtlGetProcessPreferredUILanguages(DWORD,ULONG*,WCHAR*,ULONG*);
3614 NTSYSAPI NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
3615 NTSYSAPI NTSTATUS WINAPI RtlGetSearchPath(PWSTR*);
3616 NTSYSAPI NTSTATUS WINAPI RtlGetSystemPreferredUILanguages(DWORD,ULONG,ULONG*,WCHAR*,ULONG*);
3617 NTSYSAPI LONGLONG WINAPI RtlGetSystemTimePrecise(void);
3618 NTSYSAPI DWORD WINAPI RtlGetThreadErrorMode(void);
3619 NTSYSAPI NTSTATUS WINAPI RtlGetThreadPreferredUILanguages(DWORD,ULONG*,WCHAR*,ULONG*);
3620 NTSYSAPI NTSTATUS WINAPI RtlGetUserPreferredUILanguages(DWORD,ULONG,ULONG*,WCHAR*,ULONG*);
3621 NTSYSAPI NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
3622 NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING,GUID*);
3623 NTSYSAPI PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
3624 NTSYSAPI NTSTATUS WINAPI RtlIdnToAscii(DWORD,const WCHAR*,INT,WCHAR*,INT*);
3625 NTSYSAPI NTSTATUS WINAPI RtlIdnToNameprepUnicode(DWORD,const WCHAR*,INT,WCHAR*,INT*);
3626 NTSYSAPI NTSTATUS WINAPI RtlIdnToUnicode(DWORD,const WCHAR*,INT,WCHAR*,INT*);
3627 NTSYSAPI PVOID WINAPI RtlImageDirectoryEntryToData(HMODULE,BOOL,WORD,ULONG *);
3628 NTSYSAPI PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE);
3629 NTSYSAPI PIMAGE_SECTION_HEADER WINAPI RtlImageRvaToSection(const IMAGE_NT_HEADERS *,HMODULE,DWORD);
3630 NTSYSAPI PVOID WINAPI RtlImageRvaToVa(const IMAGE_NT_HEADERS *,HMODULE,DWORD,IMAGE_SECTION_HEADER **);
3631 NTSYSAPI NTSTATUS WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
3632 NTSYSAPI void WINAPI RtlInitString(PSTRING,PCSZ);
3633 NTSYSAPI void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
3634 NTSYSAPI NTSTATUS WINAPI RtlInitAnsiStringEx(PANSI_STRING,PCSZ);
3635 NTSYSAPI void WINAPI RtlInitCodePageTable(USHORT*,CPTABLEINFO*);
3636 NTSYSAPI void WINAPI RtlInitNlsTables(USHORT*,USHORT*,USHORT*,NLSTABLEINFO*);
3637 NTSYSAPI void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
3638 NTSYSAPI NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
3639 NTSYSAPI void WINAPI RtlInitializeBitMap(PRTL_BITMAP,PULONG,ULONG);
3640 NTSYSAPI void WINAPI RtlInitializeConditionVariable(RTL_CONDITION_VARIABLE *);
3641 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
3642 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,ULONG);
3643 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSectionEx(RTL_CRITICAL_SECTION *,ULONG,ULONG);
3644 NTSYSAPI void WINAPI RtlInitializeHandleTable(ULONG,ULONG,RTL_HANDLE_TABLE *);
3645 NTSYSAPI void WINAPI RtlInitializeResource(LPRTL_RWLOCK);
3646 NTSYSAPI void WINAPI RtlInitializeSRWLock(RTL_SRWLOCK*);
3647 NTSYSAPI BOOL WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
3648 NTSYSAPI NTSTATUS WINAPI RtlInt64ToUnicodeString(ULONGLONG,ULONG,UNICODE_STRING *);
3649 NTSYSAPI NTSTATUS WINAPI RtlIntegerToChar(ULONG,ULONG,ULONG,PCHAR);
3650 NTSYSAPI NTSTATUS WINAPI RtlIntegerToUnicodeString(ULONG,ULONG,UNICODE_STRING *);
3651 NTSYSAPI BOOLEAN WINAPI RtlIsActivationContextActive(HANDLE);
3652 NTSYSAPI BOOL WINAPI RtlIsCriticalSectionLocked(RTL_CRITICAL_SECTION *);
3653 NTSYSAPI BOOL WINAPI RtlIsCriticalSectionLockedByThread(RTL_CRITICAL_SECTION *);
3654 NTSYSAPI ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR);
3655 NTSYSAPI BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN);
3656 NTSYSAPI NTSTATUS WINAPI RtlIsNormalizedString(ULONG,const WCHAR*,INT,BOOLEAN*);
3657 NTSYSAPI BOOLEAN WINAPI RtlIsProcessorFeaturePresent(UINT);
3658 NTSYSAPI BOOLEAN WINAPI RtlIsTextUnicode(LPCVOID,INT,INT *);
3659 NTSYSAPI BOOLEAN WINAPI RtlIsValidHandle(const RTL_HANDLE_TABLE *, const RTL_HANDLE *);
3660 NTSYSAPI BOOLEAN WINAPI RtlIsValidIndexHandle(const RTL_HANDLE_TABLE *, ULONG Index, RTL_HANDLE **);
3661 NTSYSAPI NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *);
3662 NTSYSAPI DWORD WINAPI RtlLengthRequiredSid(DWORD);
3663 NTSYSAPI ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR);
3664 NTSYSAPI DWORD WINAPI RtlLengthSid(PSID);
3665 NTSYSAPI NTSTATUS WINAPI RtlLocalTimeToSystemTime(const LARGE_INTEGER*,PLARGE_INTEGER);
3666 NTSYSAPI NTSTATUS WINAPI RtlLocaleNameToLcid(const WCHAR*,LCID*,ULONG);
3667 NTSYSAPI BOOLEAN WINAPI RtlLockHeap(HANDLE);
3668 NTSYSAPI NTSTATUS WINAPI RtlLookupAtomInAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
3669 NTSYSAPI NTSTATUS WINAPI RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
3670 NTSYSAPI void WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*);
3671 NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
3672 NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
3673 NTSYSAPI NTSTATUS WINAPI RtlNewSecurityObject(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,BOOLEAN,HANDLE,PGENERIC_MAPPING);
3674 NTSYSAPI PRTL_USER_PROCESS_PARAMETERS WINAPI RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
3675 NTSYSAPI NTSTATUS WINAPI RtlNormalizeString(ULONG,const WCHAR*,INT,WCHAR*,INT*);
3676 NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS);
3677 NTSYSAPI ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS);
3678 NTSYSAPI ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP);
3679 NTSYSAPI ULONG WINAPI RtlNumberOfClearBits(PCRTL_BITMAP);
3680 NTSYSAPI UINT WINAPI RtlOemStringToUnicodeSize(const STRING*);
3681 NTSYSAPI NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
3682 NTSYSAPI NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
3683 NTSYSAPI NTSTATUS WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHANDLE);
3684 NTSYSAPI PVOID WINAPI RtlPcToFileHeader(PVOID,PVOID*);
3685 NTSYSAPI NTSTATUS WINAPI RtlPinAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
3686 NTSYSAPI void WINAPI RtlPopFrame(TEB_ACTIVE_FRAME*);
3687 NTSYSAPI BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
3688 NTSYSAPI BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
3689 NTSYSAPI void WINAPI RtlProcessFlsData(void*,ULONG);
3690 NTSYSAPI void WINAPI RtlPushFrame(TEB_ACTIVE_FRAME*);
3691 NTSYSAPI NTSTATUS WINAPI RtlQueryActivationContextApplicationSettings(DWORD,HANDLE,const WCHAR*,const WCHAR*,WCHAR*,SIZE_T,SIZE_T*);
3692 NTSYSAPI NTSTATUS WINAPI RtlQueryAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM,ULONG*,ULONG*,WCHAR*,ULONG*);
3693 NTSYSAPI NTSTATUS WINAPI RtlQueryDynamicTimeZoneInformation(RTL_DYNAMIC_TIME_ZONE_INFORMATION*);
3694 NTSYSAPI NTSTATUS WINAPI RtlQueryEnvironmentVariable(WCHAR*,const WCHAR*,SIZE_T,WCHAR*,SIZE_T,SIZE_T*);
3695 NTSYSAPI NTSTATUS WINAPI RtlQueryEnvironmentVariable_U(PWSTR,PUNICODE_STRING,PUNICODE_STRING);
3696 NTSYSAPI NTSTATUS WINAPI RtlQueryHeapInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T,PSIZE_T);
3697 NTSYSAPI NTSTATUS WINAPI RtlQueryInformationAcl(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
3698 NTSYSAPI NTSTATUS WINAPI RtlQueryInformationActivationContext(ULONG,HANDLE,PVOID,ULONG,PVOID,SIZE_T,SIZE_T*);
3699 NTSYSAPI BOOL WINAPI RtlQueryPerformanceCounter(LARGE_INTEGER*);
3700 NTSYSAPI BOOL WINAPI RtlQueryPerformanceFrequency(LARGE_INTEGER*);
3701 NTSYSAPI NTSTATUS WINAPI RtlQueryProcessDebugInformation(ULONG,ULONG,PDEBUG_BUFFER);
3702 NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID);
3703 NTSYSAPI NTSTATUS WINAPI RtlQueryTimeZoneInformation(RTL_TIME_ZONE_INFORMATION*);
3704 NTSYSAPI BOOL WINAPI RtlQueryUnbiasedInterruptTime(ULONGLONG*);
3705 NTSYSAPI NTSTATUS WINAPI RtlQueueWorkItem(PRTL_WORK_ITEM_ROUTINE,PVOID,ULONG);
3706 NTSYSAPI void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
3707 NTSYSAPI void WINAPI RtlRaiseStatus(NTSTATUS);
3708 NTSYSAPI ULONG WINAPI RtlRandom(PULONG);
3709 NTSYSAPI PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,SIZE_T);
3710 NTSYSAPI NTSTATUS WINAPI RtlRegisterWait(PHANDLE,HANDLE,RTL_WAITORTIMERCALLBACKFUNC,PVOID,ULONG,ULONG);
3711 NTSYSAPI void WINAPI RtlReleaseActivationContext(HANDLE);
3712 NTSYSAPI void WINAPI RtlReleasePath(PWSTR);
3713 NTSYSAPI void WINAPI RtlReleasePebLock(void);
3714 NTSYSAPI void WINAPI RtlReleaseResource(LPRTL_RWLOCK);
3715 NTSYSAPI void WINAPI RtlReleaseSRWLockExclusive(RTL_SRWLOCK*);
3716 NTSYSAPI void WINAPI RtlReleaseSRWLockShared(RTL_SRWLOCK*);
3717 NTSYSAPI ULONG WINAPI RtlRemoveVectoredExceptionHandler(PVOID);
3718 NTSYSAPI void WINAPI RtlResetRtlTranslations(const NLSTABLEINFO*);
3719 NTSYSAPI void WINAPI RtlRestoreLastWin32Error(DWORD);
3720 NTSYSAPI void WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *);
3721 NTSYSAPI void WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *);
3722 NTSYSAPI NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD);
3723 NTSYSAPI void WINAPI RtlSetAllBits(PRTL_BITMAP);
3724 NTSYSAPI void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG);
3725 NTSYSAPI ULONG WINAPI RtlSetCriticalSectionSpinCount(RTL_CRITICAL_SECTION*,ULONG);
3726 NTSYSAPI NTSTATUS WINAPI RtlSetControlSecurityDescriptor(PSECURITY_DESCRIPTOR,SECURITY_DESCRIPTOR_CONTROL,SECURITY_DESCRIPTOR_CONTROL);
3727 NTSYSAPI NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING*);
3728 NTSYSAPI void WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*);
3729 NTSYSAPI NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
3730 NTSYSAPI NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR*,PUNICODE_STRING,PUNICODE_STRING);
3731 NTSYSAPI NTSTATUS WINAPI RtlSetHeapInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T);
3732 NTSYSAPI NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
3733 NTSYSAPI NTSTATUS WINAPI RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
3734 NTSYSAPI NTSTATUS WINAPI RtlSetIoCompletionCallback(HANDLE,PRTL_OVERLAPPED_COMPLETION_ROUTINE,ULONG);
3735 NTSYSAPI void WINAPI RtlSetLastWin32Error(DWORD);
3736 NTSYSAPI void WINAPI RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS);
3737 NTSYSAPI NTSTATUS WINAPI RtlSetProcessPreferredUILanguages(DWORD,PCZZWSTR,ULONG*);
3738 NTSYSAPI NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
3739 NTSYSAPI NTSTATUS WINAPI RtlSetSearchPathMode(ULONG);
3740 NTSYSAPI NTSTATUS WINAPI RtlSetThreadErrorMode(DWORD,LPDWORD);
3741 NTSYSAPI NTSTATUS WINAPI RtlSetThreadPreferredUILanguages(DWORD,PCZZWSTR,ULONG*);
3742 NTSYSAPI NTSTATUS WINAPI RtlSetTimeZoneInformation(const RTL_TIME_ZONE_INFORMATION*);
3743 NTSYSAPI void WINAPI RtlSetUnhandledExceptionFilter(PRTL_EXCEPTION_FILTER);
3744 NTSYSAPI SIZE_T WINAPI RtlSizeHeap(HANDLE,ULONG,const void*);
3745 NTSYSAPI NTSTATUS WINAPI RtlSleepConditionVariableCS(RTL_CONDITION_VARIABLE*,RTL_CRITICAL_SECTION*,const LARGE_INTEGER*);
3746 NTSYSAPI NTSTATUS WINAPI RtlSleepConditionVariableSRW(RTL_CONDITION_VARIABLE*,RTL_SRWLOCK*,const LARGE_INTEGER*,ULONG);
3747 NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID,PUNICODE_STRING);
3748 NTSYSAPI LPDWORD WINAPI RtlSubAuthoritySid(PSID,DWORD);
3749 NTSYSAPI LPBYTE WINAPI RtlSubAuthorityCountSid(PSID);
3750 NTSYSAPI NTSTATUS WINAPI RtlSystemTimeToLocalTime(const LARGE_INTEGER*,PLARGE_INTEGER);
3751 NTSYSAPI void WINAPI RtlTimeToTimeFields(const LARGE_INTEGER*,PTIME_FIELDS);
3752 NTSYSAPI BOOLEAN WINAPI RtlTimeFieldsToTime(PTIME_FIELDS,PLARGE_INTEGER);
3753 NTSYSAPI void WINAPI RtlTimeToElapsedTimeFields(const LARGE_INTEGER *,PTIME_FIELDS);
3754 NTSYSAPI BOOLEAN WINAPI RtlTimeToSecondsSince1970(const LARGE_INTEGER *,LPDWORD);
3755 NTSYSAPI BOOLEAN WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *,LPDWORD);
3756 NTSYSAPI BOOLEAN WINAPI RtlTryAcquireSRWLockExclusive(RTL_SRWLOCK *);
3757 NTSYSAPI BOOLEAN WINAPI RtlTryAcquireSRWLockShared(RTL_SRWLOCK *);
3758 NTSYSAPI BOOL WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *);
3759 NTSYSAPI NTSTATUS WINAPI RtlUTF8ToUnicodeN(WCHAR*,DWORD,DWORD*,const char*,DWORD);
3760 NTSYSAPI ULONGLONG __cdecl RtlUlonglongByteSwap(ULONGLONG);
3761 NTSYSAPI DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
3762 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING,PCUNICODE_STRING,BOOLEAN);
3763 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToInteger(const UNICODE_STRING *,ULONG,ULONG *);
3764 NTSYSAPI DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
3765 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToOemString(POEM_STRING,PCUNICODE_STRING,BOOLEAN);
3766 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToCustomCPN(CPTABLEINFO*,char*,DWORD,DWORD*,const WCHAR*,DWORD);
3767 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
3768 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToMultiByteSize(PULONG,PCWSTR,ULONG);
3769 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
3770 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToUTF8N(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
3771 NTSYSAPI ULONG WINAPI RtlUniform(PULONG);
3772 NTSYSAPI BOOLEAN WINAPI RtlUnlockHeap(HANDLE);
3773 NTSYSAPI void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID);
3774 #ifdef __x86_64__
3775 NTSYSAPI void WINAPI RtlUnwindEx(PVOID,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
3776 #elif defined(__ia64__)
3777 NTSYSAPI void WINAPI RtlUnwind2(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT);
3778 NTSYSAPI void WINAPI RtlUnwindEx(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
3779 #endif
3780 NTSYSAPI WCHAR WINAPI RtlUpcaseUnicodeChar(WCHAR);
3781 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
3782 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
3783 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
3784 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
3785 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeToCustomCPN(CPTABLEINFO*,char*,DWORD,DWORD*,const WCHAR*,DWORD);
3786 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
3787 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
3788 NTSYSAPI NTSTATUS WINAPI RtlUpdateTimer(HANDLE, HANDLE, DWORD, DWORD);
3789 NTSYSAPI CHAR WINAPI RtlUpperChar(CHAR);
3790 NTSYSAPI void WINAPI RtlUpperString(STRING *,const STRING *);
3791 NTSYSAPI void WINAPI RtlUserThreadStart(PRTL_THREAD_START_ROUTINE,void*);
3792 NTSYSAPI NTSTATUS WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
3793 NTSYSAPI BOOLEAN WINAPI RtlValidRelativeSecurityDescriptor(PSECURITY_DESCRIPTOR,ULONG,SECURITY_INFORMATION);
3794 NTSYSAPI BOOLEAN WINAPI RtlValidAcl(PACL);
3795 NTSYSAPI BOOLEAN WINAPI RtlValidSid(PSID);
3796 NTSYSAPI BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
3797 NTSYSAPI NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
3798 NTSYSAPI NTSTATUS WINAPI RtlWaitOnAddress(const void *,const void *,SIZE_T,const LARGE_INTEGER *);
3799 NTSYSAPI void WINAPI RtlWakeAddressAll(const void *);
3800 NTSYSAPI void WINAPI RtlWakeAddressSingle(const void *);
3801 NTSYSAPI void WINAPI RtlWakeAllConditionVariable(RTL_CONDITION_VARIABLE *);
3802 NTSYSAPI void WINAPI RtlWakeConditionVariable(RTL_CONDITION_VARIABLE *);
3803 NTSYSAPI NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
3804 NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirection(BOOLEAN);
3805 NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx(ULONG,ULONG*);
3806 #ifdef __x86_64__
3807 NTSYSAPI NTSTATUS WINAPI RtlWow64GetThreadContext(HANDLE, WOW64_CONTEXT *);
3808 NTSYSAPI NTSTATUS WINAPI RtlWow64SetThreadContext(HANDLE, const WOW64_CONTEXT *);
3809 #endif
3810 NTSYSAPI NTSTATUS WINAPI RtlWriteRegistryValue(ULONG,PCWSTR,PCWSTR,ULONG,PVOID,ULONG);
3811 NTSYSAPI NTSTATUS WINAPI RtlZombifyActivationContext(HANDLE);
3812 NTSYSAPI NTSTATUS WINAPI RtlpNtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
3813 NTSYSAPI NTSTATUS WINAPI RtlpNtEnumerateSubKey(HANDLE,UNICODE_STRING *, ULONG);
3814 NTSYSAPI NTSTATUS WINAPI RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION *);
3815 NTSYSAPI NTSTATUS WINAPI RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION *);
3816 NTSYSAPI NTSTATUS WINAPI vDbgPrintEx(ULONG,ULONG,LPCSTR,__ms_va_list);
3817 NTSYSAPI NTSTATUS WINAPI vDbgPrintExWithPrefix(LPCSTR,ULONG,ULONG,LPCSTR,__ms_va_list);
3819 #if defined(__x86_64__) || defined(__i386__)
3820 NTSYSAPI NTSTATUS WINAPI RtlCopyExtendedContext(CONTEXT_EX*,ULONG,CONTEXT_EX*);
3821 NTSYSAPI NTSTATUS WINAPI RtlInitializeExtendedContext(void*,ULONG,CONTEXT_EX**);
3822 NTSYSAPI NTSTATUS WINAPI RtlInitializeExtendedContext2(void*,ULONG,CONTEXT_EX**,ULONG64);
3823 NTSYSAPI ULONG64 WINAPI RtlGetEnabledExtendedFeatures(ULONG64);
3824 NTSYSAPI NTSTATUS WINAPI RtlGetExtendedContextLength(ULONG,ULONG*);
3825 NTSYSAPI NTSTATUS WINAPI RtlGetExtendedContextLength2(ULONG,ULONG*,ULONG64);
3826 NTSYSAPI void * WINAPI RtlLocateLegacyContext(CONTEXT_EX*,ULONG*);
3827 NTSYSAPI void * WINAPI RtlLocateExtendedFeature(CONTEXT_EX*,ULONG,ULONG*);
3828 NTSYSAPI void * WINAPI RtlLocateExtendedFeature2(CONTEXT_EX*,ULONG,XSTATE_CONFIGURATION*,ULONG*);
3829 NTSYSAPI ULONG64 WINAPI RtlGetExtendedFeaturesMask(CONTEXT_EX*);
3830 NTSYSAPI void WINAPI RtlSetExtendedFeaturesMask(CONTEXT_EX*,ULONG64);
3831 #endif
3833 #ifndef __WINE_USE_MSVCRT
3834 NTSYSAPI int __cdecl _strnicmp(LPCSTR,LPCSTR,size_t);
3835 #endif
3837 /* 32-bit only functions */
3839 #ifndef _WIN64
3840 NTSYSAPI LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
3841 NTSYSAPI ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
3842 NTSYSAPI LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
3843 NTSYSAPI ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
3844 NTSYSAPI UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
3845 NTSYSAPI LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
3846 NTSYSAPI LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
3847 NTSYSAPI LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
3848 NTSYSAPI LONGLONG WINAPI RtlInterlockedCompareExchange64(LONGLONG*,LONGLONG,LONGLONG);
3849 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
3850 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
3851 NTSYSAPI ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
3852 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerNegate(LONGLONG);
3853 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
3854 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
3855 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
3856 NTSYSAPI NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
3857 #endif
3859 /* Threadpool functions */
3861 NTSYSAPI NTSTATUS WINAPI TpAllocCleanupGroup(TP_CLEANUP_GROUP **);
3862 NTSYSAPI NTSTATUS WINAPI TpAllocIoCompletion(TP_IO **,HANDLE,PTP_IO_CALLBACK,void *,TP_CALLBACK_ENVIRON *);
3863 NTSYSAPI NTSTATUS WINAPI TpAllocPool(TP_POOL **,PVOID);
3864 NTSYSAPI NTSTATUS WINAPI TpAllocTimer(TP_TIMER **,PTP_TIMER_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
3865 NTSYSAPI NTSTATUS WINAPI TpAllocWait(TP_WAIT **,PTP_WAIT_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
3866 NTSYSAPI NTSTATUS WINAPI TpAllocWork(TP_WORK **,PTP_WORK_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
3867 NTSYSAPI void WINAPI TpCallbackLeaveCriticalSectionOnCompletion(TP_CALLBACK_INSTANCE *,RTL_CRITICAL_SECTION *);
3868 NTSYSAPI NTSTATUS WINAPI TpCallbackMayRunLong(TP_CALLBACK_INSTANCE *);
3869 NTSYSAPI void WINAPI TpCallbackReleaseMutexOnCompletion(TP_CALLBACK_INSTANCE *,HANDLE);
3870 NTSYSAPI void WINAPI TpCallbackReleaseSemaphoreOnCompletion(TP_CALLBACK_INSTANCE *,HANDLE,DWORD);
3871 NTSYSAPI void WINAPI TpCallbackSetEventOnCompletion(TP_CALLBACK_INSTANCE *,HANDLE);
3872 NTSYSAPI void WINAPI TpCallbackUnloadDllOnCompletion(TP_CALLBACK_INSTANCE *,HMODULE);
3873 NTSYSAPI void WINAPI TpCancelAsyncIoOperation(TP_IO *);
3874 NTSYSAPI void WINAPI TpDisassociateCallback(TP_CALLBACK_INSTANCE *);
3875 NTSYSAPI BOOL WINAPI TpIsTimerSet(TP_TIMER *);
3876 NTSYSAPI void WINAPI TpPostWork(TP_WORK *);
3877 NTSYSAPI NTSTATUS WINAPI TpQueryPoolStackInformation(TP_POOL *, TP_POOL_STACK_INFORMATION *stack_info);
3878 NTSYSAPI void WINAPI TpReleaseCleanupGroup(TP_CLEANUP_GROUP *);
3879 NTSYSAPI void WINAPI TpReleaseCleanupGroupMembers(TP_CLEANUP_GROUP *,BOOL,PVOID);
3880 NTSYSAPI void WINAPI TpReleaseIoCompletion(TP_IO *);
3881 NTSYSAPI void WINAPI TpReleasePool(TP_POOL *);
3882 NTSYSAPI void WINAPI TpReleaseTimer(TP_TIMER *);
3883 NTSYSAPI void WINAPI TpReleaseWait(TP_WAIT *);
3884 NTSYSAPI void WINAPI TpReleaseWork(TP_WORK *);
3885 NTSYSAPI void WINAPI TpSetPoolMaxThreads(TP_POOL *,DWORD);
3886 NTSYSAPI BOOL WINAPI TpSetPoolMinThreads(TP_POOL *,DWORD);
3887 NTSYSAPI NTSTATUS WINAPI TpSetPoolStackInformation(TP_POOL *, TP_POOL_STACK_INFORMATION *stack_info);
3888 NTSYSAPI void WINAPI TpSetTimer(TP_TIMER *, LARGE_INTEGER *,LONG,LONG);
3889 NTSYSAPI void WINAPI TpSetWait(TP_WAIT *,HANDLE,LARGE_INTEGER *);
3890 NTSYSAPI NTSTATUS WINAPI TpSimpleTryPost(PTP_SIMPLE_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
3891 NTSYSAPI void WINAPI TpStartAsyncIoOperation(TP_IO *);
3892 NTSYSAPI void WINAPI TpWaitForIoCompletion(TP_IO *,BOOL);
3893 NTSYSAPI void WINAPI TpWaitForTimer(TP_TIMER *,BOOL);
3894 NTSYSAPI void WINAPI TpWaitForWait(TP_WAIT *,BOOL);
3895 NTSYSAPI void WINAPI TpWaitForWork(TP_WORK *,BOOL);
3897 /* Wine internal functions */
3899 NTSYSAPI NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, char *nameA, SIZE_T *size,
3900 UINT disposition );
3901 NTSYSAPI NTSTATUS CDECL wine_unix_to_nt_file_name( const char *name, WCHAR *buffer, SIZE_T *size );
3904 /***********************************************************************
3905 * Inline functions
3908 #define InitializeObjectAttributes(p,n,a,r,s) \
3909 do { \
3910 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
3911 (p)->RootDirectory = r; \
3912 (p)->Attributes = a; \
3913 (p)->ObjectName = n; \
3914 (p)->SecurityDescriptor = s; \
3915 (p)->SecurityQualityOfService = NULL; \
3916 } while (0)
3918 #define NtCurrentProcess() ((HANDLE)-1)
3920 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
3921 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
3922 #define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
3923 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
3924 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
3925 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
3926 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
3928 static inline BOOLEAN RtlCheckBit(PCRTL_BITMAP lpBits, ULONG ulBit)
3930 if (lpBits && ulBit < lpBits->SizeOfBitMap &&
3931 lpBits->Buffer[ulBit >> 5] & (1 << (ulBit & 31)))
3932 return TRUE;
3933 return FALSE;
3936 /* These are implemented as __fastcall, so we can't let Winelib apps link with them */
3937 static inline USHORT RtlUshortByteSwap(USHORT s)
3939 return (s >> 8) | (s << 8);
3941 static inline ULONG RtlUlongByteSwap(ULONG i)
3943 #if defined(__i386__) && defined(__GNUC__)
3944 ULONG ret;
3945 __asm__("bswap %0" : "=r" (ret) : "0" (i) );
3946 return ret;
3947 #else
3948 return ((ULONG)RtlUshortByteSwap((USHORT)i) << 16) | RtlUshortByteSwap((USHORT)(i >> 16));
3949 #endif
3952 /* list manipulation macros */
3953 #define InitializeListHead(le) (void)((le)->Flink = (le)->Blink = (le))
3954 #define InsertHeadList(le,e) do { PLIST_ENTRY f = (le)->Flink; (e)->Flink = f; (e)->Blink = (le); f->Blink = (e); (le)->Flink = (e); } while (0)
3955 #define InsertTailList(le,e) do { PLIST_ENTRY b = (le)->Blink; (e)->Flink = (le); (e)->Blink = b; b->Flink = (e); (le)->Blink = (e); } while (0)
3956 #define IsListEmpty(le) ((le)->Flink == (le))
3957 #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)
3958 static inline PLIST_ENTRY RemoveHeadList(PLIST_ENTRY le)
3960 PLIST_ENTRY f, b, e;
3962 e = le->Flink;
3963 f = le->Flink->Flink;
3964 b = le->Flink->Blink;
3965 f->Blink = b;
3966 b->Flink = f;
3968 if (e != le) e->Flink = e->Blink = NULL;
3969 return e;
3971 static inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le)
3973 PLIST_ENTRY f, b, e;
3975 e = le->Blink;
3976 f = le->Blink->Flink;
3977 b = le->Blink->Blink;
3978 f->Blink = b;
3979 b->Flink = f;
3981 if (e != le) e->Flink = e->Blink = NULL;
3982 return e;
3986 #ifdef __WINESRC__
3988 /* Wine internal functions */
3989 extern NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out );
3991 /* The thread information for 16-bit threads */
3992 /* NtCurrentTeb()->SubSystemTib points to this */
3993 typedef struct
3995 void *unknown; /* 00 unknown */
3996 UNICODE_STRING *exe_name; /* 04 exe module name */
3998 /* the following fields do not exist under Windows */
3999 UNICODE_STRING exe_str; /* exe name string pointed to by exe_name */
4000 CURDIR curdir; /* current directory */
4001 WCHAR curdir_buffer[MAX_PATH];
4002 } WIN16_SUBSYSTEM_TIB;
4004 #endif /* __WINESRC__ */
4006 #ifdef __cplusplus
4007 } /* extern "C" */
4008 #endif /* defined(__cplusplus) */
4010 #endif /* __WINE_WINTERNL_H */