[INCLUDE/WINE] Update winternl.h. CORE-10912
[reactos.git] / reactos / include / reactos / wine / winternl.h
1 /*
2 * Internal NT APIs and data structures
3 *
4 * Copyright (C) the Wine project
5 *
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.
10 *
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.
15 *
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
19 */
20
21 #ifndef __WINE_WINTERNL_H
22 #define __WINE_WINTERNL_H
23
24 #ifndef __REACTOS__
25 #include <ntdef.h>
26 #endif /* __REACTOS__ */
27 #include <windef.h>
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif /* defined(__cplusplus) */
32
33 #ifdef __REACTOS__
34 typedef enum _TIMER_TYPE {
35 NotificationTimer,
36 SynchronizationTimer
37 } TIMER_TYPE;
38 typedef enum _EVENT_TYPE {
39 NotificationEvent,
40 SynchronizationEvent
41 } EVENT_TYPE, *PEVENT_TYPE;
42 #define FSCTL_PIPE_LISTEN CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
43 #endif /* __REACTOS__ */
44
45 /**********************************************************************
46 * Fundamental types and data structures
47 */
48
49 #ifndef WINE_NTSTATUS_DECLARED
50 #define WINE_NTSTATUS_DECLARED
51 typedef LONG NTSTATUS;
52 #ifdef __REACTOS__
53 typedef NTSTATUS *PNTSTATUS;
54 #endif /* __REACTOS__ */
55 #endif
56
57 typedef const char *PCSZ;
58
59 typedef short CSHORT;
60 typedef CSHORT *PCSHORT;
61
62 #ifndef __STRING_DEFINED__
63 #define __STRING_DEFINED__
64 typedef struct _STRING {
65 USHORT Length;
66 USHORT MaximumLength;
67 PCHAR Buffer;
68 } STRING, *PSTRING;
69 #endif
70
71 typedef STRING ANSI_STRING;
72 typedef PSTRING PANSI_STRING;
73 typedef const STRING *PCANSI_STRING;
74
75 typedef STRING OEM_STRING;
76 typedef PSTRING POEM_STRING;
77 typedef const STRING *PCOEM_STRING;
78
79 #ifndef __UNICODE_STRING_DEFINED__
80 #define __UNICODE_STRING_DEFINED__
81 typedef struct _UNICODE_STRING {
82 USHORT Length; /* bytes */
83 USHORT MaximumLength; /* bytes */
84 PWSTR Buffer;
85 } UNICODE_STRING, *PUNICODE_STRING;
86 #endif
87
88 typedef const UNICODE_STRING *PCUNICODE_STRING;
89
90 #ifndef _FILETIME_
91 #define _FILETIME_
92 /* 64 bit number of 100 nanoseconds intervals since January 1, 1601 */
93 typedef struct _FILETIME
94 {
95 #ifdef WORDS_BIGENDIAN
96 DWORD dwHighDateTime;
97 DWORD dwLowDateTime;
98 #else
99 DWORD dwLowDateTime;
100 DWORD dwHighDateTime;
101 #endif
102 } FILETIME, *PFILETIME, *LPFILETIME;
103 #endif /* _FILETIME_ */
104
105 /*
106 * RTL_SYSTEM_TIME and RTL_TIME_ZONE_INFORMATION are the same as
107 * the SYSTEMTIME and TIME_ZONE_INFORMATION structures defined
108 * in winbase.h, however we need to define them separately so
109 * winternl.h doesn't depend on winbase.h. They are used by
110 * RtlQueryTimeZoneInformation and RtlSetTimeZoneInformation.
111 * The names are guessed; if anybody knows the real names, let me know.
112 */
113 typedef struct _RTL_SYSTEM_TIME {
114 WORD wYear;
115 WORD wMonth;
116 WORD wDayOfWeek;
117 WORD wDay;
118 WORD wHour;
119 WORD wMinute;
120 WORD wSecond;
121 WORD wMilliseconds;
122 } RTL_SYSTEM_TIME, *PRTL_SYSTEM_TIME;
123
124 typedef struct _RTL_TIME_ZONE_INFORMATION {
125 LONG Bias;
126 WCHAR StandardName[32];
127 RTL_SYSTEM_TIME StandardDate;
128 LONG StandardBias;
129 WCHAR DaylightName[32];
130 RTL_SYSTEM_TIME DaylightDate;
131 LONG DaylightBias;
132 } RTL_TIME_ZONE_INFORMATION, *PRTL_TIME_ZONE_INFORMATION;
133
134 typedef struct _RTL_TIME_DYNAMIC_ZONE_INFORMATION
135 {
136 LONG Bias;
137 WCHAR StandardName[32];
138 RTL_SYSTEM_TIME StandardDate;
139 LONG StandardBias;
140 WCHAR DaylightName[32];
141 RTL_SYSTEM_TIME DaylightDate;
142 LONG DaylightBias;
143 WCHAR TimeZoneKeyName[128];
144 BOOLEAN DynamicDaylightTimeDisabled;
145 } RTL_DYNAMIC_TIME_ZONE_INFORMATION, *PRTL_DYNAMIC_TIME_ZONE_INFORMATION;
146
147 typedef struct _CLIENT_ID
148 {
149 HANDLE UniqueProcess;
150 HANDLE UniqueThread;
151 } CLIENT_ID, *PCLIENT_ID;
152
153 typedef struct _CURDIR
154 {
155 UNICODE_STRING DosPath;
156 PVOID Handle;
157 } CURDIR, *PCURDIR;
158
159 typedef struct RTL_DRIVE_LETTER_CURDIR
160 {
161 USHORT Flags;
162 USHORT Length;
163 ULONG TimeStamp;
164 UNICODE_STRING DosPath;
165 } RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
166
167 typedef struct tagRTL_BITMAP {
168 ULONG SizeOfBitMap; /* Number of bits in the bitmap */
169 PULONG Buffer; /* Bitmap data, assumed sized to a DWORD boundary */
170 } RTL_BITMAP, *PRTL_BITMAP;
171
172 typedef const RTL_BITMAP *PCRTL_BITMAP;
173
174 typedef struct tagRTL_BITMAP_RUN {
175 ULONG StartingIndex; /* Bit position at which run starts */
176 ULONG NumberOfBits; /* Size of the run in bits */
177 } RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
178
179 typedef const RTL_BITMAP_RUN *PCRTL_BITMAP_RUN;
180
181 typedef struct _RTL_USER_PROCESS_PARAMETERS
182 {
183 ULONG AllocationSize;
184 ULONG Size;
185 ULONG Flags;
186 ULONG DebugFlags;
187 HANDLE ConsoleHandle;
188 ULONG ConsoleFlags;
189 HANDLE hStdInput;
190 HANDLE hStdOutput;
191 HANDLE hStdError;
192 CURDIR CurrentDirectory;
193 UNICODE_STRING DllPath;
194 UNICODE_STRING ImagePathName;
195 UNICODE_STRING CommandLine;
196 PWSTR Environment;
197 ULONG dwX;
198 ULONG dwY;
199 ULONG dwXSize;
200 ULONG dwYSize;
201 ULONG dwXCountChars;
202 ULONG dwYCountChars;
203 ULONG dwFillAttribute;
204 ULONG dwFlags;
205 ULONG wShowWindow;
206 UNICODE_STRING WindowTitle;
207 UNICODE_STRING Desktop;
208 UNICODE_STRING ShellInfo;
209 UNICODE_STRING RuntimeInfo;
210 RTL_DRIVE_LETTER_CURDIR DLCurrentDirectory[0x20];
211 } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
212
213 /* value for Flags field (FIXME: not the correct name) */
214 #define PROCESS_PARAMS_FLAG_NORMALIZED 1
215
216 typedef struct _PEB_LDR_DATA
217 {
218 ULONG Length;
219 BOOLEAN Initialized;
220 PVOID SsHandle;
221 LIST_ENTRY InLoadOrderModuleList;
222 LIST_ENTRY InMemoryOrderModuleList;
223 LIST_ENTRY InInitializationOrderModuleList;
224 PVOID EntryInProgress;
225 } PEB_LDR_DATA, *PPEB_LDR_DATA;
226
227 typedef struct _GDI_TEB_BATCH
228 {
229 ULONG Offset;
230 HANDLE HDC;
231 ULONG Buffer[0x136];
232 } GDI_TEB_BATCH;
233
234 typedef struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME
235 {
236 struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME *Previous;
237 struct _ACTIVATION_CONTEXT *ActivationContext;
238 ULONG Flags;
239 } RTL_ACTIVATION_CONTEXT_STACK_FRAME, *PRTL_ACTIVATION_CONTEXT_STACK_FRAME;
240
241 typedef struct _ACTIVATION_CONTEXT_STACK
242 {
243 ULONG Flags;
244 ULONG NextCookieSequenceNumber;
245 RTL_ACTIVATION_CONTEXT_STACK_FRAME *ActiveFrame;
246 LIST_ENTRY FrameListCache;
247 } ACTIVATION_CONTEXT_STACK, *PACTIVATION_CONTEXT_STACK;
248
249 /***********************************************************************
250 * PEB data structure
251 */
252 typedef struct _PEB
253 { /* win32/win64 */
254 BOOLEAN InheritedAddressSpace; /* 000/000 */
255 BOOLEAN ReadImageFileExecOptions; /* 001/001 */
256 BOOLEAN BeingDebugged; /* 002/002 */
257 BOOLEAN SpareBool; /* 003/003 */
258 HANDLE Mutant; /* 004/008 */
259 HMODULE ImageBaseAddress; /* 008/010 */
260 PPEB_LDR_DATA LdrData; /* 00c/018 */
261 RTL_USER_PROCESS_PARAMETERS *ProcessParameters; /* 010/020 */
262 PVOID SubSystemData; /* 014/028 */
263 HANDLE ProcessHeap; /* 018/030 */
264 PRTL_CRITICAL_SECTION FastPebLock; /* 01c/038 */
265 PVOID /*PPEBLOCKROUTINE*/ FastPebLockRoutine; /* 020/040 */
266 PVOID /*PPEBLOCKROUTINE*/ FastPebUnlockRoutine; /* 024/048 */
267 ULONG EnvironmentUpdateCount; /* 028/050 */
268 PVOID KernelCallbackTable; /* 02c/058 */
269 ULONG Reserved[2]; /* 030/060 */
270 PVOID /*PPEB_FREE_BLOCK*/ FreeList; /* 038/068 */
271 ULONG TlsExpansionCounter; /* 03c/070 */
272 PRTL_BITMAP TlsBitmap; /* 040/078 */
273 ULONG TlsBitmapBits[2]; /* 044/080 */
274 PVOID ReadOnlySharedMemoryBase; /* 04c/088 */
275 PVOID ReadOnlySharedMemoryHeap; /* 050/090 */
276 PVOID *ReadOnlyStaticServerData; /* 054/098 */
277 PVOID AnsiCodePageData; /* 058/0a0 */
278 PVOID OemCodePageData; /* 05c/0a8 */
279 PVOID UnicodeCaseTableData; /* 060/0b0 */
280 ULONG NumberOfProcessors; /* 064/0b8 */
281 ULONG NtGlobalFlag; /* 068/0bc */
282 LARGE_INTEGER CriticalSectionTimeout; /* 070/0c0 */
283 SIZE_T HeapSegmentReserve; /* 078/0c8 */
284 SIZE_T HeapSegmentCommit; /* 07c/0d0 */
285 SIZE_T HeapDeCommitTotalFreeThreshold; /* 080/0d8 */
286 SIZE_T HeapDeCommitFreeBlockThreshold; /* 084/0e0 */
287 ULONG NumberOfHeaps; /* 088/0e8 */
288 ULONG MaximumNumberOfHeaps; /* 08c/0ec */
289 PVOID *ProcessHeaps; /* 090/0f0 */
290 PVOID GdiSharedHandleTable; /* 094/0f8 */
291 PVOID ProcessStarterHelper; /* 098/100 */
292 PVOID GdiDCAttributeList; /* 09c/108 */
293 PVOID LoaderLock; /* 0a0/110 */
294 ULONG OSMajorVersion; /* 0a4/118 */
295 ULONG OSMinorVersion; /* 0a8/11c */
296 ULONG OSBuildNumber; /* 0ac/120 */
297 ULONG OSPlatformId; /* 0b0/124 */
298 ULONG ImageSubSystem; /* 0b4/128 */
299 ULONG ImageSubSystemMajorVersion; /* 0b8/12c */
300 ULONG ImageSubSystemMinorVersion; /* 0bc/130 */
301 ULONG ImageProcessAffinityMask; /* 0c0/134 */
302 HANDLE GdiHandleBuffer[28]; /* 0c4/138 */
303 ULONG unknown[6]; /* 134/218 */
304 PVOID PostProcessInitRoutine; /* 14c/230 */
305 PRTL_BITMAP TlsExpansionBitmap; /* 150/238 */
306 ULONG TlsExpansionBitmapBits[32]; /* 154/240 */
307 ULONG SessionId; /* 1d4/2c0 */
308 ULARGE_INTEGER AppCompatFlags; /* 1d8/2c8 */
309 ULARGE_INTEGER AppCompatFlagsUser; /* 1e0/2d0 */
310 PVOID ShimData; /* 1e8/2d8 */
311 PVOID AppCompatInfo; /* 1ec/2e0 */
312 UNICODE_STRING CSDVersion; /* 1f0/2e8 */
313 PVOID ActivationContextData; /* 1f8/2f8 */
314 PVOID ProcessAssemblyStorageMap; /* 1fc/300 */
315 PVOID SystemDefaultActivationData; /* 200/308 */
316 PVOID SystemAssemblyStorageMap; /* 204/310 */
317 SIZE_T MinimumStackCommit; /* 208/318 */
318 PVOID *FlsCallback; /* 20c/320 */
319 LIST_ENTRY FlsListHead; /* 210/328 */
320 PRTL_BITMAP FlsBitmap; /* 218/338 */
321 ULONG FlsBitmapBits[4]; /* 21c/340 */
322 } PEB, *PPEB;
323
324
325 /***********************************************************************
326 * TEB data structure
327 */
328 typedef struct _TEB
329 { /* win32/win64 */
330 NT_TIB Tib; /* 000/0000 */
331 PVOID EnvironmentPointer; /* 01c/0038 */
332 CLIENT_ID ClientId; /* 020/0040 */
333 PVOID ActiveRpcHandle; /* 028/0050 */
334 PVOID ThreadLocalStoragePointer; /* 02c/0058 */
335 PPEB Peb; /* 030/0060 */
336 ULONG LastErrorValue; /* 034/0068 */
337 ULONG CountOfOwnedCriticalSections; /* 038/006c */
338 PVOID CsrClientThread; /* 03c/0070 */
339 PVOID Win32ThreadInfo; /* 040/0078 */
340 ULONG Win32ClientInfo[31]; /* 044/0080 used for user32 private data in Wine */
341 PVOID WOW32Reserved; /* 0c0/0100 */
342 ULONG CurrentLocale; /* 0c4/0108 */
343 ULONG FpSoftwareStatusRegister; /* 0c8/010c */
344 PVOID SystemReserved1[54]; /* 0cc/0110 used for kernel32 private data in Wine */
345 LONG ExceptionCode; /* 1a4/02c0 */
346 ACTIVATION_CONTEXT_STACK ActivationContextStack; /* 1a8/02c8 */
347 BYTE SpareBytes1[24]; /* 1bc/02e8 used for ntdll private data in Wine */
348 PVOID SystemReserved2[10]; /* 1d4/0300 used for ntdll private data in Wine */
349 GDI_TEB_BATCH GdiTebBatch; /* 1fc/0350 used for vm86 private data in Wine */
350 HANDLE gdiRgn; /* 6dc/0838 */
351 HANDLE gdiPen; /* 6e0/0840 */
352 HANDLE gdiBrush; /* 6e4/0848 */
353 CLIENT_ID RealClientId; /* 6e8/0850 */
354 HANDLE GdiCachedProcessHandle; /* 6f0/0860 */
355 ULONG GdiClientPID; /* 6f4/0868 */
356 ULONG GdiClientTID; /* 6f8/086c */
357 PVOID GdiThreadLocaleInfo; /* 6fc/0870 */
358 ULONG UserReserved[5]; /* 700/0878 */
359 PVOID glDispachTable[280]; /* 714/0890 */
360 PVOID glReserved1[26]; /* b74/1150 */
361 PVOID glReserved2; /* bdc/1220 */
362 PVOID glSectionInfo; /* be0/1228 */
363 PVOID glSection; /* be4/1230 */
364 PVOID glTable; /* be8/1238 */
365 PVOID glCurrentRC; /* bec/1240 */
366 PVOID glContext; /* bf0/1248 */
367 ULONG LastStatusValue; /* bf4/1250 */
368 UNICODE_STRING StaticUnicodeString; /* bf8/1258 used by advapi32 */
369 WCHAR StaticUnicodeBuffer[261]; /* c00/1268 used by advapi32 */
370 PVOID DeallocationStack; /* e0c/1478 */
371 PVOID TlsSlots[64]; /* e10/1480 */
372 LIST_ENTRY TlsLinks; /* f10/1680 */
373 PVOID Vdm; /* f18/1690 */
374 PVOID ReservedForNtRpc; /* f1c/1698 */
375 PVOID DbgSsReserved[2]; /* f20/16a0 */
376 ULONG HardErrorDisabled; /* f28/16b0 */
377 PVOID Instrumentation[16]; /* f2c/16b8 */
378 PVOID WinSockData; /* f6c/1738 */
379 ULONG GdiBatchCount; /* f70/1740 */
380 ULONG Spare2; /* f74/1744 */
381 PVOID Spare3; /* f78/1748 */
382 PVOID Spare4; /* f7c/1750 */
383 PVOID ReservedForOle; /* f80/1758 */
384 ULONG WaitingOnLoaderLock; /* f84/1760 */
385 PVOID Reserved5[3]; /* f88/1768 used for wineserver shared memory */
386 PVOID *TlsExpansionSlots; /* f94/1780 */
387 ULONG ImpersonationLocale; /* f98/1788 */
388 ULONG IsImpersonating; /* f9c/178c */
389 PVOID NlsCache; /* fa0/1790 */
390 PVOID ShimData; /* fa4/1798 */
391 ULONG HeapVirtualAffinity; /* fa8/17a0 */
392 PVOID CurrentTransactionHandle; /* fac/17a8 */
393 PVOID ActiveFrame; /* fb0/17b0 */
394 #ifdef _WIN64
395 PVOID unknown[2]; /* 17b8 */
396 #endif
397 PVOID *FlsSlots; /* fb4/17c8 */
398 } TEB, *PTEB;
399
400 /***********************************************************************
401 * Enums
402 */
403
404 typedef enum _FILE_INFORMATION_CLASS {
405 FileDirectoryInformation = 1,
406 FileFullDirectoryInformation,
407 FileBothDirectoryInformation,
408 FileBasicInformation,
409 FileStandardInformation,
410 FileInternalInformation,
411 FileEaInformation,
412 FileAccessInformation,
413 FileNameInformation,
414 FileRenameInformation,
415 FileLinkInformation,
416 FileNamesInformation,
417 FileDispositionInformation,
418 FilePositionInformation,
419 FileFullEaInformation,
420 FileModeInformation,
421 FileAlignmentInformation,
422 FileAllInformation,
423 FileAllocationInformation,
424 FileEndOfFileInformation,
425 FileAlternateNameInformation,
426 FileStreamInformation,
427 FilePipeInformation,
428 FilePipeLocalInformation,
429 FilePipeRemoteInformation,
430 FileMailslotQueryInformation,
431 FileMailslotSetInformation,
432 FileCompressionInformation,
433 FileObjectIdInformation,
434 FileCompletionInformation,
435 FileMoveClusterInformation,
436 FileQuotaInformation,
437 FileReparsePointInformation,
438 FileNetworkOpenInformation,
439 FileAttributeTagInformation,
440 FileTrackingInformation,
441 FileIdBothDirectoryInformation,
442 FileIdFullDirectoryInformation,
443 FileValidDataLengthInformation,
444 FileShortNameInformation,
445 FileIoCompletionNotificationInformation,
446 FileIoStatusBlockRangeInformation,
447 FileIoPriorityHintInformation,
448 FileSfioReserveInformation,
449 FileSfioVolumeInformation,
450 FileHardLinkInformation,
451 FileProcessIdsUsingFileInformation,
452 FileNormalizedNameInformation,
453 FileNetworkPhysicalNameInformation,
454 FileIdGlobalTxDirectoryInformation,
455 FileIsRemoteDeviceInformation,
456 FileAttributeCacheInformation,
457 FileNumaNodeInformation,
458 FileStandardLinkInformation,
459 FileRemoteProtocolInformation,
460 FileReplaceCompletionInformation,
461 FileMaximumInformation
462 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
463
464 typedef struct _FILE_DIRECTORY_INFORMATION {
465 ULONG NextEntryOffset;
466 ULONG FileIndex;
467 LARGE_INTEGER CreationTime;
468 LARGE_INTEGER LastAccessTime;
469 LARGE_INTEGER LastWriteTime;
470 LARGE_INTEGER ChangeTime;
471 LARGE_INTEGER EndOfFile;
472 LARGE_INTEGER AllocationSize;
473 ULONG FileAttributes;
474 ULONG FileNameLength;
475 WCHAR FileName[ANYSIZE_ARRAY];
476 } FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
477
478 typedef struct _FILE_FULL_DIRECTORY_INFORMATION {
479 ULONG NextEntryOffset;
480 ULONG FileIndex;
481 LARGE_INTEGER CreationTime;
482 LARGE_INTEGER LastAccessTime;
483 LARGE_INTEGER LastWriteTime;
484 LARGE_INTEGER ChangeTime;
485 LARGE_INTEGER EndOfFile;
486 LARGE_INTEGER AllocationSize;
487 ULONG FileAttributes;
488 ULONG FileNameLength;
489 ULONG EaSize;
490 WCHAR FileName[ANYSIZE_ARRAY];
491 } FILE_FULL_DIRECTORY_INFORMATION, *PFILE_FULL_DIRECTORY_INFORMATION,
492 FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION;
493
494 typedef struct _FILE_ID_FULL_DIRECTORY_INFORMATION {
495 ULONG NextEntryOffset;
496 ULONG FileIndex;
497 LARGE_INTEGER CreationTime;
498 LARGE_INTEGER LastAccessTime;
499 LARGE_INTEGER LastWriteTime;
500 LARGE_INTEGER ChangeTime;
501 LARGE_INTEGER EndOfFile;
502 LARGE_INTEGER AllocationSize;
503 ULONG FileAttributes;
504 ULONG FileNameLength;
505 ULONG EaSize;
506 LARGE_INTEGER FileId;
507 WCHAR FileName[ANYSIZE_ARRAY];
508 } FILE_ID_FULL_DIRECTORY_INFORMATION, *PFILE_ID_FULL_DIRECTORY_INFORMATION;
509
510 typedef struct _FILE_BOTH_DIRECTORY_INFORMATION {
511 ULONG NextEntryOffset;
512 ULONG FileIndex;
513 LARGE_INTEGER CreationTime;
514 LARGE_INTEGER LastAccessTime;
515 LARGE_INTEGER LastWriteTime;
516 LARGE_INTEGER ChangeTime;
517 LARGE_INTEGER EndOfFile;
518 LARGE_INTEGER AllocationSize;
519 ULONG FileAttributes;
520 ULONG FileNameLength;
521 ULONG EaSize;
522 CHAR ShortNameLength;
523 WCHAR ShortName[12];
524 WCHAR FileName[ANYSIZE_ARRAY];
525 } FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION,
526 FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
527
528 typedef struct _FILE_ID_BOTH_DIRECTORY_INFORMATION {
529 ULONG NextEntryOffset;
530 ULONG FileIndex;
531 LARGE_INTEGER CreationTime;
532 LARGE_INTEGER LastAccessTime;
533 LARGE_INTEGER LastWriteTime;
534 LARGE_INTEGER ChangeTime;
535 LARGE_INTEGER EndOfFile;
536 LARGE_INTEGER AllocationSize;
537 ULONG FileAttributes;
538 ULONG FileNameLength;
539 ULONG EaSize;
540 CHAR ShortNameLength;
541 WCHAR ShortName[12];
542 LARGE_INTEGER FileId;
543 WCHAR FileName[ANYSIZE_ARRAY];
544 } FILE_ID_BOTH_DIRECTORY_INFORMATION, *PFILE_ID_BOTH_DIRECTORY_INFORMATION;
545
546 typedef struct _FILE_BASIC_INFORMATION {
547 LARGE_INTEGER CreationTime;
548 LARGE_INTEGER LastAccessTime;
549 LARGE_INTEGER LastWriteTime;
550 LARGE_INTEGER ChangeTime;
551 ULONG FileAttributes;
552 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
553
554 typedef struct _FILE_STANDARD_INFORMATION {
555 LARGE_INTEGER AllocationSize;
556 LARGE_INTEGER EndOfFile;
557 ULONG NumberOfLinks;
558 BOOLEAN DeletePending;
559 BOOLEAN Directory;
560 } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
561
562 typedef struct _FILE_INTERNAL_INFORMATION {
563 LARGE_INTEGER IndexNumber;
564 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
565
566 typedef struct _FILE_EA_INFORMATION {
567 ULONG EaSize;
568 } FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
569
570 typedef struct _FILE_ACCESS_INFORMATION {
571 ACCESS_MASK AccessFlags;
572 } FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
573
574 typedef struct _FILE_NAME_INFORMATION {
575 ULONG FileNameLength;
576 WCHAR FileName[1];
577 } FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
578
579 typedef struct _FILE_RENAME_INFORMATION {
580 BOOLEAN Replace;
581 HANDLE RootDir;
582 ULONG FileNameLength;
583 WCHAR FileName[1];
584 } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
585
586 typedef struct _FILE_LINK_INFORMATION {
587 BOOLEAN ReplaceIfExists;
588 HANDLE RootDirectory;
589 ULONG FileNameLength;
590 WCHAR FileName[1];
591 } FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION;
592
593 typedef struct _FILE_NAMES_INFORMATION {
594 ULONG NextEntryOffset;
595 ULONG FileIndex;
596 ULONG FileNameLength;
597 WCHAR FileName[1];
598 } FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
599
600 typedef struct _FILE_DISPOSITION_INFORMATION {
601 BOOLEAN DoDeleteFile;
602 } FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
603
604 typedef struct _FILE_POSITION_INFORMATION {
605 LARGE_INTEGER CurrentByteOffset;
606 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
607
608 typedef struct _FILE_ALIGNMENT_INFORMATION {
609 ULONG AlignmentRequirement;
610 } FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION;
611
612 typedef struct _FILE_ALLOCATION_INFORMATION {
613 LARGE_INTEGER AllocationSize;
614 } FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
615
616 typedef struct _FILE_END_OF_FILE_INFORMATION {
617 LARGE_INTEGER EndOfFile;
618 } FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
619
620 typedef struct _FILE_NETWORK_OPEN_INFORMATION {
621 LARGE_INTEGER CreationTime;
622 LARGE_INTEGER LastAccessTime;
623 LARGE_INTEGER LastWriteTime;
624 LARGE_INTEGER ChangeTime;
625 LARGE_INTEGER AllocationSize;
626 LARGE_INTEGER EndOfFile;
627 ULONG FileAttributes;
628 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
629
630 typedef struct _FILE_FULL_EA_INFORMATION {
631 ULONG NextEntryOffset;
632 UCHAR Flags;
633 UCHAR EaNameLength;
634 USHORT EaValueLength;
635 CHAR EaName[1];
636 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
637
638 typedef struct _FILE_MODE_INFORMATION {
639 ULONG Mode;
640 } FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION;
641
642 typedef struct _FILE_STREAM_INFORMATION
643 {
644 ULONG NextEntryOffset;
645 ULONG StreamNameLength;
646 LARGE_INTEGER StreamSize;
647 LARGE_INTEGER StreamAllocationSize;
648 WCHAR StreamName[1];
649 } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
650
651 typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION
652 {
653 ULONG FileAttributes;
654 ULONG ReparseTag;
655 } FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
656
657 typedef struct _FILE_MAILSLOT_QUERY_INFORMATION {
658 ULONG MaximumMessageSize;
659 ULONG MailslotQuota;
660 ULONG NextMessageSize;
661 ULONG MessagesAvailable;
662 LARGE_INTEGER ReadTimeout;
663 } FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION;
664
665 typedef struct _FILE_MAILSLOT_SET_INFORMATION {
666 LARGE_INTEGER ReadTimeout;
667 } FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
668
669 typedef struct _FILE_PIPE_INFORMATION {
670 ULONG ReadMode;
671 ULONG CompletionMode;
672 } FILE_PIPE_INFORMATION, *PFILE_PIPE_INFORMATION;
673
674 typedef struct _FILE_PIPE_LOCAL_INFORMATION {
675 ULONG NamedPipeType;
676 ULONG NamedPipeConfiguration;
677 ULONG MaximumInstances;
678 ULONG CurrentInstances;
679 ULONG InboundQuota;
680 ULONG ReadDataAvailable;
681 ULONG OutboundQuota;
682 ULONG WriteQuotaAvailable;
683 ULONG NamedPipeState;
684 ULONG NamedPipeEnd;
685 } FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
686
687 #define FILE_PIPE_DISCONNECTED_STATE 0x01
688 #define FILE_PIPE_LISTENING_STATE 0x02
689 #define FILE_PIPE_CONNECTED_STATE 0x03
690 #define FILE_PIPE_CLOSING_STATE 0x04
691
692 typedef struct _FILE_ALL_INFORMATION {
693 FILE_BASIC_INFORMATION BasicInformation;
694 FILE_STANDARD_INFORMATION StandardInformation;
695 FILE_INTERNAL_INFORMATION InternalInformation;
696 FILE_EA_INFORMATION EaInformation;
697 FILE_ACCESS_INFORMATION AccessInformation;
698 FILE_POSITION_INFORMATION PositionInformation;
699 FILE_MODE_INFORMATION ModeInformation;
700 FILE_ALIGNMENT_INFORMATION AlignmentInformation;
701 FILE_NAME_INFORMATION NameInformation;
702 } FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION;
703
704 typedef enum _FSINFOCLASS {
705 FileFsVolumeInformation = 1,
706 FileFsLabelInformation,
707 FileFsSizeInformation,
708 FileFsDeviceInformation,
709 FileFsAttributeInformation,
710 FileFsControlInformation,
711 FileFsFullSizeInformation,
712 FileFsObjectIdInformation,
713 FileFsMaximumInformation
714 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
715
716 typedef enum _KEY_INFORMATION_CLASS {
717 KeyBasicInformation,
718 KeyNodeInformation,
719 KeyFullInformation,
720 KeyNameInformation,
721 KeyCachedInformation,
722 KeyFlagsInformation,
723 KeyVirtualizationInformation,
724 KeyHandleTagsInformation,
725 MaxKeyInfoClass
726 } KEY_INFORMATION_CLASS;
727
728 typedef enum _KEY_VALUE_INFORMATION_CLASS {
729 KeyValueBasicInformation,
730 KeyValueFullInformation,
731 KeyValuePartialInformation,
732 KeyValueFullInformationAlign64,
733 KeyValuePartialInformationAlign64
734 } KEY_VALUE_INFORMATION_CLASS;
735
736 typedef enum _OBJECT_INFORMATION_CLASS {
737 ObjectBasicInformation,
738 ObjectNameInformation,
739 ObjectTypeInformation,
740 ObjectAllInformation,
741 ObjectDataInformation
742 } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
743
744 typedef enum _PROCESSINFOCLASS {
745 ProcessBasicInformation = 0,
746 ProcessQuotaLimits = 1,
747 ProcessIoCounters = 2,
748 ProcessVmCounters = 3,
749 ProcessTimes = 4,
750 ProcessBasePriority = 5,
751 ProcessRaisePriority = 6,
752 ProcessDebugPort = 7,
753 ProcessExceptionPort = 8,
754 ProcessAccessToken = 9,
755 ProcessLdtInformation = 10,
756 ProcessLdtSize = 11,
757 ProcessDefaultHardErrorMode = 12,
758 ProcessIoPortHandlers = 13,
759 ProcessPooledUsageAndLimits = 14,
760 ProcessWorkingSetWatch = 15,
761 ProcessUserModeIOPL = 16,
762 ProcessEnableAlignmentFaultFixup = 17,
763 ProcessPriorityClass = 18,
764 ProcessWx86Information = 19,
765 ProcessHandleCount = 20,
766 ProcessAffinityMask = 21,
767 ProcessPriorityBoost = 22,
768 ProcessDeviceMap = 23,
769 ProcessSessionInformation = 24,
770 ProcessForegroundInformation = 25,
771 ProcessWow64Information = 26,
772 ProcessImageFileName = 27,
773 ProcessLUIDDeviceMapsEnabled = 28,
774 ProcessBreakOnTermination = 29,
775 ProcessDebugObjectHandle = 30,
776 ProcessDebugFlags = 31,
777 ProcessHandleTracing = 32,
778 ProcessExecuteFlags = 34,
779 MaxProcessInfoClass
780 } PROCESSINFOCLASS, PROCESS_INFORMATION_CLASS;
781
782 #define MEM_EXECUTE_OPTION_DISABLE 0x01
783 #define MEM_EXECUTE_OPTION_ENABLE 0x02
784 #define MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION 0x04
785 #define MEM_EXECUTE_OPTION_PERMANENT 0x08
786
787 typedef enum _SECTION_INHERIT {
788 ViewShare = 1,
789 ViewUnmap = 2
790 } SECTION_INHERIT;
791
792 typedef enum _SYSTEM_INFORMATION_CLASS {
793 SystemBasicInformation = 0,
794 SystemCpuInformation = 1,
795 SystemPerformanceInformation = 2,
796 SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
797 Unknown4,
798 SystemProcessInformation = 5,
799 Unknown6,
800 Unknown7,
801 SystemProcessorPerformanceInformation = 8,
802 Unknown9,
803 Unknown10,
804 SystemModuleInformation = 11,
805 Unknown12,
806 Unknown13,
807 Unknown14,
808 Unknown15,
809 SystemHandleInformation = 16,
810 Unknown17,
811 SystemPageFileInformation = 18,
812 Unknown19,
813 Unknown20,
814 SystemCacheInformation = 21,
815 Unknown22,
816 SystemInterruptInformation = 23,
817 SystemDpcBehaviourInformation = 24,
818 SystemFullMemoryInformation = 25,
819 SystemNotImplemented6 = 25,
820 SystemLoadImage = 26,
821 SystemUnloadImage = 27,
822 SystemTimeAdjustmentInformation = 28,
823 SystemTimeAdjustment = 28,
824 SystemSummaryMemoryInformation = 29,
825 SystemNotImplemented7 = 29,
826 SystemNextEventIdInformation = 30,
827 SystemNotImplemented8 = 30,
828 SystemEventIdsInformation = 31,
829 SystemCrashDumpInformation = 32,
830 SystemExceptionInformation = 33,
831 SystemCrashDumpStateInformation = 34,
832 SystemKernelDebuggerInformation = 35,
833 SystemContextSwitchInformation = 36,
834 SystemRegistryQuotaInformation = 37,
835 SystemCurrentTimeZoneInformation = 44,
836 SystemTimeZoneInformation = 44,
837 SystemLookasideInformation = 45,
838 SystemSetTimeSlipEvent = 46,
839 SystemCreateSession = 47,
840 SystemDeleteSession = 48,
841 SystemInvalidInfoClass4 = 49,
842 SystemRangeStartInformation = 50,
843 SystemVerifierInformation = 51,
844 SystemAddVerifier = 52,
845 SystemSessionProcessesInformation = 53,
846 SystemLoadGdiDriverInSystemSpace = 54,
847 SystemNumaProcessorMap = 55,
848 SystemPrefetcherInformation = 56,
849 SystemExtendedProcessInformation = 57,
850 SystemRecommendedSharedDataAlignment = 58,
851 SystemComPlusPackage = 59,
852 SystemNumaAvailableMemory = 60,
853 SystemProcessorPowerInformation = 61,
854 SystemEmulationBasicInformation = 62,
855 SystemEmulationProcessorInformation = 63,
856 SystemExtendedHandleInformation = 64,
857 SystemLostDelayedWriteInformation = 65,
858 SystemBigPoolInformation = 66,
859 SystemSessionPoolTagInformation = 67,
860 SystemSessionMappedViewInformation = 68,
861 SystemHotpatchInformation = 69,
862 SystemObjectSecurityMode = 70,
863 SystemWatchdogTimerHandler = 71,
864 SystemWatchdogTimerInformation = 72,
865 SystemLogicalProcessorInformation = 73,
866 SystemWow64SharedInformation = 74,
867 SystemRegisterFirmwareTableInformationHandler = 75,
868 SystemFirmwareTableInformation = 76,
869 SystemModuleInformationEx = 77,
870 SystemVerifierTriageInformation = 78,
871 SystemSuperfetchInformation = 79,
872 SystemMemoryListInformation = 80,
873 SystemFileCacheInformationEx = 81,
874 SystemLogicalProcessorInformationEx = 107,
875 SystemInformationClassMax
876 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
877
878 typedef enum _THREADINFOCLASS {
879 ThreadBasicInformation,
880 ThreadTimes,
881 ThreadPriority,
882 ThreadBasePriority,
883 ThreadAffinityMask,
884 ThreadImpersonationToken,
885 ThreadDescriptorTableEntry,
886 ThreadEnableAlignmentFaultFixup,
887 ThreadEventPair_Reusable,
888 ThreadQuerySetWin32StartAddress,
889 ThreadZeroTlsCell,
890 ThreadPerformanceCount,
891 ThreadAmILastThread,
892 ThreadIdealProcessor,
893 ThreadPriorityBoost,
894 ThreadSetTlsArrayAddress,
895 ThreadIsIoPending,
896 ThreadHideFromDebugger,
897 ThreadBreakOnTermination,
898 ThreadSwitchLegacyState,
899 ThreadIsTerminated,
900 ThreadLastSystemCall,
901 ThreadIoPriority,
902 ThreadCycleTime,
903 ThreadPagePriority,
904 ThreadActualBasePriority,
905 ThreadTebInformation,
906 ThreadCSwitchMon,
907 ThreadCSwitchPmu,
908 ThreadWow64Context,
909 ThreadGroupInformation,
910 ThreadUmsInformation,
911 ThreadCounterProfiling,
912 ThreadIdealProcessorEx,
913 MaxThreadInfoClass
914 } THREADINFOCLASS;
915
916 typedef struct _THREAD_BASIC_INFORMATION
917 {
918 NTSTATUS ExitStatus;
919 PVOID TebBaseAddress;
920 CLIENT_ID ClientId;
921 ULONG_PTR AffinityMask;
922 LONG Priority;
923 LONG BasePriority;
924 } THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
925
926 typedef struct _THREAD_DESCRIPTOR_INFORMATION
927 {
928 DWORD Selector;
929 LDT_ENTRY Entry;
930 } THREAD_DESCRIPTOR_INFORMATION, *PTHREAD_DESCRIPTOR_INFORMATION;
931
932 typedef struct _KERNEL_USER_TIMES {
933 LARGE_INTEGER CreateTime;
934 LARGE_INTEGER ExitTime;
935 LARGE_INTEGER KernelTime;
936 LARGE_INTEGER UserTime;
937 } KERNEL_USER_TIMES, *PKERNEL_USER_TIMES;
938
939 typedef enum _WINSTATIONINFOCLASS {
940 WinStationInformation = 8
941 } WINSTATIONINFOCLASS;
942
943 typedef enum _MEMORY_INFORMATION_CLASS {
944 MemoryBasicInformation,
945 MemoryWorkingSetList,
946 MemorySectionName,
947 MemoryBasicVlmInformation
948 } MEMORY_INFORMATION_CLASS;
949
950 typedef struct _MEMORY_SECTION_NAME
951 {
952 UNICODE_STRING SectionFileName;
953 } MEMORY_SECTION_NAME, *PMEMORY_SECTION_NAME;
954
955 typedef enum _MUTANT_INFORMATION_CLASS
956 {
957 MutantBasicInformation
958 } MUTANT_INFORMATION_CLASS, *PMUTANT_INFORMATION_CLASS;
959
960 typedef struct _MUTANT_BASIC_INFORMATION {
961 LONG CurrentCount;
962 BOOLEAN OwnedByCaller;
963 BOOLEAN AbandonedState;
964 } MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION;
965
966 typedef enum _TIMER_INFORMATION_CLASS
967 {
968 TimerBasicInformation = 0
969 } TIMER_INFORMATION_CLASS;
970
971 typedef struct _TIMER_BASIC_INFORMATION
972 {
973 LARGE_INTEGER RemainingTime;
974 BOOLEAN TimerState;
975 } TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION;
976
977
978 /* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
979 typedef enum
980 {
981 INVALID_PATH = 0,
982 UNC_PATH, /* "//foo" */
983 ABSOLUTE_DRIVE_PATH, /* "c:/foo" */
984 RELATIVE_DRIVE_PATH, /* "c:foo" */
985 ABSOLUTE_PATH, /* "/foo" */
986 RELATIVE_PATH, /* "foo" */
987 DEVICE_PATH, /* "//./foo" */
988 UNC_DOT_PATH /* "//." */
989 } DOS_PATHNAME_TYPE;
990
991
992 /***********************************************************************
993 * Types and data structures
994 */
995
996 /* This is used by NtQuerySystemInformation */
997 typedef struct _SYSTEM_THREAD_INFORMATION
998 { /* win32/win64 */
999 LARGE_INTEGER KernelTime; /* 00/00 */
1000 LARGE_INTEGER UserTime; /* 08/08 */
1001 LARGE_INTEGER CreateTime; /* 10/10 */
1002 DWORD dwTickCount; /* 18/18 */
1003 LPVOID StartAddress; /* 1c/20 */
1004 CLIENT_ID ClientId; /* 20/28 */
1005 DWORD dwCurrentPriority; /* 28/38 */
1006 DWORD dwBasePriority; /* 2c/3c */
1007 DWORD dwContextSwitches; /* 30/40 */
1008 DWORD dwThreadState; /* 34/44 */
1009 DWORD dwWaitReason; /* 38/48 */
1010 DWORD dwUnknown; /* 3c/4c */
1011 } SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION;
1012
1013 typedef struct _IO_STATUS_BLOCK {
1014 union {
1015 NTSTATUS Status;
1016 PVOID Pointer;
1017 } DUMMYUNIONNAME;
1018
1019 ULONG_PTR Information;
1020 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
1021
1022 typedef void (WINAPI * PIO_APC_ROUTINE)(PVOID,PIO_STATUS_BLOCK,ULONG);
1023
1024 typedef struct _KEY_BASIC_INFORMATION {
1025 LARGE_INTEGER LastWriteTime;
1026 ULONG TitleIndex;
1027 ULONG NameLength;
1028 WCHAR Name[1];
1029 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
1030
1031 typedef struct _KEY_NODE_INFORMATION
1032 {
1033 LARGE_INTEGER LastWriteTime;
1034 ULONG TitleIndex;
1035 ULONG ClassOffset;
1036 ULONG ClassLength;
1037 ULONG NameLength;
1038 WCHAR Name[1];
1039 /* Class[1]; */
1040 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
1041
1042 typedef struct _KEY_FULL_INFORMATION
1043 {
1044 LARGE_INTEGER LastWriteTime;
1045 ULONG TitleIndex;
1046 ULONG ClassOffset;
1047 ULONG ClassLength;
1048 ULONG SubKeys;
1049 ULONG MaxNameLen;
1050 ULONG MaxClassLen;
1051 ULONG Values;
1052 ULONG MaxValueNameLen;
1053 ULONG MaxValueDataLen;
1054 WCHAR Class[1];
1055 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
1056
1057 typedef struct _KEY_NAME_INFORMATION {
1058 ULONG NameLength;
1059 WCHAR Name[1];
1060 } KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION;
1061
1062 typedef struct _KEY_CACHED_INFORMATION
1063 {
1064 LARGE_INTEGER LastWriteTime;
1065 ULONG TitleIndex;
1066 ULONG SubKeys;
1067 ULONG MaxNameLen;
1068 ULONG Values;
1069 ULONG MaxValueNameLen;
1070 ULONG MaxValueDataLen;
1071 ULONG NameLength;
1072 } KEY_CACHED_INFORMATION, *PKEY_CACHED_INFORMATION;
1073
1074 typedef struct _KEY_VALUE_ENTRY
1075 {
1076 PUNICODE_STRING ValueName;
1077 ULONG DataLength;
1078 ULONG DataOffset;
1079 ULONG Type;
1080 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
1081
1082 typedef struct _KEY_VALUE_BASIC_INFORMATION {
1083 ULONG TitleIndex;
1084 ULONG Type;
1085 ULONG NameLength;
1086 WCHAR Name[1];
1087 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
1088
1089 typedef struct _KEY_VALUE_FULL_INFORMATION {
1090 ULONG TitleIndex;
1091 ULONG Type;
1092 ULONG DataOffset;
1093 ULONG DataLength;
1094 ULONG NameLength;
1095 WCHAR Name[1];
1096 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
1097
1098 typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
1099 ULONG TitleIndex;
1100 ULONG Type;
1101 ULONG DataLength;
1102 UCHAR Data[1];
1103 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
1104
1105 #ifndef __OBJECT_ATTRIBUTES_DEFINED__
1106 #define __OBJECT_ATTRIBUTES_DEFINED__
1107 typedef struct _OBJECT_ATTRIBUTES {
1108 ULONG Length;
1109 HANDLE RootDirectory;
1110 PUNICODE_STRING ObjectName;
1111 ULONG Attributes;
1112 PVOID SecurityDescriptor; /* type SECURITY_DESCRIPTOR */
1113 PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
1114 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
1115 #endif
1116
1117 typedef struct _OBJECT_DATA_INFORMATION {
1118 BOOLEAN InheritHandle;
1119 BOOLEAN ProtectFromClose;
1120 } OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION;
1121
1122 typedef struct _OBJECT_BASIC_INFORMATION {
1123 ULONG Attributes;
1124 ACCESS_MASK GrantedAccess;
1125 ULONG HandleCount;
1126 ULONG PointerCount;
1127 ULONG PagedPoolUsage;
1128 ULONG NonPagedPoolUsage;
1129 ULONG Reserved[3];
1130 ULONG NameInformationLength;
1131 ULONG TypeInformationLength;
1132 ULONG SecurityDescriptorLength;
1133 LARGE_INTEGER CreateTime;
1134 } OBJECT_BASIC_INFORMATION, *POBJECT_BASIC_INFORMATION;
1135
1136 typedef struct _OBJECT_NAME_INFORMATION {
1137 UNICODE_STRING Name;
1138 } OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;
1139
1140 typedef struct __OBJECT_TYPE_INFORMATION {
1141 UNICODE_STRING TypeName;
1142 ULONG Reserved [22];
1143 } OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION;
1144
1145 typedef struct _PROCESS_BASIC_INFORMATION {
1146 #ifdef __WINESRC__
1147 DWORD_PTR ExitStatus;
1148 PPEB PebBaseAddress;
1149 DWORD_PTR AffinityMask;
1150 DWORD_PTR BasePriority;
1151 ULONG_PTR UniqueProcessId;
1152 ULONG_PTR InheritedFromUniqueProcessId;
1153 #else
1154 PVOID Reserved1;
1155 PPEB PebBaseAddress;
1156 PVOID Reserved2[2];
1157 ULONG_PTR UniqueProcessId;
1158 PVOID Reserved3;
1159 #endif
1160 } PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION;
1161
1162 #define PROCESS_PRIOCLASS_IDLE 1
1163 #define PROCESS_PRIOCLASS_NORMAL 2
1164 #define PROCESS_PRIOCLASS_HIGH 3
1165 #define PROCESS_PRIOCLASS_REALTIME 4
1166 #define PROCESS_PRIOCLASS_BELOW_NORMAL 5
1167 #define PROCESS_PRIOCLASS_ABOVE_NORMAL 6
1168
1169 typedef struct _PROCESS_PRIORITY_CLASS {
1170 BOOLEAN Foreground;
1171 UCHAR PriorityClass;
1172 } PROCESS_PRIORITY_CLASS, *PPROCESS_PRIORITY_CLASS;
1173
1174 typedef struct _RTL_HEAP_DEFINITION {
1175 ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
1176
1177 ULONG Unknown[11];
1178 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
1179
1180 typedef struct _RTL_RWLOCK {
1181 RTL_CRITICAL_SECTION rtlCS;
1182
1183 HANDLE hSharedReleaseSemaphore;
1184 UINT uSharedWaiters;
1185
1186 HANDLE hExclusiveReleaseSemaphore;
1187 UINT uExclusiveWaiters;
1188
1189 INT iNumberActive;
1190 HANDLE hOwningThreadId;
1191 DWORD dwTimeoutBoost;
1192 PVOID pDebugInfo;
1193 } RTL_RWLOCK, *LPRTL_RWLOCK;
1194
1195 /* System Information Class 0x00 */
1196
1197 typedef struct _SYSTEM_BASIC_INFORMATION {
1198 #ifdef __WINESRC__
1199 DWORD unknown;
1200 ULONG KeMaximumIncrement;
1201 ULONG PageSize;
1202 ULONG MmNumberOfPhysicalPages;
1203 ULONG MmLowestPhysicalPage;
1204 ULONG MmHighestPhysicalPage;
1205 ULONG_PTR AllocationGranularity;
1206 PVOID LowestUserAddress;
1207 PVOID HighestUserAddress;
1208 ULONG_PTR ActiveProcessorsAffinityMask;
1209 BYTE NumberOfProcessors;
1210 #else
1211 BYTE Reserved1[24];
1212 PVOID Reserved2[4];
1213 CCHAR NumberOfProcessors;
1214 #endif
1215 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
1216
1217 /* System Information Class 0x01 */
1218
1219 typedef struct _SYSTEM_CPU_INFORMATION {
1220 WORD Architecture;
1221 WORD Level;
1222 WORD Revision; /* combination of CPU model and stepping */
1223 WORD Reserved; /* always zero */
1224 DWORD FeatureSet; /* see bit flags below */
1225 } SYSTEM_CPU_INFORMATION, *PSYSTEM_CPU_INFORMATION;
1226
1227 /* definitions of bits in the Feature set for the x86 processors */
1228 #define CPU_FEATURE_VME 0x00000005 /* Virtual 86 Mode Extensions */
1229 #define CPU_FEATURE_TSC 0x00000002 /* Time Stamp Counter available */
1230 #define CPU_FEATURE_CMOV 0x00000008 /* Conditional Move instruction*/
1231 #define CPU_FEATURE_PGE 0x00000014 /* Page table Entry Global bit */
1232 #define CPU_FEATURE_PSE 0x00000024 /* Page Size Extension */
1233 #define CPU_FEATURE_MTRR 0x00000040 /* Memory Type Range Registers */
1234 #define CPU_FEATURE_CX8 0x00000080 /* Compare and eXchange 8 byte instr. */
1235 #define CPU_FEATURE_MMX 0x00000100 /* Multi Media eXtensions */
1236 #define CPU_FEATURE_X86 0x00000200 /* seems to be always ON, on the '86 */
1237 #define CPU_FEATURE_PAT 0x00000400 /* Page Attribute Table */
1238 #define CPU_FEATURE_FXSR 0x00000800 /* FXSAVE and FXSTORE instructions */
1239 #define CPU_FEATURE_SEP 0x00001000 /* SYSENTER and SYSEXIT instructions */
1240 #define CPU_FEATURE_SSE 0x00002000 /* SSE extensions (ext. MMX) */
1241 #define CPU_FEATURE_3DNOW 0x00004000 /* 3DNOW instructions available */
1242 #define CPU_FEATURE_SSE2 0x00010000 /* SSE2 extensions (XMMI64) */
1243 #define CPU_FEATURE_DS 0x00020000 /* Debug Store */
1244 #define CPU_FEATURE_HTT 0x00040000 /* Hyper Threading Technology */
1245
1246 /* System Information Class 0x02 */
1247
1248 /* Documented in "Windows NT/2000 Native API Reference" by Gary Nebbett. */
1249 typedef struct _SYSTEM_PERFORMANCE_INFORMATION {
1250 LARGE_INTEGER IdleTime;
1251 LARGE_INTEGER ReadTransferCount;
1252 LARGE_INTEGER WriteTransferCount;
1253 LARGE_INTEGER OtherTransferCount;
1254 ULONG ReadOperationCount;
1255 ULONG WriteOperationCount;
1256 ULONG OtherOperationCount;
1257 ULONG AvailablePages;
1258 ULONG TotalCommittedPages;
1259 ULONG TotalCommitLimit;
1260 ULONG PeakCommitment;
1261 ULONG PageFaults;
1262 ULONG WriteCopyFaults;
1263 ULONG TransitionFaults;
1264 ULONG Reserved1;
1265 ULONG DemandZeroFaults;
1266 ULONG PagesRead;
1267 ULONG PageReadIos;
1268 ULONG Reserved2[2];
1269 ULONG PagefilePagesWritten;
1270 ULONG PagefilePageWriteIos;
1271 ULONG MappedFilePagesWritten;
1272 ULONG MappedFilePageWriteIos;
1273 ULONG PagedPoolUsage;
1274 ULONG NonPagedPoolUsage;
1275 ULONG PagedPoolAllocs;
1276 ULONG PagedPoolFrees;
1277 ULONG NonPagedPoolAllocs;
1278 ULONG NonPagedPoolFrees;
1279 ULONG TotalFreeSystemPtes;
1280 ULONG SystemCodePage;
1281 ULONG TotalSystemDriverPages;
1282 ULONG TotalSystemCodePages;
1283 ULONG SmallNonPagedLookasideListAllocateHits;
1284 ULONG SmallPagedLookasideListAllocateHits;
1285 ULONG Reserved3;
1286 ULONG MmSystemCachePage;
1287 ULONG PagedPoolPage;
1288 ULONG SystemDriverPage;
1289 ULONG FastReadNoWait;
1290 ULONG FastReadWait;
1291 ULONG FastReadResourceMiss;
1292 ULONG FastReadNotPossible;
1293 ULONG FastMdlReadNoWait;
1294 ULONG FastMdlReadWait;
1295 ULONG FastMdlReadResourceMiss;
1296 ULONG FastMdlReadNotPossible;
1297 ULONG MapDataNoWait;
1298 ULONG MapDataWait;
1299 ULONG MapDataNoWaitMiss;
1300 ULONG MapDataWaitMiss;
1301 ULONG PinMappedDataCount;
1302 ULONG PinReadNoWait;
1303 ULONG PinReadWait;
1304 ULONG PinReadNoWaitMiss;
1305 ULONG PinReadWaitMiss;
1306 ULONG CopyReadNoWait;
1307 ULONG CopyReadWait;
1308 ULONG CopyReadNoWaitMiss;
1309 ULONG CopyReadWaitMiss;
1310 ULONG MdlReadNoWait;
1311 ULONG MdlReadWait;
1312 ULONG MdlReadNoWaitMiss;
1313 ULONG MdlReadWaitMiss;
1314 ULONG ReadAheadIos;
1315 ULONG LazyWriteIos;
1316 ULONG LazyWritePages;
1317 ULONG DataFlushes;
1318 ULONG DataPages;
1319 ULONG ContextSwitches;
1320 ULONG FirstLevelTbFills;
1321 ULONG SecondLevelTbFills;
1322 ULONG SystemCalls;
1323 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
1324
1325 /* System Information Class 0x03 */
1326
1327 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
1328 #ifdef __WINESRC__
1329 LARGE_INTEGER liKeBootTime;
1330 LARGE_INTEGER liKeSystemTime;
1331 LARGE_INTEGER liExpTimeZoneBias;
1332 ULONG uCurrentTimeZoneId;
1333 DWORD dwUnknown1[5];
1334 #else
1335 BYTE Reserved1[48];
1336 #endif
1337 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; /* was SYSTEM_TIME_INFORMATION */
1338
1339 /* System Information Class 0x08 */
1340
1341 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
1342 LARGE_INTEGER IdleTime;
1343 LARGE_INTEGER KernelTime;
1344 LARGE_INTEGER UserTime;
1345 LARGE_INTEGER Reserved1[2];
1346 ULONG Reserved2;
1347 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
1348
1349 /* System Information Class 0x0b */
1350
1351 typedef struct _SYSTEM_DRIVER_INFORMATION {
1352 PVOID pvAddress;
1353 DWORD dwUnknown1;
1354 DWORD dwUnknown2;
1355 DWORD dwEntryIndex;
1356 DWORD dwUnknown3;
1357 char szName[MAX_PATH + 1];
1358 } SYSTEM_DRIVER_INFORMATION, *PSYSTEM_DRIVER_INFORMATION;
1359
1360 /* System Information Class 0x10 */
1361
1362 typedef struct _SYSTEM_HANDLE_ENTRY {
1363 ULONG OwnerPid;
1364 BYTE ObjectType;
1365 BYTE HandleFlags;
1366 USHORT HandleValue;
1367 PVOID ObjectPointer;
1368 ULONG AccessMask;
1369 } SYSTEM_HANDLE_ENTRY, *PSYSTEM_HANDLE_ENTRY;
1370
1371 typedef struct _SYSTEM_HANDLE_INFORMATION {
1372 ULONG Count;
1373 SYSTEM_HANDLE_ENTRY Handle[1];
1374 } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
1375
1376 /* System Information Class 0x15 */
1377
1378 typedef struct _SYSTEM_CACHE_INFORMATION {
1379 ULONG CurrentSize;
1380 ULONG PeakSize;
1381 ULONG PageFaultCount;
1382 ULONG MinimumWorkingSet;
1383 ULONG MaximumWorkingSet;
1384 ULONG unused[4];
1385 #ifdef _WIN64
1386 ULONG unknown64[7];
1387 #endif
1388 } SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION;
1389
1390 /* System Information Class 0x17 */
1391
1392 typedef struct _SYSTEM_INTERRUPT_INFORMATION {
1393 BYTE Reserved1[24];
1394 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
1395
1396 typedef struct _SYSTEM_CONFIGURATION_INFO {
1397 union {
1398 ULONG OemId;
1399 struct {
1400 WORD ProcessorArchitecture;
1401 WORD Reserved;
1402 } tag1;
1403 } tag2;
1404 ULONG PageSize;
1405 PVOID MinimumApplicationAddress;
1406 PVOID MaximumApplicationAddress;
1407 ULONG ActiveProcessorMask;
1408 ULONG NumberOfProcessors;
1409 ULONG ProcessorType;
1410 ULONG AllocationGranularity;
1411 WORD ProcessorLevel;
1412 WORD ProcessorRevision;
1413 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
1414
1415 typedef struct _SYSTEM_EXCEPTION_INFORMATION {
1416 BYTE Reserved1[16];
1417 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
1418
1419 typedef struct _SYSTEM_LOOKASIDE_INFORMATION {
1420 BYTE Reserved1[32];
1421 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
1422
1423 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION {
1424 BOOLEAN DebuggerEnabled;
1425 BOOLEAN DebuggerNotPresent;
1426 } SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
1427
1428 /* System Information Class 0x05 */
1429
1430 typedef struct _VM_COUNTERS_ {
1431 SIZE_T PeakVirtualSize;
1432 SIZE_T VirtualSize;
1433 ULONG PageFaultCount;
1434 SIZE_T PeakWorkingSetSize;
1435 SIZE_T WorkingSetSize;
1436 SIZE_T QuotaPeakPagedPoolUsage;
1437 SIZE_T QuotaPagedPoolUsage;
1438 SIZE_T QuotaPeakNonPagedPoolUsage;
1439 SIZE_T QuotaNonPagedPoolUsage;
1440 SIZE_T PagefileUsage;
1441 SIZE_T PeakPagefileUsage;
1442 SIZE_T PrivatePageCount;
1443 } VM_COUNTERS, *PVM_COUNTERS;
1444
1445 typedef struct _SYSTEM_PROCESS_INFORMATION {
1446 #ifdef __WINESRC__ /* win32/win64 */
1447 ULONG NextEntryOffset; /* 00/00 */
1448 DWORD dwThreadCount; /* 04/04 */
1449 DWORD dwUnknown1[6]; /* 08/08 */
1450 LARGE_INTEGER CreationTime; /* 20/20 */
1451 LARGE_INTEGER UserTime; /* 28/28 */
1452 LARGE_INTEGER KernelTime; /* 30/30 */
1453 UNICODE_STRING ProcessName; /* 38/38 */
1454 DWORD dwBasePriority; /* 40/48 */
1455 HANDLE UniqueProcessId; /* 44/50 */
1456 HANDLE ParentProcessId; /* 48/58 */
1457 ULONG HandleCount; /* 4c/60 */
1458 ULONG SessionId; /* 50/64 */
1459 DWORD dwUnknown4; /* 54/68 */
1460 VM_COUNTERS vmCounters; /* 58/70 */
1461 IO_COUNTERS ioCounters; /* 88/d0 */
1462 SYSTEM_THREAD_INFORMATION ti[1]; /* b8/100 */
1463 #else
1464 ULONG NextEntryOffset; /* 00/00 */
1465 BYTE Reserved1[52]; /* 04/04 */
1466 PVOID Reserved2[3]; /* 38/38 */
1467 HANDLE UniqueProcessId; /* 44/50 */
1468 PVOID Reserved3; /* 48/58 */
1469 ULONG HandleCount; /* 4c/60 */
1470 BYTE Reserved4[4]; /* 50/64 */
1471 PVOID Reserved5[11]; /* 54/68 */
1472 SIZE_T PeakPagefileUsage; /* 80/c0 */
1473 SIZE_T PrivatePageCount; /* 84/c8 */
1474 LARGE_INTEGER Reserved6[6]; /* 88/d0 */
1475 #endif
1476 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
1477
1478 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION {
1479 ULONG RegistryQuotaAllowed;
1480 ULONG RegistryQuotaUsed;
1481 PVOID Reserved1;
1482 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
1483
1484 typedef struct _SYSTEM_TIME_ADJUSTMENT {
1485 ULONG TimeAdjustment;
1486 BOOLEAN TimeAdjustmentDisabled;
1487 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
1488
1489 typedef struct _TIME_FIELDS
1490 { CSHORT Year;
1491 CSHORT Month;
1492 CSHORT Day;
1493 CSHORT Hour;
1494 CSHORT Minute;
1495 CSHORT Second;
1496 CSHORT Milliseconds;
1497 CSHORT Weekday;
1498 } TIME_FIELDS, *PTIME_FIELDS;
1499
1500 typedef struct _WINSTATIONINFORMATIONW {
1501 BYTE Reserved2[70];
1502 ULONG LogonId;
1503 BYTE Reserved3[1140];
1504 } WINSTATIONINFORMATIONW, *PWINSTATIONINFORMATIONW;
1505
1506 typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONW)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
1507
1508 typedef struct _LDR_RESOURCE_INFO
1509 {
1510 ULONG_PTR Type;
1511 ULONG_PTR Name;
1512 ULONG Language;
1513 } LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO;
1514
1515
1516 /* debug buffer definitions */
1517
1518 typedef struct _DEBUG_BUFFER {
1519 HANDLE SectionHandle;
1520 PVOID SectionBase;
1521 PVOID RemoteSectionBase;
1522 ULONG SectionBaseDelta;
1523 HANDLE EventPairHandle;
1524 ULONG Unknown[2];
1525 HANDLE RemoteThreadHandle;
1526 ULONG InfoClassMask;
1527 ULONG SizeOfInfo;
1528 ULONG AllocatedSize;
1529 ULONG SectionSize;
1530 PVOID ModuleInformation;
1531 PVOID BackTraceInformation;
1532 PVOID HeapInformation;
1533 PVOID LockInformation;
1534 PVOID Reserved[8];
1535 } DEBUG_BUFFER, *PDEBUG_BUFFER;
1536
1537 #define PDI_MODULES 0x01
1538 #define PDI_BACKTRACE 0x02
1539 #define PDI_HEAPS 0x04
1540 #define PDI_HEAP_TAGS 0x08
1541 #define PDI_HEAP_BLOCKS 0x10
1542 #define PDI_LOCKS 0x20
1543
1544 typedef struct _DEBUG_MODULE_INFORMATION {
1545 ULONG Reserved[2];
1546 ULONG Base;
1547 ULONG Size;
1548 ULONG Flags;
1549 USHORT Index;
1550 USHORT Unknown;
1551 USHORT LoadCount;
1552 USHORT ModuleNameOffset;
1553 CHAR ImageName[256];
1554 } DEBUG_MODULE_INFORMATION, *PDEBUG_MODULE_INFORMATION;
1555
1556 typedef struct _DEBUG_HEAP_INFORMATION {
1557 ULONG Base;
1558 ULONG Flags;
1559 USHORT Granularity;
1560 USHORT Unknown;
1561 ULONG Allocated;
1562 ULONG Committed;
1563 ULONG TagCount;
1564 ULONG BlockCount;
1565 ULONG Reserved[7];
1566 PVOID Tags;
1567 PVOID Blocks;
1568 } DEBUG_HEAP_INFORMATION, *PDEBUG_HEAP_INFORMATION;
1569
1570 typedef struct _DEBUG_LOCK_INFORMATION {
1571 PVOID Address;
1572 USHORT Type;
1573 USHORT CreatorBackTraceIndex;
1574 ULONG OwnerThreadId;
1575 ULONG ActiveCount;
1576 ULONG ContentionCount;
1577 ULONG EntryCount;
1578 ULONG RecursionCount;
1579 ULONG NumberOfSharedWaiters;
1580 ULONG NumberOfExclusiveWaiters;
1581 } DEBUG_LOCK_INFORMATION, *PDEBUG_LOCK_INFORMATION;
1582
1583 typedef struct _PORT_MESSAGE_HEADER {
1584 USHORT DataSize;
1585 USHORT MessageSize;
1586 USHORT MessageType;
1587 USHORT VirtualRangesOffset;
1588 CLIENT_ID ClientId;
1589 ULONG MessageId;
1590 ULONG SectionSize;
1591 } PORT_MESSAGE_HEADER, *PPORT_MESSAGE_HEADER, PORT_MESSAGE, *PPORT_MESSAGE;
1592
1593 typedef unsigned short RTL_ATOM, *PRTL_ATOM;
1594
1595 /* Wine doesn't implement atom table as NT does:
1596 * - in NT, atom tables are user space tables, which ntdll directly accesses
1597 * - on Wine, (even local) atom tables are wineserver objects, hence a HANDLE
1598 */
1599 typedef struct atom_table *RTL_ATOM_TABLE, **PRTL_ATOM_TABLE;
1600
1601 typedef enum _ATOM_INFORMATION_CLASS {
1602 AtomBasicInformation = 0,
1603 AtomTableInformation = 1,
1604 } ATOM_INFORMATION_CLASS;
1605
1606 typedef struct _ATOM_BASIC_INFORMATION {
1607 USHORT ReferenceCount;
1608 USHORT Pinned;
1609 USHORT NameLength;
1610 WCHAR Name[1];
1611 } ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION;
1612
1613 /* FIXME: names probably not correct */
1614 typedef struct _RTL_HANDLE
1615 {
1616 struct _RTL_HANDLE * Next;
1617 } RTL_HANDLE;
1618
1619 /* FIXME: names probably not correct */
1620 typedef struct _RTL_HANDLE_TABLE
1621 {
1622 ULONG MaxHandleCount; /* 0x00 */
1623 ULONG HandleSize; /* 0x04 */
1624 ULONG Unused[2]; /* 0x08-0x0c */
1625 PVOID NextFree; /* 0x10 */
1626 PVOID FirstHandle; /* 0x14 */
1627 PVOID ReservedMemory; /* 0x18 */
1628 PVOID MaxHandle; /* 0x1c */
1629 } RTL_HANDLE_TABLE;
1630
1631 /***********************************************************************
1632 * Defines
1633 */
1634
1635 /* flags for NtCreateFile and NtOpenFile */
1636 #define FILE_DIRECTORY_FILE 0x00000001
1637 #define FILE_WRITE_THROUGH 0x00000002
1638 #define FILE_SEQUENTIAL_ONLY 0x00000004
1639 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
1640 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
1641 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
1642 #define FILE_NON_DIRECTORY_FILE 0x00000040
1643 #define FILE_CREATE_TREE_CONNECTION 0x00000080
1644 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
1645 #define FILE_NO_EA_KNOWLEDGE 0x00000200
1646 #define FILE_OPEN_FOR_RECOVERY 0x00000400
1647 #define FILE_RANDOM_ACCESS 0x00000800
1648 #define FILE_DELETE_ON_CLOSE 0x00001000
1649 #define FILE_OPEN_BY_FILE_ID 0x00002000
1650 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
1651 #define FILE_NO_COMPRESSION 0x00008000
1652 #define FILE_RESERVE_OPFILTER 0x00100000
1653 #define FILE_TRANSACTED_MODE 0x00200000
1654 #define FILE_OPEN_OFFLINE_FILE 0x00400000
1655 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
1656
1657 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
1658 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
1659
1660 /* status for NtCreateFile or NtOpenFile */
1661 #define FILE_SUPERSEDED 0
1662 #define FILE_OPENED 1
1663 #define FILE_CREATED 2
1664 #define FILE_OVERWRITTEN 3
1665 #define FILE_EXISTS 4
1666 #define FILE_DOES_NOT_EXIST 5
1667
1668 /* disposition for NtCreateFile */
1669 #define FILE_SUPERSEDE 0
1670 #define FILE_OPEN 1
1671 #define FILE_CREATE 2
1672 #define FILE_OPEN_IF 3
1673 #define FILE_OVERWRITE 4
1674 #define FILE_OVERWRITE_IF 5
1675 #define FILE_MAXIMUM_DISPOSITION 5
1676
1677 /* Characteristics of a File System */
1678 #define FILE_REMOVABLE_MEDIA 0x00000001
1679 #define FILE_READ_ONLY_DEVICE 0x00000002
1680 #define FILE_FLOPPY_DISKETTE 0x00000004
1681 #define FILE_WRITE_ONE_MEDIA 0x00000008
1682 #define FILE_REMOTE_DEVICE 0x00000010
1683 #define FILE_DEVICE_IS_MOUNTED 0x00000020
1684 #define FILE_VIRTUAL_VOLUME 0x00000040
1685 #define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
1686 #define FILE_DEVICE_SECURE_OPEN 0x00000100
1687
1688 /* options for NtCreateNamedPipeFile */
1689 #define FILE_PIPE_INBOUND 0x00000000
1690 #define FILE_PIPE_OUTBOUND 0x00000001
1691 #define FILE_PIPE_FULL_DUPLEX 0x00000002
1692
1693 /* options for pipe's type */
1694 #define FILE_PIPE_TYPE_MESSAGE 0x00000001
1695 #define FILE_PIPE_TYPE_BYTE 0x00000000
1696 /* options for pipe's message mode */
1697 #define FILE_PIPE_MESSAGE_MODE 0x00000001
1698 #define FILE_PIPE_BYTE_STREAM_MODE 0x00000000
1699 /* options for pipe's blocking mode */
1700 #define FILE_PIPE_COMPLETE_OPERATION 0x00000001
1701 #define FILE_PIPE_QUEUE_OPERATION 0x00000000
1702 /* and client / server end */
1703 #define FILE_PIPE_SERVER_END 0x00000001
1704 #define FILE_PIPE_CLIENT_END 0x00000000
1705
1706 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
1707
1708 #define LOGONID_CURRENT ((ULONG)-1)
1709
1710 #define OBJ_INHERIT 0x00000002
1711 #define OBJ_PERMANENT 0x00000010
1712 #define OBJ_EXCLUSIVE 0x00000020
1713 #define OBJ_CASE_INSENSITIVE 0x00000040
1714 #define OBJ_OPENIF 0x00000080
1715 #define OBJ_OPENLINK 0x00000100
1716 #define OBJ_KERNEL_HANDLE 0x00000200
1717 #define OBJ_VALID_ATTRIBUTES 0x000003F2
1718
1719 #define SERVERNAME_CURRENT ((HANDLE)NULL)
1720
1721 typedef void (CALLBACK *PNTAPCFUNC)(ULONG_PTR,ULONG_PTR,ULONG_PTR); /* FIXME: not the right name */
1722 typedef void (CALLBACK *PRTL_THREAD_START_ROUTINE)(LPVOID); /* FIXME: not the right name */
1723 typedef DWORD (CALLBACK *PRTL_WORK_ITEM_ROUTINE)(LPVOID); /* FIXME: not the right name */
1724 typedef void (NTAPI *RTL_WAITORTIMERCALLBACKFUNC)(PVOID,BOOLEAN); /* FIXME: not the right name */
1725
1726
1727 /* DbgPrintEx default levels */
1728 #define DPFLTR_ERROR_LEVEL 0
1729 #define DPFLTR_WARNING_LEVEL 1
1730 #define DPFLTR_TRACE_LEVEL 2
1731 #define DPFLTR_INFO_LEVEL 3
1732 #define DPFLTR_MASK 0x8000000
1733
1734 /* Well-known LUID values */
1735 #define SE_MIN_WELL_KNOWN_PRIVILEGE 2
1736 #define SE_CREATE_TOKEN_PRIVILEGE 2
1737 #define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3
1738 #define SE_LOCK_MEMORY_PRIVILEGE 4
1739 #define SE_INCREASE_QUOTA_PRIVILEGE 5
1740 #define SE_UNSOLICITED_INPUT_PRIVILEGE 6 /* obsolete */
1741 #define SE_MACHINE_ACCOUNT_PRIVILEGE 6
1742 #define SE_TCB_PRIVILEGE 7
1743 #define SE_SECURITY_PRIVILEGE 8
1744 #define SE_TAKE_OWNERSHIP_PRIVILEGE 9
1745 #define SE_LOAD_DRIVER_PRIVILEGE 10
1746 #define SE_SYSTEM_PROFILE_PRIVILEGE 11
1747 #define SE_SYSTEMTIME_PRIVILEGE 12
1748 #define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13
1749 #define SE_INC_BASE_PRIORITY_PRIVILEGE 14
1750 #define SE_CREATE_PAGEFILE_PRIVILEGE 15
1751 #define SE_CREATE_PERMANENT_PRIVILEGE 16
1752 #define SE_BACKUP_PRIVILEGE 17
1753 #define SE_RESTORE_PRIVILEGE 18
1754 #define SE_SHUTDOWN_PRIVILEGE 19
1755 #define SE_DEBUG_PRIVILEGE 20
1756 #define SE_AUDIT_PRIVILEGE 21
1757 #define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22
1758 #define SE_CHANGE_NOTIFY_PRIVILEGE 23
1759 #define SE_REMOTE_SHUTDOWN_PRIVILEGE 24
1760 #define SE_UNDOCK_PRIVILEGE 25
1761 #define SE_SYNC_AGENT_PRIVILEGE 26
1762 #define SE_ENABLE_DELEGATION_PRIVILEGE 27
1763 #define SE_MANAGE_VOLUME_PRIVILEGE 28
1764 #define SE_IMPERSONATE_PRIVILEGE 29
1765 #define SE_CREATE_GLOBAL_PRIVILEGE 30
1766 #define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_GLOBAL_PRIVILEGE
1767
1768 /* NtGlobalFlag bits */
1769 #define FLG_STOP_ON_EXCEPTION 0x00000001
1770 #define FLG_SHOW_LDR_SNAPS 0x00000002
1771 #define FLG_DEBUG_INITIAL_COMMAND 0x00000004
1772 #define FLG_STOP_ON_HUNG_GUI 0x00000008
1773 #define FLG_HEAP_ENABLE_TAIL_CHECK 0x00000010
1774 #define FLG_HEAP_ENABLE_FREE_CHECK 0x00000020
1775 #define FLG_HEAP_VALIDATE_PARAMETERS 0x00000040
1776 #define FLG_HEAP_VALIDATE_ALL 0x00000080
1777 #define FLG_APPLICATION_VERIFIER 0x00000100
1778 #define FLG_POOL_ENABLE_TAGGING 0x00000400
1779 #define FLG_HEAP_ENABLE_TAGGING 0x00000800
1780 #define FLG_USER_STACK_TRACE_DB 0x00001000
1781 #define FLG_KERNEL_STACK_TRACE_DB 0x00002000
1782 #define FLG_MAINTAIN_OBJECT_TYPELIST 0x00004000
1783 #define FLG_HEAP_ENABLE_TAG_BY_DLL 0x00008000
1784 #define FLG_DISABLE_STACK_EXTENSION 0x00010000
1785 #define FLG_ENABLE_CSRDEBUG 0x00020000
1786 #define FLG_ENABLE_KDEBUG_SYMBOL_LOAD 0x00040000
1787 #define FLG_DISABLE_PAGE_KERNEL_STACKS 0x00080000
1788 #define FLG_ENABLE_SYSTEM_CRIT_BREAKS 0x00100000
1789 #define FLG_HEAP_DISABLE_COALESCING 0x00200000
1790 #define FLG_ENABLE_CLOSE_EXCEPTIONS 0x00400000
1791 #define FLG_ENABLE_EXCEPTION_LOGGING 0x00800000
1792 #define FLG_ENABLE_HANDLE_TYPE_TAGGING 0x01000000
1793 #define FLG_HEAP_PAGE_ALLOCS 0x02000000
1794 #define FLG_DEBUG_INITIAL_COMMAND_EX 0x04000000
1795 #define FLG_DISABLE_DBGPRINT 0x08000000
1796 #define FLG_CRITSEC_EVENT_CREATION 0x10000000
1797 #define FLG_LDR_TOP_DOWN 0x20000000
1798 #define FLG_ENABLE_HANDLE_EXCEPTIONS 0x40000000
1799 #define FLG_DISABLE_PROTDLLS 0x80000000
1800
1801 /* Rtl*Registry* functions structs and defines */
1802 #define RTL_REGISTRY_ABSOLUTE 0
1803 #define RTL_REGISTRY_SERVICES 1
1804 #define RTL_REGISTRY_CONTROL 2
1805 #define RTL_REGISTRY_WINDOWS_NT 3
1806 #define RTL_REGISTRY_DEVICEMAP 4
1807 #define RTL_REGISTRY_USER 5
1808
1809 #define RTL_REGISTRY_HANDLE 0x40000000
1810 #define RTL_REGISTRY_OPTIONAL 0x80000000
1811
1812 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
1813 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
1814 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
1815 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
1816 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
1817 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
1818 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
1819
1820 typedef NTSTATUS (WINAPI *PRTL_QUERY_REGISTRY_ROUTINE)( PCWSTR ValueName,
1821 ULONG ValueType,
1822 PVOID ValueData,
1823 ULONG ValueLength,
1824 PVOID Context,
1825 PVOID EntryContext);
1826
1827 typedef struct _RTL_QUERY_REGISTRY_TABLE
1828 {
1829 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
1830 ULONG Flags;
1831 PWSTR Name;
1832 PVOID EntryContext;
1833 ULONG DefaultType;
1834 PVOID DefaultData;
1835 ULONG DefaultLength;
1836 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
1837
1838 typedef struct _KEY_MULTIPLE_VALUE_INFORMATION
1839 {
1840 PUNICODE_STRING ValueName;
1841 ULONG DataLength;
1842 ULONG DataOffset;
1843 ULONG Type;
1844 } KEY_MULTIPLE_VALUE_INFORMATION, *PKEY_MULTIPLE_VALUE_INFORMATION;
1845
1846 typedef VOID (CALLBACK *PRTL_OVERLAPPED_COMPLETION_ROUTINE)(DWORD,DWORD,LPVOID);
1847
1848 typedef VOID (CALLBACK *PTIMER_APC_ROUTINE) ( PVOID, ULONG, LONG );
1849
1850 typedef enum _EVENT_INFORMATION_CLASS {
1851 EventBasicInformation
1852 } EVENT_INFORMATION_CLASS, *PEVENT_INFORMATION_CLASS;
1853
1854 typedef struct _EVENT_BASIC_INFORMATION {
1855 EVENT_TYPE EventType;
1856 LONG EventState;
1857 } EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION;
1858
1859 typedef enum _SEMAPHORE_INFORMATION_CLASS {
1860 SemaphoreBasicInformation
1861 } SEMAPHORE_INFORMATION_CLASS, *PSEMAPHORE_INFORMATION_CLASS;
1862
1863 typedef struct _SEMAPHORE_BASIC_INFORMATION {
1864 ULONG CurrentCount;
1865 ULONG MaximumCount;
1866 } SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION;
1867
1868 typedef enum _SECTION_INFORMATION_CLASS
1869 {
1870 SectionBasicInformation,
1871 SectionImageInformation,
1872 } SECTION_INFORMATION_CLASS;
1873
1874 typedef struct _SECTION_BASIC_INFORMATION {
1875 PVOID BaseAddress;
1876 ULONG Attributes;
1877 LARGE_INTEGER Size;
1878 } SECTION_BASIC_INFORMATION, *PSECTION_BASIC_INFORMATION;
1879
1880 typedef struct _SECTION_IMAGE_INFORMATION {
1881 PVOID TransferAddress;
1882 ULONG ZeroBits;
1883 SIZE_T MaximumStackSize;
1884 SIZE_T CommittedStackSize;
1885 ULONG SubSystemType;
1886 WORD SubsystemVersionLow;
1887 WORD SubsystemVersionHigh;
1888 ULONG GpValue;
1889 USHORT ImageCharacteristics;
1890 USHORT DllCharacteristics;
1891 USHORT Machine;
1892 BOOLEAN ImageContainsCode;
1893 UCHAR ImageFlags;
1894 ULONG LoaderFlags;
1895 ULONG ImageFileSize;
1896 ULONG CheckSum;
1897 } SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION;
1898
1899 typedef struct _LPC_SECTION_WRITE {
1900 ULONG Length;
1901 HANDLE SectionHandle;
1902 ULONG SectionOffset;
1903 ULONG ViewSize;
1904 PVOID ViewBase;
1905 PVOID TargetViewBase;
1906 } LPC_SECTION_WRITE, *PLPC_SECTION_WRITE;
1907
1908 typedef struct _LPC_SECTION_READ {
1909 ULONG Length;
1910 ULONG ViewSize;
1911 PVOID ViewBase;
1912 } LPC_SECTION_READ, *PLPC_SECTION_READ;
1913
1914 typedef struct _LPC_MESSAGE {
1915 USHORT DataSize;
1916 USHORT MessageSize;
1917 USHORT MessageType;
1918 USHORT VirtualRangesOffset;
1919 CLIENT_ID ClientId;
1920 ULONG_PTR MessageId;
1921 ULONG_PTR SectionSize;
1922 UCHAR Data[ANYSIZE_ARRAY];
1923 } LPC_MESSAGE, *PLPC_MESSAGE;
1924
1925 typedef struct _RTL_USER_PROCESS_INFORMATION
1926 {
1927 ULONG Length;
1928 HANDLE Process;
1929 HANDLE Thread;
1930 CLIENT_ID ClientId;
1931 SECTION_IMAGE_INFORMATION ImageInformation;
1932 } RTL_USER_PROCESS_INFORMATION, *PRTL_USER_PROCESS_INFORMATION;
1933
1934 typedef enum _SHUTDOWN_ACTION {
1935 ShutdownNoReboot,
1936 ShutdownReboot,
1937 ShutdownPowerOff
1938 } SHUTDOWN_ACTION, *PSHUTDOWN_ACTION;
1939
1940 typedef enum _KPROFILE_SOURCE {
1941 ProfileTime,
1942 ProfileAlignmentFixup,
1943 ProfileTotalIssues,
1944 ProfilePipelineDry,
1945 ProfileLoadInstructions,
1946 ProfilePipelineFrozen,
1947 ProfileBranchInstructions,
1948 ProfileTotalNonissues,
1949 ProfileDcacheMisses,
1950 ProfileIcacheMisses,
1951 ProfileCacheMisses,
1952 ProfileBranchMispredictions,
1953 ProfileStoreInstructions,
1954 ProfileFpInstructions,
1955 ProfileIntegerInstructions,
1956 Profile2Issue,
1957 Profile3Issue,
1958 Profile4Issue,
1959 ProfileSpecialInstructions,
1960 ProfileTotalCycles,
1961 ProfileIcacheIssues,
1962 ProfileDcacheAccesses,
1963 ProfileMemoryBarrierCycles,
1964 ProfileLoadLinkedIssues,
1965 ProfileMaximum
1966 } KPROFILE_SOURCE, *PKPROFILE_SOURCE;
1967
1968 typedef struct _DIRECTORY_BASIC_INFORMATION {
1969 UNICODE_STRING ObjectName;
1970 UNICODE_STRING ObjectTypeName;
1971 } DIRECTORY_BASIC_INFORMATION, *PDIRECTORY_BASIC_INFORMATION;
1972
1973 typedef struct _INITIAL_TEB {
1974 PVOID StackBase;
1975 PVOID StackLimit;
1976 PVOID StackCommit;
1977 PVOID StackCommitMax;
1978 PVOID StackReserved;
1979 } INITIAL_TEB, *PINITIAL_TEB;
1980
1981 typedef enum _PORT_INFORMATION_CLASS {
1982 PortNoInformation
1983 } PORT_INFORMATION_CLASS, *PPORT_INFORMATION_CLASS;
1984
1985 typedef enum _IO_COMPLETION_INFORMATION_CLASS {
1986 IoCompletionBasicInformation
1987 } IO_COMPLETION_INFORMATION_CLASS, *PIO_COMPLETION_INFORMATION_CLASS;
1988
1989 typedef struct _FILE_COMPLETION_INFORMATION {
1990 HANDLE CompletionPort;
1991 ULONG_PTR CompletionKey;
1992 } FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION;
1993
1994 #define IO_COMPLETION_QUERY_STATE 0x0001
1995 #define IO_COMPLETION_MODIFY_STATE 0x0002
1996 #define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
1997
1998 typedef enum _HARDERROR_RESPONSE_OPTION {
1999 OptionAbortRetryIgnore,
2000 OptionOk,
2001 OptionOkCancel,
2002 OptionRetryCancel,
2003 OptionYesNo,
2004 OptionYesNoCancel,
2005 OptionShutdownSystem
2006 } HARDERROR_RESPONSE_OPTION, *PHARDERROR_RESPONSE_OPTION;
2007
2008 typedef enum _HARDERROR_RESPONSE {
2009 ResponseReturnToCaller,
2010 ResponseNotHandled,
2011 ResponseAbort,
2012 ResponseCancel,
2013 ResponseIgnore,
2014 ResponseNo,
2015 ResponseOk,
2016 ResponseRetry,
2017 ResponseYes
2018 } HARDERROR_RESPONSE, *PHARDERROR_RESPONSE;
2019
2020 typedef enum _SYSDBG_COMMAND {
2021 SysDbgQueryModuleInformation,
2022 SysDbgQueryTraceInformation,
2023 SysDbgSetTracepoint,
2024 SysDbgSetSpecialCall,
2025 SysDbgClearSpecialCalls,
2026 SysDbgQuerySpecialCalls,
2027 SysDbgBreakPoint,
2028 SysDbgQueryVersion,
2029 SysDbgReadVirtual,
2030 SysDbgWriteVirtual,
2031 SysDbgReadPhysical,
2032 SysDbgWritePhysical,
2033 SysDbgReadControlSpace,
2034 SysDbgWriteControlSpace,
2035 SysDbgReadIoSpace,
2036 SysDbgWriteIoSpace,
2037 SysDbgReadMsr,
2038 SysDbgWriteMsr,
2039 SysDbgReadBusData,
2040 SysDbgWriteBusData
2041 } SYSDBG_COMMAND, *PSYSDBG_COMMAND;
2042
2043
2044 /*************************************************************************
2045 * Loader structures
2046 *
2047 * Those are not part of standard Winternl.h
2048 */
2049 typedef struct _LDR_MODULE
2050 {
2051 LIST_ENTRY InLoadOrderModuleList;
2052 LIST_ENTRY InMemoryOrderModuleList;
2053 LIST_ENTRY InInitializationOrderModuleList;
2054 void* BaseAddress;
2055 void* EntryPoint;
2056 ULONG SizeOfImage;
2057 UNICODE_STRING FullDllName;
2058 UNICODE_STRING BaseDllName;
2059 ULONG Flags;
2060 SHORT LoadCount;
2061 SHORT TlsIndex;
2062 HANDLE SectionHandle;
2063 ULONG CheckSum;
2064 ULONG TimeDateStamp;
2065 HANDLE ActivationContext;
2066 } LDR_MODULE, *PLDR_MODULE;
2067
2068 /* those defines are (some of the) regular LDR_MODULE.Flags values */
2069 #define LDR_IMAGE_IS_DLL 0x00000004
2070 #define LDR_LOAD_IN_PROGRESS 0x00001000
2071 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
2072 #define LDR_NO_DLL_CALLS 0x00040000
2073 #define LDR_PROCESS_ATTACHED 0x00080000
2074 #define LDR_MODULE_REBASED 0x00200000
2075
2076 /* these ones is Wine specific */
2077 #define LDR_DONT_RESOLVE_REFS 0x40000000
2078 #define LDR_WINE_INTERNAL 0x80000000
2079
2080 /* flag for LdrAddRefDll */
2081 #define LDR_ADDREF_DLL_PIN 0x00000001
2082
2083 /* FIXME: to be checked */
2084 #define MAXIMUM_FILENAME_LENGTH 256
2085
2086 typedef struct _SYSTEM_MODULE
2087 {
2088 PVOID Reserved1; /* 00/00 */
2089 PVOID Reserved2; /* 04/08 */
2090 PVOID ImageBaseAddress; /* 08/10 */
2091 ULONG ImageSize; /* 0c/18 */
2092 ULONG Flags; /* 10/1c */
2093 WORD Id; /* 14/20 */
2094 WORD Rank; /* 16/22 */
2095 WORD Unknown; /* 18/24 */
2096 WORD NameOffset; /* 1a/26 */
2097 BYTE Name[MAXIMUM_FILENAME_LENGTH]; /* 1c/28 */
2098 } SYSTEM_MODULE, *PSYSTEM_MODULE;
2099
2100 typedef struct _SYSTEM_MODULE_INFORMATION
2101 {
2102 ULONG ModulesCount;
2103 SYSTEM_MODULE Modules[1]; /* FIXME: should be Modules[0] */
2104 } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
2105
2106 /***********************************************************************
2107 * Function declarations
2108 */
2109
2110 #if defined(__i386__) && defined(__GNUC__)
2111 static inline void WINAPI DbgBreakPoint(void) { __asm__ __volatile__("int3"); }
2112 static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3"); }
2113 #else /* __i386__ && __GNUC__ */
2114 NTSYSAPI void WINAPI DbgBreakPoint(void);
2115 NTSYSAPI void WINAPI DbgUserBreakPoint(void);
2116 #endif /* __i386__ && __GNUC__ */
2117 #ifndef __REACTOS__
2118 NTSYSAPI NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
2119 #endif /* __REACTOS__ */
2120 NTSYSAPI NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
2121 NTSYSAPI NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
2122 NTSYSAPI NTSTATUS WINAPI LdrAddRefDll(ULONG,HMODULE);
2123 NTSYSAPI NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
2124 NTSYSAPI NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
2125 NTSYSAPI NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
2126 NTSYSAPI NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_MODULE*);
2127 NTSYSAPI NTSTATUS WINAPI LdrGetDllHandle(LPCWSTR, ULONG, const UNICODE_STRING*, HMODULE*);
2128 NTSYSAPI NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
2129 NTSYSAPI void WINAPI LdrInitializeThunk(void*,ULONG_PTR,ULONG_PTR,ULONG_PTR);
2130 NTSYSAPI NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
2131 NTSYSAPI NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG_PTR*);
2132 IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock(void*,UINT,USHORT*,INT_PTR);
2133 NTSYSAPI NTSTATUS WINAPI LdrQueryImageFileExecutionOptions(const UNICODE_STRING*,LPCWSTR,ULONG,void*,ULONG,ULONG*);
2134 NTSYSAPI NTSTATUS WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*);
2135 NTSYSAPI void WINAPI LdrShutdownProcess(void);
2136 NTSYSAPI void WINAPI LdrShutdownThread(void);
2137 NTSYSAPI NTSTATUS WINAPI LdrUnloadDll(HMODULE);
2138 NTSYSAPI NTSTATUS WINAPI LdrUnlockLoaderLock(ULONG,ULONG_PTR);
2139 NTSYSAPI NTSTATUS WINAPI NtAcceptConnectPort(PHANDLE,ULONG,PLPC_MESSAGE,BOOLEAN,PLPC_SECTION_WRITE,PLPC_SECTION_READ);
2140 NTSYSAPI NTSTATUS WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,NTSTATUS*);
2141 NTSYSAPI NTSTATUS WINAPI NtAccessCheckAndAuditAlarm(PUNICODE_STRING,HANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,ACCESS_MASK,PGENERIC_MAPPING,BOOLEAN,PACCESS_MASK,PBOOLEAN,PBOOLEAN);
2142 NTSYSAPI NTSTATUS WINAPI NtAddAtom(const WCHAR*,ULONG,RTL_ATOM*);
2143 NTSYSAPI NTSTATUS WINAPI NtAdjustGroupsToken(HANDLE,BOOLEAN,PTOKEN_GROUPS,ULONG,PTOKEN_GROUPS,PULONG);
2144 NTSYSAPI NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
2145 NTSYSAPI NTSTATUS WINAPI NtAlertResumeThread(HANDLE,PULONG);
2146 NTSYSAPI NTSTATUS WINAPI NtAlertThread(HANDLE ThreadHandle);
2147 NTSYSAPI NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID lpLuid);
2148 NTSYSAPI NTSTATUS WINAPI NtAllocateUuids(PULARGE_INTEGER,PULONG,PULONG);
2149 NTSYSAPI NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,ULONG,SIZE_T*,ULONG,ULONG);
2150 NTSYSAPI NTSTATUS WINAPI NtAreMappedFilesTheSame(PVOID,PVOID);
2151 NTSYSAPI NTSTATUS WINAPI NtAssignProcessToJobObject(HANDLE,HANDLE);
2152 NTSYSAPI NTSTATUS WINAPI NtCallbackReturn(PVOID,ULONG,NTSTATUS);
2153 NTSYSAPI NTSTATUS WINAPI NtCancelIoFile(HANDLE,PIO_STATUS_BLOCK);
2154 NTSYSAPI NTSTATUS WINAPI NtCancelIoFileEx(HANDLE,PIO_STATUS_BLOCK,PIO_STATUS_BLOCK);
2155 NTSYSAPI NTSTATUS WINAPI NtCancelTimer(HANDLE, BOOLEAN*);
2156 NTSYSAPI NTSTATUS WINAPI NtClearEvent(HANDLE);
2157 NTSYSAPI NTSTATUS WINAPI NtClose(HANDLE);
2158 NTSYSAPI NTSTATUS WINAPI NtCloseObjectAuditAlarm(PUNICODE_STRING,HANDLE,BOOLEAN);
2159 NTSYSAPI NTSTATUS WINAPI NtCompleteConnectPort(HANDLE);
2160 NTSYSAPI NTSTATUS WINAPI NtConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
2161 NTSYSAPI NTSTATUS WINAPI NtContinue(PCONTEXT,BOOLEAN);
2162 NTSYSAPI NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
2163 NTSYSAPI NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,EVENT_TYPE,BOOLEAN);
2164 NTSYSAPI NTSTATUS WINAPI NtCreateEventPair(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
2165 NTSYSAPI NTSTATUS WINAPI NtCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
2166 NTSYSAPI NTSTATUS WINAPI NtCreateIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,ULONG);
2167 NTSYSAPI NTSTATUS WINAPI NtCreateJobObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2168 NTSYSAPI NTSTATUS WINAPI NtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
2169 NTSYSAPI NTSTATUS WINAPI NtCreateKeyTransacted(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,HANDLE,ULONG*);
2170 NTSYSAPI NTSTATUS WINAPI NtCreateKeyedEvent(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG);
2171 NTSYSAPI NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,PLARGE_INTEGER);
2172 NTSYSAPI NTSTATUS WINAPI NtCreateMutant(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,BOOLEAN);
2173 NTSYSAPI NTSTATUS WINAPI NtCreateNamedPipeFile(PHANDLE,ULONG,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,PLARGE_INTEGER);
2174 NTSYSAPI NTSTATUS WINAPI NtCreatePagingFile(PUNICODE_STRING,PLARGE_INTEGER,PLARGE_INTEGER,PLARGE_INTEGER);
2175 NTSYSAPI NTSTATUS WINAPI NtCreatePort(PHANDLE,POBJECT_ATTRIBUTES,ULONG,ULONG,PULONG);
2176 NTSYSAPI NTSTATUS WINAPI NtCreateProcess(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,BOOLEAN,HANDLE,HANDLE,HANDLE);
2177 NTSYSAPI NTSTATUS WINAPI NtCreateProfile(PHANDLE,HANDLE,PVOID,ULONG,ULONG,PVOID,ULONG,KPROFILE_SOURCE,KAFFINITY);
2178 NTSYSAPI NTSTATUS WINAPI NtCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
2179 NTSYSAPI NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,LONG,LONG);
2180 NTSYSAPI NTSTATUS WINAPI NtCreateSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PUNICODE_STRING);
2181 NTSYSAPI NTSTATUS WINAPI NtCreateThread(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,PCLIENT_ID,PCONTEXT,PINITIAL_TEB,BOOLEAN);
2182 NTSYSAPI NTSTATUS WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
2183 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);
2184 NTSYSAPI NTSTATUS WINAPI NtDelayExecution(BOOLEAN,const LARGE_INTEGER*);
2185 NTSYSAPI NTSTATUS WINAPI NtDeleteAtom(RTL_ATOM);
2186 NTSYSAPI NTSTATUS WINAPI NtDeleteFile(POBJECT_ATTRIBUTES);
2187 NTSYSAPI NTSTATUS WINAPI NtDeleteKey(HANDLE);
2188 NTSYSAPI NTSTATUS WINAPI NtDeleteValueKey(HANDLE,const UNICODE_STRING *);
2189 NTSYSAPI NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
2190 NTSYSAPI NTSTATUS WINAPI NtDisplayString(PUNICODE_STRING);
2191 NTSYSAPI NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
2192 NTSYSAPI NTSTATUS WINAPI NtDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE);
2193 NTSYSAPI NTSTATUS WINAPI NtEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
2194 NTSYSAPI NTSTATUS WINAPI NtEnumerateValueKey(HANDLE,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2195 NTSYSAPI NTSTATUS WINAPI NtExtendSection(HANDLE,PLARGE_INTEGER);
2196 NTSYSAPI NTSTATUS WINAPI NtFindAtom(const WCHAR*,ULONG,RTL_ATOM*);
2197 NTSYSAPI NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
2198 NTSYSAPI NTSTATUS WINAPI NtFlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
2199 NTSYSAPI NTSTATUS WINAPI NtFlushKey(HANDLE);
2200 NTSYSAPI NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,SIZE_T*,ULONG);
2201 NTSYSAPI NTSTATUS WINAPI NtFlushWriteBuffer(VOID);
2202 NTSYSAPI NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
2203 NTSYSAPI NTSTATUS WINAPI NtFsControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
2204 NTSYSAPI NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*);
2205 NTSYSAPI ULONG WINAPI NtGetCurrentProcessorNumber(void);
2206 NTSYSAPI NTSTATUS WINAPI NtGetPlugPlayEvent(ULONG,ULONG,PVOID,ULONG);
2207 NTSYSAPI ULONG WINAPI NtGetTickCount(VOID);
2208 NTSYSAPI NTSTATUS WINAPI NtGetWriteWatch(HANDLE,ULONG,PVOID,SIZE_T,PVOID*,ULONG_PTR*,ULONG*);
2209 NTSYSAPI NTSTATUS WINAPI NtImpersonateAnonymousToken(HANDLE);
2210 NTSYSAPI NTSTATUS WINAPI NtImpersonateClientOfPort(HANDLE,PPORT_MESSAGE);
2211 NTSYSAPI NTSTATUS WINAPI NtImpersonateThread(HANDLE,HANDLE,PSECURITY_QUALITY_OF_SERVICE);
2212 NTSYSAPI NTSTATUS WINAPI NtInitializeRegistry(BOOLEAN);
2213 NTSYSAPI NTSTATUS WINAPI NtInitiatePowerAction(POWER_ACTION,SYSTEM_POWER_STATE,ULONG,BOOLEAN);
2214 NTSYSAPI NTSTATUS WINAPI NtIsProcessInJob(HANDLE,HANDLE);
2215 NTSYSAPI NTSTATUS WINAPI NtListenPort(HANDLE,PLPC_MESSAGE);
2216 NTSYSAPI NTSTATUS WINAPI NtLoadDriver(const UNICODE_STRING *);
2217 NTSYSAPI NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *);
2218 NTSYSAPI NTSTATUS WINAPI NtLockFile(HANDLE,HANDLE,PIO_APC_ROUTINE,void*,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,ULONG*,BOOLEAN,BOOLEAN);
2219 NTSYSAPI NTSTATUS WINAPI NtLockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
2220 NTSYSAPI NTSTATUS WINAPI NtMakeTemporaryObject(HANDLE);
2221 NTSYSAPI NTSTATUS WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,SIZE_T,const LARGE_INTEGER*,SIZE_T*,SECTION_INHERIT,ULONG,ULONG);
2222 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,ULONG,BOOLEAN);
2223 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeKey(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
2224 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeMultipleKeys(HANDLE,ULONG,OBJECT_ATTRIBUTES*,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
2225 NTSYSAPI NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2226 NTSYSAPI NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
2227 NTSYSAPI NTSTATUS WINAPI NtOpenEventPair(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2228 NTSYSAPI NTSTATUS WINAPI NtOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
2229 NTSYSAPI NTSTATUS WINAPI NtOpenIoCompletion(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2230 NTSYSAPI NTSTATUS WINAPI NtOpenJobObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2231 NTSYSAPI NTSTATUS WINAPI NtOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
2232 NTSYSAPI NTSTATUS WINAPI NtOpenKeyEx(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG);
2233 NTSYSAPI NTSTATUS WINAPI NtOpenKeyTransacted(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,HANDLE);
2234 NTSYSAPI NTSTATUS WINAPI NtOpenKeyTransactedEx(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,HANDLE);
2235 NTSYSAPI NTSTATUS WINAPI NtOpenKeyedEvent(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2236 NTSYSAPI NTSTATUS WINAPI NtOpenMutant(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2237 NTSYSAPI NTSTATUS WINAPI NtOpenObjectAuditAlarm(PUNICODE_STRING,PHANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,ACCESS_MASK,PPRIVILEGE_SET,BOOLEAN,BOOLEAN,PBOOLEAN);
2238 NTSYSAPI NTSTATUS WINAPI NtOpenProcess(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
2239 NTSYSAPI NTSTATUS WINAPI NtOpenProcessToken(HANDLE,DWORD,HANDLE *);
2240 NTSYSAPI NTSTATUS WINAPI NtOpenProcessTokenEx(HANDLE,DWORD,DWORD,HANDLE *);
2241 NTSYSAPI NTSTATUS WINAPI NtOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2242 NTSYSAPI NTSTATUS WINAPI NtOpenSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2243 NTSYSAPI NTSTATUS WINAPI NtOpenSymbolicLinkObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2244 NTSYSAPI NTSTATUS WINAPI NtOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
2245 NTSYSAPI NTSTATUS WINAPI NtOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
2246 NTSYSAPI NTSTATUS WINAPI NtOpenThreadTokenEx(HANDLE,DWORD,BOOLEAN,DWORD,HANDLE *);
2247 NTSYSAPI NTSTATUS WINAPI NtOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
2248 NTSYSAPI NTSTATUS WINAPI NtPowerInformation(POWER_INFORMATION_LEVEL,PVOID,ULONG,PVOID,ULONG);
2249 NTSYSAPI NTSTATUS WINAPI NtPrivilegeCheck(HANDLE,PPRIVILEGE_SET,PBOOLEAN);
2250 NTSYSAPI NTSTATUS WINAPI NtPrivilegeObjectAuditAlarm(PUNICODE_STRING,HANDLE,HANDLE,ULONG,PPRIVILEGE_SET,BOOLEAN);
2251 NTSYSAPI NTSTATUS WINAPI NtPrivilegedServiceAuditAlarm(PUNICODE_STRING,PUNICODE_STRING,HANDLE,PPRIVILEGE_SET,BOOLEAN);
2252 NTSYSAPI NTSTATUS WINAPI NtProtectVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG,ULONG*);
2253 NTSYSAPI NTSTATUS WINAPI NtPulseEvent(HANDLE,PULONG);
2254 NTSYSAPI NTSTATUS WINAPI NtQueueApcThread(HANDLE,PNTAPCFUNC,ULONG_PTR,ULONG_PTR,ULONG_PTR);
2255 NTSYSAPI NTSTATUS WINAPI NtQueryAttributesFile(const OBJECT_ATTRIBUTES*,FILE_BASIC_INFORMATION*);
2256 NTSYSAPI NTSTATUS WINAPI NtQueryDefaultLocale(BOOLEAN,LCID*);
2257 NTSYSAPI NTSTATUS WINAPI NtQueryDefaultUILanguage(LANGID*);
2258 NTSYSAPI NTSTATUS WINAPI NtQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
2259 NTSYSAPI NTSTATUS WINAPI NtQueryDirectoryObject(HANDLE,PDIRECTORY_BASIC_INFORMATION,ULONG,BOOLEAN,BOOLEAN,PULONG,PULONG);
2260 NTSYSAPI NTSTATUS WINAPI NtQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PULONG,BOOLEAN);
2261 NTSYSAPI NTSTATUS WINAPI NtQueryEvent(HANDLE,EVENT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2262 NTSYSAPI NTSTATUS WINAPI NtQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*);
2263 NTSYSAPI NTSTATUS WINAPI NtQueryInformationAtom(RTL_ATOM,ATOM_INFORMATION_CLASS,PVOID,ULONG,ULONG*);
2264 NTSYSAPI NTSTATUS WINAPI NtQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS);
2265 NTSYSAPI NTSTATUS WINAPI NtQueryInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,PVOID,ULONG,PULONG);
2266 NTSYSAPI NTSTATUS WINAPI NtQueryInformationPort(HANDLE,PORT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2267 NTSYSAPI NTSTATUS WINAPI NtQueryInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG,PULONG);
2268 NTSYSAPI NTSTATUS WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
2269 NTSYSAPI NTSTATUS WINAPI NtQueryInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2270 NTSYSAPI NTSTATUS WINAPI NtQueryInstallUILanguage(LANGID*);
2271 NTSYSAPI NTSTATUS WINAPI NtQueryIntervalProfile(KPROFILE_SOURCE,PULONG);
2272 NTSYSAPI NTSTATUS WINAPI NtQueryIoCompletion(HANDLE,IO_COMPLETION_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2273 NTSYSAPI NTSTATUS WINAPI NtQueryKey(HANDLE,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
2274 NTSYSAPI NTSTATUS WINAPI NtQueryMultipleValueKey(HANDLE,PKEY_MULTIPLE_VALUE_INFORMATION,ULONG,PVOID,ULONG,PULONG);
2275 NTSYSAPI NTSTATUS WINAPI NtQueryMutant(HANDLE,MUTANT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2276 NTSYSAPI NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
2277 NTSYSAPI NTSTATUS WINAPI NtQueryOpenSubKeys(POBJECT_ATTRIBUTES,PULONG);
2278 NTSYSAPI NTSTATUS WINAPI NtQueryPerformanceCounter(PLARGE_INTEGER, PLARGE_INTEGER);
2279 NTSYSAPI NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
2280 NTSYSAPI NTSTATUS WINAPI NtQuerySection(HANDLE,SECTION_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2281 NTSYSAPI NTSTATUS WINAPI NtQuerySemaphore(HANDLE,SEMAPHORE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2282 NTSYSAPI NTSTATUS WINAPI NtQuerySymbolicLinkObject(HANDLE,PUNICODE_STRING,PULONG);
2283 NTSYSAPI NTSTATUS WINAPI NtQuerySystemEnvironmentValue(PUNICODE_STRING,PWCHAR,ULONG,PULONG);
2284 NTSYSAPI NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2285 NTSYSAPI NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS,void*,ULONG,void*,ULONG,ULONG*);
2286 NTSYSAPI NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER);
2287 NTSYSAPI NTSTATUS WINAPI NtQueryTimer(HANDLE,TIMER_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2288 NTSYSAPI NTSTATUS WINAPI NtQueryTimerResolution(PULONG,PULONG,PULONG);
2289 NTSYSAPI NTSTATUS WINAPI NtQueryValueKey(HANDLE,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
2290 NTSYSAPI NTSTATUS WINAPI NtQueryLicenseValue(const UNICODE_STRING *,ULONG *,PVOID,ULONG,ULONG *);
2291 NTSYSAPI NTSTATUS WINAPI NtQueryVirtualMemory(HANDLE,LPCVOID,MEMORY_INFORMATION_CLASS,PVOID,SIZE_T,SIZE_T*);
2292 NTSYSAPI NTSTATUS WINAPI NtQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
2293 NTSYSAPI NTSTATUS WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
2294 NTSYSAPI NTSTATUS WINAPI NtRaiseHardError(NTSTATUS,ULONG,PUNICODE_STRING,PVOID*,HARDERROR_RESPONSE_OPTION,PHARDERROR_RESPONSE);
2295 NTSYSAPI NTSTATUS WINAPI NtReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
2296 NTSYSAPI NTSTATUS WINAPI NtReadFileScatter(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT*,ULONG,PLARGE_INTEGER,PULONG);
2297 NTSYSAPI NTSTATUS WINAPI NtReadRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
2298 NTSYSAPI NTSTATUS WINAPI NtReadVirtualMemory(HANDLE,const void*,void*,SIZE_T,SIZE_T*);
2299 NTSYSAPI NTSTATUS WINAPI NtRegisterThreadTerminatePort(HANDLE);
2300 NTSYSAPI NTSTATUS WINAPI NtReleaseKeyedEvent(HANDLE,const void*,BOOLEAN,const LARGE_INTEGER*);
2301 NTSYSAPI NTSTATUS WINAPI NtReleaseMutant(HANDLE,PLONG);
2302 NTSYSAPI NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
2303 NTSYSAPI NTSTATUS WINAPI NtRemoveIoCompletion(HANDLE,PULONG_PTR,PULONG_PTR,PIO_STATUS_BLOCK,PLARGE_INTEGER);
2304 NTSYSAPI NTSTATUS WINAPI NtRenameKey(HANDLE,UNICODE_STRING*);
2305 NTSYSAPI NTSTATUS WINAPI NtReplaceKey(POBJECT_ATTRIBUTES,HANDLE,POBJECT_ATTRIBUTES);
2306 NTSYSAPI NTSTATUS WINAPI NtReplyPort(HANDLE,PLPC_MESSAGE);
2307 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReceivePort(HANDLE,PULONG,PLPC_MESSAGE,PLPC_MESSAGE);
2308 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReceivePortEx(HANDLE,PVOID*,PPORT_MESSAGE,PPORT_MESSAGE,PLARGE_INTEGER);
2309 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReplyPort(HANDLE,PLPC_MESSAGE);
2310 NTSYSAPI NTSTATUS WINAPI NtRequestPort(HANDLE,PLPC_MESSAGE);
2311 NTSYSAPI NTSTATUS WINAPI NtRequestWaitReplyPort(HANDLE,PLPC_MESSAGE,PLPC_MESSAGE);
2312 NTSYSAPI NTSTATUS WINAPI NtResetEvent(HANDLE,PULONG);
2313 NTSYSAPI NTSTATUS WINAPI NtResetWriteWatch(HANDLE,PVOID,SIZE_T);
2314 NTSYSAPI NTSTATUS WINAPI NtRestoreKey(HANDLE,HANDLE,ULONG);
2315 NTSYSAPI NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG);
2316 NTSYSAPI NTSTATUS WINAPI NtSaveKey(HANDLE,HANDLE);
2317 NTSYSAPI NTSTATUS WINAPI NtSecureConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PSID,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
2318 NTSYSAPI NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
2319 NTSYSAPI NTSTATUS WINAPI NtSetDefaultHardErrorPort(HANDLE);
2320 NTSYSAPI NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID);
2321 NTSYSAPI NTSTATUS WINAPI NtSetDefaultUILanguage(LANGID);
2322 NTSYSAPI NTSTATUS WINAPI NtSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG);
2323 NTSYSAPI NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
2324 NTSYSAPI NTSTATUS WINAPI NtSetHighEventPair(HANDLE);
2325 NTSYSAPI NTSTATUS WINAPI NtSetHighWaitLowEventPair(HANDLE);
2326 NTSYSAPI NTSTATUS WINAPI NtSetHighWaitLowThread(VOID);
2327 NTSYSAPI NTSTATUS WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
2328 NTSYSAPI NTSTATUS WINAPI NtSetInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,PVOID,ULONG);
2329 NTSYSAPI NTSTATUS WINAPI NtSetInformationKey(HANDLE,const int,PVOID,ULONG);
2330 NTSYSAPI NTSTATUS WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
2331 NTSYSAPI NTSTATUS WINAPI NtSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLASS,PVOID,ULONG);
2332 NTSYSAPI NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
2333 NTSYSAPI NTSTATUS WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG);
2334 NTSYSAPI NTSTATUS WINAPI NtSetIntervalProfile(ULONG,KPROFILE_SOURCE);
2335 NTSYSAPI NTSTATUS WINAPI NtSetIoCompletion(HANDLE,ULONG_PTR,ULONG_PTR,NTSTATUS,SIZE_T);
2336 NTSYSAPI NTSTATUS WINAPI NtSetLdtEntries(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG);
2337 NTSYSAPI NTSTATUS WINAPI NtSetLowEventPair(HANDLE);
2338 NTSYSAPI NTSTATUS WINAPI NtSetLowWaitHighEventPair(HANDLE);
2339 NTSYSAPI NTSTATUS WINAPI NtSetLowWaitHighThread(VOID);
2340 NTSYSAPI NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
2341 NTSYSAPI NTSTATUS WINAPI NtSetSystemEnvironmentValue(PUNICODE_STRING,PUNICODE_STRING);
2342 NTSYSAPI NTSTATUS WINAPI NtSetSystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG);
2343 NTSYSAPI NTSTATUS WINAPI NtSetSystemPowerState(POWER_ACTION,SYSTEM_POWER_STATE,ULONG);
2344 NTSYSAPI NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
2345 NTSYSAPI NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMER_APC_ROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
2346 NTSYSAPI NTSTATUS WINAPI NtSetTimerResolution(ULONG,BOOLEAN,PULONG);
2347 NTSYSAPI NTSTATUS WINAPI NtSetValueKey(HANDLE,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
2348 NTSYSAPI NTSTATUS WINAPI NtSetVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
2349 NTSYSAPI NTSTATUS WINAPI NtSignalAndWaitForSingleObject(HANDLE,HANDLE,BOOLEAN,const LARGE_INTEGER*);
2350 NTSYSAPI NTSTATUS WINAPI NtShutdownSystem(SHUTDOWN_ACTION);
2351 NTSYSAPI NTSTATUS WINAPI NtStartProfile(HANDLE);
2352 NTSYSAPI NTSTATUS WINAPI NtStopProfile(HANDLE);
2353 NTSYSAPI NTSTATUS WINAPI NtSuspendThread(HANDLE,PULONG);
2354 NTSYSAPI NTSTATUS WINAPI NtSystemDebugControl(SYSDBG_COMMAND,PVOID,ULONG,PVOID,ULONG,PULONG);
2355 NTSYSAPI NTSTATUS WINAPI NtTerminateJobObject(HANDLE,NTSTATUS);
2356 NTSYSAPI NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG);
2357 NTSYSAPI NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG);
2358 NTSYSAPI NTSTATUS WINAPI NtTestAlert(VOID);
2359 NTSYSAPI NTSTATUS WINAPI NtUnloadDriver(const UNICODE_STRING *);
2360 NTSYSAPI NTSTATUS WINAPI NtUnloadKey(POBJECT_ATTRIBUTES);
2361 NTSYSAPI NTSTATUS WINAPI NtUnloadKeyEx(POBJECT_ATTRIBUTES,HANDLE);
2362 NTSYSAPI NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
2363 NTSYSAPI NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
2364 NTSYSAPI NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
2365 NTSYSAPI NTSTATUS WINAPI NtVdmControl(ULONG,PVOID);
2366 NTSYSAPI NTSTATUS WINAPI NtWaitForKeyedEvent(HANDLE,const void*,BOOLEAN,const LARGE_INTEGER*);
2367 NTSYSAPI NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
2368 NTSYSAPI NTSTATUS WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
2369 NTSYSAPI NTSTATUS WINAPI NtWaitHighEventPair(HANDLE);
2370 NTSYSAPI NTSTATUS WINAPI NtWaitLowEventPair(HANDLE);
2371 NTSYSAPI NTSTATUS WINAPI NtWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
2372 NTSYSAPI NTSTATUS WINAPI NtWriteFileGather(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT*,ULONG,PLARGE_INTEGER,PULONG);
2373 NTSYSAPI NTSTATUS WINAPI NtWriteRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
2374 NTSYSAPI NTSTATUS WINAPI NtWriteVirtualMemory(HANDLE,void*,const void*,SIZE_T,SIZE_T*);
2375 NTSYSAPI NTSTATUS WINAPI NtYieldExecution(void);
2376
2377 NTSYSAPI void WINAPI RtlAcquirePebLock(void);
2378 NTSYSAPI BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK,BYTE);
2379 NTSYSAPI BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK,BYTE);
2380 NTSYSAPI void WINAPI RtlAcquireSRWLockExclusive(RTL_SRWLOCK*);
2381 NTSYSAPI void WINAPI RtlAcquireSRWLockShared(RTL_SRWLOCK*);
2382 NTSYSAPI NTSTATUS WINAPI RtlActivateActivationContext(DWORD,HANDLE,ULONG_PTR*);
2383 NTSYSAPI NTSTATUS WINAPI RtlAddAce(PACL,DWORD,DWORD,PACE_HEADER,DWORD);
2384 NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
2385 NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
2386 NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
2387 NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
2388 NTSYSAPI NTSTATUS WINAPI RtlAddAtomToAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
2389 NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL);
2390 NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAceEx(PACL,DWORD,DWORD,DWORD,PSID,BOOL,BOOL);
2391 NTSYSAPI void WINAPI RtlAddRefActivationContext(HANDLE);
2392 NTSYSAPI PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
2393 NTSYSAPI NTSTATUS WINAPI RtlAdjustPrivilege(ULONG,BOOLEAN,BOOLEAN,PBOOLEAN);
2394 NTSYSAPI NTSTATUS WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
2395 NTSYSAPI RTL_HANDLE * WINAPI RtlAllocateHandle(RTL_HANDLE_TABLE *,ULONG *);
2396 NTSYSAPI PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,SIZE_T) __WINE_ALLOC_SIZE(3);
2397 NTSYSAPI WCHAR WINAPI RtlAnsiCharToUnicodeChar(LPSTR *);
2398 NTSYSAPI DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING *);
2399 NTSYSAPI NTSTATUS WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING,PCANSI_STRING,BOOLEAN);
2400 NTSYSAPI NTSTATUS WINAPI RtlAppendAsciizToString(STRING *,LPCSTR);
2401 NTSYSAPI NTSTATUS WINAPI RtlAppendStringToString(STRING *,const STRING *);
2402 NTSYSAPI NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING *,const UNICODE_STRING *);
2403 NTSYSAPI NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING *,LPCWSTR);
2404 NTSYSAPI BOOLEAN WINAPI RtlAreAllAccessesGranted(ACCESS_MASK,ACCESS_MASK);
2405 NTSYSAPI BOOLEAN WINAPI RtlAreAnyAccessesGranted(ACCESS_MASK,ACCESS_MASK);
2406 NTSYSAPI BOOLEAN WINAPI RtlAreBitsSet(PCRTL_BITMAP,ULONG,ULONG);
2407 NTSYSAPI BOOLEAN WINAPI RtlAreBitsClear(PCRTL_BITMAP,ULONG,ULONG);
2408 NTSYSAPI NTSTATUS WINAPI RtlCharToInteger(PCSZ,ULONG,PULONG);
2409 NTSYSAPI NTSTATUS WINAPI RtlCheckRegistryKey(ULONG, PWSTR);
2410 NTSYSAPI void WINAPI RtlClearAllBits(PRTL_BITMAP);
2411 NTSYSAPI void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
2412 NTSYSAPI NTSTATUS WINAPI RtlCreateActivationContext(HANDLE*,const void*);
2413 NTSYSAPI PDEBUG_BUFFER WINAPI RtlCreateQueryDebugBuffer(ULONG,BOOLEAN);
2414 NTSYSAPI ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
2415 NTSYSAPI LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
2416 NTSYSAPI LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2417 NTSYSAPI NTSTATUS WINAPI RtlCompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,ULONG,PULONG,PVOID);
2418 NTSYSAPI DWORD WINAPI RtlComputeCrc32(DWORD,const BYTE*,INT);
2419 NTSYSAPI NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
2420 NTSYSAPI void WINAPI RtlCopyLuid(PLUID,const LUID*);
2421 NTSYSAPI void WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
2422 NTSYSAPI BOOLEAN WINAPI RtlCopySid(DWORD,PSID,PSID);
2423 NTSYSAPI NTSTATUS WINAPI RtlCopySecurityDescriptor(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR);
2424 NTSYSAPI void WINAPI RtlCopyString(STRING*,const STRING*);
2425 NTSYSAPI void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
2426 NTSYSAPI NTSTATUS WINAPI RtlCreateAcl(PACL,DWORD,DWORD);
2427 NTSYSAPI NTSTATUS WINAPI RtlCreateAtomTable(ULONG,RTL_ATOM_TABLE*);
2428 NTSYSAPI NTSTATUS WINAPI RtlCreateEnvironment(BOOLEAN, PWSTR*);
2429 NTSYSAPI HANDLE WINAPI RtlCreateHeap(ULONG,PVOID,SIZE_T,SIZE_T,PVOID,PRTL_HEAP_DEFINITION);
2430 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*);
2431 NTSYSAPI NTSTATUS WINAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
2432 NTSYSAPI NTSTATUS WINAPI RtlCreateTimerQueue(PHANDLE);
2433 NTSYSAPI NTSTATUS WINAPI RtlCreateTimer(PHANDLE, HANDLE, RTL_WAITORTIMERCALLBACKFUNC, PVOID, DWORD, DWORD, ULONG);
2434 NTSYSAPI BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
2435 NTSYSAPI BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
2436 NTSYSAPI NTSTATUS WINAPI RtlCreateUserProcess(UNICODE_STRING*,ULONG,RTL_USER_PROCESS_PARAMETERS*,SECURITY_DESCRIPTOR*,SECURITY_DESCRIPTOR*,HANDLE,BOOLEAN,HANDLE,HANDLE,RTL_USER_PROCESS_INFORMATION*);
2437 NTSYSAPI NTSTATUS WINAPI RtlCreateUserThread(HANDLE,const SECURITY_DESCRIPTOR*,BOOLEAN,PVOID,SIZE_T,SIZE_T,PRTL_THREAD_START_ROUTINE,void*,HANDLE*,CLIENT_ID*);
2438 NTSYSAPI void WINAPI RtlDeactivateActivationContext(DWORD,ULONG_PTR);
2439 NTSYSAPI PVOID WINAPI RtlDecodePointer(PVOID);
2440 NTSYSAPI NTSTATUS WINAPI RtlDecompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,PULONG);
2441 NTSYSAPI NTSTATUS WINAPI RtlDeleteAce(PACL,DWORD);
2442 NTSYSAPI NTSTATUS WINAPI RtlDeleteAtomFromAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
2443 NTSYSAPI NTSTATUS WINAPI RtlDeleteCriticalSection(RTL_CRITICAL_SECTION *);
2444 NTSYSAPI NTSTATUS WINAPI RtlDeleteRegistryValue(ULONG, PCWSTR, PCWSTR);
2445 NTSYSAPI void WINAPI RtlDeleteResource(LPRTL_RWLOCK);
2446 NTSYSAPI NTSTATUS WINAPI RtlDeleteSecurityObject(PSECURITY_DESCRIPTOR*);
2447 NTSYSAPI NTSTATUS WINAPI RtlDeleteTimer(HANDLE, HANDLE, HANDLE);
2448 NTSYSAPI NTSTATUS WINAPI RtlDeleteTimerQueueEx(HANDLE, HANDLE);
2449 NTSYSAPI PRTL_USER_PROCESS_PARAMETERS WINAPI RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
2450 NTSYSAPI NTSTATUS WINAPI RtlDeregisterWait(HANDLE);
2451 NTSYSAPI NTSTATUS WINAPI RtlDeregisterWaitEx(HANDLE,HANDLE);
2452 NTSYSAPI NTSTATUS WINAPI RtlDestroyAtomTable(RTL_ATOM_TABLE);
2453 NTSYSAPI NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR);
2454 NTSYSAPI NTSTATUS WINAPI RtlDestroyHandleTable(RTL_HANDLE_TABLE *);
2455 NTSYSAPI HANDLE WINAPI RtlDestroyHeap(HANDLE);
2456 NTSYSAPI void WINAPI RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS*);
2457 NTSYSAPI NTSTATUS WINAPI RtlDestroyQueryDebugBuffer(PDEBUG_BUFFER);
2458 NTSYSAPI DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
2459 NTSYSAPI BOOLEAN WINAPI RtlDllShutdownInProgress(void);
2460 NTSYSAPI BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR);
2461 NTSYSAPI BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(PCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
2462 NTSYSAPI ULONG WINAPI RtlDosSearchPath_U(LPCWSTR, LPCWSTR, LPCWSTR, ULONG, LPWSTR, LPWSTR*);
2463 NTSYSAPI WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
2464 NTSYSAPI NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2465 NTSYSAPI void WINAPI RtlDumpResource(LPRTL_RWLOCK);
2466 NTSYSAPI NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
2467 NTSYSAPI NTSTATUS WINAPI RtlEmptyAtomTable(RTL_ATOM_TABLE,BOOLEAN);
2468 NTSYSAPI PVOID WINAPI RtlEncodePointer(PVOID);
2469 NTSYSAPI NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
2470 NTSYSAPI void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
2471 NTSYSAPI NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
2472 NTSYSAPI NTSTATUS WINAPI RtlEqualDomainName(const UNICODE_STRING*,const UNICODE_STRING*);
2473 NTSYSAPI BOOLEAN WINAPI RtlEqualLuid(const LUID*,const LUID*);
2474 NTSYSAPI BOOL WINAPI RtlEqualPrefixSid(PSID,PSID);
2475 NTSYSAPI BOOL WINAPI RtlEqualSid(PSID,PSID);
2476 NTSYSAPI BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
2477 NTSYSAPI BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2478 NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlExitUserProcess(ULONG);
2479 NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlExitUserThread(ULONG);
2480 NTSYSAPI NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PCWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*);
2481 NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionString(ULONG,const GUID*,ULONG,const UNICODE_STRING*,PVOID);
2482 NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionGuid(ULONG,const GUID*,ULONG,const GUID*,PVOID);
2483 NTSYSAPI NTSTATUS WINAPI RtlFindCharInUnicodeString(int,const UNICODE_STRING*,const UNICODE_STRING*,USHORT*);
2484 NTSYSAPI ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
2485 NTSYSAPI ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
2486 NTSYSAPI ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
2487 NTSYSAPI ULONG WINAPI RtlFindLastBackwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
2488 NTSYSAPI ULONG WINAPI RtlFindLastBackwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
2489 NTSYSAPI CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG);
2490 NTSYSAPI ULONG WINAPI RtlFindLongestRunSet(PCRTL_BITMAP,PULONG);
2491 NTSYSAPI ULONG WINAPI RtlFindLongestRunClear(PCRTL_BITMAP,PULONG);
2492 NTSYSAPI NTSTATUS WINAPI RtlFindMessage(HMODULE,ULONG,ULONG,ULONG,const MESSAGE_RESOURCE_ENTRY**);
2493 NTSYSAPI CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG);
2494 NTSYSAPI ULONG WINAPI RtlFindNextForwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
2495 NTSYSAPI ULONG WINAPI RtlFindNextForwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
2496 NTSYSAPI ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP,ULONG,ULONG);
2497 NTSYSAPI ULONG WINAPI RtlFindSetBitsAndClear(PRTL_BITMAP,ULONG,ULONG);
2498 NTSYSAPI ULONG WINAPI RtlFindSetRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
2499 NTSYSAPI BOOLEAN WINAPI RtlFirstFreeAce(PACL,PACE_HEADER *);
2500 NTSYSAPI NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING);
2501 NTSYSAPI NTSTATUS WINAPI RtlFormatMessage(LPWSTR,UCHAR,BOOLEAN,BOOLEAN,BOOLEAN,__ms_va_list *,LPWSTR,ULONG);
2502 NTSYSAPI void WINAPI RtlFreeAnsiString(PANSI_STRING);
2503 NTSYSAPI BOOLEAN WINAPI RtlFreeHandle(RTL_HANDLE_TABLE *,RTL_HANDLE *);
2504 NTSYSAPI BOOLEAN WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
2505 NTSYSAPI void WINAPI RtlFreeOemString(POEM_STRING);
2506 NTSYSAPI DWORD WINAPI RtlFreeSid(PSID);
2507 NTSYSAPI void WINAPI RtlFreeThreadActivationContextStack(void);
2508 NTSYSAPI void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
2509 NTSYSAPI NTSTATUS WINAPI RtlGetAce(PACL,DWORD,LPVOID *);
2510 NTSYSAPI NTSTATUS WINAPI RtlGetActiveActivationContext(HANDLE*);
2511 NTSYSAPI NTSTATUS WINAPI RtlGetCompressionWorkSpaceSize(USHORT,PULONG,PULONG);
2512 NTSYSAPI NTSTATUS WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
2513 NTSYSAPI NTSTATUS WINAPI RtlGetCurrentDirectory_U(ULONG, LPWSTR);
2514 NTSYSAPI PEB * WINAPI RtlGetCurrentPeb(void);
2515 NTSYSAPI NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
2516 NTSYSAPI ULONG WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*);
2517 NTSYSAPI NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
2518 NTSYSAPI NTSTATUS WINAPI RtlGetLastNtStatus(void);
2519 NTSYSAPI DWORD WINAPI RtlGetLastWin32Error(void);
2520 NTSYSAPI DWORD WINAPI RtlGetLongestNtPathLength(void);
2521 NTSYSAPI ULONG WINAPI RtlGetNtGlobalFlags(void);
2522 NTSYSAPI BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
2523 NTSYSAPI NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
2524 NTSYSAPI ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
2525 NTSYSAPI DWORD WINAPI RtlGetThreadErrorMode(void);
2526 NTSYSAPI NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
2527 NTSYSAPI NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
2528 NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING,GUID*);
2529 NTSYSAPI PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
2530 NTSYSAPI PVOID WINAPI RtlImageDirectoryEntryToData(HMODULE,BOOL,WORD,ULONG *);
2531 NTSYSAPI PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE);
2532 NTSYSAPI PIMAGE_SECTION_HEADER WINAPI RtlImageRvaToSection(const IMAGE_NT_HEADERS *,HMODULE,DWORD);
2533 NTSYSAPI PVOID WINAPI RtlImageRvaToVa(const IMAGE_NT_HEADERS *,HMODULE,DWORD,IMAGE_SECTION_HEADER **);
2534 NTSYSAPI NTSTATUS WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
2535 NTSYSAPI void WINAPI RtlInitString(PSTRING,PCSZ);
2536 NTSYSAPI void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
2537 NTSYSAPI NTSTATUS WINAPI RtlInitAnsiStringEx(PANSI_STRING,PCSZ);
2538 NTSYSAPI void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
2539 NTSYSAPI NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
2540 NTSYSAPI void WINAPI RtlInitializeBitMap(PRTL_BITMAP,PULONG,ULONG);
2541 NTSYSAPI void WINAPI RtlInitializeConditionVariable(RTL_CONDITION_VARIABLE *);
2542 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
2543 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,ULONG);
2544 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSectionEx(RTL_CRITICAL_SECTION *,ULONG,ULONG);
2545 NTSYSAPI void WINAPI RtlInitializeHandleTable(ULONG,ULONG,RTL_HANDLE_TABLE *);
2546 NTSYSAPI void WINAPI RtlInitializeResource(LPRTL_RWLOCK);
2547 NTSYSAPI void WINAPI RtlInitializeSRWLock(RTL_SRWLOCK*);
2548 NTSYSAPI BOOL WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
2549 NTSYSAPI NTSTATUS WINAPI RtlInt64ToUnicodeString(ULONGLONG,ULONG,UNICODE_STRING *);
2550 NTSYSAPI NTSTATUS WINAPI RtlIntegerToChar(ULONG,ULONG,ULONG,PCHAR);
2551 NTSYSAPI NTSTATUS WINAPI RtlIntegerToUnicodeString(ULONG,ULONG,UNICODE_STRING *);
2552 NTSYSAPI BOOLEAN WINAPI RtlIsActivationContextActive(HANDLE);
2553 NTSYSAPI BOOL WINAPI RtlIsCriticalSectionLocked(RTL_CRITICAL_SECTION *);
2554 NTSYSAPI BOOL WINAPI RtlIsCriticalSectionLockedByThread(RTL_CRITICAL_SECTION *);
2555 NTSYSAPI ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR);
2556 NTSYSAPI BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN);
2557 NTSYSAPI BOOLEAN WINAPI RtlIsTextUnicode(LPCVOID,INT,INT *);
2558 NTSYSAPI BOOLEAN WINAPI RtlIsValidHandle(const RTL_HANDLE_TABLE *, const RTL_HANDLE *);
2559 NTSYSAPI BOOLEAN WINAPI RtlIsValidIndexHandle(const RTL_HANDLE_TABLE *, ULONG Index, RTL_HANDLE **);
2560 NTSYSAPI NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *);
2561 NTSYSAPI DWORD WINAPI RtlLengthRequiredSid(DWORD);
2562 NTSYSAPI ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR);
2563 NTSYSAPI DWORD WINAPI RtlLengthSid(PSID);
2564 NTSYSAPI NTSTATUS WINAPI RtlLocalTimeToSystemTime(const LARGE_INTEGER*,PLARGE_INTEGER);
2565 NTSYSAPI BOOLEAN WINAPI RtlLockHeap(HANDLE);
2566 NTSYSAPI NTSTATUS WINAPI RtlLookupAtomInAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
2567 NTSYSAPI NTSTATUS WINAPI RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
2568 NTSYSAPI void WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*);
2569 NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
2570 NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
2571 NTSYSAPI NTSTATUS WINAPI RtlNewSecurityObject(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,BOOLEAN,HANDLE,PGENERIC_MAPPING);
2572 NTSYSAPI PRTL_USER_PROCESS_PARAMETERS WINAPI RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
2573 NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS);
2574 NTSYSAPI ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS);
2575 NTSYSAPI ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP);
2576 NTSYSAPI ULONG WINAPI RtlNumberOfClearBits(PCRTL_BITMAP);
2577 NTSYSAPI UINT WINAPI RtlOemStringToUnicodeSize(const STRING*);
2578 NTSYSAPI NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
2579 NTSYSAPI NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
2580 NTSYSAPI NTSTATUS WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHANDLE);
2581 NTSYSAPI PVOID WINAPI RtlPcToFileHeader(PVOID,PVOID*);
2582 NTSYSAPI NTSTATUS WINAPI RtlPinAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
2583 NTSYSAPI BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
2584 NTSYSAPI BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2585 NTSYSAPI NTSTATUS WINAPI RtlQueryAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM,ULONG*,ULONG*,WCHAR*,ULONG*);
2586 NTSYSAPI NTSTATUS WINAPI RtlQueryDynamicTimeZoneInformation(RTL_DYNAMIC_TIME_ZONE_INFORMATION*);
2587 NTSYSAPI NTSTATUS WINAPI RtlQueryEnvironmentVariable_U(PWSTR,PUNICODE_STRING,PUNICODE_STRING);
2588 NTSYSAPI NTSTATUS WINAPI RtlQueryHeapInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T,PSIZE_T);
2589 NTSYSAPI NTSTATUS WINAPI RtlQueryInformationAcl(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
2590 NTSYSAPI NTSTATUS WINAPI RtlQueryInformationActivationContext(ULONG,HANDLE,PVOID,ULONG,PVOID,SIZE_T,SIZE_T*);
2591 NTSYSAPI NTSTATUS WINAPI RtlQueryProcessDebugInformation(ULONG,ULONG,PDEBUG_BUFFER);
2592 NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID);
2593 NTSYSAPI NTSTATUS WINAPI RtlQueryTimeZoneInformation(RTL_TIME_ZONE_INFORMATION*);
2594 NTSYSAPI NTSTATUS WINAPI RtlQueryUnbiasedInterruptTime(ULONGLONG*);
2595 NTSYSAPI NTSTATUS WINAPI RtlQueueWorkItem(PRTL_WORK_ITEM_ROUTINE,PVOID,ULONG);
2596 NTSYSAPI void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
2597 NTSYSAPI void WINAPI RtlRaiseStatus(NTSTATUS);
2598 NTSYSAPI ULONG WINAPI RtlRandom(PULONG);
2599 NTSYSAPI PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,SIZE_T);
2600 NTSYSAPI NTSTATUS WINAPI RtlRegisterWait(PHANDLE,HANDLE,RTL_WAITORTIMERCALLBACKFUNC,PVOID,ULONG,ULONG);
2601 NTSYSAPI void WINAPI RtlReleaseActivationContext(HANDLE);
2602 NTSYSAPI void WINAPI RtlReleasePebLock(void);
2603 NTSYSAPI void WINAPI RtlReleaseResource(LPRTL_RWLOCK);
2604 NTSYSAPI void WINAPI RtlReleaseSRWLockExclusive(RTL_SRWLOCK*);
2605 NTSYSAPI void WINAPI RtlReleaseSRWLockShared(RTL_SRWLOCK*);
2606 NTSYSAPI ULONG WINAPI RtlRemoveVectoredExceptionHandler(PVOID);
2607 NTSYSAPI void WINAPI RtlRestoreLastWin32Error(DWORD);
2608 NTSYSAPI void WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *);
2609 NTSYSAPI void WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *);
2610 NTSYSAPI NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD);
2611 NTSYSAPI void WINAPI RtlSetAllBits(PRTL_BITMAP);
2612 NTSYSAPI void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG);
2613 NTSYSAPI ULONG WINAPI RtlSetCriticalSectionSpinCount(RTL_CRITICAL_SECTION*,ULONG);
2614 NTSYSAPI NTSTATUS WINAPI RtlSetControlSecurityDescriptor(PSECURITY_DESCRIPTOR,SECURITY_DESCRIPTOR_CONTROL,SECURITY_DESCRIPTOR_CONTROL);
2615 NTSYSAPI NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING*);
2616 NTSYSAPI void WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*);
2617 NTSYSAPI NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
2618 NTSYSAPI NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR*,PUNICODE_STRING,PUNICODE_STRING);
2619 NTSYSAPI NTSTATUS WINAPI RtlSetHeapInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T);
2620 NTSYSAPI NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
2621 NTSYSAPI NTSTATUS WINAPI RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
2622 NTSYSAPI NTSTATUS WINAPI RtlSetIoCompletionCallback(HANDLE,PRTL_OVERLAPPED_COMPLETION_ROUTINE,ULONG);
2623 NTSYSAPI void WINAPI RtlSetLastWin32Error(DWORD);
2624 NTSYSAPI void WINAPI RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS);
2625 NTSYSAPI NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
2626 NTSYSAPI NTSTATUS WINAPI RtlSetThreadErrorMode(DWORD,LPDWORD);
2627 NTSYSAPI NTSTATUS WINAPI RtlSetTimeZoneInformation(const RTL_TIME_ZONE_INFORMATION*);
2628 NTSYSAPI SIZE_T WINAPI RtlSizeHeap(HANDLE,ULONG,const void*);
2629 NTSYSAPI NTSTATUS WINAPI RtlSleepConditionVariableCS(RTL_CONDITION_VARIABLE*,RTL_CRITICAL_SECTION*,const LARGE_INTEGER*);
2630 NTSYSAPI NTSTATUS WINAPI RtlSleepConditionVariableSRW(RTL_CONDITION_VARIABLE*,RTL_SRWLOCK*,const LARGE_INTEGER*,ULONG);
2631 NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID,PUNICODE_STRING);
2632 NTSYSAPI LPDWORD WINAPI RtlSubAuthoritySid(PSID,DWORD);
2633 NTSYSAPI LPBYTE WINAPI RtlSubAuthorityCountSid(PSID);
2634 NTSYSAPI NTSTATUS WINAPI RtlSystemTimeToLocalTime(const LARGE_INTEGER*,PLARGE_INTEGER);
2635 NTSYSAPI void WINAPI RtlTimeToTimeFields(const LARGE_INTEGER*,PTIME_FIELDS);
2636 NTSYSAPI BOOLEAN WINAPI RtlTimeFieldsToTime(PTIME_FIELDS,PLARGE_INTEGER);
2637 NTSYSAPI void WINAPI RtlTimeToElapsedTimeFields(const LARGE_INTEGER *,PTIME_FIELDS);
2638 NTSYSAPI BOOLEAN WINAPI RtlTimeToSecondsSince1970(const LARGE_INTEGER *,LPDWORD);
2639 NTSYSAPI BOOLEAN WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *,LPDWORD);
2640 NTSYSAPI BOOLEAN WINAPI RtlTryAcquireSRWLockExclusive(RTL_SRWLOCK *);
2641 NTSYSAPI BOOLEAN WINAPI RtlTryAcquireSRWLockShared(RTL_SRWLOCK *);
2642 NTSYSAPI BOOL WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *);
2643 #ifdef __REACTOS__
2644 ULONGLONG __fastcall RtlUlonglongByteSwap(ULONGLONG);
2645 #define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x))
2646 #else
2647 NTSYSAPI ULONGLONG __cdecl RtlUlonglongByteSwap(ULONGLONG);
2648 #endif /* __REACTOS__ */
2649 NTSYSAPI DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
2650 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING,PCUNICODE_STRING,BOOLEAN);
2651 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToInteger(const UNICODE_STRING *,ULONG,ULONG *);
2652 NTSYSAPI DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
2653 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToOemString(POEM_STRING,PCUNICODE_STRING,BOOLEAN);
2654 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2655 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToMultiByteSize(PULONG,PCWSTR,ULONG);
2656 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2657 NTSYSAPI ULONG WINAPI RtlUniform(PULONG);
2658 NTSYSAPI BOOLEAN WINAPI RtlUnlockHeap(HANDLE);
2659 NTSYSAPI void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID);
2660 #ifdef __x86_64__
2661 NTSYSAPI void WINAPI RtlUnwindEx(PVOID,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
2662 #elif defined(__ia64__)
2663 NTSYSAPI void WINAPI RtlUnwind2(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT);
2664 NTSYSAPI void WINAPI RtlUnwindEx(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
2665 #endif
2666 NTSYSAPI WCHAR WINAPI RtlUpcaseUnicodeChar(WCHAR);
2667 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
2668 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
2669 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
2670 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
2671 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2672 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2673 NTSYSAPI NTSTATUS WINAPI RtlUpdateTimer(HANDLE, HANDLE, DWORD, DWORD);
2674 NTSYSAPI CHAR WINAPI RtlUpperChar(CHAR);
2675 NTSYSAPI void WINAPI RtlUpperString(STRING *,const STRING *);
2676 NTSYSAPI NTSTATUS WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
2677 NTSYSAPI BOOLEAN WINAPI RtlValidRelativeSecurityDescriptor(PSECURITY_DESCRIPTOR,ULONG,SECURITY_INFORMATION);
2678 NTSYSAPI BOOLEAN WINAPI RtlValidAcl(PACL);
2679 NTSYSAPI BOOLEAN WINAPI RtlValidSid(PSID);
2680 NTSYSAPI BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
2681 NTSYSAPI NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
2682 NTSYSAPI void WINAPI RtlWakeAllConditionVariable(RTL_CONDITION_VARIABLE *);
2683 NTSYSAPI void WINAPI RtlWakeConditionVariable(RTL_CONDITION_VARIABLE *);
2684 NTSYSAPI NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
2685 NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirection(BOOLEAN);
2686 NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx(ULONG,ULONG*);
2687 NTSYSAPI NTSTATUS WINAPI RtlWriteRegistryValue(ULONG,PCWSTR,PCWSTR,ULONG,PVOID,ULONG);
2688 NTSYSAPI NTSTATUS WINAPI RtlZombifyActivationContext(HANDLE);
2689 NTSYSAPI NTSTATUS WINAPI RtlpNtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
2690 NTSYSAPI NTSTATUS WINAPI RtlpNtEnumerateSubKey(HANDLE,UNICODE_STRING *, ULONG);
2691 NTSYSAPI NTSTATUS WINAPI RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION *);
2692 NTSYSAPI NTSTATUS WINAPI RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION *);
2693 NTSYSAPI NTSTATUS WINAPI vDbgPrintEx(ULONG,ULONG,LPCSTR,__ms_va_list);
2694 NTSYSAPI NTSTATUS WINAPI vDbgPrintExWithPrefix(LPCSTR,ULONG,ULONG,LPCSTR,__ms_va_list);
2695
2696 /* 32-bit only functions */
2697
2698 #ifndef _WIN64
2699 NTSYSAPI LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
2700 NTSYSAPI ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
2701 NTSYSAPI LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
2702 NTSYSAPI ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
2703 NTSYSAPI UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
2704 NTSYSAPI LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
2705 NTSYSAPI LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
2706 NTSYSAPI LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
2707 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
2708 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
2709 NTSYSAPI ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
2710 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerNegate(LONGLONG);
2711 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
2712 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
2713 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
2714 NTSYSAPI NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
2715 #endif
2716
2717 /* Wine internal functions */
2718
2719 NTSYSAPI NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRING *unix_name_ret,
2720 UINT disposition, BOOLEAN check_case );
2721 NTSYSAPI NTSTATUS CDECL wine_unix_to_nt_file_name( const ANSI_STRING *name, UNICODE_STRING *nt );
2722
2723 NTSYSAPI SIZE_T CDECL wine_uninterrupted_read_memory( const void *addr, void *buffer, SIZE_T size );
2724 NTSYSAPI SIZE_T CDECL wine_uninterrupted_write_memory( void *addr, const void *buffer, SIZE_T size );
2725
2726
2727 /***********************************************************************
2728 * Inline functions
2729 */
2730
2731 #define InitializeObjectAttributes(p,n,a,r,s) \
2732 do { \
2733 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
2734 (p)->RootDirectory = r; \
2735 (p)->Attributes = a; \
2736 (p)->ObjectName = n; \
2737 (p)->SecurityDescriptor = s; \
2738 (p)->SecurityQualityOfService = NULL; \
2739 } while (0)
2740
2741 #define NtCurrentProcess() ((HANDLE)-1)
2742
2743 #ifndef RtlFillMemory // REACTOS
2744 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
2745 #endif // REACTOS
2746 #ifndef RtlMoveMemory // REACTOS
2747 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
2748 #endif // REACTOS
2749 #define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
2750 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
2751 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
2752 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
2753 #ifndef RtlZeroMemory // REACTOS
2754 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
2755 #endif // REACTOS
2756
2757 static inline BOOLEAN RtlCheckBit(PCRTL_BITMAP lpBits, ULONG ulBit)
2758 {
2759 if (lpBits && ulBit < lpBits->SizeOfBitMap &&
2760 lpBits->Buffer[ulBit >> 5] & (1 << (ulBit & 31)))
2761 return TRUE;
2762 return FALSE;
2763 }
2764
2765 /* These are implemented as __fastcall, so we can't let Winelib apps link with them */
2766 static inline USHORT RtlUshortByteSwap(USHORT s)
2767 {
2768 return (s >> 8) | (s << 8);
2769 }
2770 static inline ULONG RtlUlongByteSwap(ULONG i)
2771 {
2772 #if defined(__i386__) && defined(__GNUC__)
2773 ULONG ret;
2774 __asm__("bswap %0" : "=r" (ret) : "0" (i) );
2775 return ret;
2776 #else
2777 return ((ULONG)RtlUshortByteSwap((USHORT)i) << 16) | RtlUshortByteSwap((USHORT)(i >> 16));
2778 #endif
2779 }
2780
2781 /* list manipulation macros */
2782 #define InitializeListHead(le) (void)((le)->Flink = (le)->Blink = (le))
2783 #define InsertHeadList(le,e) do { PLIST_ENTRY f = (le)->Flink; (e)->Flink = f; (e)->Blink = (le); f->Blink = (e); (le)->Flink = (e); } while (0)
2784 #define InsertTailList(le,e) do { PLIST_ENTRY b = (le)->Blink; (e)->Flink = (le); (e)->Blink = b; b->Flink = (e); (le)->Blink = (e); } while (0)
2785 #define IsListEmpty(le) ((le)->Flink == (le))
2786 #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)
2787 static inline PLIST_ENTRY RemoveHeadList(PLIST_ENTRY le)
2788 {
2789 PLIST_ENTRY f, b, e;
2790
2791 e = le->Flink;
2792 f = le->Flink->Flink;
2793 b = le->Flink->Blink;
2794 f->Blink = b;
2795 b->Flink = f;
2796
2797 if (e != le) e->Flink = e->Blink = NULL;
2798 return e;
2799 }
2800 static inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le)
2801 {
2802 PLIST_ENTRY f, b, e;
2803
2804 e = le->Blink;
2805 f = le->Blink->Flink;
2806 b = le->Blink->Blink;
2807 f->Blink = b;
2808 b->Flink = f;
2809
2810 if (e != le) e->Flink = e->Blink = NULL;
2811 return e;
2812 }
2813
2814
2815 #ifdef __WINESRC__
2816
2817 /* FIXME: private structure for vm86 mode, stored in teb->GdiTebBatch */
2818 typedef struct
2819 {
2820 DWORD dpmi_vif;
2821 DWORD vm86_pending;
2822 } WINE_VM86_TEB_INFO;
2823
2824 static inline WINE_VM86_TEB_INFO *get_vm86_teb_info(void)
2825 {
2826 return (WINE_VM86_TEB_INFO *)&NtCurrentTeb()->GdiTebBatch;
2827 }
2828
2829 /* The thread information for 16-bit threads */
2830 /* NtCurrentTeb()->SubSystemTib points to this */
2831 typedef struct
2832 {
2833 void *unknown; /* 00 unknown */
2834 UNICODE_STRING *exe_name; /* 04 exe module name */
2835
2836 /* the following fields do not exist under Windows */
2837 UNICODE_STRING exe_str; /* exe name string pointed to by exe_name */
2838 CURDIR curdir; /* current directory */
2839 WCHAR curdir_buffer[MAX_PATH];
2840 } WIN16_SUBSYSTEM_TIB;
2841
2842 #endif /* __WINESRC__ */
2843
2844 #ifdef __cplusplus
2845 } /* extern "C" */
2846 #endif /* defined(__cplusplus) */
2847
2848 #endif /* __WINE_WINTERNL_H */