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