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