[DXSDK] Add missing ksuuids.h inclusion.
[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 Unknown54,
847 Unknown55,
848 Unknown56,
849 Unknown57,
850 Unknown58,
851 Unknown59,
852 Unknown60,
853 Unknown61,
854 Unknown62,
855 Unknown63,
856 Unknown64,
857 Unknown65,
858 Unknown66,
859 Unknown67,
860 Unknown68,
861 Unknown69,
862 Unknown70,
863 Unknown71,
864 Unknown72,
865 SystemLogicalProcessorInformation = 73,
866 SystemInformationClassMax
867 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
868
869 typedef enum _THREADINFOCLASS {
870 ThreadBasicInformation,
871 ThreadTimes,
872 ThreadPriority,
873 ThreadBasePriority,
874 ThreadAffinityMask,
875 ThreadImpersonationToken,
876 ThreadDescriptorTableEntry,
877 ThreadEnableAlignmentFaultFixup,
878 ThreadEventPair_Reusable,
879 ThreadQuerySetWin32StartAddress,
880 ThreadZeroTlsCell,
881 ThreadPerformanceCount,
882 ThreadAmILastThread,
883 ThreadIdealProcessor,
884 ThreadPriorityBoost,
885 ThreadSetTlsArrayAddress,
886 ThreadIsIoPending,
887 ThreadHideFromDebugger,
888 ThreadBreakOnTermination,
889 ThreadSwitchLegacyState,
890 ThreadIsTerminated,
891 ThreadLastSystemCall,
892 ThreadIoPriority,
893 ThreadCycleTime,
894 ThreadPagePriority,
895 ThreadActualBasePriority,
896 ThreadTebInformation,
897 ThreadCSwitchMon,
898 ThreadCSwitchPmu,
899 ThreadWow64Context,
900 ThreadGroupInformation,
901 ThreadUmsInformation,
902 ThreadCounterProfiling,
903 ThreadIdealProcessorEx,
904 MaxThreadInfoClass
905 } THREADINFOCLASS;
906
907 typedef struct _THREAD_BASIC_INFORMATION
908 {
909 NTSTATUS ExitStatus;
910 PVOID TebBaseAddress;
911 CLIENT_ID ClientId;
912 ULONG_PTR AffinityMask;
913 LONG Priority;
914 LONG BasePriority;
915 } THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
916
917 typedef struct _THREAD_DESCRIPTOR_INFORMATION
918 {
919 DWORD Selector;
920 LDT_ENTRY Entry;
921 } THREAD_DESCRIPTOR_INFORMATION, *PTHREAD_DESCRIPTOR_INFORMATION;
922
923 typedef struct _KERNEL_USER_TIMES {
924 LARGE_INTEGER CreateTime;
925 LARGE_INTEGER ExitTime;
926 LARGE_INTEGER KernelTime;
927 LARGE_INTEGER UserTime;
928 } KERNEL_USER_TIMES, *PKERNEL_USER_TIMES;
929
930 typedef enum _WINSTATIONINFOCLASS {
931 WinStationInformation = 8
932 } WINSTATIONINFOCLASS;
933
934 typedef enum _MEMORY_INFORMATION_CLASS {
935 MemoryBasicInformation,
936 MemoryWorkingSetList,
937 MemorySectionName,
938 MemoryBasicVlmInformation
939 } MEMORY_INFORMATION_CLASS;
940
941 typedef struct _MEMORY_SECTION_NAME
942 {
943 UNICODE_STRING SectionFileName;
944 } MEMORY_SECTION_NAME, *PMEMORY_SECTION_NAME;
945
946 typedef enum _MUTANT_INFORMATION_CLASS
947 {
948 MutantBasicInformation
949 } MUTANT_INFORMATION_CLASS, *PMUTANT_INFORMATION_CLASS;
950
951 typedef struct _MUTANT_BASIC_INFORMATION {
952 LONG CurrentCount;
953 BOOLEAN OwnedByCaller;
954 BOOLEAN AbandonedState;
955 } MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION;
956
957 typedef enum _TIMER_INFORMATION_CLASS
958 {
959 TimerBasicInformation = 0
960 } TIMER_INFORMATION_CLASS;
961
962 typedef struct _TIMER_BASIC_INFORMATION
963 {
964 LARGE_INTEGER RemainingTime;
965 BOOLEAN TimerState;
966 } TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION;
967
968
969 /* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
970 typedef enum
971 {
972 INVALID_PATH = 0,
973 UNC_PATH, /* "//foo" */
974 ABSOLUTE_DRIVE_PATH, /* "c:/foo" */
975 RELATIVE_DRIVE_PATH, /* "c:foo" */
976 ABSOLUTE_PATH, /* "/foo" */
977 RELATIVE_PATH, /* "foo" */
978 DEVICE_PATH, /* "//./foo" */
979 UNC_DOT_PATH /* "//." */
980 } DOS_PATHNAME_TYPE;
981
982
983 /***********************************************************************
984 * Types and data structures
985 */
986
987 /* This is used by NtQuerySystemInformation */
988 typedef struct _SYSTEM_THREAD_INFORMATION
989 { /* win32/win64 */
990 LARGE_INTEGER KernelTime; /* 00/00 */
991 LARGE_INTEGER UserTime; /* 08/08 */
992 LARGE_INTEGER CreateTime; /* 10/10 */
993 DWORD dwTickCount; /* 18/18 */
994 LPVOID StartAddress; /* 1c/20 */
995 CLIENT_ID ClientId; /* 20/28 */
996 DWORD dwCurrentPriority; /* 28/38 */
997 DWORD dwBasePriority; /* 2c/3c */
998 DWORD dwContextSwitches; /* 30/40 */
999 DWORD dwThreadState; /* 34/44 */
1000 DWORD dwWaitReason; /* 38/48 */
1001 DWORD dwUnknown; /* 3c/4c */
1002 } SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION;
1003
1004 typedef struct _IO_STATUS_BLOCK {
1005 union {
1006 NTSTATUS Status;
1007 PVOID Pointer;
1008 } DUMMYUNIONNAME;
1009
1010 ULONG_PTR Information;
1011 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
1012
1013 typedef void (WINAPI * PIO_APC_ROUTINE)(PVOID,PIO_STATUS_BLOCK,ULONG);
1014
1015 typedef struct _KEY_BASIC_INFORMATION {
1016 LARGE_INTEGER LastWriteTime;
1017 ULONG TitleIndex;
1018 ULONG NameLength;
1019 WCHAR Name[1];
1020 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
1021
1022 typedef struct _KEY_NODE_INFORMATION
1023 {
1024 LARGE_INTEGER LastWriteTime;
1025 ULONG TitleIndex;
1026 ULONG ClassOffset;
1027 ULONG ClassLength;
1028 ULONG NameLength;
1029 WCHAR Name[1];
1030 /* Class[1]; */
1031 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
1032
1033 typedef struct _KEY_FULL_INFORMATION
1034 {
1035 LARGE_INTEGER LastWriteTime;
1036 ULONG TitleIndex;
1037 ULONG ClassOffset;
1038 ULONG ClassLength;
1039 ULONG SubKeys;
1040 ULONG MaxNameLen;
1041 ULONG MaxClassLen;
1042 ULONG Values;
1043 ULONG MaxValueNameLen;
1044 ULONG MaxValueDataLen;
1045 WCHAR Class[1];
1046 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
1047
1048 typedef struct _KEY_NAME_INFORMATION {
1049 ULONG NameLength;
1050 WCHAR Name[1];
1051 } KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION;
1052
1053 typedef struct _KEY_CACHED_INFORMATION
1054 {
1055 LARGE_INTEGER LastWriteTime;
1056 ULONG TitleIndex;
1057 ULONG SubKeys;
1058 ULONG MaxNameLen;
1059 ULONG Values;
1060 ULONG MaxValueNameLen;
1061 ULONG MaxValueDataLen;
1062 ULONG NameLength;
1063 } KEY_CACHED_INFORMATION, *PKEY_CACHED_INFORMATION;
1064
1065 typedef struct _KEY_VALUE_ENTRY
1066 {
1067 PUNICODE_STRING ValueName;
1068 ULONG DataLength;
1069 ULONG DataOffset;
1070 ULONG Type;
1071 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
1072
1073 typedef struct _KEY_VALUE_BASIC_INFORMATION {
1074 ULONG TitleIndex;
1075 ULONG Type;
1076 ULONG NameLength;
1077 WCHAR Name[1];
1078 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
1079
1080 typedef struct _KEY_VALUE_FULL_INFORMATION {
1081 ULONG TitleIndex;
1082 ULONG Type;
1083 ULONG DataOffset;
1084 ULONG DataLength;
1085 ULONG NameLength;
1086 WCHAR Name[1];
1087 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
1088
1089 typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
1090 ULONG TitleIndex;
1091 ULONG Type;
1092 ULONG DataLength;
1093 UCHAR Data[1];
1094 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
1095
1096 #ifndef __OBJECT_ATTRIBUTES_DEFINED__
1097 #define __OBJECT_ATTRIBUTES_DEFINED__
1098 typedef struct _OBJECT_ATTRIBUTES {
1099 ULONG Length;
1100 HANDLE RootDirectory;
1101 PUNICODE_STRING ObjectName;
1102 ULONG Attributes;
1103 PVOID SecurityDescriptor; /* type SECURITY_DESCRIPTOR */
1104 PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
1105 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
1106 #endif
1107
1108 typedef struct _OBJECT_DATA_INFORMATION {
1109 BOOLEAN InheritHandle;
1110 BOOLEAN ProtectFromClose;
1111 } OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION;
1112
1113 typedef struct _OBJECT_BASIC_INFORMATION {
1114 ULONG Attributes;
1115 ACCESS_MASK GrantedAccess;
1116 ULONG HandleCount;
1117 ULONG PointerCount;
1118 ULONG PagedPoolUsage;
1119 ULONG NonPagedPoolUsage;
1120 ULONG Reserved[3];
1121 ULONG NameInformationLength;
1122 ULONG TypeInformationLength;
1123 ULONG SecurityDescriptorLength;
1124 LARGE_INTEGER CreateTime;
1125 } OBJECT_BASIC_INFORMATION, *POBJECT_BASIC_INFORMATION;
1126
1127 typedef struct _OBJECT_NAME_INFORMATION {
1128 UNICODE_STRING Name;
1129 } OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;
1130
1131 typedef struct __OBJECT_TYPE_INFORMATION {
1132 UNICODE_STRING TypeName;
1133 ULONG Reserved [22];
1134 } OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION;
1135
1136 typedef struct _PROCESS_BASIC_INFORMATION {
1137 #ifdef __WINESRC__
1138 DWORD_PTR ExitStatus;
1139 PPEB PebBaseAddress;
1140 DWORD_PTR AffinityMask;
1141 DWORD_PTR BasePriority;
1142 ULONG_PTR UniqueProcessId;
1143 ULONG_PTR InheritedFromUniqueProcessId;
1144 #else
1145 PVOID Reserved1;
1146 PPEB PebBaseAddress;
1147 PVOID Reserved2[2];
1148 ULONG_PTR UniqueProcessId;
1149 PVOID Reserved3;
1150 #endif
1151 } PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION;
1152
1153 #define PROCESS_PRIOCLASS_IDLE 1
1154 #define PROCESS_PRIOCLASS_NORMAL 2
1155 #define PROCESS_PRIOCLASS_HIGH 3
1156 #define PROCESS_PRIOCLASS_REALTIME 4
1157 #define PROCESS_PRIOCLASS_BELOW_NORMAL 5
1158 #define PROCESS_PRIOCLASS_ABOVE_NORMAL 6
1159
1160 typedef struct _PROCESS_PRIORITY_CLASS {
1161 BOOLEAN Foreground;
1162 UCHAR PriorityClass;
1163 } PROCESS_PRIORITY_CLASS, *PPROCESS_PRIORITY_CLASS;
1164
1165 typedef struct _RTL_HEAP_DEFINITION {
1166 ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
1167
1168 ULONG Unknown[11];
1169 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
1170
1171 typedef struct _RTL_RWLOCK {
1172 RTL_CRITICAL_SECTION rtlCS;
1173
1174 HANDLE hSharedReleaseSemaphore;
1175 UINT uSharedWaiters;
1176
1177 HANDLE hExclusiveReleaseSemaphore;
1178 UINT uExclusiveWaiters;
1179
1180 INT iNumberActive;
1181 HANDLE hOwningThreadId;
1182 DWORD dwTimeoutBoost;
1183 PVOID pDebugInfo;
1184 } RTL_RWLOCK, *LPRTL_RWLOCK;
1185
1186 /* System Information Class 0x00 */
1187
1188 typedef struct _SYSTEM_BASIC_INFORMATION {
1189 #ifdef __WINESRC__
1190 DWORD unknown;
1191 ULONG KeMaximumIncrement;
1192 ULONG PageSize;
1193 ULONG MmNumberOfPhysicalPages;
1194 ULONG MmLowestPhysicalPage;
1195 ULONG MmHighestPhysicalPage;
1196 ULONG_PTR AllocationGranularity;
1197 PVOID LowestUserAddress;
1198 PVOID HighestUserAddress;
1199 ULONG_PTR ActiveProcessorsAffinityMask;
1200 BYTE NumberOfProcessors;
1201 #else
1202 BYTE Reserved1[24];
1203 PVOID Reserved2[4];
1204 CCHAR NumberOfProcessors;
1205 #endif
1206 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
1207
1208 /* System Information Class 0x01 */
1209
1210 typedef struct _SYSTEM_CPU_INFORMATION {
1211 WORD Architecture;
1212 WORD Level;
1213 WORD Revision; /* combination of CPU model and stepping */
1214 WORD Reserved; /* always zero */
1215 DWORD FeatureSet; /* see bit flags below */
1216 } SYSTEM_CPU_INFORMATION, *PSYSTEM_CPU_INFORMATION;
1217
1218 /* definitions of bits in the Feature set for the x86 processors */
1219 #define CPU_FEATURE_VME 0x00000005 /* Virtual 86 Mode Extensions */
1220 #define CPU_FEATURE_TSC 0x00000002 /* Time Stamp Counter available */
1221 #define CPU_FEATURE_CMOV 0x00000008 /* Conditional Move instruction*/
1222 #define CPU_FEATURE_PGE 0x00000014 /* Page table Entry Global bit */
1223 #define CPU_FEATURE_PSE 0x00000024 /* Page Size Extension */
1224 #define CPU_FEATURE_MTRR 0x00000040 /* Memory Type Range Registers */
1225 #define CPU_FEATURE_CX8 0x00000080 /* Compare and eXchange 8 byte instr. */
1226 #define CPU_FEATURE_MMX 0x00000100 /* Multi Media eXtensions */
1227 #define CPU_FEATURE_X86 0x00000200 /* seems to be always ON, on the '86 */
1228 #define CPU_FEATURE_PAT 0x00000400 /* Page Attribute Table */
1229 #define CPU_FEATURE_FXSR 0x00000800 /* FXSAVE and FXSTORE instructions */
1230 #define CPU_FEATURE_SEP 0x00001000 /* SYSENTER and SYSEXIT instructions */
1231 #define CPU_FEATURE_SSE 0x00002000 /* SSE extensions (ext. MMX) */
1232 #define CPU_FEATURE_3DNOW 0x00004000 /* 3DNOW instructions available */
1233 #define CPU_FEATURE_SSE2 0x00010000 /* SSE2 extensions (XMMI64) */
1234 #define CPU_FEATURE_DS 0x00020000 /* Debug Store */
1235 #define CPU_FEATURE_HTT 0x00040000 /* Hyper Threading Technology */
1236
1237 /* System Information Class 0x02 */
1238
1239 /* Documented in "Windows NT/2000 Native API Reference" by Gary Nebbett. */
1240 typedef struct _SYSTEM_PERFORMANCE_INFORMATION {
1241 LARGE_INTEGER IdleTime;
1242 LARGE_INTEGER ReadTransferCount;
1243 LARGE_INTEGER WriteTransferCount;
1244 LARGE_INTEGER OtherTransferCount;
1245 ULONG ReadOperationCount;
1246 ULONG WriteOperationCount;
1247 ULONG OtherOperationCount;
1248 ULONG AvailablePages;
1249 ULONG TotalCommittedPages;
1250 ULONG TotalCommitLimit;
1251 ULONG PeakCommitment;
1252 ULONG PageFaults;
1253 ULONG WriteCopyFaults;
1254 ULONG TransitionFaults;
1255 ULONG Reserved1;
1256 ULONG DemandZeroFaults;
1257 ULONG PagesRead;
1258 ULONG PageReadIos;
1259 ULONG Reserved2[2];
1260 ULONG PagefilePagesWritten;
1261 ULONG PagefilePageWriteIos;
1262 ULONG MappedFilePagesWritten;
1263 ULONG MappedFilePageWriteIos;
1264 ULONG PagedPoolUsage;
1265 ULONG NonPagedPoolUsage;
1266 ULONG PagedPoolAllocs;
1267 ULONG PagedPoolFrees;
1268 ULONG NonPagedPoolAllocs;
1269 ULONG NonPagedPoolFrees;
1270 ULONG TotalFreeSystemPtes;
1271 ULONG SystemCodePage;
1272 ULONG TotalSystemDriverPages;
1273 ULONG TotalSystemCodePages;
1274 ULONG SmallNonPagedLookasideListAllocateHits;
1275 ULONG SmallPagedLookasideListAllocateHits;
1276 ULONG Reserved3;
1277 ULONG MmSystemCachePage;
1278 ULONG PagedPoolPage;
1279 ULONG SystemDriverPage;
1280 ULONG FastReadNoWait;
1281 ULONG FastReadWait;
1282 ULONG FastReadResourceMiss;
1283 ULONG FastReadNotPossible;
1284 ULONG FastMdlReadNoWait;
1285 ULONG FastMdlReadWait;
1286 ULONG FastMdlReadResourceMiss;
1287 ULONG FastMdlReadNotPossible;
1288 ULONG MapDataNoWait;
1289 ULONG MapDataWait;
1290 ULONG MapDataNoWaitMiss;
1291 ULONG MapDataWaitMiss;
1292 ULONG PinMappedDataCount;
1293 ULONG PinReadNoWait;
1294 ULONG PinReadWait;
1295 ULONG PinReadNoWaitMiss;
1296 ULONG PinReadWaitMiss;
1297 ULONG CopyReadNoWait;
1298 ULONG CopyReadWait;
1299 ULONG CopyReadNoWaitMiss;
1300 ULONG CopyReadWaitMiss;
1301 ULONG MdlReadNoWait;
1302 ULONG MdlReadWait;
1303 ULONG MdlReadNoWaitMiss;
1304 ULONG MdlReadWaitMiss;
1305 ULONG ReadAheadIos;
1306 ULONG LazyWriteIos;
1307 ULONG LazyWritePages;
1308 ULONG DataFlushes;
1309 ULONG DataPages;
1310 ULONG ContextSwitches;
1311 ULONG FirstLevelTbFills;
1312 ULONG SecondLevelTbFills;
1313 ULONG SystemCalls;
1314 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
1315
1316 /* System Information Class 0x03 */
1317
1318 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
1319 #ifdef __WINESRC__
1320 LARGE_INTEGER liKeBootTime;
1321 LARGE_INTEGER liKeSystemTime;
1322 LARGE_INTEGER liExpTimeZoneBias;
1323 ULONG uCurrentTimeZoneId;
1324 DWORD dwUnknown1[5];
1325 #else
1326 BYTE Reserved1[48];
1327 #endif
1328 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; /* was SYSTEM_TIME_INFORMATION */
1329
1330 /* System Information Class 0x08 */
1331
1332 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
1333 LARGE_INTEGER IdleTime;
1334 LARGE_INTEGER KernelTime;
1335 LARGE_INTEGER UserTime;
1336 LARGE_INTEGER Reserved1[2];
1337 ULONG Reserved2;
1338 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
1339
1340 /* System Information Class 0x0b */
1341
1342 typedef struct _SYSTEM_DRIVER_INFORMATION {
1343 PVOID pvAddress;
1344 DWORD dwUnknown1;
1345 DWORD dwUnknown2;
1346 DWORD dwEntryIndex;
1347 DWORD dwUnknown3;
1348 char szName[MAX_PATH + 1];
1349 } SYSTEM_DRIVER_INFORMATION, *PSYSTEM_DRIVER_INFORMATION;
1350
1351 /* System Information Class 0x10 */
1352
1353 typedef struct _SYSTEM_HANDLE_ENTRY {
1354 ULONG OwnerPid;
1355 BYTE ObjectType;
1356 BYTE HandleFlags;
1357 USHORT HandleValue;
1358 PVOID ObjectPointer;
1359 ULONG AccessMask;
1360 } SYSTEM_HANDLE_ENTRY, *PSYSTEM_HANDLE_ENTRY;
1361
1362 typedef struct _SYSTEM_HANDLE_INFORMATION {
1363 ULONG Count;
1364 SYSTEM_HANDLE_ENTRY Handle[1];
1365 } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
1366
1367 /* System Information Class 0x15 */
1368
1369 typedef struct _SYSTEM_CACHE_INFORMATION {
1370 ULONG CurrentSize;
1371 ULONG PeakSize;
1372 ULONG PageFaultCount;
1373 ULONG MinimumWorkingSet;
1374 ULONG MaximumWorkingSet;
1375 ULONG unused[4];
1376 #ifdef _WIN64
1377 ULONG unknown64[7];
1378 #endif
1379 } SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION;
1380
1381 /* System Information Class 0x17 */
1382
1383 typedef struct _SYSTEM_INTERRUPT_INFORMATION {
1384 BYTE Reserved1[24];
1385 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
1386
1387 typedef struct _SYSTEM_CONFIGURATION_INFO {
1388 union {
1389 ULONG OemId;
1390 struct {
1391 WORD ProcessorArchitecture;
1392 WORD Reserved;
1393 } tag1;
1394 } tag2;
1395 ULONG PageSize;
1396 PVOID MinimumApplicationAddress;
1397 PVOID MaximumApplicationAddress;
1398 ULONG ActiveProcessorMask;
1399 ULONG NumberOfProcessors;
1400 ULONG ProcessorType;
1401 ULONG AllocationGranularity;
1402 WORD ProcessorLevel;
1403 WORD ProcessorRevision;
1404 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
1405
1406 typedef struct _SYSTEM_EXCEPTION_INFORMATION {
1407 BYTE Reserved1[16];
1408 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
1409
1410 typedef struct _SYSTEM_LOOKASIDE_INFORMATION {
1411 BYTE Reserved1[32];
1412 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
1413
1414 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION {
1415 BOOLEAN DebuggerEnabled;
1416 BOOLEAN DebuggerNotPresent;
1417 } SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
1418
1419 /* System Information Class 0x05 */
1420
1421 typedef struct _VM_COUNTERS_ {
1422 SIZE_T PeakVirtualSize;
1423 SIZE_T VirtualSize;
1424 ULONG PageFaultCount;
1425 SIZE_T PeakWorkingSetSize;
1426 SIZE_T WorkingSetSize;
1427 SIZE_T QuotaPeakPagedPoolUsage;
1428 SIZE_T QuotaPagedPoolUsage;
1429 SIZE_T QuotaPeakNonPagedPoolUsage;
1430 SIZE_T QuotaNonPagedPoolUsage;
1431 SIZE_T PagefileUsage;
1432 SIZE_T PeakPagefileUsage;
1433 SIZE_T PrivatePageCount;
1434 } VM_COUNTERS, *PVM_COUNTERS;
1435
1436 typedef struct _SYSTEM_PROCESS_INFORMATION {
1437 #ifdef __WINESRC__ /* win32/win64 */
1438 ULONG NextEntryOffset; /* 00/00 */
1439 DWORD dwThreadCount; /* 04/04 */
1440 DWORD dwUnknown1[6]; /* 08/08 */
1441 LARGE_INTEGER CreationTime; /* 20/20 */
1442 LARGE_INTEGER UserTime; /* 28/28 */
1443 LARGE_INTEGER KernelTime; /* 30/30 */
1444 UNICODE_STRING ProcessName; /* 38/38 */
1445 DWORD dwBasePriority; /* 40/48 */
1446 HANDLE UniqueProcessId; /* 44/50 */
1447 HANDLE ParentProcessId; /* 48/58 */
1448 ULONG HandleCount; /* 4c/60 */
1449 ULONG SessionId; /* 50/64 */
1450 DWORD dwUnknown4; /* 54/68 */
1451 VM_COUNTERS vmCounters; /* 58/70 */
1452 IO_COUNTERS ioCounters; /* 88/d0 */
1453 SYSTEM_THREAD_INFORMATION ti[1]; /* b8/100 */
1454 #else
1455 ULONG NextEntryOffset; /* 00/00 */
1456 BYTE Reserved1[52]; /* 04/04 */
1457 PVOID Reserved2[3]; /* 38/38 */
1458 HANDLE UniqueProcessId; /* 44/50 */
1459 PVOID Reserved3; /* 48/58 */
1460 ULONG HandleCount; /* 4c/60 */
1461 BYTE Reserved4[4]; /* 50/64 */
1462 PVOID Reserved5[11]; /* 54/68 */
1463 SIZE_T PeakPagefileUsage; /* 80/c0 */
1464 SIZE_T PrivatePageCount; /* 84/c8 */
1465 LARGE_INTEGER Reserved6[6]; /* 88/d0 */
1466 #endif
1467 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
1468
1469 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION {
1470 ULONG RegistryQuotaAllowed;
1471 ULONG RegistryQuotaUsed;
1472 PVOID Reserved1;
1473 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
1474
1475 typedef struct _SYSTEM_TIME_ADJUSTMENT {
1476 ULONG TimeAdjustment;
1477 BOOLEAN TimeAdjustmentDisabled;
1478 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
1479
1480 typedef struct _TIME_FIELDS
1481 { CSHORT Year;
1482 CSHORT Month;
1483 CSHORT Day;
1484 CSHORT Hour;
1485 CSHORT Minute;
1486 CSHORT Second;
1487 CSHORT Milliseconds;
1488 CSHORT Weekday;
1489 } TIME_FIELDS, *PTIME_FIELDS;
1490
1491 typedef struct _WINSTATIONINFORMATIONW {
1492 BYTE Reserved2[70];
1493 ULONG LogonId;
1494 BYTE Reserved3[1140];
1495 } WINSTATIONINFORMATIONW, *PWINSTATIONINFORMATIONW;
1496
1497 typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONW)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
1498
1499 typedef struct _LDR_RESOURCE_INFO
1500 {
1501 ULONG_PTR Type;
1502 ULONG_PTR Name;
1503 ULONG Language;
1504 } LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO;
1505
1506
1507 /* debug buffer definitions */
1508
1509 typedef struct _DEBUG_BUFFER {
1510 HANDLE SectionHandle;
1511 PVOID SectionBase;
1512 PVOID RemoteSectionBase;
1513 ULONG SectionBaseDelta;
1514 HANDLE EventPairHandle;
1515 ULONG Unknown[2];
1516 HANDLE RemoteThreadHandle;
1517 ULONG InfoClassMask;
1518 ULONG SizeOfInfo;
1519 ULONG AllocatedSize;
1520 ULONG SectionSize;
1521 PVOID ModuleInformation;
1522 PVOID BackTraceInformation;
1523 PVOID HeapInformation;
1524 PVOID LockInformation;
1525 PVOID Reserved[8];
1526 } DEBUG_BUFFER, *PDEBUG_BUFFER;
1527
1528 #define PDI_MODULES 0x01
1529 #define PDI_BACKTRACE 0x02
1530 #define PDI_HEAPS 0x04
1531 #define PDI_HEAP_TAGS 0x08
1532 #define PDI_HEAP_BLOCKS 0x10
1533 #define PDI_LOCKS 0x20
1534
1535 typedef struct _DEBUG_MODULE_INFORMATION {
1536 ULONG Reserved[2];
1537 ULONG Base;
1538 ULONG Size;
1539 ULONG Flags;
1540 USHORT Index;
1541 USHORT Unknown;
1542 USHORT LoadCount;
1543 USHORT ModuleNameOffset;
1544 CHAR ImageName[256];
1545 } DEBUG_MODULE_INFORMATION, *PDEBUG_MODULE_INFORMATION;
1546
1547 typedef struct _DEBUG_HEAP_INFORMATION {
1548 ULONG Base;
1549 ULONG Flags;
1550 USHORT Granularity;
1551 USHORT Unknown;
1552 ULONG Allocated;
1553 ULONG Committed;
1554 ULONG TagCount;
1555 ULONG BlockCount;
1556 ULONG Reserved[7];
1557 PVOID Tags;
1558 PVOID Blocks;
1559 } DEBUG_HEAP_INFORMATION, *PDEBUG_HEAP_INFORMATION;
1560
1561 typedef struct _DEBUG_LOCK_INFORMATION {
1562 PVOID Address;
1563 USHORT Type;
1564 USHORT CreatorBackTraceIndex;
1565 ULONG OwnerThreadId;
1566 ULONG ActiveCount;
1567 ULONG ContentionCount;
1568 ULONG EntryCount;
1569 ULONG RecursionCount;
1570 ULONG NumberOfSharedWaiters;
1571 ULONG NumberOfExclusiveWaiters;
1572 } DEBUG_LOCK_INFORMATION, *PDEBUG_LOCK_INFORMATION;
1573
1574 typedef struct _PORT_MESSAGE_HEADER {
1575 USHORT DataSize;
1576 USHORT MessageSize;
1577 USHORT MessageType;
1578 USHORT VirtualRangesOffset;
1579 CLIENT_ID ClientId;
1580 ULONG MessageId;
1581 ULONG SectionSize;
1582 } PORT_MESSAGE_HEADER, *PPORT_MESSAGE_HEADER, PORT_MESSAGE, *PPORT_MESSAGE;
1583
1584 typedef unsigned short RTL_ATOM, *PRTL_ATOM;
1585
1586 /* Wine doesn't implement atom table as NT does:
1587 * - in NT, atom tables are user space tables, which ntdll directly accesses
1588 * - on Wine, (even local) atom tables are wineserver objects, hence a HANDLE
1589 */
1590 typedef struct atom_table *RTL_ATOM_TABLE, **PRTL_ATOM_TABLE;
1591
1592 typedef enum _ATOM_INFORMATION_CLASS {
1593 AtomBasicInformation = 0,
1594 AtomTableInformation = 1,
1595 } ATOM_INFORMATION_CLASS;
1596
1597 typedef struct _ATOM_BASIC_INFORMATION {
1598 USHORT ReferenceCount;
1599 USHORT Pinned;
1600 USHORT NameLength;
1601 WCHAR Name[1];
1602 } ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION;
1603
1604 /* FIXME: names probably not correct */
1605 typedef struct _RTL_HANDLE
1606 {
1607 struct _RTL_HANDLE * Next;
1608 } RTL_HANDLE;
1609
1610 /* FIXME: names probably not correct */
1611 typedef struct _RTL_HANDLE_TABLE
1612 {
1613 ULONG MaxHandleCount; /* 0x00 */
1614 ULONG HandleSize; /* 0x04 */
1615 ULONG Unused[2]; /* 0x08-0x0c */
1616 PVOID NextFree; /* 0x10 */
1617 PVOID FirstHandle; /* 0x14 */
1618 PVOID ReservedMemory; /* 0x18 */
1619 PVOID MaxHandle; /* 0x1c */
1620 } RTL_HANDLE_TABLE;
1621
1622 /***********************************************************************
1623 * Defines
1624 */
1625
1626 /* flags for NtCreateFile and NtOpenFile */
1627 #define FILE_DIRECTORY_FILE 0x00000001
1628 #define FILE_WRITE_THROUGH 0x00000002
1629 #define FILE_SEQUENTIAL_ONLY 0x00000004
1630 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
1631 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
1632 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
1633 #define FILE_NON_DIRECTORY_FILE 0x00000040
1634 #define FILE_CREATE_TREE_CONNECTION 0x00000080
1635 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
1636 #define FILE_NO_EA_KNOWLEDGE 0x00000200
1637 #define FILE_OPEN_FOR_RECOVERY 0x00000400
1638 #define FILE_RANDOM_ACCESS 0x00000800
1639 #define FILE_DELETE_ON_CLOSE 0x00001000
1640 #define FILE_OPEN_BY_FILE_ID 0x00002000
1641 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
1642 #define FILE_NO_COMPRESSION 0x00008000
1643 #define FILE_RESERVE_OPFILTER 0x00100000
1644 #define FILE_TRANSACTED_MODE 0x00200000
1645 #define FILE_OPEN_OFFLINE_FILE 0x00400000
1646 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
1647
1648 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
1649 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
1650
1651 /* status for NtCreateFile or NtOpenFile */
1652 #define FILE_SUPERSEDED 0
1653 #define FILE_OPENED 1
1654 #define FILE_CREATED 2
1655 #define FILE_OVERWRITTEN 3
1656 #define FILE_EXISTS 4
1657 #define FILE_DOES_NOT_EXIST 5
1658
1659 /* disposition for NtCreateFile */
1660 #define FILE_SUPERSEDE 0
1661 #define FILE_OPEN 1
1662 #define FILE_CREATE 2
1663 #define FILE_OPEN_IF 3
1664 #define FILE_OVERWRITE 4
1665 #define FILE_OVERWRITE_IF 5
1666 #define FILE_MAXIMUM_DISPOSITION 5
1667
1668 /* Characteristics of a File System */
1669 #define FILE_REMOVABLE_MEDIA 0x00000001
1670 #define FILE_READ_ONLY_DEVICE 0x00000002
1671 #define FILE_FLOPPY_DISKETTE 0x00000004
1672 #define FILE_WRITE_ONE_MEDIA 0x00000008
1673 #define FILE_REMOTE_DEVICE 0x00000010
1674 #define FILE_DEVICE_IS_MOUNTED 0x00000020
1675 #define FILE_VIRTUAL_VOLUME 0x00000040
1676 #define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
1677 #define FILE_DEVICE_SECURE_OPEN 0x00000100
1678
1679 /* options for NtCreateNamedPipeFile */
1680 #define FILE_PIPE_INBOUND 0x00000000
1681 #define FILE_PIPE_OUTBOUND 0x00000001
1682 #define FILE_PIPE_FULL_DUPLEX 0x00000002
1683
1684 /* options for pipe's type */
1685 #define FILE_PIPE_TYPE_MESSAGE 0x00000001
1686 #define FILE_PIPE_TYPE_BYTE 0x00000000
1687 /* options for pipe's message mode */
1688 #define FILE_PIPE_MESSAGE_MODE 0x00000001
1689 #define FILE_PIPE_BYTE_STREAM_MODE 0x00000000
1690 /* options for pipe's blocking mode */
1691 #define FILE_PIPE_COMPLETE_OPERATION 0x00000001
1692 #define FILE_PIPE_QUEUE_OPERATION 0x00000000
1693 /* and client / server end */
1694 #define FILE_PIPE_SERVER_END 0x00000001
1695 #define FILE_PIPE_CLIENT_END 0x00000000
1696
1697 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
1698
1699 #define LOGONID_CURRENT ((ULONG)-1)
1700
1701 #define OBJ_INHERIT 0x00000002
1702 #define OBJ_PERMANENT 0x00000010
1703 #define OBJ_EXCLUSIVE 0x00000020
1704 #define OBJ_CASE_INSENSITIVE 0x00000040
1705 #define OBJ_OPENIF 0x00000080
1706 #define OBJ_OPENLINK 0x00000100
1707 #define OBJ_KERNEL_HANDLE 0x00000200
1708 #define OBJ_VALID_ATTRIBUTES 0x000003F2
1709
1710 #define SERVERNAME_CURRENT ((HANDLE)NULL)
1711
1712 typedef void (CALLBACK *PNTAPCFUNC)(ULONG_PTR,ULONG_PTR,ULONG_PTR); /* FIXME: not the right name */
1713 typedef void (CALLBACK *PRTL_THREAD_START_ROUTINE)(LPVOID); /* FIXME: not the right name */
1714 typedef DWORD (CALLBACK *PRTL_WORK_ITEM_ROUTINE)(LPVOID); /* FIXME: not the right name */
1715 typedef void (NTAPI *RTL_WAITORTIMERCALLBACKFUNC)(PVOID,BOOLEAN); /* FIXME: not the right name */
1716
1717
1718 /* DbgPrintEx default levels */
1719 #define DPFLTR_ERROR_LEVEL 0
1720 #define DPFLTR_WARNING_LEVEL 1
1721 #define DPFLTR_TRACE_LEVEL 2
1722 #define DPFLTR_INFO_LEVEL 3
1723 #define DPFLTR_MASK 0x8000000
1724
1725 /* Well-known LUID values */
1726 #define SE_MIN_WELL_KNOWN_PRIVILEGE 2
1727 #define SE_CREATE_TOKEN_PRIVILEGE 2
1728 #define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3
1729 #define SE_LOCK_MEMORY_PRIVILEGE 4
1730 #define SE_INCREASE_QUOTA_PRIVILEGE 5
1731 #define SE_UNSOLICITED_INPUT_PRIVILEGE 6 /* obsolete */
1732 #define SE_MACHINE_ACCOUNT_PRIVILEGE 6
1733 #define SE_TCB_PRIVILEGE 7
1734 #define SE_SECURITY_PRIVILEGE 8
1735 #define SE_TAKE_OWNERSHIP_PRIVILEGE 9
1736 #define SE_LOAD_DRIVER_PRIVILEGE 10
1737 #define SE_SYSTEM_PROFILE_PRIVILEGE 11
1738 #define SE_SYSTEMTIME_PRIVILEGE 12
1739 #define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13
1740 #define SE_INC_BASE_PRIORITY_PRIVILEGE 14
1741 #define SE_CREATE_PAGEFILE_PRIVILEGE 15
1742 #define SE_CREATE_PERMANENT_PRIVILEGE 16
1743 #define SE_BACKUP_PRIVILEGE 17
1744 #define SE_RESTORE_PRIVILEGE 18
1745 #define SE_SHUTDOWN_PRIVILEGE 19
1746 #define SE_DEBUG_PRIVILEGE 20
1747 #define SE_AUDIT_PRIVILEGE 21
1748 #define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22
1749 #define SE_CHANGE_NOTIFY_PRIVILEGE 23
1750 #define SE_REMOTE_SHUTDOWN_PRIVILEGE 24
1751 #define SE_UNDOCK_PRIVILEGE 25
1752 #define SE_SYNC_AGENT_PRIVILEGE 26
1753 #define SE_ENABLE_DELEGATION_PRIVILEGE 27
1754 #define SE_MANAGE_VOLUME_PRIVILEGE 28
1755 #define SE_IMPERSONATE_PRIVILEGE 29
1756 #define SE_CREATE_GLOBAL_PRIVILEGE 30
1757 #define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_GLOBAL_PRIVILEGE
1758
1759 /* NtGlobalFlag bits */
1760 #define FLG_STOP_ON_EXCEPTION 0x00000001
1761 #define FLG_SHOW_LDR_SNAPS 0x00000002
1762 #define FLG_DEBUG_INITIAL_COMMAND 0x00000004
1763 #define FLG_STOP_ON_HUNG_GUI 0x00000008
1764 #define FLG_HEAP_ENABLE_TAIL_CHECK 0x00000010
1765 #define FLG_HEAP_ENABLE_FREE_CHECK 0x00000020
1766 #define FLG_HEAP_VALIDATE_PARAMETERS 0x00000040
1767 #define FLG_HEAP_VALIDATE_ALL 0x00000080
1768 #define FLG_APPLICATION_VERIFIER 0x00000100
1769 #define FLG_POOL_ENABLE_TAGGING 0x00000400
1770 #define FLG_HEAP_ENABLE_TAGGING 0x00000800
1771 #define FLG_USER_STACK_TRACE_DB 0x00001000
1772 #define FLG_KERNEL_STACK_TRACE_DB 0x00002000
1773 #define FLG_MAINTAIN_OBJECT_TYPELIST 0x00004000
1774 #define FLG_HEAP_ENABLE_TAG_BY_DLL 0x00008000
1775 #define FLG_DISABLE_STACK_EXTENSION 0x00010000
1776 #define FLG_ENABLE_CSRDEBUG 0x00020000
1777 #define FLG_ENABLE_KDEBUG_SYMBOL_LOAD 0x00040000
1778 #define FLG_DISABLE_PAGE_KERNEL_STACKS 0x00080000
1779 #define FLG_ENABLE_SYSTEM_CRIT_BREAKS 0x00100000
1780 #define FLG_HEAP_DISABLE_COALESCING 0x00200000
1781 #define FLG_ENABLE_CLOSE_EXCEPTIONS 0x00400000
1782 #define FLG_ENABLE_EXCEPTION_LOGGING 0x00800000
1783 #define FLG_ENABLE_HANDLE_TYPE_TAGGING 0x01000000
1784 #define FLG_HEAP_PAGE_ALLOCS 0x02000000
1785 #define FLG_DEBUG_INITIAL_COMMAND_EX 0x04000000
1786 #define FLG_DISABLE_DBGPRINT 0x08000000
1787 #define FLG_CRITSEC_EVENT_CREATION 0x10000000
1788 #define FLG_LDR_TOP_DOWN 0x20000000
1789 #define FLG_ENABLE_HANDLE_EXCEPTIONS 0x40000000
1790 #define FLG_DISABLE_PROTDLLS 0x80000000
1791
1792 /* Rtl*Registry* functions structs and defines */
1793 #define RTL_REGISTRY_ABSOLUTE 0
1794 #define RTL_REGISTRY_SERVICES 1
1795 #define RTL_REGISTRY_CONTROL 2
1796 #define RTL_REGISTRY_WINDOWS_NT 3
1797 #define RTL_REGISTRY_DEVICEMAP 4
1798 #define RTL_REGISTRY_USER 5
1799
1800 #define RTL_REGISTRY_HANDLE 0x40000000
1801 #define RTL_REGISTRY_OPTIONAL 0x80000000
1802
1803 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
1804 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
1805 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
1806 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
1807 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
1808 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
1809 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
1810
1811 typedef NTSTATUS (WINAPI *PRTL_QUERY_REGISTRY_ROUTINE)( PCWSTR ValueName,
1812 ULONG ValueType,
1813 PVOID ValueData,
1814 ULONG ValueLength,
1815 PVOID Context,
1816 PVOID EntryContext);
1817
1818 typedef struct _RTL_QUERY_REGISTRY_TABLE
1819 {
1820 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
1821 ULONG Flags;
1822 PWSTR Name;
1823 PVOID EntryContext;
1824 ULONG DefaultType;
1825 PVOID DefaultData;
1826 ULONG DefaultLength;
1827 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
1828
1829 typedef struct _KEY_MULTIPLE_VALUE_INFORMATION
1830 {
1831 PUNICODE_STRING ValueName;
1832 ULONG DataLength;
1833 ULONG DataOffset;
1834 ULONG Type;
1835 } KEY_MULTIPLE_VALUE_INFORMATION, *PKEY_MULTIPLE_VALUE_INFORMATION;
1836
1837 typedef VOID (CALLBACK *PRTL_OVERLAPPED_COMPLETION_ROUTINE)(DWORD,DWORD,LPVOID);
1838
1839 typedef VOID (CALLBACK *PTIMER_APC_ROUTINE) ( PVOID, ULONG, LONG );
1840
1841 typedef enum _EVENT_INFORMATION_CLASS {
1842 EventBasicInformation
1843 } EVENT_INFORMATION_CLASS, *PEVENT_INFORMATION_CLASS;
1844
1845 typedef struct _EVENT_BASIC_INFORMATION {
1846 EVENT_TYPE EventType;
1847 LONG EventState;
1848 } EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION;
1849
1850 typedef enum _SEMAPHORE_INFORMATION_CLASS {
1851 SemaphoreBasicInformation
1852 } SEMAPHORE_INFORMATION_CLASS, *PSEMAPHORE_INFORMATION_CLASS;
1853
1854 typedef struct _SEMAPHORE_BASIC_INFORMATION {
1855 ULONG CurrentCount;
1856 ULONG MaximumCount;
1857 } SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION;
1858
1859 typedef enum _SECTION_INFORMATION_CLASS
1860 {
1861 SectionBasicInformation,
1862 SectionImageInformation,
1863 } SECTION_INFORMATION_CLASS;
1864
1865 typedef struct _SECTION_BASIC_INFORMATION {
1866 PVOID BaseAddress;
1867 ULONG Attributes;
1868 LARGE_INTEGER Size;
1869 } SECTION_BASIC_INFORMATION, *PSECTION_BASIC_INFORMATION;
1870
1871 typedef struct _SECTION_IMAGE_INFORMATION {
1872 PVOID TransferAddress;
1873 ULONG ZeroBits;
1874 SIZE_T MaximumStackSize;
1875 SIZE_T CommittedStackSize;
1876 ULONG SubSystemType;
1877 WORD SubsystemVersionLow;
1878 WORD SubsystemVersionHigh;
1879 ULONG GpValue;
1880 USHORT ImageCharacteristics;
1881 USHORT DllCharacteristics;
1882 USHORT Machine;
1883 BOOLEAN ImageContainsCode;
1884 UCHAR ImageFlags;
1885 ULONG LoaderFlags;
1886 ULONG ImageFileSize;
1887 ULONG CheckSum;
1888 } SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION;
1889
1890 typedef struct _LPC_SECTION_WRITE {
1891 ULONG Length;
1892 HANDLE SectionHandle;
1893 ULONG SectionOffset;
1894 ULONG ViewSize;
1895 PVOID ViewBase;
1896 PVOID TargetViewBase;
1897 } LPC_SECTION_WRITE, *PLPC_SECTION_WRITE;
1898
1899 typedef struct _LPC_SECTION_READ {
1900 ULONG Length;
1901 ULONG ViewSize;
1902 PVOID ViewBase;
1903 } LPC_SECTION_READ, *PLPC_SECTION_READ;
1904
1905 typedef struct _LPC_MESSAGE {
1906 USHORT DataSize;
1907 USHORT MessageSize;
1908 USHORT MessageType;
1909 USHORT VirtualRangesOffset;
1910 CLIENT_ID ClientId;
1911 ULONG_PTR MessageId;
1912 ULONG_PTR SectionSize;
1913 UCHAR Data[ANYSIZE_ARRAY];
1914 } LPC_MESSAGE, *PLPC_MESSAGE;
1915
1916 typedef enum _SHUTDOWN_ACTION {
1917 ShutdownNoReboot,
1918 ShutdownReboot,
1919 ShutdownPowerOff
1920 } SHUTDOWN_ACTION, *PSHUTDOWN_ACTION;
1921
1922 typedef enum _KPROFILE_SOURCE {
1923 ProfileTime,
1924 ProfileAlignmentFixup,
1925 ProfileTotalIssues,
1926 ProfilePipelineDry,
1927 ProfileLoadInstructions,
1928 ProfilePipelineFrozen,
1929 ProfileBranchInstructions,
1930 ProfileTotalNonissues,
1931 ProfileDcacheMisses,
1932 ProfileIcacheMisses,
1933 ProfileCacheMisses,
1934 ProfileBranchMispredictions,
1935 ProfileStoreInstructions,
1936 ProfileFpInstructions,
1937 ProfileIntegerInstructions,
1938 Profile2Issue,
1939 Profile3Issue,
1940 Profile4Issue,
1941 ProfileSpecialInstructions,
1942 ProfileTotalCycles,
1943 ProfileIcacheIssues,
1944 ProfileDcacheAccesses,
1945 ProfileMemoryBarrierCycles,
1946 ProfileLoadLinkedIssues,
1947 ProfileMaximum
1948 } KPROFILE_SOURCE, *PKPROFILE_SOURCE;
1949
1950 typedef struct _DIRECTORY_BASIC_INFORMATION {
1951 UNICODE_STRING ObjectName;
1952 UNICODE_STRING ObjectTypeName;
1953 } DIRECTORY_BASIC_INFORMATION, *PDIRECTORY_BASIC_INFORMATION;
1954
1955 typedef struct _INITIAL_TEB {
1956 PVOID StackBase;
1957 PVOID StackLimit;
1958 PVOID StackCommit;
1959 PVOID StackCommitMax;
1960 PVOID StackReserved;
1961 } INITIAL_TEB, *PINITIAL_TEB;
1962
1963 typedef enum _PORT_INFORMATION_CLASS {
1964 PortNoInformation
1965 } PORT_INFORMATION_CLASS, *PPORT_INFORMATION_CLASS;
1966
1967 typedef enum _IO_COMPLETION_INFORMATION_CLASS {
1968 IoCompletionBasicInformation
1969 } IO_COMPLETION_INFORMATION_CLASS, *PIO_COMPLETION_INFORMATION_CLASS;
1970
1971 typedef struct _FILE_COMPLETION_INFORMATION {
1972 HANDLE CompletionPort;
1973 ULONG_PTR CompletionKey;
1974 } FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION;
1975
1976 #define IO_COMPLETION_QUERY_STATE 0x0001
1977 #define IO_COMPLETION_MODIFY_STATE 0x0002
1978 #define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
1979
1980 typedef enum _HARDERROR_RESPONSE_OPTION {
1981 OptionAbortRetryIgnore,
1982 OptionOk,
1983 OptionOkCancel,
1984 OptionRetryCancel,
1985 OptionYesNo,
1986 OptionYesNoCancel,
1987 OptionShutdownSystem
1988 } HARDERROR_RESPONSE_OPTION, *PHARDERROR_RESPONSE_OPTION;
1989
1990 typedef enum _HARDERROR_RESPONSE {
1991 ResponseReturnToCaller,
1992 ResponseNotHandled,
1993 ResponseAbort,
1994 ResponseCancel,
1995 ResponseIgnore,
1996 ResponseNo,
1997 ResponseOk,
1998 ResponseRetry,
1999 ResponseYes
2000 } HARDERROR_RESPONSE, *PHARDERROR_RESPONSE;
2001
2002 typedef enum _SYSDBG_COMMAND {
2003 SysDbgQueryModuleInformation,
2004 SysDbgQueryTraceInformation,
2005 SysDbgSetTracepoint,
2006 SysDbgSetSpecialCall,
2007 SysDbgClearSpecialCalls,
2008 SysDbgQuerySpecialCalls,
2009 SysDbgBreakPoint,
2010 SysDbgQueryVersion,
2011 SysDbgReadVirtual,
2012 SysDbgWriteVirtual,
2013 SysDbgReadPhysical,
2014 SysDbgWritePhysical,
2015 SysDbgReadControlSpace,
2016 SysDbgWriteControlSpace,
2017 SysDbgReadIoSpace,
2018 SysDbgWriteIoSpace,
2019 SysDbgReadMsr,
2020 SysDbgWriteMsr,
2021 SysDbgReadBusData,
2022 SysDbgWriteBusData
2023 } SYSDBG_COMMAND, *PSYSDBG_COMMAND;
2024
2025
2026 /*************************************************************************
2027 * Loader structures
2028 *
2029 * Those are not part of standard Winternl.h
2030 */
2031 typedef struct _LDR_MODULE
2032 {
2033 LIST_ENTRY InLoadOrderModuleList;
2034 LIST_ENTRY InMemoryOrderModuleList;
2035 LIST_ENTRY InInitializationOrderModuleList;
2036 void* BaseAddress;
2037 void* EntryPoint;
2038 ULONG SizeOfImage;
2039 UNICODE_STRING FullDllName;
2040 UNICODE_STRING BaseDllName;
2041 ULONG Flags;
2042 SHORT LoadCount;
2043 SHORT TlsIndex;
2044 HANDLE SectionHandle;
2045 ULONG CheckSum;
2046 ULONG TimeDateStamp;
2047 HANDLE ActivationContext;
2048 } LDR_MODULE, *PLDR_MODULE;
2049
2050 /* those defines are (some of the) regular LDR_MODULE.Flags values */
2051 #define LDR_IMAGE_IS_DLL 0x00000004
2052 #define LDR_LOAD_IN_PROGRESS 0x00001000
2053 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
2054 #define LDR_NO_DLL_CALLS 0x00040000
2055 #define LDR_PROCESS_ATTACHED 0x00080000
2056 #define LDR_MODULE_REBASED 0x00200000
2057
2058 /* these ones is Wine specific */
2059 #define LDR_DONT_RESOLVE_REFS 0x40000000
2060 #define LDR_WINE_INTERNAL 0x80000000
2061
2062 /* flag for LdrAddRefDll */
2063 #define LDR_ADDREF_DLL_PIN 0x00000001
2064
2065 /* FIXME: to be checked */
2066 #define MAXIMUM_FILENAME_LENGTH 256
2067
2068 typedef struct _SYSTEM_MODULE
2069 {
2070 PVOID Reserved1; /* 00/00 */
2071 PVOID Reserved2; /* 04/08 */
2072 PVOID ImageBaseAddress; /* 08/10 */
2073 ULONG ImageSize; /* 0c/18 */
2074 ULONG Flags; /* 10/1c */
2075 WORD Id; /* 14/20 */
2076 WORD Rank; /* 16/22 */
2077 WORD Unknown; /* 18/24 */
2078 WORD NameOffset; /* 1a/26 */
2079 BYTE Name[MAXIMUM_FILENAME_LENGTH]; /* 1c/28 */
2080 } SYSTEM_MODULE, *PSYSTEM_MODULE;
2081
2082 typedef struct _SYSTEM_MODULE_INFORMATION
2083 {
2084 ULONG ModulesCount;
2085 SYSTEM_MODULE Modules[1]; /* FIXME: should be Modules[0] */
2086 } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
2087
2088 /***********************************************************************
2089 * Function declarations
2090 */
2091
2092 #if defined(__i386__) && defined(__GNUC__)
2093 static inline void WINAPI DbgBreakPoint(void) { __asm__ __volatile__("int3"); }
2094 static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3"); }
2095 #else /* __i386__ && __GNUC__ */
2096 NTSYSAPI void WINAPI DbgBreakPoint(void);
2097 NTSYSAPI void WINAPI DbgUserBreakPoint(void);
2098 #endif /* __i386__ && __GNUC__ */
2099 #ifndef __REACTOS__
2100 NTSYSAPI NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
2101 #endif /* __REACTOS__ */
2102 NTSYSAPI NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
2103 NTSYSAPI NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
2104 NTSYSAPI NTSTATUS WINAPI LdrAddRefDll(ULONG,HMODULE);
2105 NTSYSAPI NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
2106 NTSYSAPI NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
2107 NTSYSAPI NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
2108 NTSYSAPI NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_MODULE*);
2109 NTSYSAPI NTSTATUS WINAPI LdrGetDllHandle(LPCWSTR, ULONG, const UNICODE_STRING*, HMODULE*);
2110 NTSYSAPI NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
2111 NTSYSAPI void WINAPI LdrInitializeThunk(void*,ULONG_PTR,ULONG_PTR,ULONG_PTR);
2112 NTSYSAPI NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
2113 NTSYSAPI NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG_PTR*);
2114 IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock(void*,UINT,USHORT*,INT_PTR);
2115 NTSYSAPI NTSTATUS WINAPI LdrQueryImageFileExecutionOptions(const UNICODE_STRING*,LPCWSTR,ULONG,void*,ULONG,ULONG*);
2116 NTSYSAPI NTSTATUS WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*);
2117 NTSYSAPI void WINAPI LdrShutdownProcess(void);
2118 NTSYSAPI void WINAPI LdrShutdownThread(void);
2119 NTSYSAPI NTSTATUS WINAPI LdrUnloadDll(HMODULE);
2120 NTSYSAPI NTSTATUS WINAPI LdrUnlockLoaderLock(ULONG,ULONG_PTR);
2121 NTSYSAPI NTSTATUS WINAPI NtAcceptConnectPort(PHANDLE,ULONG,PLPC_MESSAGE,BOOLEAN,PLPC_SECTION_WRITE,PLPC_SECTION_READ);
2122 NTSYSAPI NTSTATUS WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,NTSTATUS*);
2123 NTSYSAPI NTSTATUS WINAPI NtAccessCheckAndAuditAlarm(PUNICODE_STRING,HANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,ACCESS_MASK,PGENERIC_MAPPING,BOOLEAN,PACCESS_MASK,PBOOLEAN,PBOOLEAN);
2124 NTSYSAPI NTSTATUS WINAPI NtAddAtom(const WCHAR*,ULONG,RTL_ATOM*);
2125 NTSYSAPI NTSTATUS WINAPI NtAdjustGroupsToken(HANDLE,BOOLEAN,PTOKEN_GROUPS,ULONG,PTOKEN_GROUPS,PULONG);
2126 NTSYSAPI NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
2127 NTSYSAPI NTSTATUS WINAPI NtAlertResumeThread(HANDLE,PULONG);
2128 NTSYSAPI NTSTATUS WINAPI NtAlertThread(HANDLE ThreadHandle);
2129 NTSYSAPI NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID lpLuid);
2130 NTSYSAPI NTSTATUS WINAPI NtAllocateUuids(PULARGE_INTEGER,PULONG,PULONG);
2131 NTSYSAPI NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,ULONG,SIZE_T*,ULONG,ULONG);
2132 NTSYSAPI NTSTATUS WINAPI NtAreMappedFilesTheSame(PVOID,PVOID);
2133 NTSYSAPI NTSTATUS WINAPI NtAssignProcessToJobObject(HANDLE,HANDLE);
2134 NTSYSAPI NTSTATUS WINAPI NtCallbackReturn(PVOID,ULONG,NTSTATUS);
2135 NTSYSAPI NTSTATUS WINAPI NtCancelIoFile(HANDLE,PIO_STATUS_BLOCK);
2136 NTSYSAPI NTSTATUS WINAPI NtCancelIoFileEx(HANDLE,PIO_STATUS_BLOCK,PIO_STATUS_BLOCK);
2137 NTSYSAPI NTSTATUS WINAPI NtCancelTimer(HANDLE, BOOLEAN*);
2138 NTSYSAPI NTSTATUS WINAPI NtClearEvent(HANDLE);
2139 NTSYSAPI NTSTATUS WINAPI NtClose(HANDLE);
2140 NTSYSAPI NTSTATUS WINAPI NtCloseObjectAuditAlarm(PUNICODE_STRING,HANDLE,BOOLEAN);
2141 NTSYSAPI NTSTATUS WINAPI NtCompleteConnectPort(HANDLE);
2142 NTSYSAPI NTSTATUS WINAPI NtConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
2143 NTSYSAPI NTSTATUS WINAPI NtContinue(PCONTEXT,BOOLEAN);
2144 NTSYSAPI NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
2145 NTSYSAPI NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,EVENT_TYPE,BOOLEAN);
2146 NTSYSAPI NTSTATUS WINAPI NtCreateEventPair(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
2147 NTSYSAPI NTSTATUS WINAPI NtCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
2148 NTSYSAPI NTSTATUS WINAPI NtCreateIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,ULONG);
2149 NTSYSAPI NTSTATUS WINAPI NtCreateJobObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2150 NTSYSAPI NTSTATUS WINAPI NtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
2151 NTSYSAPI NTSTATUS WINAPI NtCreateKeyTransacted(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,HANDLE,ULONG*);
2152 NTSYSAPI NTSTATUS WINAPI NtCreateKeyedEvent(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG);
2153 NTSYSAPI NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,PLARGE_INTEGER);
2154 NTSYSAPI NTSTATUS WINAPI NtCreateMutant(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,BOOLEAN);
2155 NTSYSAPI NTSTATUS WINAPI NtCreateNamedPipeFile(PHANDLE,ULONG,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,PLARGE_INTEGER);
2156 NTSYSAPI NTSTATUS WINAPI NtCreatePagingFile(PUNICODE_STRING,PLARGE_INTEGER,PLARGE_INTEGER,PLARGE_INTEGER);
2157 NTSYSAPI NTSTATUS WINAPI NtCreatePort(PHANDLE,POBJECT_ATTRIBUTES,ULONG,ULONG,PULONG);
2158 NTSYSAPI NTSTATUS WINAPI NtCreateProcess(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,BOOLEAN,HANDLE,HANDLE,HANDLE);
2159 NTSYSAPI NTSTATUS WINAPI NtCreateProfile(PHANDLE,HANDLE,PVOID,ULONG,ULONG,PVOID,ULONG,KPROFILE_SOURCE,KAFFINITY);
2160 NTSYSAPI NTSTATUS WINAPI NtCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
2161 NTSYSAPI NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,LONG,LONG);
2162 NTSYSAPI NTSTATUS WINAPI NtCreateSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PUNICODE_STRING);
2163 NTSYSAPI NTSTATUS WINAPI NtCreateThread(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,PCLIENT_ID,PCONTEXT,PINITIAL_TEB,BOOLEAN);
2164 NTSYSAPI NTSTATUS WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
2165 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);
2166 NTSYSAPI NTSTATUS WINAPI NtDelayExecution(BOOLEAN,const LARGE_INTEGER*);
2167 NTSYSAPI NTSTATUS WINAPI NtDeleteAtom(RTL_ATOM);
2168 NTSYSAPI NTSTATUS WINAPI NtDeleteFile(POBJECT_ATTRIBUTES);
2169 NTSYSAPI NTSTATUS WINAPI NtDeleteKey(HANDLE);
2170 NTSYSAPI NTSTATUS WINAPI NtDeleteValueKey(HANDLE,const UNICODE_STRING *);
2171 NTSYSAPI NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
2172 NTSYSAPI NTSTATUS WINAPI NtDisplayString(PUNICODE_STRING);
2173 NTSYSAPI NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
2174 NTSYSAPI NTSTATUS WINAPI NtDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE);
2175 NTSYSAPI NTSTATUS WINAPI NtEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
2176 NTSYSAPI NTSTATUS WINAPI NtEnumerateValueKey(HANDLE,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2177 NTSYSAPI NTSTATUS WINAPI NtExtendSection(HANDLE,PLARGE_INTEGER);
2178 NTSYSAPI NTSTATUS WINAPI NtFindAtom(const WCHAR*,ULONG,RTL_ATOM*);
2179 NTSYSAPI NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
2180 NTSYSAPI NTSTATUS WINAPI NtFlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
2181 NTSYSAPI NTSTATUS WINAPI NtFlushKey(HANDLE);
2182 NTSYSAPI NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,SIZE_T*,ULONG);
2183 NTSYSAPI NTSTATUS WINAPI NtFlushWriteBuffer(VOID);
2184 NTSYSAPI NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
2185 NTSYSAPI NTSTATUS WINAPI NtFsControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
2186 NTSYSAPI NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*);
2187 NTSYSAPI ULONG WINAPI NtGetCurrentProcessorNumber(void);
2188 NTSYSAPI NTSTATUS WINAPI NtGetPlugPlayEvent(ULONG,ULONG,PVOID,ULONG);
2189 NTSYSAPI ULONG WINAPI NtGetTickCount(VOID);
2190 NTSYSAPI NTSTATUS WINAPI NtGetWriteWatch(HANDLE,ULONG,PVOID,SIZE_T,PVOID*,ULONG_PTR*,ULONG*);
2191 NTSYSAPI NTSTATUS WINAPI NtImpersonateAnonymousToken(HANDLE);
2192 NTSYSAPI NTSTATUS WINAPI NtImpersonateClientOfPort(HANDLE,PPORT_MESSAGE);
2193 NTSYSAPI NTSTATUS WINAPI NtImpersonateThread(HANDLE,HANDLE,PSECURITY_QUALITY_OF_SERVICE);
2194 NTSYSAPI NTSTATUS WINAPI NtInitializeRegistry(BOOLEAN);
2195 NTSYSAPI NTSTATUS WINAPI NtInitiatePowerAction(POWER_ACTION,SYSTEM_POWER_STATE,ULONG,BOOLEAN);
2196 NTSYSAPI NTSTATUS WINAPI NtIsProcessInJob(HANDLE,HANDLE);
2197 NTSYSAPI NTSTATUS WINAPI NtListenPort(HANDLE,PLPC_MESSAGE);
2198 NTSYSAPI NTSTATUS WINAPI NtLoadDriver(const UNICODE_STRING *);
2199 NTSYSAPI NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *);
2200 NTSYSAPI NTSTATUS WINAPI NtLockFile(HANDLE,HANDLE,PIO_APC_ROUTINE,void*,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,ULONG*,BOOLEAN,BOOLEAN);
2201 NTSYSAPI NTSTATUS WINAPI NtLockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
2202 NTSYSAPI NTSTATUS WINAPI NtMakeTemporaryObject(HANDLE);
2203 NTSYSAPI NTSTATUS WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,SIZE_T,const LARGE_INTEGER*,SIZE_T*,SECTION_INHERIT,ULONG,ULONG);
2204 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,ULONG,BOOLEAN);
2205 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeKey(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
2206 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeMultipleKeys(HANDLE,ULONG,OBJECT_ATTRIBUTES*,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
2207 NTSYSAPI NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
2208 NTSYSAPI NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
2209 NTSYSAPI NTSTATUS WINAPI NtOpenEventPair(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
2210 NTSYSAPI NTSTATUS WINAPI NtOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
2211 NTSYSAPI NTSTATUS WINAPI NtOpenIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
2212 NTSYSAPI NTSTATUS WINAPI NtOpenJobObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2213 NTSYSAPI NTSTATUS WINAPI NtOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
2214 NTSYSAPI NTSTATUS WINAPI NtOpenKeyEx(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG);
2215 NTSYSAPI NTSTATUS WINAPI NtOpenKeyTransacted(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,HANDLE);
2216 NTSYSAPI NTSTATUS WINAPI NtOpenKeyTransactedEx(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,HANDLE);
2217 NTSYSAPI NTSTATUS WINAPI NtOpenKeyedEvent(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2218 NTSYSAPI NTSTATUS WINAPI NtOpenMutant(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2219 NTSYSAPI NTSTATUS WINAPI NtOpenObjectAuditAlarm(PUNICODE_STRING,PHANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,ACCESS_MASK,PPRIVILEGE_SET,BOOLEAN,BOOLEAN,PBOOLEAN);
2220 NTSYSAPI NTSTATUS WINAPI NtOpenProcess(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
2221 NTSYSAPI NTSTATUS WINAPI NtOpenProcessToken(HANDLE,DWORD,HANDLE *);
2222 NTSYSAPI NTSTATUS WINAPI NtOpenProcessTokenEx(HANDLE,DWORD,DWORD,HANDLE *);
2223 NTSYSAPI NTSTATUS WINAPI NtOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2224 NTSYSAPI NTSTATUS WINAPI NtOpenSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2225 NTSYSAPI NTSTATUS WINAPI NtOpenSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
2226 NTSYSAPI NTSTATUS WINAPI NtOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
2227 NTSYSAPI NTSTATUS WINAPI NtOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
2228 NTSYSAPI NTSTATUS WINAPI NtOpenThreadTokenEx(HANDLE,DWORD,BOOLEAN,DWORD,HANDLE *);
2229 NTSYSAPI NTSTATUS WINAPI NtOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
2230 NTSYSAPI NTSTATUS WINAPI NtPowerInformation(POWER_INFORMATION_LEVEL,PVOID,ULONG,PVOID,ULONG);
2231 NTSYSAPI NTSTATUS WINAPI NtPrivilegeCheck(HANDLE,PPRIVILEGE_SET,PBOOLEAN);
2232 NTSYSAPI NTSTATUS WINAPI NtPrivilegeObjectAuditAlarm(PUNICODE_STRING,HANDLE,HANDLE,ULONG,PPRIVILEGE_SET,BOOLEAN);
2233 NTSYSAPI NTSTATUS WINAPI NtPrivilegedServiceAuditAlarm(PUNICODE_STRING,PUNICODE_STRING,HANDLE,PPRIVILEGE_SET,BOOLEAN);
2234 NTSYSAPI NTSTATUS WINAPI NtProtectVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG,ULONG*);
2235 NTSYSAPI NTSTATUS WINAPI NtPulseEvent(HANDLE,PULONG);
2236 NTSYSAPI NTSTATUS WINAPI NtQueueApcThread(HANDLE,PNTAPCFUNC,ULONG_PTR,ULONG_PTR,ULONG_PTR);
2237 NTSYSAPI NTSTATUS WINAPI NtQueryAttributesFile(const OBJECT_ATTRIBUTES*,FILE_BASIC_INFORMATION*);
2238 NTSYSAPI NTSTATUS WINAPI NtQueryDefaultLocale(BOOLEAN,LCID*);
2239 NTSYSAPI NTSTATUS WINAPI NtQueryDefaultUILanguage(LANGID*);
2240 NTSYSAPI NTSTATUS WINAPI NtQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
2241 NTSYSAPI NTSTATUS WINAPI NtQueryDirectoryObject(HANDLE,PDIRECTORY_BASIC_INFORMATION,ULONG,BOOLEAN,BOOLEAN,PULONG,PULONG);
2242 NTSYSAPI NTSTATUS WINAPI NtQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PULONG,BOOLEAN);
2243 NTSYSAPI NTSTATUS WINAPI NtQueryEvent(HANDLE,EVENT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2244 NTSYSAPI NTSTATUS WINAPI NtQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*);
2245 NTSYSAPI NTSTATUS WINAPI NtQueryInformationAtom(RTL_ATOM,ATOM_INFORMATION_CLASS,PVOID,ULONG,ULONG*);
2246 NTSYSAPI NTSTATUS WINAPI NtQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS);
2247 NTSYSAPI NTSTATUS WINAPI NtQueryInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,PVOID,ULONG,PULONG);
2248 NTSYSAPI NTSTATUS WINAPI NtQueryInformationPort(HANDLE,PORT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2249 NTSYSAPI NTSTATUS WINAPI NtQueryInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG,PULONG);
2250 NTSYSAPI NTSTATUS WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
2251 NTSYSAPI NTSTATUS WINAPI NtQueryInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2252 NTSYSAPI NTSTATUS WINAPI NtQueryInstallUILanguage(LANGID*);
2253 NTSYSAPI NTSTATUS WINAPI NtQueryIntervalProfile(KPROFILE_SOURCE,PULONG);
2254 NTSYSAPI NTSTATUS WINAPI NtQueryIoCompletion(HANDLE,IO_COMPLETION_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2255 NTSYSAPI NTSTATUS WINAPI NtQueryKey(HANDLE,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
2256 NTSYSAPI NTSTATUS WINAPI NtQueryMultipleValueKey(HANDLE,PKEY_MULTIPLE_VALUE_INFORMATION,ULONG,PVOID,ULONG,PULONG);
2257 NTSYSAPI NTSTATUS WINAPI NtQueryMutant(HANDLE,MUTANT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2258 NTSYSAPI NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
2259 NTSYSAPI NTSTATUS WINAPI NtQueryOpenSubKeys(POBJECT_ATTRIBUTES,PULONG);
2260 NTSYSAPI NTSTATUS WINAPI NtQueryPerformanceCounter(PLARGE_INTEGER, PLARGE_INTEGER);
2261 NTSYSAPI NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
2262 NTSYSAPI NTSTATUS WINAPI NtQuerySection(HANDLE,SECTION_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2263 NTSYSAPI NTSTATUS WINAPI NtQuerySemaphore(HANDLE,SEMAPHORE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2264 NTSYSAPI NTSTATUS WINAPI NtQuerySymbolicLinkObject(HANDLE,PUNICODE_STRING,PULONG);
2265 NTSYSAPI NTSTATUS WINAPI NtQuerySystemEnvironmentValue(PUNICODE_STRING,PWCHAR,ULONG,PULONG);
2266 NTSYSAPI NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2267 NTSYSAPI NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER);
2268 NTSYSAPI NTSTATUS WINAPI NtQueryTimer(HANDLE,TIMER_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2269 NTSYSAPI NTSTATUS WINAPI NtQueryTimerResolution(PULONG,PULONG,PULONG);
2270 NTSYSAPI NTSTATUS WINAPI NtQueryValueKey(HANDLE,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
2271 NTSYSAPI NTSTATUS WINAPI NtQueryLicenseValue(const UNICODE_STRING *,ULONG *,PVOID,ULONG,ULONG *);
2272 NTSYSAPI NTSTATUS WINAPI NtQueryVirtualMemory(HANDLE,LPCVOID,MEMORY_INFORMATION_CLASS,PVOID,SIZE_T,SIZE_T*);
2273 NTSYSAPI NTSTATUS WINAPI NtQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
2274 NTSYSAPI NTSTATUS WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
2275 NTSYSAPI NTSTATUS WINAPI NtRaiseHardError(NTSTATUS,ULONG,PUNICODE_STRING,PVOID*,HARDERROR_RESPONSE_OPTION,PHARDERROR_RESPONSE);
2276 NTSYSAPI NTSTATUS WINAPI NtReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
2277 NTSYSAPI NTSTATUS WINAPI NtReadFileScatter(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT*,ULONG,PLARGE_INTEGER,PULONG);
2278 NTSYSAPI NTSTATUS WINAPI NtReadRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
2279 NTSYSAPI NTSTATUS WINAPI NtReadVirtualMemory(HANDLE,const void*,void*,SIZE_T,SIZE_T*);
2280 NTSYSAPI NTSTATUS WINAPI NtRegisterThreadTerminatePort(HANDLE);
2281 NTSYSAPI NTSTATUS WINAPI NtReleaseKeyedEvent(HANDLE,const void*,BOOLEAN,const LARGE_INTEGER*);
2282 NTSYSAPI NTSTATUS WINAPI NtReleaseMutant(HANDLE,PLONG);
2283 NTSYSAPI NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
2284 NTSYSAPI NTSTATUS WINAPI NtRemoveIoCompletion(HANDLE,PULONG_PTR,PULONG_PTR,PIO_STATUS_BLOCK,PLARGE_INTEGER);
2285 NTSYSAPI NTSTATUS WINAPI NtRenameKey(HANDLE,UNICODE_STRING*);
2286 NTSYSAPI NTSTATUS WINAPI NtReplaceKey(POBJECT_ATTRIBUTES,HANDLE,POBJECT_ATTRIBUTES);
2287 NTSYSAPI NTSTATUS WINAPI NtReplyPort(HANDLE,PLPC_MESSAGE);
2288 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReceivePort(HANDLE,PULONG,PLPC_MESSAGE,PLPC_MESSAGE);
2289 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReceivePortEx(HANDLE,PVOID*,PPORT_MESSAGE,PPORT_MESSAGE,PLARGE_INTEGER);
2290 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReplyPort(HANDLE,PLPC_MESSAGE);
2291 NTSYSAPI NTSTATUS WINAPI NtRequestPort(HANDLE,PLPC_MESSAGE);
2292 NTSYSAPI NTSTATUS WINAPI NtRequestWaitReplyPort(HANDLE,PLPC_MESSAGE,PLPC_MESSAGE);
2293 NTSYSAPI NTSTATUS WINAPI NtResetEvent(HANDLE,PULONG);
2294 NTSYSAPI NTSTATUS WINAPI NtResetWriteWatch(HANDLE,PVOID,SIZE_T);
2295 NTSYSAPI NTSTATUS WINAPI NtRestoreKey(HANDLE,HANDLE,ULONG);
2296 NTSYSAPI NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG);
2297 NTSYSAPI NTSTATUS WINAPI NtSaveKey(HANDLE,HANDLE);
2298 NTSYSAPI NTSTATUS WINAPI NtSecureConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PSID,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
2299 NTSYSAPI NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
2300 NTSYSAPI NTSTATUS WINAPI NtSetDefaultHardErrorPort(HANDLE);
2301 NTSYSAPI NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID);
2302 NTSYSAPI NTSTATUS WINAPI NtSetDefaultUILanguage(LANGID);
2303 NTSYSAPI NTSTATUS WINAPI NtSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG);
2304 NTSYSAPI NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
2305 NTSYSAPI NTSTATUS WINAPI NtSetHighEventPair(HANDLE);
2306 NTSYSAPI NTSTATUS WINAPI NtSetHighWaitLowEventPair(HANDLE);
2307 NTSYSAPI NTSTATUS WINAPI NtSetHighWaitLowThread(VOID);
2308 NTSYSAPI NTSTATUS WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
2309 NTSYSAPI NTSTATUS WINAPI NtSetInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,PVOID,ULONG);
2310 NTSYSAPI NTSTATUS WINAPI NtSetInformationKey(HANDLE,const int,PVOID,ULONG);
2311 NTSYSAPI NTSTATUS WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
2312 NTSYSAPI NTSTATUS WINAPI NtSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLASS,PVOID,ULONG);
2313 NTSYSAPI NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
2314 NTSYSAPI NTSTATUS WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG);
2315 NTSYSAPI NTSTATUS WINAPI NtSetIntervalProfile(ULONG,KPROFILE_SOURCE);
2316 NTSYSAPI NTSTATUS WINAPI NtSetIoCompletion(HANDLE,ULONG_PTR,ULONG_PTR,NTSTATUS,SIZE_T);
2317 NTSYSAPI NTSTATUS WINAPI NtSetLdtEntries(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG);
2318 NTSYSAPI NTSTATUS WINAPI NtSetLowEventPair(HANDLE);
2319 NTSYSAPI NTSTATUS WINAPI NtSetLowWaitHighEventPair(HANDLE);
2320 NTSYSAPI NTSTATUS WINAPI NtSetLowWaitHighThread(VOID);
2321 NTSYSAPI NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
2322 NTSYSAPI NTSTATUS WINAPI NtSetSystemEnvironmentValue(PUNICODE_STRING,PUNICODE_STRING);
2323 NTSYSAPI NTSTATUS WINAPI NtSetSystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG);
2324 NTSYSAPI NTSTATUS WINAPI NtSetSystemPowerState(POWER_ACTION,SYSTEM_POWER_STATE,ULONG);
2325 NTSYSAPI NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
2326 NTSYSAPI NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMER_APC_ROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
2327 NTSYSAPI NTSTATUS WINAPI NtSetTimerResolution(ULONG,BOOLEAN,PULONG);
2328 NTSYSAPI NTSTATUS WINAPI NtSetValueKey(HANDLE,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
2329 NTSYSAPI NTSTATUS WINAPI NtSetVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
2330 NTSYSAPI NTSTATUS WINAPI NtSignalAndWaitForSingleObject(HANDLE,HANDLE,BOOLEAN,const LARGE_INTEGER*);
2331 NTSYSAPI NTSTATUS WINAPI NtShutdownSystem(SHUTDOWN_ACTION);
2332 NTSYSAPI NTSTATUS WINAPI NtStartProfile(HANDLE);
2333 NTSYSAPI NTSTATUS WINAPI NtStopProfile(HANDLE);
2334 NTSYSAPI NTSTATUS WINAPI NtSuspendThread(HANDLE,PULONG);
2335 NTSYSAPI NTSTATUS WINAPI NtSystemDebugControl(SYSDBG_COMMAND,PVOID,ULONG,PVOID,ULONG,PULONG);
2336 NTSYSAPI NTSTATUS WINAPI NtTerminateJobObject(HANDLE,NTSTATUS);
2337 NTSYSAPI NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG);
2338 NTSYSAPI NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG);
2339 NTSYSAPI NTSTATUS WINAPI NtTestAlert(VOID);
2340 NTSYSAPI NTSTATUS WINAPI NtUnloadDriver(const UNICODE_STRING *);
2341 NTSYSAPI NTSTATUS WINAPI NtUnloadKey(POBJECT_ATTRIBUTES);
2342 NTSYSAPI NTSTATUS WINAPI NtUnloadKeyEx(POBJECT_ATTRIBUTES,HANDLE);
2343 NTSYSAPI NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
2344 NTSYSAPI NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
2345 NTSYSAPI NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
2346 NTSYSAPI NTSTATUS WINAPI NtVdmControl(ULONG,PVOID);
2347 NTSYSAPI NTSTATUS WINAPI NtWaitForKeyedEvent(HANDLE,const void*,BOOLEAN,const LARGE_INTEGER*);
2348 NTSYSAPI NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
2349 NTSYSAPI NTSTATUS WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
2350 NTSYSAPI NTSTATUS WINAPI NtWaitHighEventPair(HANDLE);
2351 NTSYSAPI NTSTATUS WINAPI NtWaitLowEventPair(HANDLE);
2352 NTSYSAPI NTSTATUS WINAPI NtWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
2353 NTSYSAPI NTSTATUS WINAPI NtWriteFileGather(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT*,ULONG,PLARGE_INTEGER,PULONG);
2354 NTSYSAPI NTSTATUS WINAPI NtWriteRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
2355 NTSYSAPI NTSTATUS WINAPI NtWriteVirtualMemory(HANDLE,void*,const void*,SIZE_T,SIZE_T*);
2356 NTSYSAPI NTSTATUS WINAPI NtYieldExecution(void);
2357
2358 NTSYSAPI void WINAPI RtlAcquirePebLock(void);
2359 NTSYSAPI BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK,BYTE);
2360 NTSYSAPI BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK,BYTE);
2361 NTSYSAPI void WINAPI RtlAcquireSRWLockExclusive(RTL_SRWLOCK*);
2362 NTSYSAPI void WINAPI RtlAcquireSRWLockShared(RTL_SRWLOCK*);
2363 NTSYSAPI NTSTATUS WINAPI RtlActivateActivationContext(DWORD,HANDLE,ULONG_PTR*);
2364 NTSYSAPI NTSTATUS WINAPI RtlAddAce(PACL,DWORD,DWORD,PACE_HEADER,DWORD);
2365 NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
2366 NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
2367 NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
2368 NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
2369 NTSYSAPI NTSTATUS WINAPI RtlAddAtomToAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
2370 NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL);
2371 NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAceEx(PACL,DWORD,DWORD,DWORD,PSID,BOOL,BOOL);
2372 NTSYSAPI void WINAPI RtlAddRefActivationContext(HANDLE);
2373 NTSYSAPI PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
2374 NTSYSAPI NTSTATUS WINAPI RtlAdjustPrivilege(ULONG,BOOLEAN,BOOLEAN,PBOOLEAN);
2375 NTSYSAPI NTSTATUS WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
2376 NTSYSAPI RTL_HANDLE * WINAPI RtlAllocateHandle(RTL_HANDLE_TABLE *,ULONG *);
2377 NTSYSAPI PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,SIZE_T) __WINE_ALLOC_SIZE(3);
2378 NTSYSAPI WCHAR WINAPI RtlAnsiCharToUnicodeChar(LPSTR *);
2379 NTSYSAPI DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING *);
2380 NTSYSAPI NTSTATUS WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING,PCANSI_STRING,BOOLEAN);
2381 NTSYSAPI NTSTATUS WINAPI RtlAppendAsciizToString(STRING *,LPCSTR);
2382 NTSYSAPI NTSTATUS WINAPI RtlAppendStringToString(STRING *,const STRING *);
2383 NTSYSAPI NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING *,const UNICODE_STRING *);
2384 NTSYSAPI NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING *,LPCWSTR);
2385 NTSYSAPI BOOLEAN WINAPI RtlAreAllAccessesGranted(ACCESS_MASK,ACCESS_MASK);
2386 NTSYSAPI BOOLEAN WINAPI RtlAreAnyAccessesGranted(ACCESS_MASK,ACCESS_MASK);
2387 NTSYSAPI BOOLEAN WINAPI RtlAreBitsSet(PCRTL_BITMAP,ULONG,ULONG);
2388 NTSYSAPI BOOLEAN WINAPI RtlAreBitsClear(PCRTL_BITMAP,ULONG,ULONG);
2389 NTSYSAPI NTSTATUS WINAPI RtlCharToInteger(PCSZ,ULONG,PULONG);
2390 NTSYSAPI NTSTATUS WINAPI RtlCheckRegistryKey(ULONG, PWSTR);
2391 NTSYSAPI void WINAPI RtlClearAllBits(PRTL_BITMAP);
2392 NTSYSAPI void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
2393 NTSYSAPI NTSTATUS WINAPI RtlCreateActivationContext(HANDLE*,const void*);
2394 NTSYSAPI PDEBUG_BUFFER WINAPI RtlCreateQueryDebugBuffer(ULONG,BOOLEAN);
2395 NTSYSAPI ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
2396 NTSYSAPI LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
2397 NTSYSAPI LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2398 NTSYSAPI NTSTATUS WINAPI RtlCompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,ULONG,PULONG,PVOID);
2399 NTSYSAPI DWORD WINAPI RtlComputeCrc32(DWORD,const BYTE*,INT);
2400 NTSYSAPI NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
2401 NTSYSAPI void WINAPI RtlCopyLuid(PLUID,const LUID*);
2402 NTSYSAPI void WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
2403 NTSYSAPI BOOLEAN WINAPI RtlCopySid(DWORD,PSID,PSID);
2404 NTSYSAPI NTSTATUS WINAPI RtlCopySecurityDescriptor(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR);
2405 NTSYSAPI void WINAPI RtlCopyString(STRING*,const STRING*);
2406 NTSYSAPI void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
2407 NTSYSAPI NTSTATUS WINAPI RtlCreateAcl(PACL,DWORD,DWORD);
2408 NTSYSAPI NTSTATUS WINAPI RtlCreateAtomTable(ULONG,RTL_ATOM_TABLE*);
2409 NTSYSAPI NTSTATUS WINAPI RtlCreateEnvironment(BOOLEAN, PWSTR*);
2410 NTSYSAPI HANDLE WINAPI RtlCreateHeap(ULONG,PVOID,SIZE_T,SIZE_T,PVOID,PRTL_HEAP_DEFINITION);
2411 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*);
2412 NTSYSAPI NTSTATUS WINAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
2413 NTSYSAPI NTSTATUS WINAPI RtlCreateTimerQueue(PHANDLE);
2414 NTSYSAPI NTSTATUS WINAPI RtlCreateTimer(PHANDLE, HANDLE, RTL_WAITORTIMERCALLBACKFUNC, PVOID, DWORD, DWORD, ULONG);
2415 NTSYSAPI BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
2416 NTSYSAPI BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
2417 NTSYSAPI NTSTATUS WINAPI RtlCreateUserThread(HANDLE,const SECURITY_DESCRIPTOR*,BOOLEAN,PVOID,SIZE_T,SIZE_T,PRTL_THREAD_START_ROUTINE,void*,HANDLE*,CLIENT_ID*);
2418 NTSYSAPI void WINAPI RtlDeactivateActivationContext(DWORD,ULONG_PTR);
2419 NTSYSAPI PVOID WINAPI RtlDecodePointer(PVOID);
2420 NTSYSAPI NTSTATUS WINAPI RtlDecompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,PULONG);
2421 NTSYSAPI NTSTATUS WINAPI RtlDeleteAce(PACL,DWORD);
2422 NTSYSAPI NTSTATUS WINAPI RtlDeleteAtomFromAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
2423 NTSYSAPI NTSTATUS WINAPI RtlDeleteCriticalSection(RTL_CRITICAL_SECTION *);
2424 NTSYSAPI NTSTATUS WINAPI RtlDeleteRegistryValue(ULONG, PCWSTR, PCWSTR);
2425 NTSYSAPI void WINAPI RtlDeleteResource(LPRTL_RWLOCK);
2426 NTSYSAPI NTSTATUS WINAPI RtlDeleteSecurityObject(PSECURITY_DESCRIPTOR*);
2427 NTSYSAPI NTSTATUS WINAPI RtlDeleteTimer(HANDLE, HANDLE, HANDLE);
2428 NTSYSAPI NTSTATUS WINAPI RtlDeleteTimerQueueEx(HANDLE, HANDLE);
2429 NTSYSAPI PRTL_USER_PROCESS_PARAMETERS WINAPI RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
2430 NTSYSAPI NTSTATUS WINAPI RtlDeregisterWait(HANDLE);
2431 NTSYSAPI NTSTATUS WINAPI RtlDeregisterWaitEx(HANDLE,HANDLE);
2432 NTSYSAPI NTSTATUS WINAPI RtlDestroyAtomTable(RTL_ATOM_TABLE);
2433 NTSYSAPI NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR);
2434 NTSYSAPI NTSTATUS WINAPI RtlDestroyHandleTable(RTL_HANDLE_TABLE *);
2435 NTSYSAPI HANDLE WINAPI RtlDestroyHeap(HANDLE);
2436 NTSYSAPI void WINAPI RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS*);
2437 NTSYSAPI NTSTATUS WINAPI RtlDestroyQueryDebugBuffer(PDEBUG_BUFFER);
2438 NTSYSAPI DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
2439 NTSYSAPI BOOLEAN WINAPI RtlDllShutdownInProgress(void);
2440 NTSYSAPI BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR);
2441 NTSYSAPI BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(PCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
2442 NTSYSAPI ULONG WINAPI RtlDosSearchPath_U(LPCWSTR, LPCWSTR, LPCWSTR, ULONG, LPWSTR, LPWSTR*);
2443 NTSYSAPI WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
2444 NTSYSAPI NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2445 NTSYSAPI void WINAPI RtlDumpResource(LPRTL_RWLOCK);
2446 NTSYSAPI NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
2447 NTSYSAPI NTSTATUS WINAPI RtlEmptyAtomTable(RTL_ATOM_TABLE,BOOLEAN);
2448 NTSYSAPI PVOID WINAPI RtlEncodePointer(PVOID);
2449 NTSYSAPI NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
2450 NTSYSAPI void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
2451 NTSYSAPI NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
2452 NTSYSAPI NTSTATUS WINAPI RtlEqualDomainName(const UNICODE_STRING*,const UNICODE_STRING*);
2453 NTSYSAPI BOOLEAN WINAPI RtlEqualLuid(const LUID*,const LUID*);
2454 NTSYSAPI BOOL WINAPI RtlEqualPrefixSid(PSID,PSID);
2455 NTSYSAPI BOOL WINAPI RtlEqualSid(PSID,PSID);
2456 NTSYSAPI BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
2457 NTSYSAPI BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2458 NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlExitUserProcess(ULONG);
2459 NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlExitUserThread(ULONG);
2460 NTSYSAPI NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PCWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*);
2461 NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionString(ULONG,const GUID*,ULONG,const UNICODE_STRING*,PVOID);
2462 NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionGuid(ULONG,const GUID*,ULONG,const GUID*,PVOID);
2463 NTSYSAPI NTSTATUS WINAPI RtlFindCharInUnicodeString(int,const UNICODE_STRING*,const UNICODE_STRING*,USHORT*);
2464 NTSYSAPI ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
2465 NTSYSAPI ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
2466 NTSYSAPI ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
2467 NTSYSAPI ULONG WINAPI RtlFindLastBackwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
2468 NTSYSAPI ULONG WINAPI RtlFindLastBackwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
2469 NTSYSAPI CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG);
2470 NTSYSAPI ULONG WINAPI RtlFindLongestRunSet(PCRTL_BITMAP,PULONG);
2471 NTSYSAPI ULONG WINAPI RtlFindLongestRunClear(PCRTL_BITMAP,PULONG);
2472 NTSYSAPI NTSTATUS WINAPI RtlFindMessage(HMODULE,ULONG,ULONG,ULONG,const MESSAGE_RESOURCE_ENTRY**);
2473 NTSYSAPI CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG);
2474 NTSYSAPI ULONG WINAPI RtlFindNextForwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
2475 NTSYSAPI ULONG WINAPI RtlFindNextForwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
2476 NTSYSAPI ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP,ULONG,ULONG);
2477 NTSYSAPI ULONG WINAPI RtlFindSetBitsAndClear(PRTL_BITMAP,ULONG,ULONG);
2478 NTSYSAPI ULONG WINAPI RtlFindSetRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
2479 NTSYSAPI BOOLEAN WINAPI RtlFirstFreeAce(PACL,PACE_HEADER *);
2480 NTSYSAPI NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING);
2481 NTSYSAPI NTSTATUS WINAPI RtlFormatMessage(LPWSTR,UCHAR,BOOLEAN,BOOLEAN,BOOLEAN,__ms_va_list *,LPWSTR,ULONG);
2482 NTSYSAPI void WINAPI RtlFreeAnsiString(PANSI_STRING);
2483 NTSYSAPI BOOLEAN WINAPI RtlFreeHandle(RTL_HANDLE_TABLE *,RTL_HANDLE *);
2484 NTSYSAPI BOOLEAN WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
2485 NTSYSAPI void WINAPI RtlFreeOemString(POEM_STRING);
2486 NTSYSAPI DWORD WINAPI RtlFreeSid(PSID);
2487 NTSYSAPI void WINAPI RtlFreeThreadActivationContextStack(void);
2488 NTSYSAPI void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
2489 NTSYSAPI NTSTATUS WINAPI RtlGetAce(PACL,DWORD,LPVOID *);
2490 NTSYSAPI NTSTATUS WINAPI RtlGetActiveActivationContext(HANDLE*);
2491 NTSYSAPI NTSTATUS WINAPI RtlGetCompressionWorkSpaceSize(USHORT,PULONG,PULONG);
2492 NTSYSAPI NTSTATUS WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
2493 NTSYSAPI NTSTATUS WINAPI RtlGetCurrentDirectory_U(ULONG, LPWSTR);
2494 NTSYSAPI PEB * WINAPI RtlGetCurrentPeb(void);
2495 NTSYSAPI NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
2496 NTSYSAPI ULONG WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*);
2497 NTSYSAPI NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
2498 NTSYSAPI NTSTATUS WINAPI RtlGetLastNtStatus(void);
2499 NTSYSAPI DWORD WINAPI RtlGetLastWin32Error(void);
2500 NTSYSAPI DWORD WINAPI RtlGetLongestNtPathLength(void);
2501 NTSYSAPI ULONG WINAPI RtlGetNtGlobalFlags(void);
2502 NTSYSAPI BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
2503 NTSYSAPI NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
2504 NTSYSAPI ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
2505 NTSYSAPI DWORD WINAPI RtlGetThreadErrorMode(void);
2506 NTSYSAPI NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
2507 NTSYSAPI NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
2508 NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING,GUID*);
2509 NTSYSAPI PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
2510 NTSYSAPI PVOID WINAPI RtlImageDirectoryEntryToData(HMODULE,BOOL,WORD,ULONG *);
2511 NTSYSAPI PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE);
2512 NTSYSAPI PIMAGE_SECTION_HEADER WINAPI RtlImageRvaToSection(const IMAGE_NT_HEADERS *,HMODULE,DWORD);
2513 NTSYSAPI PVOID WINAPI RtlImageRvaToVa(const IMAGE_NT_HEADERS *,HMODULE,DWORD,IMAGE_SECTION_HEADER **);
2514 NTSYSAPI NTSTATUS WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
2515 NTSYSAPI void WINAPI RtlInitString(PSTRING,PCSZ);
2516 NTSYSAPI void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
2517 NTSYSAPI NTSTATUS WINAPI RtlInitAnsiStringEx(PANSI_STRING,PCSZ);
2518 NTSYSAPI void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
2519 NTSYSAPI NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
2520 NTSYSAPI void WINAPI RtlInitializeBitMap(PRTL_BITMAP,PULONG,ULONG);
2521 NTSYSAPI void WINAPI RtlInitializeConditionVariable(RTL_CONDITION_VARIABLE *);
2522 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
2523 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,ULONG);
2524 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSectionEx(RTL_CRITICAL_SECTION *,ULONG,ULONG);
2525 NTSYSAPI void WINAPI RtlInitializeHandleTable(ULONG,ULONG,RTL_HANDLE_TABLE *);
2526 NTSYSAPI void WINAPI RtlInitializeResource(LPRTL_RWLOCK);
2527 NTSYSAPI void WINAPI RtlInitializeSRWLock(RTL_SRWLOCK*);
2528 NTSYSAPI BOOL WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
2529 NTSYSAPI NTSTATUS WINAPI RtlInt64ToUnicodeString(ULONGLONG,ULONG,UNICODE_STRING *);
2530 NTSYSAPI NTSTATUS WINAPI RtlIntegerToChar(ULONG,ULONG,ULONG,PCHAR);
2531 NTSYSAPI NTSTATUS WINAPI RtlIntegerToUnicodeString(ULONG,ULONG,UNICODE_STRING *);
2532 NTSYSAPI BOOLEAN WINAPI RtlIsActivationContextActive(HANDLE);
2533 NTSYSAPI BOOL WINAPI RtlIsCriticalSectionLocked(RTL_CRITICAL_SECTION *);
2534 NTSYSAPI BOOL WINAPI RtlIsCriticalSectionLockedByThread(RTL_CRITICAL_SECTION *);
2535 NTSYSAPI ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR);
2536 NTSYSAPI BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN);
2537 NTSYSAPI BOOLEAN WINAPI RtlIsTextUnicode(LPCVOID,INT,INT *);
2538 NTSYSAPI BOOLEAN WINAPI RtlIsValidHandle(const RTL_HANDLE_TABLE *, const RTL_HANDLE *);
2539 NTSYSAPI BOOLEAN WINAPI RtlIsValidIndexHandle(const RTL_HANDLE_TABLE *, ULONG Index, RTL_HANDLE **);
2540 NTSYSAPI NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *);
2541 NTSYSAPI DWORD WINAPI RtlLengthRequiredSid(DWORD);
2542 NTSYSAPI ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR);
2543 NTSYSAPI DWORD WINAPI RtlLengthSid(PSID);
2544 NTSYSAPI NTSTATUS WINAPI RtlLocalTimeToSystemTime(const LARGE_INTEGER*,PLARGE_INTEGER);
2545 NTSYSAPI BOOLEAN WINAPI RtlLockHeap(HANDLE);
2546 NTSYSAPI NTSTATUS WINAPI RtlLookupAtomInAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
2547 NTSYSAPI NTSTATUS WINAPI RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
2548 NTSYSAPI void WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*);
2549 NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
2550 NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
2551 NTSYSAPI NTSTATUS WINAPI RtlNewSecurityObject(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,BOOLEAN,HANDLE,PGENERIC_MAPPING);
2552 NTSYSAPI PRTL_USER_PROCESS_PARAMETERS WINAPI RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
2553 NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS);
2554 NTSYSAPI ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS);
2555 NTSYSAPI ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP);
2556 NTSYSAPI ULONG WINAPI RtlNumberOfClearBits(PCRTL_BITMAP);
2557 NTSYSAPI UINT WINAPI RtlOemStringToUnicodeSize(const STRING*);
2558 NTSYSAPI NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
2559 NTSYSAPI NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
2560 NTSYSAPI NTSTATUS WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHANDLE);
2561 NTSYSAPI PVOID WINAPI RtlPcToFileHeader(PVOID,PVOID*);
2562 NTSYSAPI NTSTATUS WINAPI RtlPinAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
2563 NTSYSAPI BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
2564 NTSYSAPI BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2565 NTSYSAPI NTSTATUS WINAPI RtlQueryAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM,ULONG*,ULONG*,WCHAR*,ULONG*);
2566 NTSYSAPI NTSTATUS WINAPI RtlQueryDynamicTimeZoneInformation(RTL_DYNAMIC_TIME_ZONE_INFORMATION*);
2567 NTSYSAPI NTSTATUS WINAPI RtlQueryEnvironmentVariable_U(PWSTR,PUNICODE_STRING,PUNICODE_STRING);
2568 NTSYSAPI NTSTATUS WINAPI RtlQueryHeapInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T,PSIZE_T);
2569 NTSYSAPI NTSTATUS WINAPI RtlQueryInformationAcl(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
2570 NTSYSAPI NTSTATUS WINAPI RtlQueryInformationActivationContext(ULONG,HANDLE,PVOID,ULONG,PVOID,SIZE_T,SIZE_T*);
2571 NTSYSAPI NTSTATUS WINAPI RtlQueryProcessDebugInformation(ULONG,ULONG,PDEBUG_BUFFER);
2572 NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID);
2573 NTSYSAPI NTSTATUS WINAPI RtlQueryTimeZoneInformation(RTL_TIME_ZONE_INFORMATION*);
2574 NTSYSAPI NTSTATUS WINAPI RtlQueryUnbiasedInterruptTime(ULONGLONG*);
2575 NTSYSAPI NTSTATUS WINAPI RtlQueueWorkItem(PRTL_WORK_ITEM_ROUTINE,PVOID,ULONG);
2576 NTSYSAPI void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
2577 NTSYSAPI void WINAPI RtlRaiseStatus(NTSTATUS);
2578 NTSYSAPI ULONG WINAPI RtlRandom(PULONG);
2579 NTSYSAPI PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,SIZE_T);
2580 NTSYSAPI NTSTATUS WINAPI RtlRegisterWait(PHANDLE,HANDLE,RTL_WAITORTIMERCALLBACKFUNC,PVOID,ULONG,ULONG);
2581 NTSYSAPI void WINAPI RtlReleaseActivationContext(HANDLE);
2582 NTSYSAPI void WINAPI RtlReleasePebLock(void);
2583 NTSYSAPI void WINAPI RtlReleaseResource(LPRTL_RWLOCK);
2584 NTSYSAPI void WINAPI RtlReleaseSRWLockExclusive(RTL_SRWLOCK*);
2585 NTSYSAPI void WINAPI RtlReleaseSRWLockShared(RTL_SRWLOCK*);
2586 NTSYSAPI ULONG WINAPI RtlRemoveVectoredExceptionHandler(PVOID);
2587 NTSYSAPI void WINAPI RtlRestoreLastWin32Error(DWORD);
2588 NTSYSAPI void WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *);
2589 NTSYSAPI void WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *);
2590 NTSYSAPI NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD);
2591 NTSYSAPI void WINAPI RtlSetAllBits(PRTL_BITMAP);
2592 NTSYSAPI void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG);
2593 NTSYSAPI ULONG WINAPI RtlSetCriticalSectionSpinCount(RTL_CRITICAL_SECTION*,ULONG);
2594 NTSYSAPI NTSTATUS WINAPI RtlSetControlSecurityDescriptor(PSECURITY_DESCRIPTOR,SECURITY_DESCRIPTOR_CONTROL,SECURITY_DESCRIPTOR_CONTROL);
2595 NTSYSAPI NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING*);
2596 NTSYSAPI void WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*);
2597 NTSYSAPI NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
2598 NTSYSAPI NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR*,PUNICODE_STRING,PUNICODE_STRING);
2599 NTSYSAPI NTSTATUS WINAPI RtlSetHeapInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T);
2600 NTSYSAPI NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
2601 NTSYSAPI NTSTATUS WINAPI RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
2602 NTSYSAPI NTSTATUS WINAPI RtlSetIoCompletionCallback(HANDLE,PRTL_OVERLAPPED_COMPLETION_ROUTINE,ULONG);
2603 NTSYSAPI void WINAPI RtlSetLastWin32Error(DWORD);
2604 NTSYSAPI void WINAPI RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS);
2605 NTSYSAPI NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
2606 NTSYSAPI NTSTATUS WINAPI RtlSetThreadErrorMode(DWORD,LPDWORD);
2607 NTSYSAPI NTSTATUS WINAPI RtlSetTimeZoneInformation(const RTL_TIME_ZONE_INFORMATION*);
2608 NTSYSAPI SIZE_T WINAPI RtlSizeHeap(HANDLE,ULONG,const void*);
2609 NTSYSAPI NTSTATUS WINAPI RtlSleepConditionVariableCS(RTL_CONDITION_VARIABLE*,RTL_CRITICAL_SECTION*,const LARGE_INTEGER*);
2610 NTSYSAPI NTSTATUS WINAPI RtlSleepConditionVariableSRW(RTL_CONDITION_VARIABLE*,RTL_SRWLOCK*,const LARGE_INTEGER*,ULONG);
2611 NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID,PUNICODE_STRING);
2612 NTSYSAPI LPDWORD WINAPI RtlSubAuthoritySid(PSID,DWORD);
2613 NTSYSAPI LPBYTE WINAPI RtlSubAuthorityCountSid(PSID);
2614 NTSYSAPI NTSTATUS WINAPI RtlSystemTimeToLocalTime(const LARGE_INTEGER*,PLARGE_INTEGER);
2615 NTSYSAPI void WINAPI RtlTimeToTimeFields(const LARGE_INTEGER*,PTIME_FIELDS);
2616 NTSYSAPI BOOLEAN WINAPI RtlTimeFieldsToTime(PTIME_FIELDS,PLARGE_INTEGER);
2617 NTSYSAPI void WINAPI RtlTimeToElapsedTimeFields(const LARGE_INTEGER *,PTIME_FIELDS);
2618 NTSYSAPI BOOLEAN WINAPI RtlTimeToSecondsSince1970(const LARGE_INTEGER *,LPDWORD);
2619 NTSYSAPI BOOLEAN WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *,LPDWORD);
2620 NTSYSAPI BOOLEAN WINAPI RtlTryAcquireSRWLockExclusive(RTL_SRWLOCK *);
2621 NTSYSAPI BOOLEAN WINAPI RtlTryAcquireSRWLockShared(RTL_SRWLOCK *);
2622 NTSYSAPI BOOL WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *);
2623 #ifdef __REACTOS__
2624 ULONGLONG __fastcall RtlUlonglongByteSwap(ULONGLONG);
2625 #define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x))
2626 #else
2627 NTSYSAPI ULONGLONG __cdecl RtlUlonglongByteSwap(ULONGLONG);
2628 #endif /* __REACTOS__ */
2629 NTSYSAPI DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
2630 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING,PCUNICODE_STRING,BOOLEAN);
2631 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToInteger(const UNICODE_STRING *,ULONG,ULONG *);
2632 NTSYSAPI DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
2633 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToOemString(POEM_STRING,PCUNICODE_STRING,BOOLEAN);
2634 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2635 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToMultiByteSize(PULONG,PCWSTR,ULONG);
2636 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2637 NTSYSAPI ULONG WINAPI RtlUniform(PULONG);
2638 NTSYSAPI BOOLEAN WINAPI RtlUnlockHeap(HANDLE);
2639 NTSYSAPI void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID);
2640 #ifdef __x86_64__
2641 NTSYSAPI void WINAPI RtlUnwindEx(PVOID,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
2642 #elif defined(__ia64__)
2643 NTSYSAPI void WINAPI RtlUnwind2(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT);
2644 NTSYSAPI void WINAPI RtlUnwindEx(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
2645 #endif
2646 NTSYSAPI WCHAR WINAPI RtlUpcaseUnicodeChar(WCHAR);
2647 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
2648 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
2649 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
2650 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
2651 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2652 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2653 NTSYSAPI NTSTATUS WINAPI RtlUpdateTimer(HANDLE, HANDLE, DWORD, DWORD);
2654 NTSYSAPI CHAR WINAPI RtlUpperChar(CHAR);
2655 NTSYSAPI void WINAPI RtlUpperString(STRING *,const STRING *);
2656 NTSYSAPI NTSTATUS WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
2657 NTSYSAPI BOOLEAN WINAPI RtlValidRelativeSecurityDescriptor(PSECURITY_DESCRIPTOR,ULONG,SECURITY_INFORMATION);
2658 NTSYSAPI BOOLEAN WINAPI RtlValidAcl(PACL);
2659 NTSYSAPI BOOLEAN WINAPI RtlValidSid(PSID);
2660 NTSYSAPI BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
2661 NTSYSAPI NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
2662 NTSYSAPI void WINAPI RtlWakeAllConditionVariable(RTL_CONDITION_VARIABLE *);
2663 NTSYSAPI void WINAPI RtlWakeConditionVariable(RTL_CONDITION_VARIABLE *);
2664 NTSYSAPI NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
2665 NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirection(BOOLEAN);
2666 NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx(ULONG,ULONG*);
2667 NTSYSAPI NTSTATUS WINAPI RtlWriteRegistryValue(ULONG,PCWSTR,PCWSTR,ULONG,PVOID,ULONG);
2668 NTSYSAPI NTSTATUS WINAPI RtlZombifyActivationContext(HANDLE);
2669 NTSYSAPI NTSTATUS WINAPI RtlpNtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
2670 NTSYSAPI NTSTATUS WINAPI RtlpNtEnumerateSubKey(HANDLE,UNICODE_STRING *, ULONG);
2671 NTSYSAPI NTSTATUS WINAPI RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION *);
2672 NTSYSAPI NTSTATUS WINAPI RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION *);
2673 NTSYSAPI NTSTATUS WINAPI vDbgPrintEx(ULONG,ULONG,LPCSTR,__ms_va_list);
2674 NTSYSAPI NTSTATUS WINAPI vDbgPrintExWithPrefix(LPCSTR,ULONG,ULONG,LPCSTR,__ms_va_list);
2675
2676 /* 32-bit only functions */
2677
2678 #ifndef _WIN64
2679 NTSYSAPI LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
2680 NTSYSAPI ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
2681 NTSYSAPI LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
2682 NTSYSAPI ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
2683 NTSYSAPI UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
2684 NTSYSAPI LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
2685 NTSYSAPI LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
2686 NTSYSAPI LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
2687 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
2688 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
2689 NTSYSAPI ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
2690 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerNegate(LONGLONG);
2691 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
2692 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
2693 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
2694 NTSYSAPI NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
2695 #endif
2696
2697 /* Wine internal functions */
2698
2699 NTSYSAPI NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRING *unix_name_ret,
2700 UINT disposition, BOOLEAN check_case );
2701 NTSYSAPI NTSTATUS CDECL wine_unix_to_nt_file_name( const ANSI_STRING *name, UNICODE_STRING *nt );
2702
2703 NTSYSAPI SIZE_T CDECL wine_uninterrupted_read_memory( const void *addr, void *buffer, SIZE_T size );
2704 NTSYSAPI SIZE_T CDECL wine_uninterrupted_write_memory( void *addr, const void *buffer, SIZE_T size );
2705
2706
2707 /***********************************************************************
2708 * Inline functions
2709 */
2710
2711 #define InitializeObjectAttributes(p,n,a,r,s) \
2712 do { \
2713 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
2714 (p)->RootDirectory = r; \
2715 (p)->Attributes = a; \
2716 (p)->ObjectName = n; \
2717 (p)->SecurityDescriptor = s; \
2718 (p)->SecurityQualityOfService = NULL; \
2719 } while (0)
2720
2721 #define NtCurrentProcess() ((HANDLE)-1)
2722
2723 #ifndef RtlFillMemory // REACTOS
2724 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
2725 #endif // REACTOS
2726 #ifndef RtlMoveMemory // REACTOS
2727 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
2728 #endif // REACTOS
2729 #define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
2730 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
2731 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
2732 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
2733 #ifndef RtlZeroMemory // REACTOS
2734 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
2735 #endif // REACTOS
2736
2737 static inline BOOLEAN RtlCheckBit(PCRTL_BITMAP lpBits, ULONG ulBit)
2738 {
2739 if (lpBits && ulBit < lpBits->SizeOfBitMap &&
2740 lpBits->Buffer[ulBit >> 5] & (1 << (ulBit & 31)))
2741 return TRUE;
2742 return FALSE;
2743 }
2744
2745 /* These are implemented as __fastcall, so we can't let Winelib apps link with them */
2746 static inline USHORT RtlUshortByteSwap(USHORT s)
2747 {
2748 return (s >> 8) | (s << 8);
2749 }
2750 static inline ULONG RtlUlongByteSwap(ULONG i)
2751 {
2752 #if defined(__i386__) && defined(__GNUC__)
2753 ULONG ret;
2754 __asm__("bswap %0" : "=r" (ret) : "0" (i) );
2755 return ret;
2756 #else
2757 return ((ULONG)RtlUshortByteSwap((USHORT)i) << 16) | RtlUshortByteSwap((USHORT)(i >> 16));
2758 #endif
2759 }
2760
2761 /* list manipulation macros */
2762 #define InitializeListHead(le) (void)((le)->Flink = (le)->Blink = (le))
2763 #define InsertHeadList(le,e) do { PLIST_ENTRY f = (le)->Flink; (e)->Flink = f; (e)->Blink = (le); f->Blink = (e); (le)->Flink = (e); } while (0)
2764 #define InsertTailList(le,e) do { PLIST_ENTRY b = (le)->Blink; (e)->Flink = (le); (e)->Blink = b; b->Flink = (e); (le)->Blink = (e); } while (0)
2765 #define IsListEmpty(le) ((le)->Flink == (le))
2766 #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)
2767 static inline PLIST_ENTRY RemoveHeadList(PLIST_ENTRY le)
2768 {
2769 PLIST_ENTRY f, b, e;
2770
2771 e = le->Flink;
2772 f = le->Flink->Flink;
2773 b = le->Flink->Blink;
2774 f->Blink = b;
2775 b->Flink = f;
2776
2777 if (e != le) e->Flink = e->Blink = NULL;
2778 return e;
2779 }
2780 static inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le)
2781 {
2782 PLIST_ENTRY f, b, e;
2783
2784 e = le->Blink;
2785 f = le->Blink->Flink;
2786 b = le->Blink->Blink;
2787 f->Blink = b;
2788 b->Flink = f;
2789
2790 if (e != le) e->Flink = e->Blink = NULL;
2791 return e;
2792 }
2793
2794
2795 #ifdef __WINESRC__
2796
2797 /* FIXME: private structure for vm86 mode, stored in teb->GdiTebBatch */
2798 typedef struct
2799 {
2800 DWORD dpmi_vif;
2801 DWORD vm86_pending;
2802 } WINE_VM86_TEB_INFO;
2803
2804 static inline WINE_VM86_TEB_INFO *get_vm86_teb_info(void)
2805 {
2806 return (WINE_VM86_TEB_INFO *)&NtCurrentTeb()->GdiTebBatch;
2807 }
2808
2809 /* The thread information for 16-bit threads */
2810 /* NtCurrentTeb()->SubSystemTib points to this */
2811 typedef struct
2812 {
2813 void *unknown; /* 00 unknown */
2814 UNICODE_STRING *exe_name; /* 04 exe module name */
2815
2816 /* the following fields do not exist under Windows */
2817 UNICODE_STRING exe_str; /* exe name string pointed to by exe_name */
2818 CURDIR curdir; /* current directory */
2819 WCHAR curdir_buffer[MAX_PATH];
2820 } WIN16_SUBSYSTEM_TIB;
2821
2822 #endif /* __WINESRC__ */
2823
2824 #ifdef __cplusplus
2825 } /* extern "C" */
2826 #endif /* defined(__cplusplus) */
2827
2828 #endif /* __WINE_WINTERNL_H */