VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/winternl.h@ 33281

Last change on this file since 33281 was 28475, checked in by vboxsync, 15 years ago

crOpenGL: update to wine 1.1.43

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette