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
28 #endif /* defined(__cplusplus) */
31 /**********************************************************************
32 * Fundamental types and data structures
35 typedef LONG NTSTATUS;
37 typedef CONST char *PCSZ;
40 typedef CSHORT *PCSHORT;
42 typedef struct _STRING {
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 */
60 } UNICODE_STRING, *PUNICODE_STRING;
62 typedef const UNICODE_STRING *PCUNICODE_STRING;
64 typedef struct _CLIENT_ID
68 } CLIENT_ID, *PCLIENT_ID;
70 typedef struct _CURDIR
72 UNICODE_STRING DosPath;
76 typedef struct RTL_DRIVE_LETTER_CURDIR
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;
104 HANDLE ConsoleHandle;
109 CURDIR CurrentDirectory;
110 UNICODE_STRING DllPath;
111 UNICODE_STRING ImagePathName;
112 UNICODE_STRING CommandLine;
120 ULONG dwFillAttribute;
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
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
150 /***********************************************************************
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 */
213 /***********************************************************************
216 #if defined(_NTSYSTEM_) || defined(_KERNEL32_) /* hack, should go away */
220 #ifndef WINE_NO_TEB /* don't define TEB if included from thread.h */
221 # ifndef WINE_TEB_DEFINED
222 # define WINE_TEB_DEFINED
225 NT_TIB Tib; /* 000 */
226 PVOID EnvironmentPointer; /* 01c */
227 CLIENT_ID ClientId; /* 020 */
228 PVOID ActiveRpcHandle; /* 028 */
229 PVOID ThreadLocalStoragePointer; /* 02c */
231 ULONG LastErrorValue; /* 034 */
232 ULONG CountOfOwnedCriticalSections;/* 038 */
233 PVOID CsrClientThread; /* 03c */
234 PVOID Win32ThreadInfo; /* 040 */
235 ULONG Win32ClientInfo[31]; /* 044 */
236 PVOID WOW32Reserved; /* 0c0 */
237 ULONG CurrentLocale; /* 0c4 */
238 ULONG FpSoftwareStatusRegister; /* 0c8 */
239 PVOID SystemReserved1[54]; /* 0cc */
240 PVOID Spare1; /* 1a4 */
241 LONG ExceptionCode; /* 1a8 */
242 BYTE SpareBytes1[40]; /* 1ac */
243 PVOID SystemReserved2[10]; /* 1d4 */
244 GDI_TEB_BATCH GdiTebBatch; /* 1fc */
245 ULONG gdiRgn; /* 6dc */
246 ULONG gdiPen; /* 6e0 */
247 ULONG gdiBrush; /* 6e4 */
248 CLIENT_ID RealClientId; /* 6e8 */
249 HANDLE GdiCachedProcessHandle; /* 6f0 */
250 ULONG GdiClientPID; /* 6f4 */
251 ULONG GdiClientTID; /* 6f8 */
252 PVOID GdiThreadLocaleInfo; /* 6fc */
253 PVOID UserReserved[5]; /* 700 */
254 PVOID glDispachTable[280]; /* 714 */
255 ULONG glReserved1[26]; /* b74 */
256 PVOID glReserved2; /* bdc */
257 PVOID glSectionInfo; /* be0 */
258 PVOID glSection; /* be4 */
259 PVOID glTable; /* be8 */
260 PVOID glCurrentRC; /* bec */
261 PVOID glContext; /* bf0 */
262 ULONG LastStatusValue; /* bf4 */
263 UNICODE_STRING StaticUnicodeString; /* bf8 used by advapi32 */
264 WCHAR StaticUnicodeBuffer[261]; /* c00 used by advapi32 */
265 PVOID DeallocationStack; /* e0c */
266 PVOID TlsSlots[64]; /* e10 */
267 LIST_ENTRY TlsLinks; /* f10 */
269 PVOID ReservedForNtRpc; /* f1c */
270 PVOID DbgSsReserved[2]; /* f20 */
271 ULONG HardErrorDisabled; /* f28 */
272 PVOID Instrumentation[16]; /* f2c */
273 PVOID WinSockData; /* f6c */
274 ULONG GdiBatchCount; /* f70 */
275 ULONG Spare2; /* f74 */
276 ULONG Spare3; /* f78 */
277 ULONG Spare4; /* f7c */
278 PVOID ReservedForOle; /* f80 Windows 2000 only */
279 ULONG WaitingOnLoaderLock; /* f84 */
280 PVOID Reserved5[3]; /* f88 */
281 PVOID *TlsExpansionSlots; /* f94 */
283 # endif /* WINE_TEB_DEFINED */
284 #endif /* WINE_NO_TEB */
286 /***********************************************************************
290 typedef enum _FILE_INFORMATION_CLASS {
291 FileDirectoryInformation = 1,
292 FileFullDirectoryInformation,
293 FileBothDirectoryInformation,
294 FileBasicInformation,
295 FileStandardInformation,
296 FileInternalInformation,
298 FileAccessInformation,
300 FileRenameInformation,
302 FileNamesInformation,
303 FileDispositionInformation,
304 FilePositionInformation,
305 FileFullEaInformation,
307 FileAlignmentInformation,
309 FileAllocationInformation,
310 FileEndOfFileInformation,
311 FileAlternateNameInformation,
312 FileStreamInformation,
314 FilePipeLocalInformation,
315 FilePipeRemoteInformation,
316 FileMailslotQueryInformation,
317 FileMailslotSetInformation,
318 FileCompressionInformation,
319 FileObjectIdInformation,
320 FileCompletionInformation,
321 FileMoveClusterInformation,
322 FileQuotaInformation,
323 FileReparsePointInformation,
324 FileNetworkOpenInformation,
325 FileAttributeTagInformation,
326 FileTrackingInformation,
327 FileMaximumInformation
328 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
330 typedef struct _FILE_DIRECTORY_INFORMATION {
331 ULONG NextEntryOffset;
333 LARGE_INTEGER CreationTime;
334 LARGE_INTEGER LastAccessTime;
335 LARGE_INTEGER LastWriteTime;
336 LARGE_INTEGER ChangeTime;
337 LARGE_INTEGER EndOfFile;
338 LARGE_INTEGER AllocationSize;
339 ULONG FileAttributes;
340 ULONG FileNameLength;
341 WCHAR FileName[ANYSIZE_ARRAY];
342 } FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
344 typedef struct _FILE_FULL_DIRECTORY_INFORMATION {
345 ULONG NextEntryOffset;
347 LARGE_INTEGER CreationTime;
348 LARGE_INTEGER LastAccessTime;
349 LARGE_INTEGER LastWriteTime;
350 LARGE_INTEGER ChangeTime;
351 LARGE_INTEGER EndOfFile;
352 LARGE_INTEGER AllocationSize;
353 ULONG FileAttributes;
354 ULONG FileNameLength;
356 WCHAR FileName[ANYSIZE_ARRAY];
357 } FILE_FULL_DIRECTORY_INFORMATION, *PFILE_FULL_DIRECTORY_INFORMATION,
358 FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION;
360 typedef struct _FILE_BOTH_DIRECTORY_INFORMATION {
361 ULONG NextEntryOffset;
363 LARGE_INTEGER CreationTime;
364 LARGE_INTEGER LastAccessTime;
365 LARGE_INTEGER LastWriteTime;
366 LARGE_INTEGER ChangeTime;
367 LARGE_INTEGER EndOfFile;
368 LARGE_INTEGER AllocationSize;
369 ULONG FileAttributes;
370 ULONG FileNameLength;
372 CHAR ShortNameLength;
374 WCHAR FileName[ANYSIZE_ARRAY];
375 } FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION,
376 FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
378 typedef struct _FILE_BASIC_INFORMATION {
379 LARGE_INTEGER CreationTime;
380 LARGE_INTEGER LastAccessTime;
381 LARGE_INTEGER LastWriteTime;
382 LARGE_INTEGER ChangeTime;
383 ULONG FileAttributes;
384 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
386 typedef struct _FILE_STANDARD_INFORMATION {
387 LARGE_INTEGER AllocationSize;
388 LARGE_INTEGER EndOfFile;
390 BOOLEAN DeletePending;
392 } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
394 typedef struct _FILE_INTERNAL_INFORMATION {
395 LARGE_INTEGER IndexNumber;
396 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
398 typedef struct _FILE_EA_INFORMATION {
400 } FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
402 typedef struct _FILE_ACCESS_INFORMATION {
403 ACCESS_MASK AccessFlags;
404 } FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
406 typedef struct _FILE_NAME_INFORMATION {
407 ULONG FileNameLength;
409 } FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
411 typedef struct _FILE_RENAME_INFORMATION {
414 ULONG FileNameLength;
416 } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
418 typedef struct _FILE_NAMES_INFORMATION {
419 ULONG NextEntryOffset;
421 ULONG FileNameLength;
423 } FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
425 typedef struct _FILE_DISPOSITION_INFORMATION {
426 BOOLEAN DoDeleteFile;
427 } FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
429 typedef struct _FILE_POSITION_INFORMATION {
430 LARGE_INTEGER CurrentByteOffset;
431 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
433 typedef struct _FILE_ALIGNMENT_INFORMATION {
434 ULONG AlignmentRequirement;
435 } FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION;
437 typedef struct _FILE_ALLOCATION_INFORMATION {
438 LARGE_INTEGER AllocationSize;
439 } FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
441 typedef struct _FILE_END_OF_FILE_INFORMATION {
442 LARGE_INTEGER EndOfFile;
443 } FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
445 typedef struct _FILE_NETWORK_OPEN_INFORMATION {
446 LARGE_INTEGER CreationTime;
447 LARGE_INTEGER LastAccessTime;
448 LARGE_INTEGER LastWriteTime;
449 LARGE_INTEGER ChangeTime;
450 LARGE_INTEGER AllocationSize;
451 LARGE_INTEGER EndOfFile;
452 ULONG FileAttributes;
453 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
455 typedef struct _FILE_FULL_EA_INFORMATION {
456 ULONG NextEntryOffset;
459 USHORT EaValueLength;
461 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
463 typedef struct _FILE_MODE_INFORMATION {
465 } FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION;
467 typedef struct _FILE_STREAM_INFORMATION
469 ULONG NextEntryOffset;
470 ULONG StreamNameLength;
471 LARGE_INTEGER StreamSize;
472 LARGE_INTEGER StreamAllocationSize;
474 } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
476 typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION
478 ULONG FileAttributes;
480 } FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
482 typedef struct _FILE_MAILSLOT_QUERY_INFORMATION {
483 ULONG MaximumMessageSize;
485 ULONG NextMessageSize;
486 ULONG MessagesAvailable;
487 LARGE_INTEGER ReadTimeout;
488 } FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION;
490 typedef struct _FILE_MAILSLOT_SET_INFORMATION {
491 LARGE_INTEGER ReadTimeout;
492 } FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
494 typedef struct _FILE_ALL_INFORMATION
496 FILE_BASIC_INFORMATION BasicInformation;
497 FILE_STANDARD_INFORMATION StandardInformation;
498 FILE_INTERNAL_INFORMATION InternalInformation;
499 FILE_EA_INFORMATION EaInformation;
500 FILE_ACCESS_INFORMATION AccessInformation;
501 FILE_POSITION_INFORMATION PositionInformation;
502 FILE_MODE_INFORMATION ModeInformation;
503 FILE_ALIGNMENT_INFORMATION AlignmentInformation;
504 FILE_NAME_INFORMATION NameInformation;
505 } FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION;
507 typedef enum _FSINFOCLASS {
508 FileFsVolumeInformation = 1,
509 FileFsLabelInformation,
510 FileFsSizeInformation,
511 FileFsDeviceInformation,
512 FileFsAttributeInformation,
513 FileFsControlInformation,
514 FileFsFullSizeInformation,
515 FileFsObjectIdInformation,
516 FileFsMaximumInformation
517 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
519 typedef enum _KEY_INFORMATION_CLASS {
523 } KEY_INFORMATION_CLASS;
525 typedef enum _KEY_VALUE_INFORMATION_CLASS {
526 KeyValueBasicInformation,
527 KeyValueFullInformation,
528 KeyValuePartialInformation,
529 KeyValueFullInformationAlign64,
530 KeyValuePartialInformationAlign64
531 } KEY_VALUE_INFORMATION_CLASS;
533 typedef enum _OBJECT_INFORMATION_CLASS {
534 ObjectBasicInformation,
535 ObjectNameInformation,
536 ObjectTypeInformation,
537 ObjectAllInformation,
538 ObjectDataInformation
539 } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
541 typedef enum _PROCESSINFOCLASS {
542 ProcessBasicInformation = 0,
543 ProcessQuotaLimits = 1,
544 ProcessIoCounters = 2,
545 ProcessVmCounters = 3,
547 ProcessBasePriority = 5,
548 ProcessRaisePriority = 6,
549 ProcessDebugPort = 7,
550 ProcessExceptionPort = 8,
551 ProcessAccessToken = 9,
552 ProcessLdtInformation = 10,
554 ProcessDefaultHardErrorMode = 12,
555 ProcessIoPortHandlers = 13,
556 ProcessPooledUsageAndLimits = 14,
557 ProcessWorkingSetWatch = 15,
558 ProcessUserModeIOPL = 16,
559 ProcessEnableAlignmentFaultFixup = 17,
560 ProcessPriorityClass = 18,
561 ProcessWx86Information = 19,
562 ProcessHandleCount = 20,
563 ProcessAffinityMask = 21,
564 ProcessPriorityBoost = 22,
565 ProcessDeviceMap = 23,
566 ProcessSessionInformation = 24,
567 ProcessForegroundInformation = 25,
568 ProcessWow64Information = 26,
572 typedef enum _SECTION_INHERIT {
577 typedef enum _SYSTEM_INFORMATION_CLASS {
578 SystemBasicInformation = 0,
579 SystemCpuInformation = 1,
580 SystemPerformanceInformation = 2,
581 SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
583 SystemProcessInformation = 5,
586 SystemProcessorPerformanceInformation = 8,
589 SystemDriverInformation,
599 SystemCacheInformation,
601 SystemInterruptInformation = 23,
602 SystemDpcBehaviourInformation = 24,
603 SystemFullMemoryInformation = 25,
604 SystemNotImplemented6 = 25,
605 SystemLoadImage = 26,
606 SystemUnloadImage = 27,
607 SystemTimeAdjustmentInformation = 28,
608 SystemTimeAdjustment = 28,
609 SystemSummaryMemoryInformation = 29,
610 SystemNotImplemented7 = 29,
611 SystemNextEventIdInformation = 30,
612 SystemNotImplemented8 = 30,
613 SystemEventIdsInformation = 31,
614 SystemCrashDumpInformation = 32,
615 SystemExceptionInformation = 33,
616 SystemCrashDumpStateInformation = 34,
617 SystemKernelDebuggerInformation = 35,
618 SystemContextSwitchInformation = 36,
619 SystemRegistryQuotaInformation = 37,
620 SystemCurrentTimeZoneInformation = 44,
621 SystemTimeZoneInformation = 44,
622 SystemLookasideInformation = 45,
623 SystemSetTimeSlipEvent = 46,
624 SystemCreateSession = 47,
625 SystemDeleteSession = 48,
626 SystemInvalidInfoClass4 = 49,
627 SystemRangeStartInformation = 50,
628 SystemVerifierInformation = 51,
629 SystemAddVerifier = 52,
630 SystemSessionProcessesInformation = 53,
631 SystemInformationClassMax
632 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
634 typedef enum _TIMER_TYPE {
639 typedef enum _THREADINFOCLASS {
640 ThreadBasicInformation,
645 ThreadImpersonationToken,
646 ThreadDescriptorTableEntry,
647 ThreadEnableAlignmentFaultFixup,
648 ThreadEventPair_Reusable,
649 ThreadQuerySetWin32StartAddress,
651 ThreadPerformanceCount,
653 ThreadIdealProcessor,
655 ThreadSetTlsArrayAddress,
660 typedef struct _THREAD_BASIC_INFORMATION
663 PVOID TebBaseAddress;
668 } THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
671 typedef enum _WINSTATIONINFOCLASS {
672 WinStationInformation = 8
673 } WINSTATIONINFOCLASS;
675 typedef enum _MEMORY_INFORMATION_CLASS {
676 MemoryBasicInformation,
677 MemoryWorkingSetList,
679 MemoryBasicVlmInformation
680 } MEMORY_INFORMATION_CLASS;
682 typedef enum _MUTANT_INFORMATION_CLASS
684 MutantBasicInformation
685 } MUTANT_INFORMATION_CLASS, *PMUTANT_INFORMATION_CLASS;
687 typedef struct _MUTANT_BASIC_INFORMATION {
689 BOOLEAN OwnedByCaller;
690 BOOLEAN AbandonedState;
691 } MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION;
693 typedef enum _TIMER_INFORMATION_CLASS
695 TimerBasicInformation = 0
696 } TIMER_INFORMATION_CLASS;
698 typedef struct _TIMER_BASIC_INFORMATION
700 LARGE_INTEGER RemainingTime;
702 } TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION;
705 /* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
709 UNC_PATH, /* "//foo" */
710 ABSOLUTE_DRIVE_PATH, /* "c:/foo" */
711 RELATIVE_DRIVE_PATH, /* "c:foo" */
712 ABSOLUTE_PATH, /* "/foo" */
713 RELATIVE_PATH, /* "foo" */
714 DEVICE_PATH, /* "//./foo" */
715 UNC_DOT_PATH /* "//." */
718 /***********************************************************************
719 * IA64 specific types and data structures
724 typedef struct _FRAME_POINTERS {
725 ULONGLONG MemoryStackFp;
726 ULONGLONG BackingStoreFp;
727 } FRAME_POINTERS, *PFRAME_POINTERS;
729 #define UNWIND_HISTORY_TABLE_SIZE 12
731 typedef struct _RUNTIME_FUNCTION {
734 ULONG UnwindInfoAddress;
735 } RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
737 typedef struct _UNWIND_HISTORY_TABLE_ENTRY {
740 PRUNTIME_FUNCTION FunctionEntry;
741 } UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY;
743 typedef struct _UNWIND_HISTORY_TABLE {
748 UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE];
749 } UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE;
751 #endif /* defined(__ia64__) */
753 /***********************************************************************
754 * Types and data structures
757 /* This is used by NtQuerySystemInformation */
758 typedef struct _SYSTEM_THREAD_INFORMATION{
759 FILETIME ftKernelTime;
761 FILETIME ftCreateTime;
763 DWORD dwStartAddress;
766 DWORD dwCurrentPriority;
767 DWORD dwBasePriority;
768 DWORD dwContextSwitches;
771 } SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION;
773 typedef struct _IO_STATUS_BLOCK {
779 ULONG_PTR Information;
780 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
782 typedef void (WINAPI * PIO_APC_ROUTINE)(PVOID,PIO_STATUS_BLOCK,ULONG);
784 typedef struct _KEY_BASIC_INFORMATION {
785 LARGE_INTEGER LastWriteTime;
789 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
791 typedef struct _KEY_NODE_INFORMATION
793 LARGE_INTEGER LastWriteTime;
800 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
802 typedef struct _KEY_FULL_INFORMATION
804 LARGE_INTEGER LastWriteTime;
812 ULONG MaxValueNameLen;
813 ULONG MaxValueDataLen;
815 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
817 typedef struct _KEY_VALUE_ENTRY
819 PUNICODE_STRING ValueName;
823 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
825 typedef struct _KEY_VALUE_BASIC_INFORMATION {
830 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
832 typedef struct _KEY_VALUE_FULL_INFORMATION {
839 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
841 typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
846 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
848 typedef struct _OBJECT_ATTRIBUTES {
850 HANDLE RootDirectory;
851 PUNICODE_STRING ObjectName;
853 PVOID SecurityDescriptor; /* type SECURITY_DESCRIPTOR */
854 PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
855 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
857 typedef struct _OBJECT_DATA_INFORMATION {
858 BOOLEAN InheritHandle;
859 BOOLEAN ProtectFromClose;
860 } OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION;
862 typedef struct _PROCESS_BASIC_INFORMATION {
865 DWORD PebBaseAddress;
868 ULONG UniqueProcessId;
869 ULONG InheritedFromUniqueProcessId;
874 ULONG_PTR UniqueProcessId;
877 } PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION;
879 typedef struct _PROCESS_INFO {
880 DWORD Offset; /* 00 offset to next PROCESS_INFO ok*/
881 DWORD ThreadCount; /* 04 number of ThreadInfo member ok */
883 FILETIME CreationTime; /* 20 */
885 PWCHAR ProcessName; /* 3c ok */
887 DWORD ProcessID; /* 44 ok*/
888 DWORD ParentProcessID;
890 DWORD Unknown3[2]; /* 50 */
891 ULONG PeakVirtualSize;
893 ULONG PageFaultCount;
894 ULONG PeakWorkingSetSize;
895 ULONG WorkingSetSize;
896 ULONG QuotaPeakPagedPoolUsage;
897 ULONG QuotaPagedPoolUsage;
898 ULONG QuotaPeakNonPagedPoolUsage;
899 ULONG QuotaNonPagedPoolUsage;
901 ULONG PeakPagefileUsage;
904 SYSTEM_THREAD_INFORMATION ati[ANYSIZE_ARRAY]; /* 94 size=0x40*/
905 } PROCESS_INFO, PPROCESS_INFO;
907 typedef struct _RTL_HEAP_DEFINITION {
908 ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
911 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
913 typedef struct _RTL_RWLOCK {
914 RTL_CRITICAL_SECTION rtlCS;
916 HANDLE hSharedReleaseSemaphore;
919 HANDLE hExclusiveReleaseSemaphore;
920 UINT uExclusiveWaiters;
923 HANDLE hOwningThreadId;
924 DWORD dwTimeoutBoost;
926 } RTL_RWLOCK, *LPRTL_RWLOCK;
928 /* System Information Class 0x00 */
929 typedef struct _SYSTEM_BASIC_INFORMATION {
932 ULONG uKeMaximumIncrement;
934 ULONG uMmNumberOfPhysicalPages;
935 ULONG uMmLowestPhysicalPage;
936 ULONG uMmHighestPhysicalPage;
937 ULONG uAllocationGranularity;
938 PVOID pLowestUserAddress;
939 PVOID pMmHighestUserAddress;
940 ULONG uKeActiveProcessors;
941 BYTE bKeNumberProcessors;
947 CCHAR NumberOfProcessors;
949 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
951 /* CPU Information Class 0x01 */
955 WORD Revision; /* combination of CPU model and stepping */
956 WORD Reserved; /* always zero */
957 DWORD FeatureSet; /* see bit flags below */
958 } SYSTEM_CPU_INFORMATION;
960 /* definitions of bits in the Feature set for the x86 processors */
961 #define CPU_FEATURE_VME 0x00000005 /* Virtual 86 Mode Extensions */
962 #define CPU_FEATURE_TSC 0x00000002 /* Time Stamp Counter available */
963 #define CPU_FEATURE_CMOV 0x00000008 /* Conditional Move instruction*/
964 #define CPU_FEATURE_PGE 0x00000014 /* Page table Entry Global bit */
965 #define CPU_FEATURE_PSE 0x00000024 /* Page Size Extension */
966 #define CPU_FEATURE_MTRR 0x00000040 /* Memory Type Range Registers */
967 #define CPU_FEATURE_CX8 0x00000080 /* Compare and eXchange 8 byte instr. */
968 #define CPU_FEATURE_MMX 0x00000100 /* Multi Media eXtensions */
969 #define CPU_FEATURE_X86 0x00000200 /* seems to be alway ON, on the '86 */
970 #define CPU_FEATURE_PAT 0x00000400 /* Page Attribute Table */
971 #define CPU_FEATURE_FXSR 0x00000800 /* FXSAVE and FXSTORE instructions */
972 #define CPU_FEATURE_SEP 0x00001000 /* SYSENTER and SYSEXIT instructions */
973 #define CPU_FEATURE_SSE 0x00002000 /* SSE extenstions (ext. MMX) */
974 #define CPU_FEATURE_3DNOW 0x00008000 /* 3DNOW instructions available
975 (FIXME: needs to be confirmed) */
976 #define CPU_FEATURE_SSE2 0x00010000 /* SSE2 extensions (XMMI64) */
977 #define CPU_FEATURE_DS 0x00020000 /* Debug Store */
978 #define CPU_FEATURE_HTT 0x00040000 /* Hyper Threading Technology */
980 /* System Information Class 0x15 */
984 ULONG PageFaultCount;
985 ULONG MinimumWorkingSet;
986 ULONG MaximumWorkingSet;
988 } SYSTEM_CACHE_INFORMATION;
990 typedef struct _SYSTEM_CONFIGURATION_INFO {
994 WORD ProcessorArchitecture;
999 PVOID MinimumApplicationAddress;
1000 PVOID MaximumApplicationAddress;
1001 ULONG ActiveProcessorMask;
1002 ULONG NumberOfProcessors;
1003 ULONG ProcessorType;
1004 ULONG AllocationGranularity;
1005 WORD ProcessorLevel;
1006 WORD ProcessorRevision;
1007 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
1009 /* System Information Class 0x0b */
1016 char szName[MAX_PATH + 1];
1017 } SYSTEM_DRIVER_INFORMATION;
1019 typedef struct _SYSTEM_EXCEPTION_INFORMATION {
1021 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
1023 typedef struct _SYSTEM_LOOKASIDE_INFORMATION {
1025 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
1027 typedef struct _SYSTEM_INTERRUPT_INFORMATION {
1029 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
1031 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION {
1032 BOOLEAN DebuggerEnabled;
1033 BOOLEAN DebuggerNotPresent;
1034 } SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
1036 /* System Information Class 0x10 */
1039 USHORT dwCreatorBackTraceIndex;
1041 BYTE bHandleAttributes;
1042 USHORT usHandleOffset;
1044 ULONG ulGrantedAccess;
1045 } HANDLEINFO, *PHANDLEINFO; /* FIXME: SYSTEM_HANDLE_INFORMATION? */
1047 typedef struct _SYSTEM_PERFORMANCE_INFORMATION {
1048 BYTE Reserved1[312];
1049 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
1051 /* System Information Class 0x02 */
1052 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
1054 LARGE_INTEGER liIdleTime;
1057 LARGE_INTEGER IdleTime;
1058 LARGE_INTEGER KernelTime;
1059 LARGE_INTEGER UserTime;
1060 LARGE_INTEGER Reserved1[2];
1063 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
1065 /* System Information Class 0x05 */
1066 typedef struct _SYSTEM_PROCESS_INFORMATION {
1069 DWORD dwThreadCount;
1070 DWORD dwUnknown1[6];
1071 FILETIME ftCreationTime;
1072 DWORD dwUnknown2[5];
1073 WCHAR *pszProcessName;
1074 DWORD dwBasePriority;
1076 DWORD dwParentProcessID;
1077 DWORD dwHandleCount;
1080 DWORD dwVirtualBytesPeak;
1081 DWORD dwVirtualBytes;
1083 DWORD dwWorkingSetPeak;
1088 DWORD dwNonPagedPool;
1089 DWORD dwPageFileBytesPeak;
1090 DWORD dwPrivateBytes;
1091 DWORD dwPageFileBytes;
1092 DWORD dwUnknown7[4];
1093 SYSTEM_THREAD_INFORMATION ti[1];
1095 ULONG NextEntryOffset;
1098 HANDLE UniqueProcessId;
1102 PVOID Reserved5[11];
1103 SIZE_T PeakPagefileUsage;
1104 SIZE_T PrivatePageCount;
1105 LARGE_INTEGER Reserved6[6];
1107 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
1109 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION {
1110 ULONG RegistryQuotaAllowed;
1111 ULONG RegistryQuotaUsed;
1113 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
1115 typedef struct _SYSTEM_TIME_ADJUSTMENT {
1116 ULONG TimeAdjustment;
1117 BOOLEAN TimeAdjustmentDisabled;
1118 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
1120 /* System Information Class 0x03 */
1121 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
1123 LARGE_INTEGER liKeBootTime;
1124 LARGE_INTEGER liKeSystemTime;
1125 LARGE_INTEGER liExpTimeZoneBias;
1126 ULONG uCurrentTimeZoneId;
1131 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; /* was SYSTEM_TIME_INFORMATION */
1133 typedef struct _TIME_FIELDS
1140 CSHORT Milliseconds;
1142 } TIME_FIELDS, *PTIME_FIELDS;
1144 typedef struct _WINSTATIONINFORMATIONW {
1147 BYTE Reserved3[1140];
1148 } WINSTATIONINFORMATIONW, *PWINSTATIONINFORMATIONW;
1150 typedef struct _VM_COUNTERS_ {
1151 SIZE_T PeakVirtualSize;
1153 ULONG PageFaultCount;
1154 SIZE_T PeakWorkingSetSize;
1155 SIZE_T WorkingSetSize;
1156 SIZE_T QuotaPeakPagedPoolUsage;
1157 SIZE_T QuotaPagedPoolUsage;
1158 SIZE_T QuotaPeakNonPagedPoolUsage;
1159 SIZE_T QuotaNonPagedPoolUsage;
1160 SIZE_T PagefileUsage;
1161 SIZE_T PeakPagefileUsage;
1162 } VM_COUNTERS, *PVM_COUNTERS;
1164 typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONW)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
1166 typedef struct _LDR_RESOURCE_INFO
1171 } LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO;
1174 /* debug buffer definitions */
1176 typedef struct _DEBUG_BUFFER {
1177 HANDLE SectionHandle;
1179 PVOID RemoteSectionBase;
1180 ULONG SectionBaseDelta;
1181 HANDLE EventPairHandle;
1183 HANDLE RemoteThreadHandle;
1184 ULONG InfoClassMask;
1186 ULONG AllocatedSize;
1188 PVOID ModuleInformation;
1189 PVOID BackTraceInformation;
1190 PVOID HeapInformation;
1191 PVOID LockInformation;
1193 } DEBUG_BUFFER, *PDEBUG_BUFFER;
1195 #define PDI_MODULES 0x01
1196 #define PDI_BACKTRACE 0x02
1197 #define PDI_HEAPS 0x04
1198 #define PDI_HEAP_TAGS 0x08
1199 #define PDI_HEAP_BLOCKS 0x10
1200 #define PDI_LOCKS 0x20
1202 typedef struct _DEBUG_MODULE_INFORMATION {
1210 USHORT ModuleNameOffset;
1211 CHAR ImageName[256];
1212 } DEBUG_MODULE_INFORMATION, *PDEBUG_MODULE_INFORMATION;
1214 typedef struct _DEBUG_HEAP_INFORMATION {
1226 } DEBUG_HEAP_INFORMATION, *PDEBUG_HEAP_INFORMATION;
1228 typedef struct _DEBUG_LOCK_INFORMATION {
1231 USHORT CreatorBackTraceIndex;
1232 ULONG OwnerThreadId;
1234 ULONG ContentionCount;
1236 ULONG RecursionCount;
1237 ULONG NumberOfSharedWaiters;
1238 ULONG NumberOfExclusiveWaiters;
1239 } DEBUG_LOCK_INFORMATION, *PDEBUG_LOCK_INFORMATION;
1241 typedef struct _PORT_MESSAGE_HEADER {
1245 USHORT VirtualRangesOffset;
1249 } PORT_MESSAGE_HEADER, *PPORT_MESSAGE_HEADER, PORT_MESSAGE, *PPORT_MESSAGE;
1251 /* FIXME: names probably not correct */
1252 typedef struct _RTL_HANDLE
1254 struct _RTL_HANDLE * Next;
1257 /* FIXME: names probably not correct */
1258 typedef struct _RTL_HANDLE_TABLE
1260 ULONG MaxHandleCount; /* 0x00 */
1261 ULONG HandleSize; /* 0x04 */
1262 ULONG Unused[2]; /* 0x08-0x0c */
1263 PVOID NextFree; /* 0x10 */
1264 PVOID FirstHandle; /* 0x14 */
1265 PVOID ReservedMemory; /* 0x18 */
1266 PVOID MaxHandle; /* 0x1c */
1269 /***********************************************************************
1273 /* flags for NtCreateFile and NtOpenFile */
1274 #define FILE_DIRECTORY_FILE 0x00000001
1275 #define FILE_WRITE_THROUGH 0x00000002
1276 #define FILE_SEQUENTIAL_ONLY 0x00000004
1277 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
1278 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
1279 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
1280 #define FILE_NON_DIRECTORY_FILE 0x00000040
1281 #define FILE_CREATE_TREE_CONNECTION 0x00000080
1282 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
1283 #define FILE_NO_EA_KNOWLEDGE 0x00000200
1284 #define FILE_OPEN_FOR_RECOVERY 0x00000400
1285 #define FILE_RANDOM_ACCESS 0x00000800
1286 #define FILE_DELETE_ON_CLOSE 0x00001000
1287 #define FILE_OPEN_BY_FILE_ID 0x00002000
1288 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
1289 #define FILE_NO_COMPRESSION 0x00008000
1290 #define FILE_RESERVE_OPFILTER 0x00100000
1291 #define FILE_TRANSACTED_MODE 0x00200000
1292 #define FILE_OPEN_OFFLINE_FILE 0x00400000
1293 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
1295 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
1296 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
1298 /* status for NtCreateFile or NtOpenFile */
1299 #define FILE_SUPERSEDED 0
1300 #define FILE_OPENED 1
1301 #define FILE_CREATED 2
1302 #define FILE_OVERWRITTEN 3
1303 #define FILE_EXISTS 4
1304 #define FILE_DOES_NOT_EXIST 5
1306 /* disposition for NtCreateFile */
1307 #define FILE_SUPERSEDE 0
1309 #define FILE_CREATE 2
1310 #define FILE_OPEN_IF 3
1311 #define FILE_OVERWRITE 4
1312 #define FILE_OVERWRITE_IF 5
1313 #define FILE_MAXIMUM_DISPOSITION 5
1315 /* Characteristics of a File System */
1316 #define FILE_REMOVABLE_MEDIA 0x00000001
1317 #define FILE_READ_ONLY_DEVICE 0x00000002
1318 #define FILE_FLOPPY_DISKETTE 0x00000004
1319 #define FILE_WRITE_ONE_MEDIA 0x00000008
1320 #define FILE_REMOTE_DEVICE 0x00000010
1321 #define FILE_DEVICE_IS_MOUNTED 0x00000020
1322 #define FILE_VIRTUAL_VOLUME 0x00000040
1323 #define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
1324 #define FILE_DEVICE_SECURE_OPEN 0x00000100
1326 /* options for NtCreateNamedPipeFile */
1327 #define FILE_PIPE_INBOUND 0x00000000
1328 #define FILE_PIPE_OUTBOUND 0x00000001
1329 #define FILE_PIPE_FULL_DUPLEX 0x00000002
1331 #if (_WIN32_WINNT >= 0x0501)
1332 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
1333 #endif /* (_WIN32_WINNT >= 0x0501) */
1335 #define LOGONID_CURRENT ((ULONG)-1)
1337 #define OBJ_INHERIT 0x00000002L
1338 #define OBJ_PERMANENT 0x00000010L
1339 #define OBJ_EXCLUSIVE 0x00000020L
1340 #define OBJ_CASE_INSENSITIVE 0x00000040L
1341 #define OBJ_OPENIF 0x00000080L
1342 #define OBJ_OPENLINK 0x00000100L
1343 #define OBJ_KERNEL_HANDLE 0x00000200L
1344 #define OBJ_VALID_ATTRIBUTES 0x000003F2L
1346 #define SERVERNAME_CURRENT ((HANDLE)NULL)
1348 typedef void (CALLBACK *PNTAPCFUNC)(ULONG_PTR,ULONG_PTR,ULONG_PTR); /* FIXME: not the right name */
1349 typedef void (CALLBACK *PRTL_THREAD_START_ROUTINE)(LPVOID); /* FIXME: not the right name */
1352 /* DbgPrintEx default levels */
1353 #define DPFLTR_ERROR_LEVEL 0
1354 #define DPFLTR_WARNING_LEVEL 1
1355 #define DPFLTR_TRACE_LEVEL 2
1356 #define DPFLTR_INFO_LEVEL 3
1357 #define DPFLTR_MASK 0x8000000
1359 /* Well-known LUID values */
1360 #define SE_MIN_WELL_KNOWN_PRIVILEGE 2L
1361 #define SE_CREATE_TOKEN_PRIVILEGE 2L
1362 #define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3L
1363 #define SE_LOCK_MEMORY_PRIVILEGE 4L
1364 #define SE_INCREASE_QUOTA_PRIVILEGE 5L
1365 #define SE_UNSOLICITED_INPUT_PRIVILEGE 6L /* obsolete */
1366 #define SE_MACHINE_ACCOUNT_PRIVILEGE 6L
1367 #define SE_TCB_PRIVILEGE 7L
1368 #define SE_SECURITY_PRIVILEGE 8L
1369 #define SE_TAKE_OWNERSHIP_PRIVILEGE 9L
1370 #define SE_LOAD_DRIVER_PRIVILEGE 10L
1371 #define SE_SYSTEM_PROFILE_PRIVILEGE 11L
1372 #define SE_SYSTEMTIME_PRIVILEGE 12L
1373 #define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13L
1374 #define SE_INC_BASE_PRIORITY_PRIVILEGE 14L
1375 #define SE_CREATE_PAGEFILE_PRIVILEGE 15L
1376 #define SE_CREATE_PERMANENT_PRIVILEGE 16L
1377 #define SE_BACKUP_PRIVILEGE 17L
1378 #define SE_RESTORE_PRIVILEGE 18L
1379 #define SE_SHUTDOWN_PRIVILEGE 19L
1380 #define SE_DEBUG_PRIVILEGE 20L
1381 #define SE_AUDIT_PRIVILEGE 21L
1382 #define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22L
1383 #define SE_CHANGE_NOTIFY_PRIVILLEGE 23L
1384 #define SE_REMOTE_SHUTDOWN_PRIVILEGE 24L
1385 #define SE_UNDOCK_PRIVILEGE 25L
1386 #define SE_SYNC_AGENT_PRIVILEGE 26L
1387 #define SE_ENABLE_DELEGATION_PRIVILEGE 27L
1388 #define SE_MANAGE_VOLUME_PRIVILEGE 28L
1389 #define SE_IMPERSONATE_PRIVILEGE 29L
1390 #define SE_CREATE_GLOBAL_PRIVILEGE 30L
1391 #define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_GLOBAL_PRIVILEGE
1394 /* Rtl*Registry* functions structs and defines */
1395 #define RTL_REGISTRY_ABSOLUTE 0
1396 #define RTL_REGISTRY_SERVICES 1
1397 #define RTL_REGISTRY_CONTROL 2
1398 #define RTL_REGISTRY_WINDOWS_NT 3
1399 #define RTL_REGISTRY_DEVICEMAP 4
1400 #define RTL_REGISTRY_USER 5
1402 #define RTL_REGISTRY_HANDLE 0x40000000
1403 #define RTL_REGISTRY_OPTIONAL 0x80000000
1405 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
1406 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
1407 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
1408 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
1409 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
1410 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
1411 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
1413 typedef NTSTATUS (WINAPI *PRTL_QUERY_REGISTRY_ROUTINE)( PCWSTR ValueName,
1418 PVOID EntryContext);
1420 typedef struct _RTL_QUERY_REGISTRY_TABLE
1422 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
1428 ULONG DefaultLength;
1429 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
1432 /***********************************************************************
1433 * Function declarations
1436 extern LPSTR _strlwr(LPSTR str); /* FIXME: Doesn't belong here */
1437 extern LPSTR _strupr(LPSTR str); /* FIXME: Doesn't belong here */
1439 #if defined(__i386__) && defined(__GNUC__)
1440 static inline void WINAPI DbgBreakPoint(void) { __asm__ __volatile__("int3"); }
1441 static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3"); }
1442 #else /* __i386__ && __GNUC__ */
1443 void WINAPI DbgBreakPoint(void);
1444 void WINAPI DbgUserBreakPoint(void);
1445 #endif /* __i386__ && __GNUC__ */
1446 NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
1447 NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
1449 NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
1450 NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
1451 NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
1452 NTSTATUS WINAPI LdrGetDllHandle(ULONG, ULONG, const UNICODE_STRING*, HMODULE*);
1453 NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
1454 void WINAPI LdrInitializeThunk(HANDLE,ULONG,ULONG,ULONG);
1455 NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
1456 void WINAPI LdrShutdownProcess(void);
1457 void WINAPI LdrShutdownThread(void);
1458 NTSTATUS WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,NTSTATUS*);
1459 NTSTATUS WINAPI NtAdjustGroupsToken(HANDLE,BOOLEAN,PTOKEN_GROUPS,ULONG,PTOKEN_GROUPS,PULONG);
1460 NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
1461 NTSTATUS WINAPI NtAlertThread(HANDLE ThreadHandle);
1462 NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID lpLuid);
1463 NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,ULONG,ULONG*,ULONG,ULONG);
1464 NTSTATUS WINAPI NtCancelIoFile(HANDLE,PIO_STATUS_BLOCK);
1465 NTSTATUS WINAPI NtCancelTimer(HANDLE, BOOLEAN*);
1466 NTSTATUS WINAPI NtClearEvent(HANDLE);
1467 NTSTATUS WINAPI NtClose(HANDLE);
1468 NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOOLEAN,BOOLEAN);
1469 NTSTATUS WINAPI NtCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
1470 NTSTATUS WINAPI NtCreateIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,ULONG);
1471 NTSTATUS WINAPI NtCreateKey(PHKEY,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
1472 NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,PLARGE_INTEGER);
1473 NTSTATUS WINAPI NtCreateMutant(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,BOOLEAN);
1474 NTSTATUS WINAPI NtCreateNamedPipeFile(PHANDLE,ULONG,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,PLARGE_INTEGER);
1475 NTSTATUS WINAPI NtCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
1476 NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,LONG,LONG);
1477 NTSTATUS WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
1478 NTSTATUS WINAPI NtDelayExecution(BOOLEAN,const LARGE_INTEGER*);
1479 NTSTATUS WINAPI NtDeleteFile(POBJECT_ATTRIBUTES);
1480 NTSTATUS WINAPI NtDeleteKey(HKEY);
1481 NTSTATUS WINAPI NtDeleteValueKey(HKEY,const UNICODE_STRING *);
1482 NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
1483 NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
1484 NTSTATUS WINAPI NtDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE);
1485 NTSTATUS WINAPI NtEnumerateKey(HKEY,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1486 NTSTATUS WINAPI NtEnumerateValueKey(HKEY,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1487 NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
1488 NTSTATUS WINAPI NtFlushInstructionCache(HANDLE,LPCVOID,ULONG);
1489 NTSTATUS WINAPI NtFlushKey(HKEY);
1490 NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,ULONG*,ULONG);
1491 NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
1492 NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*);
1493 NTSTATUS WINAPI NtImpersonateAnonymousToken(HANDLE);
1494 NTSTATUS WINAPI NtImpersonateClientOfPort(HANDLE,PPORT_MESSAGE);
1495 NTSTATUS WINAPI NtImpersonateThread(HANDLE,HANDLE,PSECURITY_QUALITY_OF_SERVICE);
1496 NTSTATUS WINAPI NtInitiatePowerAction(POWER_ACTION,SYSTEM_POWER_STATE,ULONG,BOOLEAN);
1497 NTSTATUS WINAPI NtLoadDriver(const UNICODE_STRING *);
1498 NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *);
1499 NTSTATUS WINAPI NtLockFile(HANDLE,HANDLE,PIO_APC_ROUTINE,void*,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,ULONG*,BOOLEAN,BOOLEAN);
1500 NTSTATUS WINAPI NtLockVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
1501 NTSTATUS WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,ULONG,const LARGE_INTEGER*,ULONG*,SECTION_INHERIT,ULONG,ULONG);
1502 NTSTATUS WINAPI NtNotifyChangeKey(HKEY,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
1503 NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1504 NTSTATUS WINAPI NtOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
1505 NTSTATUS WINAPI NtOpenIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1506 NTSTATUS WINAPI NtOpenKey(PHKEY,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1507 NTSTATUS WINAPI NtOpenMutant(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1508 NTSTATUS WINAPI NtOpenProcessToken(HANDLE,DWORD,HANDLE *);
1509 NTSTATUS WINAPI NtOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1510 NTSTATUS WINAPI NtOpenSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1511 NTSTATUS WINAPI NtOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
1512 NTSTATUS WINAPI NtOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
1513 NTSTATUS WINAPI NtOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
1514 NTSTATUS WINAPI NtPowerInformation(POWER_INFORMATION_LEVEL,PVOID,ULONG,PVOID,ULONG);
1515 NTSTATUS WINAPI NtPrivilegeCheck(HANDLE,PPRIVILEGE_SET,PBOOLEAN);
1516 NTSTATUS WINAPI NtProtectVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG,ULONG*);
1517 NTSTATUS WINAPI NtPulseEvent(HANDLE,PULONG);
1518 NTSTATUS WINAPI NtQueueApcThread(HANDLE,PNTAPCFUNC,ULONG_PTR,ULONG_PTR,ULONG_PTR);
1519 NTSTATUS WINAPI NtQueryAttributesFile(const OBJECT_ATTRIBUTES*,FILE_BASIC_INFORMATION*);
1520 NTSTATUS WINAPI NtQueryDefaultLocale(BOOLEAN,LCID*);
1521 NTSTATUS WINAPI NtQueryDefaultUILanguage(LANGID*);
1522 NTSTATUS WINAPI NtQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
1523 NTSTATUS WINAPI NtQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PVOID,BOOLEAN);
1524 NTSTATUS WINAPI NtQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*);
1525 NTSTATUS WINAPI NtQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS);
1526 NTSTATUS WINAPI NtQueryInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG,PULONG);
1527 NTSTATUS WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
1528 NTSTATUS WINAPI NtQueryInformationToken(HANDLE,DWORD,LPVOID,DWORD,LPDWORD);
1529 NTSTATUS WINAPI NtQueryInstallUILanguage(LANGID*);
1530 NTSTATUS WINAPI NtQueryKey(HKEY,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1531 NTSTATUS WINAPI NtQueryMultipleValueKey(HKEY,PVALENTW,ULONG,PVOID,ULONG,PULONG);
1532 NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
1533 NTSTATUS WINAPI NtQueryPerformanceCounter(PLARGE_INTEGER, PLARGE_INTEGER);
1534 NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
1535 NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1536 NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER);
1537 NTSTATUS WINAPI NtQueryTimer(HANDLE,TIMER_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1538 NTSTATUS WINAPI NtQueryValueKey(HKEY,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
1539 NTSTATUS WINAPI NtQueryVirtualMemory(HANDLE,LPCVOID,MEMORY_INFORMATION_CLASS,PVOID,ULONG,ULONG*);
1540 NTSTATUS WINAPI NtQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
1541 void WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
1542 NTSTATUS WINAPI NtReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
1543 NTSTATUS WINAPI NtReadVirtualMemory(HANDLE,const void*,void*,SIZE_T,SIZE_T*);
1544 NTSTATUS WINAPI NtReleaseMutant(HANDLE,PLONG);
1545 NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
1546 NTSTATUS WINAPI NtRemoveIoCompletion(HANDLE,PULONG,PULONG,PIO_STATUS_BLOCK,PLARGE_INTEGER);
1547 NTSTATUS WINAPI NtReplaceKey(POBJECT_ATTRIBUTES,HKEY,POBJECT_ATTRIBUTES);
1548 NTSTATUS WINAPI NtResetEvent(HANDLE,PULONG);
1549 NTSTATUS WINAPI NtRestoreKey(HKEY,HANDLE,ULONG);
1550 NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG);
1551 NTSTATUS WINAPI NtSaveKey(HKEY,HANDLE);
1552 NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
1553 NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID);
1554 NTSTATUS WINAPI NtSetDefaultUILanguage(LANGID);
1555 NTSTATUS WINAPI NtSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG);
1556 NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
1557 NTSTATUS WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
1558 NTSTATUS WINAPI NtSetInformationKey(HKEY,const int,PVOID,ULONG);
1559 NTSTATUS WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
1560 NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
1561 NTSTATUS WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG);
1562 NTSTATUS WINAPI NtSetIoCompletion(HANDLE,ULONG,ULONG,NTSTATUS,ULONG);
1563 NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
1564 NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
1565 NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMERAPCROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
1566 NTSTATUS WINAPI NtSetValueKey(HKEY,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
1567 NTSTATUS WINAPI NtSignalAndWaitForSingleObject(HANDLE,HANDLE,BOOLEAN,const LARGE_INTEGER*);
1568 NTSTATUS WINAPI NtSuspendThread(HANDLE,PULONG);
1569 NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG);
1570 NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG);
1571 NTSTATUS WINAPI NtUnloadDriver(const UNICODE_STRING *);
1572 NTSTATUS WINAPI NtUnloadKey(HKEY);
1573 NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
1574 NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
1575 NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
1576 NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
1577 NTSTATUS WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
1578 NTSTATUS WINAPI NtWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
1579 NTSTATUS WINAPI NtWriteVirtualMemory(HANDLE,void*,const void*,SIZE_T,SIZE_T*);
1580 NTSTATUS WINAPI NtYieldExecution(void);
1582 void WINAPI RtlAcquirePebLock(void);
1583 BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK,BYTE);
1584 BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK,BYTE);
1585 NTSTATUS WINAPI RtlAddAce(PACL,DWORD,DWORD,PACE_HEADER,DWORD);
1586 NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
1587 NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
1588 NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
1589 NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
1590 PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
1591 DWORD WINAPI RtlAdjustPrivilege(DWORD,DWORD,DWORD,DWORD);
1592 NTSTATUS WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
1593 RTL_HANDLE * WINAPI RtlAllocateHandle(RTL_HANDLE_TABLE *,ULONG *);
1594 PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,ULONG);
1595 DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING *);
1596 NTSTATUS WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING,PCANSI_STRING,BOOLEAN);
1597 NTSTATUS WINAPI RtlAppendAsciizToString(STRING *,LPCSTR);
1598 NTSTATUS WINAPI RtlAppendStringToString(STRING *,const STRING *);
1599 NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING *,const UNICODE_STRING *);
1600 NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING *,LPCWSTR);
1601 BOOLEAN WINAPI RtlAreAllAccessesGranted(ACCESS_MASK,ACCESS_MASK);
1602 BOOLEAN WINAPI RtlAreAnyAccessesGranted(ACCESS_MASK,ACCESS_MASK);
1603 BOOLEAN WINAPI RtlAreBitsSet(PCRTL_BITMAP,ULONG,ULONG);
1604 BOOLEAN WINAPI RtlAreBitsClear(PCRTL_BITMAP,ULONG,ULONG);
1606 NTSTATUS WINAPI RtlCharToInteger(PCSZ,ULONG,PULONG);
1607 NTSTATUS WINAPI RtlCheckRegistryKey(ULONG, PWSTR);
1608 void WINAPI RtlClearAllBits(PRTL_BITMAP);
1609 void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
1610 ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
1611 LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
1612 LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1613 DWORD WINAPI RtlComputeCrc32(DWORD,PBYTE,INT);
1614 NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
1615 LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
1616 ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
1617 void WINAPI RtlCopyLuid(PLUID,const LUID*);
1618 void WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
1619 BOOLEAN WINAPI RtlCopySid(DWORD,PSID,PSID);
1620 void WINAPI RtlCopyString(STRING*,const STRING*);
1621 void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
1622 NTSTATUS WINAPI RtlCreateAcl(PACL,DWORD,DWORD);
1623 NTSTATUS WINAPI RtlCreateEnvironment(BOOLEAN, PWSTR*);
1624 HANDLE WINAPI RtlCreateHeap(ULONG,PVOID,ULONG,ULONG,PVOID,PRTL_HEAP_DEFINITION);
1625 NTSTATUS WINAPI RtlCreateProcessParameters(RTL_USER_PROCESS_PARAMETERS**,const UNICODE_STRING*,
1626 const UNICODE_STRING*,const UNICODE_STRING*,
1627 const UNICODE_STRING*,PWSTR,const UNICODE_STRING*,
1628 const UNICODE_STRING*,const UNICODE_STRING*,
1629 const UNICODE_STRING*);
1630 NTSTATUS WINAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
1631 BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
1632 BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
1633 NTSTATUS WINAPI RtlCreateUserThread(HANDLE,const SECURITY_DESCRIPTOR*,BOOLEAN,PVOID,SIZE_T,SIZE_T,PRTL_THREAD_START_ROUTINE,void*,HANDLE*,CLIENT_ID*);
1635 NTSTATUS WINAPI RtlDeleteAce(PACL,DWORD);
1636 NTSTATUS WINAPI RtlDeleteCriticalSection(RTL_CRITICAL_SECTION *);
1637 NTSTATUS WINAPI RtlDeleteRegistryValue(ULONG, PCWSTR, PCWSTR);
1638 void WINAPI RtlDeleteResource(LPRTL_RWLOCK);
1639 DWORD WINAPI RtlDeleteSecurityObject(DWORD);
1640 PRTL_USER_PROCESS_PARAMETERS WINAPI RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
1641 NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR);
1642 NTSTATUS WINAPI RtlDestroyHandleTable(RTL_HANDLE_TABLE *);
1643 HANDLE WINAPI RtlDestroyHeap(HANDLE);
1644 void WINAPI RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS*);
1645 DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
1646 BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR);
1647 BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(PCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
1648 ULONG WINAPI RtlDosSearchPath_U(LPCWSTR, LPCWSTR, LPCWSTR, ULONG, LPWSTR, LPWSTR*);
1649 WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
1650 NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1651 void WINAPI RtlDumpResource(LPRTL_RWLOCK);
1652 NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
1654 LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
1655 ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
1656 UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
1657 NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
1658 void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
1659 NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
1660 NTSTATUS WINAPI RtlEqualDomainName(const UNICODE_STRING*,const UNICODE_STRING*);
1661 BOOLEAN WINAPI RtlEqualLuid(const LUID*,const LUID*);
1662 BOOL WINAPI RtlEqualPrefixSid(PSID,PSID);
1663 BOOL WINAPI RtlEqualSid(PSID,PSID);
1664 BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
1665 BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1666 NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*);
1667 LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
1668 LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
1669 LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
1671 NTSTATUS WINAPI RtlFindCharInUnicodeString(int,const UNICODE_STRING*,const UNICODE_STRING*,USHORT*);
1672 ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
1673 ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
1674 ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
1675 ULONG WINAPI RtlFindLastBackwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
1676 ULONG WINAPI RtlFindLastBackwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
1677 CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG);
1678 ULONG WINAPI RtlFindLongestRunSet(PCRTL_BITMAP,PULONG);
1679 ULONG WINAPI RtlFindLongestRunClear(PCRTL_BITMAP,PULONG);
1680 NTSTATUS WINAPI RtlFindMessage(HMODULE,ULONG,ULONG,ULONG,const MESSAGE_RESOURCE_ENTRY**);
1681 CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG);
1682 ULONG WINAPI RtlFindNextForwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
1683 ULONG WINAPI RtlFindNextForwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
1684 ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP,ULONG,ULONG);
1685 ULONG WINAPI RtlFindSetBitsAndClear(PRTL_BITMAP,ULONG,ULONG);
1686 ULONG WINAPI RtlFindSetRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
1687 BOOLEAN WINAPI RtlFirstFreeAce(PACL,PACE_HEADER *);
1688 NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING);
1689 NTSTATUS WINAPI RtlFormatMessage(LPWSTR,UCHAR,BOOLEAN,BOOLEAN,BOOLEAN,va_list *,LPWSTR,ULONG);
1690 void WINAPI RtlFreeAnsiString(PANSI_STRING);
1691 BOOLEAN WINAPI RtlFreeHandle(RTL_HANDLE_TABLE *,RTL_HANDLE *);
1692 BOOLEAN WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
1693 void WINAPI RtlFreeOemString(POEM_STRING);
1694 DWORD WINAPI RtlFreeSid(PSID);
1695 void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
1697 NTSTATUS WINAPI RtlGetAce(PACL,DWORD,LPVOID *);
1698 NTSTATUS WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
1699 NTSTATUS WINAPI RtlGetCurrentDirectory_U(ULONG, LPWSTR);
1700 NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
1701 ULONG WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*);
1702 NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
1703 NTSTATUS WINAPI RtlGetLastNtStatus(void);
1704 DWORD WINAPI RtlGetLastWin32Error(void);
1705 DWORD WINAPI RtlGetLongestNtPathLength(void);
1706 BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
1707 NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
1708 ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
1709 NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
1710 NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
1712 PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
1713 PVOID WINAPI RtlImageDirectoryEntryToData(HMODULE,BOOL,WORD,ULONG *);
1714 PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE);
1715 PIMAGE_SECTION_HEADER WINAPI RtlImageRvaToSection(const IMAGE_NT_HEADERS *,HMODULE,DWORD);
1716 PVOID WINAPI RtlImageRvaToVa(const IMAGE_NT_HEADERS *,HMODULE,DWORD,IMAGE_SECTION_HEADER **);
1717 BOOL WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
1718 void WINAPI RtlInitString(PSTRING,PCSZ);
1719 void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
1720 void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
1721 NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
1722 NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
1723 NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,DWORD);
1724 void WINAPI RtlInitializeBitMap(PRTL_BITMAP,PULONG,ULONG);
1725 void WINAPI RtlInitializeHandleTable(ULONG,ULONG,RTL_HANDLE_TABLE *);
1726 void WINAPI RtlInitializeResource(LPRTL_RWLOCK);
1727 BOOL WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
1729 NTSTATUS WINAPI RtlInt64ToUnicodeString(ULONGLONG,ULONG,UNICODE_STRING *);
1730 NTSTATUS WINAPI RtlIntegerToChar(ULONG,ULONG,ULONG,PCHAR);
1731 NTSTATUS WINAPI RtlIntegerToUnicodeString(ULONG,ULONG,UNICODE_STRING *);
1732 ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR);
1733 BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN);
1734 DWORD WINAPI RtlIsTextUnicode(LPVOID,DWORD,DWORD *);
1735 BOOLEAN WINAPI RtlIsValidHandle(const RTL_HANDLE_TABLE *, const RTL_HANDLE *);
1736 BOOLEAN WINAPI RtlIsValidIndexHandle(const RTL_HANDLE_TABLE *, ULONG Index, RTL_HANDLE **);
1738 LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
1739 LONGLONG WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
1740 ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
1741 LONGLONG WINAPI RtlLargeIntegerNegate(LONGLONG);
1742 LONGLONG WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
1743 LONGLONG WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
1744 LONGLONG WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
1745 NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
1746 NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *);
1747 DWORD WINAPI RtlLengthRequiredSid(DWORD);
1748 ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR);
1749 DWORD WINAPI RtlLengthSid(PSID);
1750 NTSTATUS WINAPI RtlLocalTimeToSystemTime(const LARGE_INTEGER*,PLARGE_INTEGER);
1751 BOOLEAN WINAPI RtlLockHeap(HANDLE);
1753 NTSTATUS WINAPI RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
1754 void WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*);
1755 NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
1756 NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
1758 DWORD WINAPI RtlNewSecurityObject(DWORD,DWORD,DWORD,DWORD,DWORD,DWORD);
1759 PRTL_USER_PROCESS_PARAMETERS WINAPI RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
1760 ULONG WINAPI RtlNtStatusToDosError(NTSTATUS);
1761 ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS);
1762 ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP);
1763 ULONG WINAPI RtlNumberOfClearBits(PCRTL_BITMAP);
1765 UINT WINAPI RtlOemStringToUnicodeSize(const STRING*);
1766 NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
1767 NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
1768 DWORD WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHKEY);
1770 BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
1771 BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1773 NTSTATUS WINAPI RtlQueryEnvironmentVariable_U(PWSTR,PUNICODE_STRING,PUNICODE_STRING);
1774 NTSTATUS WINAPI RtlQueryInformationAcl(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
1775 NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID);
1776 NTSTATUS WINAPI RtlQueryTimeZoneInformation(LPTIME_ZONE_INFORMATION);
1778 void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
1779 void WINAPI RtlRaiseStatus(NTSTATUS);
1780 ULONG WINAPI RtlRandom(PULONG);
1781 PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,ULONG);
1782 void WINAPI RtlReleasePebLock(void);
1783 void WINAPI RtlReleaseResource(LPRTL_RWLOCK);
1784 ULONG WINAPI RtlRemoveVectoredExceptionHandler(PVOID);
1785 void WINAPI RtlRestoreLastWin32Error(DWORD);
1787 void WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *);
1788 void WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *);
1789 NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,
1790 PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD);
1791 void WINAPI RtlSetAllBits(PRTL_BITMAP);
1792 void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG);
1793 ULONG WINAPI RtlSetCriticalSectionSpinCount(RTL_CRITICAL_SECTION*,ULONG);
1794 NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING*);
1795 void WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*);
1796 NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
1797 NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR*,PUNICODE_STRING,PUNICODE_STRING);
1798 NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
1799 NTSTATUS WINAPI RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
1800 void WINAPI RtlSetLastWin32Error(DWORD);
1801 void WINAPI RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS);
1802 NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
1803 NTSTATUS WINAPI RtlSetTimeZoneInformation(const TIME_ZONE_INFORMATION*);
1804 ULONG WINAPI RtlSizeHeap(HANDLE,ULONG,PVOID);
1805 LPDWORD WINAPI RtlSubAuthoritySid(PSID,DWORD);
1806 LPBYTE WINAPI RtlSubAuthorityCountSid(PSID);
1807 NTSTATUS WINAPI RtlSystemTimeToLocalTime(const LARGE_INTEGER*,PLARGE_INTEGER);
1809 void WINAPI RtlTimeToTimeFields(const LARGE_INTEGER*,PTIME_FIELDS);
1810 BOOLEAN WINAPI RtlTimeFieldsToTime(PTIME_FIELDS,PLARGE_INTEGER);
1811 void WINAPI RtlTimeToElapsedTimeFields(const LARGE_INTEGER *,PTIME_FIELDS);
1812 BOOLEAN WINAPI RtlTimeToSecondsSince1970(const LARGE_INTEGER *,LPDWORD);
1813 BOOLEAN WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *,LPDWORD);
1814 BOOL WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *);
1816 ULONGLONG __cdecl RtlUlonglongByteSwap(ULONGLONG);
1817 DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
1818 NTSTATUS WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING,PCUNICODE_STRING,BOOLEAN);
1819 NTSTATUS WINAPI RtlUnicodeStringToInteger(const UNICODE_STRING *,ULONG,ULONG *);
1820 DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
1821 NTSTATUS WINAPI RtlUnicodeStringToOemString(POEM_STRING,PCUNICODE_STRING,BOOLEAN);
1822 NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1823 NTSTATUS WINAPI RtlUnicodeToMultiByteSize(PULONG,PCWSTR,ULONG);
1824 NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1825 ULONG WINAPI RtlUniform(PULONG);
1826 BOOLEAN WINAPI RtlUnlockHeap(HANDLE);
1827 void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID);
1829 void WINAPI RtlUnwind2(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT);
1830 void WINAPI RtlUnwindEx(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
1832 WCHAR WINAPI RtlUpcaseUnicodeChar(WCHAR);
1833 NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
1834 NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
1835 NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
1836 NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
1837 NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1838 NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1839 CHAR WINAPI RtlUpperChar(CHAR);
1840 void WINAPI RtlUpperString(STRING *,const STRING *);
1842 NTSTATUS WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
1843 BOOLEAN WINAPI RtlValidAcl(PACL);
1844 BOOLEAN WINAPI RtlValidSid(PSID);
1845 BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
1846 NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
1848 NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
1850 NTSTATUS WINAPI RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION *);
1851 NTSTATUS WINAPI RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION *);
1853 /* Wine internal functions */
1855 extern NTSTATUS wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRING *unix_name_ret,
1856 UINT disposition, BOOLEAN check_case );
1858 /***********************************************************************
1862 #define InitializeObjectAttributes(p,n,a,r,s) \
1864 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
1865 (p)->RootDirectory = r; \
1866 (p)->Attributes = a; \
1867 (p)->ObjectName = n; \
1868 (p)->SecurityDescriptor = s; \
1869 (p)->SecurityQualityOfService = NULL; \
1872 #define NtCurrentProcess() ((HANDLE)-1)
1874 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
1875 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
1876 #define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1877 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1878 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
1879 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
1880 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
1882 inline static BOOLEAN RtlCheckBit(PCRTL_BITMAP lpBits, ULONG ulBit)
1884 if (lpBits && ulBit < lpBits->SizeOfBitMap &&
1885 lpBits->Buffer[ulBit >> 5] & (1 << (ulBit & 31)))
1890 /* These are implemented as __fastcall, so we can't let Winelib apps link with them */
1891 inline static USHORT RtlUshortByteSwap(USHORT s)
1893 return (s >> 8) | (s << 8);
1895 inline static ULONG RtlUlongByteSwap(ULONG i)
1897 #if defined(__i386__) && defined(__GNUC__)
1899 __asm__("bswap %0" : "=r" (ret) : "0" (i) );
1902 return ((ULONG)RtlUshortByteSwap((USHORT)i) << 16) | RtlUshortByteSwap((USHORT)(i >> 16));
1906 /*************************************************************************
1907 * Loader functions and structures.
1909 * Those are not part of standard Winternl.h
1911 typedef struct _LDR_MODULE
1913 LIST_ENTRY InLoadOrderModuleList;
1914 LIST_ENTRY InMemoryOrderModuleList;
1915 LIST_ENTRY InInitializationOrderModuleList;
1919 UNICODE_STRING FullDllName;
1920 UNICODE_STRING BaseDllName;
1924 HANDLE SectionHandle;
1926 ULONG TimeDateStamp;
1927 } LDR_MODULE, *PLDR_MODULE;
1929 /* those defines are (some of the) regular LDR_MODULE.Flags values */
1930 #define LDR_IMAGE_IS_DLL 0x00000004
1931 #define LDR_LOAD_IN_PROGRESS 0x00001000
1932 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
1933 #define LDR_NO_DLL_CALLS 0x00040000
1934 #define LDR_PROCESS_ATTACHED 0x00080000
1935 #define LDR_MODULE_REBASED 0x00200000
1937 /* these ones is Wine specific */
1938 #define LDR_DONT_RESOLVE_REFS 0x40000000
1939 #define LDR_WINE_INTERNAL 0x80000000
1941 /* FIXME: to be checked */
1942 #define MAXIMUM_FILENAME_LENGTH 256
1944 typedef struct _SYSTEM_MODULE
1948 PVOID ImageBaseAddress;
1955 BYTE Name[MAXIMUM_FILENAME_LENGTH];
1956 } SYSTEM_MODULE, *PSYSTEM_MODULE;
1958 typedef struct _SYSTEM_MODULE_INFORMATION
1961 SYSTEM_MODULE Modules[1]; /* FIXME: should be Modules[0] */
1962 } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
1964 NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
1965 NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_MODULE*);
1966 NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG*);
1967 NTSTATUS WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*);
1968 NTSTATUS WINAPI LdrUnloadDll(HMODULE);
1969 NTSTATUS WINAPI LdrUnlockLoaderLock(ULONG,ULONG);
1971 /* list manipulation macros */
1972 #define InitializeListHead(le) (void)((le)->Flink = (le)->Blink = (le))
1973 #define InsertHeadList(le,e) do { PLIST_ENTRY f = (le)->Flink; (e)->Flink = f; (e)->Blink = (le); f->Blink = (e); (le)->Flink = (e); } while (0)
1974 #define InsertTailList(le,e) do { PLIST_ENTRY b = (le)->Blink; (e)->Flink = (le); (e)->Blink = b; b->Flink = (e); (le)->Blink = (e); } while (0)
1975 #define IsListEmpty(le) ((le)->Flink == (le))
1976 #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)
1977 static inline PLIST_ENTRY RemoveHeadList(PLIST_ENTRY le)
1979 PLIST_ENTRY f, b, e;
1982 f = le->Flink->Flink;
1983 b = le->Flink->Blink;
1987 if (e != le) e->Flink = e->Blink = NULL;
1990 static inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le)
1992 PLIST_ENTRY f, b, e;
1995 f = le->Blink->Flink;
1996 b = le->Blink->Blink;
2000 if (e != le) e->Flink = e->Blink = NULL;
2006 #endif /* defined(__cplusplus) */
2008 #endif /* __WINE_WINTERNL_H */