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