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