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