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