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