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;
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 /***********************************************************************
148 BYTE Reserved1[2]; /* 00 */
149 BYTE BeingDebugged; /* 02 */
150 BYTE Reserved2[5]; /* 03 */
151 HMODULE ImageBaseAddress; /* 08 */
152 PPEB_LDR_DATA LdrData; /* 0c */
153 RTL_USER_PROCESS_PARAMETERS *ProcessParameters; /* 10 */
154 PVOID __pad_14; /* 14 */
155 HANDLE ProcessHeap; /* 18 */
156 BYTE __pad_1c[36]; /* 1c */
157 PRTL_BITMAP TlsBitmap; /* 40 */
158 ULONG TlsBitmapBits[2]; /* 44 */
159 BYTE __pad_4c[24]; /* 4c */
160 ULONG NumberOfProcessors; /* 64 */
161 BYTE __pad_68[128]; /* 68 */
162 PVOID Reserved3[59]; /* e8 */
163 ULONG SessionId; /* 1d4 */
167 /***********************************************************************
170 #if defined(_NTSYSTEM_) || defined(_KERNEL32_) /* hack, should go away */
174 #ifndef WINE_NO_TEB /* don't define TEB if included from thread.h */
175 # ifndef WINE_TEB_DEFINED
176 # define WINE_TEB_DEFINED
179 NT_TIB Tib; /* 000 */
180 PVOID EnvironmentPointer; /* 01c */
181 CLIENT_ID ClientId; /* 020 */
182 PVOID ActiveRpcHandle; /* 028 */
183 PVOID ThreadLocalStoragePointer; /* 02c */
185 ULONG LastErrorValue; /* 034 */
186 BYTE __pad038[140]; /* 038 */
187 ULONG CurrentLocale; /* 0c4 */
188 BYTE __pad0c8[1752]; /* 0c8 */
189 PVOID Reserved2[278]; /* 7a0 */
190 UNICODE_STRING StaticUnicodeString; /* bf8 used by advapi32 */
191 WCHAR StaticUnicodeBuffer[261]; /* c00 used by advapi32 */
192 PVOID DeallocationStack; /* e0c */
193 PVOID TlsSlots[64]; /* e10 */
194 LIST_ENTRY TlsLinks; /* f10 */
195 PVOID Reserved4[26]; /* f18 */
196 PVOID ReservedForOle; /* f80 Windows 2000 only */
197 PVOID Reserved5[4]; /* f84 */
198 PVOID TlsExpansionSlots; /* f94 */
200 # endif /* WINE_TEB_DEFINED */
201 #endif /* WINE_NO_TEB */
203 /***********************************************************************
207 typedef enum _FILE_INFORMATION_CLASS {
208 FileDirectoryInformation = 1,
209 FileFullDirectoryInformation,
210 FileBothDirectoryInformation,
211 FileBasicInformation,
212 FileStandardInformation,
213 FileInternalInformation,
215 FileAccessInformation,
217 FileRenameInformation,
219 FileNamesInformation,
220 FileDispositionInformation,
221 FilePositionInformation,
222 FileFullEaInformation,
224 FileAlignmentInformation,
226 FileAllocationInformation,
227 FileEndOfFileInformation,
228 FileAlternateNameInformation,
229 FileStreamInformation,
231 FilePipeLocalInformation,
232 FilePipeRemoteInformation,
233 FileMailslotQueryInformation,
234 FileMailslotSetInformation,
235 FileCompressionInformation,
236 FileObjectIdInformation,
237 FileCompletionInformation,
238 FileMoveClusterInformation,
239 FileQuotaInformation,
240 FileReparsePointInformation,
241 FileNetworkOpenInformation,
242 FileAttributeTagInformation,
243 FileTrackingInformation,
244 FileMaximumInformation
245 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
247 typedef struct _FILE_DIRECTORY_INFORMATION {
248 ULONG NextEntryOffset;
250 LARGE_INTEGER CreationTime;
251 LARGE_INTEGER LastAccessTime;
252 LARGE_INTEGER LastWriteTime;
253 LARGE_INTEGER ChangeTime;
254 LARGE_INTEGER EndOfFile;
255 LARGE_INTEGER AllocationSize;
256 ULONG FileAttributes;
257 ULONG FileNameLength;
258 WCHAR FileName[ANYSIZE_ARRAY];
259 } FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
261 typedef struct _FILE_FULL_DIRECTORY_INFORMATION {
262 ULONG NextEntryOffset;
264 LARGE_INTEGER CreationTime;
265 LARGE_INTEGER LastAccessTime;
266 LARGE_INTEGER LastWriteTime;
267 LARGE_INTEGER ChangeTime;
268 LARGE_INTEGER EndOfFile;
269 LARGE_INTEGER AllocationSize;
270 ULONG FileAttributes;
271 ULONG FileNameLength;
273 WCHAR FileName[ANYSIZE_ARRAY];
274 } FILE_FULL_DIRECTORY_INFORMATION, *PFILE_FULL_DIRECTORY_INFORMATION,
275 FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION;
277 typedef struct _FILE_BOTH_DIRECTORY_INFORMATION {
278 ULONG NextEntryOffset;
280 LARGE_INTEGER CreationTime;
281 LARGE_INTEGER LastAccessTime;
282 LARGE_INTEGER LastWriteTime;
283 LARGE_INTEGER ChangeTime;
284 LARGE_INTEGER EndOfFile;
285 LARGE_INTEGER AllocationSize;
286 ULONG FileAttributes;
287 ULONG FileNameLength;
289 CHAR ShortNameLength;
291 WCHAR FileName[ANYSIZE_ARRAY];
292 } FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION,
293 FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
295 typedef struct _FILE_BASIC_INFORMATION {
296 LARGE_INTEGER CreationTime;
297 LARGE_INTEGER LastAccessTime;
298 LARGE_INTEGER LastWriteTime;
299 LARGE_INTEGER ChangeTime;
300 ULONG FileAttributes;
301 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
303 typedef struct _FILE_STANDARD_INFORMATION {
304 LARGE_INTEGER AllocationSize;
305 LARGE_INTEGER EndOfFile;
307 BOOLEAN DeletePending;
309 } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
311 typedef struct _FILE_INTERNAL_INFORMATION {
312 LARGE_INTEGER IndexNumber;
313 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
315 typedef struct _FILE_EA_INFORMATION {
317 } FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
319 typedef struct _FILE_ACCESS_INFORMATION {
320 ACCESS_MASK AccessFlags;
321 } FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
323 typedef struct _FILE_NAME_INFORMATION {
324 ULONG FileNameLength;
326 } FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
328 typedef struct _FILE_RENAME_INFORMATION {
331 ULONG FileNameLength;
333 } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
335 typedef struct _FILE_NAMES_INFORMATION {
336 ULONG NextEntryOffset;
338 ULONG FileNameLength;
340 } FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
342 typedef struct _FILE_DISPOSITION_INFORMATION {
343 BOOLEAN DoDeleteFile;
344 } FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
346 typedef struct _FILE_POSITION_INFORMATION {
347 LARGE_INTEGER CurrentByteOffset;
348 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
350 typedef struct _FILE_ALIGNMENT_INFORMATION {
351 ULONG AlignmentRequirement;
352 } FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION;
354 typedef struct _FILE_ALLOCATION_INFORMATION {
355 LARGE_INTEGER AllocationSize;
356 } FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
358 typedef struct _FILE_END_OF_FILE_INFORMATION {
359 LARGE_INTEGER EndOfFile;
360 } FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
362 typedef struct _FILE_NETWORK_OPEN_INFORMATION {
363 LARGE_INTEGER CreationTime;
364 LARGE_INTEGER LastAccessTime;
365 LARGE_INTEGER LastWriteTime;
366 LARGE_INTEGER ChangeTime;
367 LARGE_INTEGER AllocationSize;
368 LARGE_INTEGER EndOfFile;
369 ULONG FileAttributes;
370 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
372 typedef struct _FILE_FULL_EA_INFORMATION {
373 ULONG NextEntryOffset;
376 USHORT EaValueLength;
378 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
380 typedef struct _FILE_MODE_INFORMATION {
382 } FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION;
384 typedef struct _FILE_STREAM_INFORMATION
386 ULONG NextEntryOffset;
387 ULONG StreamNameLength;
388 LARGE_INTEGER StreamSize;
389 LARGE_INTEGER StreamAllocationSize;
391 } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
393 typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION
395 ULONG FileAttributes;
397 } FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
399 typedef struct _FILE_ALL_INFORMATION
401 FILE_BASIC_INFORMATION BasicInformation;
402 FILE_STANDARD_INFORMATION StandardInformation;
403 FILE_INTERNAL_INFORMATION InternalInformation;
404 FILE_EA_INFORMATION EaInformation;
405 FILE_ACCESS_INFORMATION AccessInformation;
406 FILE_POSITION_INFORMATION PositionInformation;
407 FILE_MODE_INFORMATION ModeInformation;
408 FILE_ALIGNMENT_INFORMATION AlignmentInformation;
409 FILE_NAME_INFORMATION NameInformation;
410 } FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION;
412 typedef enum _FSINFOCLASS {
413 FileFsVolumeInformation = 1,
414 FileFsLabelInformation,
415 FileFsSizeInformation,
416 FileFsDeviceInformation,
417 FileFsAttributeInformation,
418 FileFsControlInformation,
419 FileFsFullSizeInformation,
420 FileFsObjectIdInformation,
421 FileFsMaximumInformation
422 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
424 typedef enum _KEY_INFORMATION_CLASS {
428 } KEY_INFORMATION_CLASS;
430 typedef enum _KEY_VALUE_INFORMATION_CLASS {
431 KeyValueBasicInformation,
432 KeyValueFullInformation,
433 KeyValuePartialInformation,
434 KeyValueFullInformationAlign64,
435 KeyValuePartialInformationAlign64
436 } KEY_VALUE_INFORMATION_CLASS;
438 typedef enum _OBJECT_INFORMATION_CLASS {
439 ObjectBasicInformation,
440 ObjectNameInformation,
441 ObjectTypeInformation,
442 ObjectAllInformation,
443 ObjectDataInformation
444 } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
446 typedef enum _PROCESSINFOCLASS {
447 ProcessBasicInformation = 0,
448 ProcessQuotaLimits = 1,
449 ProcessIoCounters = 2,
450 ProcessVmCounters = 3,
452 ProcessBasePriority = 5,
453 ProcessRaisePriority = 6,
454 ProcessDebugPort = 7,
455 ProcessExceptionPort = 8,
456 ProcessAccessToken = 9,
457 ProcessLdtInformation = 10,
459 ProcessDefaultHardErrorMode = 12,
460 ProcessIoPortHandlers = 13,
461 ProcessPooledUsageAndLimits = 14,
462 ProcessWorkingSetWatch = 15,
463 ProcessUserModeIOPL = 16,
464 ProcessEnableAlignmentFaultFixup = 17,
465 ProcessPriorityClass = 18,
466 ProcessWx86Information = 19,
467 ProcessHandleCount = 20,
468 ProcessAffinityMask = 21,
469 ProcessPriorityBoost = 22,
470 ProcessDeviceMap = 23,
471 ProcessSessionInformation = 24,
472 ProcessForegroundInformation = 25,
473 ProcessWow64Information = 26,
477 typedef enum _SECTION_INHERIT {
482 typedef enum _SYSTEM_INFORMATION_CLASS {
483 SystemBasicInformation = 0,
485 SystemPerformanceInformation = 2,
486 SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
488 SystemProcessInformation = 5,
491 SystemProcessorPerformanceInformation = 8,
494 SystemDriverInformation,
504 SystemCacheInformation,
506 SystemInterruptInformation = 23,
507 SystemDpcBehaviourInformation = 24,
508 SystemFullMemoryInformation = 25,
509 SystemNotImplemented6 = 25,
510 SystemLoadImage = 26,
511 SystemUnloadImage = 27,
512 SystemTimeAdjustmentInformation = 28,
513 SystemTimeAdjustment = 28,
514 SystemSummaryMemoryInformation = 29,
515 SystemNotImplemented7 = 29,
516 SystemNextEventIdInformation = 30,
517 SystemNotImplemented8 = 30,
518 SystemEventIdsInformation = 31,
519 SystemCrashDumpInformation = 32,
520 SystemExceptionInformation = 33,
521 SystemCrashDumpStateInformation = 34,
522 SystemKernelDebuggerInformation = 35,
523 SystemContextSwitchInformation = 36,
524 SystemRegistryQuotaInformation = 37,
525 SystemCurrentTimeZoneInformation = 44,
526 SystemTimeZoneInformation = 44,
527 SystemLookasideInformation = 45,
528 SystemSetTimeSlipEvent = 46,
529 SystemCreateSession = 47,
530 SystemDeleteSession = 48,
531 SystemInvalidInfoClass4 = 49,
532 SystemRangeStartInformation = 50,
533 SystemVerifierInformation = 51,
534 SystemAddVerifier = 52,
535 SystemSessionProcessesInformation = 53,
536 SystemInformationClassMax
537 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
539 typedef enum _TIMER_TYPE {
544 typedef enum _THREADINFOCLASS {
545 ThreadBasicInformation,
550 ThreadImpersonationToken,
551 ThreadDescriptorTableEntry,
552 ThreadEnableAlignmentFaultFixup,
553 ThreadEventPair_Reusable,
554 ThreadQuerySetWin32StartAddress,
556 ThreadPerformanceCount,
558 ThreadIdealProcessor,
560 ThreadSetTlsArrayAddress,
565 typedef struct _THREAD_BASIC_INFORMATION
568 PVOID TebBaseAddress;
573 } THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
576 typedef enum _WINSTATIONINFOCLASS {
577 WinStationInformation = 8
578 } WINSTATIONINFOCLASS;
582 MemoryBasicInformation = 0
583 } MEMORY_INFORMATION_CLASS;
585 /* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
589 UNC_PATH, /* "//foo" */
590 ABSOLUTE_DRIVE_PATH, /* "c:/foo" */
591 RELATIVE_DRIVE_PATH, /* "c:foo" */
592 ABSOLUTE_PATH, /* "/foo" */
593 RELATIVE_PATH, /* "foo" */
594 DEVICE_PATH, /* "//./foo" */
595 UNC_DOT_PATH /* "//." */
598 /***********************************************************************
599 * IA64 specific types and data structures
604 typedef struct _FRAME_POINTERS {
605 ULONGLONG MemoryStackFp;
606 ULONGLONG BackingStoreFp;
607 } FRAME_POINTERS, *PFRAME_POINTERS;
609 #define UNWIND_HISTORY_TABLE_SIZE 12
611 typedef struct _RUNTIME_FUNCTION {
614 ULONG UnwindInfoAddress;
615 } RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
617 typedef struct _UNWIND_HISTORY_TABLE_ENTRY {
620 PRUNTIME_FUNCTION FunctionEntry;
621 } UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY;
623 typedef struct _UNWIND_HISTORY_TABLE {
628 UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE];
629 } UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE;
631 #endif /* defined(__ia64__) */
633 /***********************************************************************
634 * Types and data structures
637 /* This is used by NtQuerySystemInformation */
638 /* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
640 FILETIME ftKernelTime;
642 FILETIME ftCreateTime;
644 DWORD dwStartAddress;
647 DWORD dwCurrentPriority;
648 DWORD dwBasePriority;
649 DWORD dwContextSwitches;
652 } THREADINFO, *PTHREADINFO;
654 /* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
655 typedef struct _THREAD_INFO{
662 } THREAD_INFO, PTHREAD_INFO;
664 /***********************************************************************
665 * Types and data structures
668 typedef struct _IO_STATUS_BLOCK {
674 ULONG_PTR Information;
675 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
677 typedef void (WINAPI * PIO_APC_ROUTINE)(PVOID,PIO_STATUS_BLOCK,ULONG);
679 typedef struct _KEY_BASIC_INFORMATION {
680 LARGE_INTEGER LastWriteTime;
684 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
686 typedef struct _KEY_NODE_INFORMATION
688 LARGE_INTEGER LastWriteTime;
695 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
697 typedef struct _KEY_FULL_INFORMATION
699 LARGE_INTEGER LastWriteTime;
707 ULONG MaxValueNameLen;
708 ULONG MaxValueDataLen;
710 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
712 typedef struct _KEY_VALUE_ENTRY
714 PUNICODE_STRING ValueName;
718 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
720 typedef struct _KEY_VALUE_BASIC_INFORMATION {
725 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
727 typedef struct _KEY_VALUE_FULL_INFORMATION {
734 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
736 typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
741 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
743 typedef struct _OBJECT_ATTRIBUTES {
745 HANDLE RootDirectory;
746 PUNICODE_STRING ObjectName;
748 PVOID SecurityDescriptor; /* type SECURITY_DESCRIPTOR */
749 PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
750 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
752 typedef struct _OBJECT_DATA_INFORMATION {
753 BOOLEAN InheritHandle;
754 BOOLEAN ProtectFromClose;
755 } OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION;
757 typedef struct _PROCESS_BASIC_INFORMATION {
760 DWORD PebBaseAddress;
763 ULONG UniqueProcessId;
764 ULONG InheritedFromUniqueProcessId;
769 ULONG_PTR UniqueProcessId;
772 } PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION;
774 typedef struct _PROCESS_INFO {
775 DWORD Offset; /* 00 offset to next PROCESS_INFO ok*/
776 DWORD ThreadCount; /* 04 number of ThreadInfo member ok */
778 FILETIME CreationTime; /* 20 */
780 PWCHAR ProcessName; /* 3c ok */
782 DWORD ProcessID; /* 44 ok*/
783 DWORD ParentProcessID;
785 DWORD Unknown3[2]; /* 50 */
786 ULONG PeakVirtualSize;
788 ULONG PageFaultCount;
789 ULONG PeakWorkingSetSize;
790 ULONG WorkingSetSize;
791 ULONG QuotaPeakPagedPoolUsage;
792 ULONG QuotaPagedPoolUsage;
793 ULONG QuotaPeakNonPagedPoolUsage;
794 ULONG QuotaNonPagedPoolUsage;
796 ULONG PeakPagefileUsage;
799 THREAD_INFO ati[ANYSIZE_ARRAY]; /* 94 size=0x40*/
800 } PROCESS_INFO, PPROCESS_INFO;
802 typedef struct _RTL_HEAP_DEFINITION {
803 ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
806 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
808 typedef struct _RTL_RWLOCK {
809 RTL_CRITICAL_SECTION rtlCS;
811 HANDLE hSharedReleaseSemaphore;
814 HANDLE hExclusiveReleaseSemaphore;
815 UINT uExclusiveWaiters;
818 HANDLE hOwningThreadId;
819 DWORD dwTimeoutBoost;
821 } RTL_RWLOCK, *LPRTL_RWLOCK;
823 /* System Information Class 0x00 */
824 typedef struct _SYSTEM_BASIC_INFORMATION {
827 ULONG uKeMaximumIncrement;
829 ULONG uMmNumberOfPhysicalPages;
830 ULONG uMmLowestPhysicalPage;
831 ULONG uMmHighestPhysicalPage;
832 ULONG uAllocationGranularity;
833 PVOID pLowestUserAddress;
834 PVOID pMmHighestUserAddress;
835 ULONG uKeActiveProcessors;
836 BYTE bKeNumberProcessors;
842 CCHAR NumberOfProcessors;
844 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
846 /* System Information Class 0x15 */
850 ULONG PageFaultCount;
851 ULONG MinimumWorkingSet;
852 ULONG MaximumWorkingSet;
854 } SYSTEM_CACHE_INFORMATION;
856 typedef struct _SYSTEM_CONFIGURATION_INFO {
860 WORD ProcessorArchitecture;
865 PVOID MinimumApplicationAddress;
866 PVOID MaximumApplicationAddress;
867 ULONG ActiveProcessorMask;
868 ULONG NumberOfProcessors;
870 ULONG AllocationGranularity;
872 WORD ProcessorRevision;
873 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
875 /* System Information Class 0x0b */
882 char szName[MAX_PATH + 1];
883 } SYSTEM_DRIVER_INFORMATION;
885 typedef struct _SYSTEM_EXCEPTION_INFORMATION {
887 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
889 typedef struct _SYSTEM_LOOKASIDE_INFORMATION {
891 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
893 typedef struct _SYSTEM_INTERRUPT_INFORMATION {
895 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
897 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION {
898 BOOLEAN DebuggerEnabled;
899 BOOLEAN DebuggerNotPresent;
900 } SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
902 /* System Information Class 0x10 */
905 USHORT dwCreatorBackTraceIndex;
907 BYTE bHandleAttributes;
908 USHORT usHandleOffset;
910 ULONG ulGrantedAccess;
911 } HANDLEINFO, *PHANDLEINFO; /* FIXME: SYSTEM_HANDLE_INFORMATION? */
913 typedef struct _SYSTEM_PERFORMANCE_INFORMATION {
915 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
917 /* System Information Class 0x02 */
918 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
920 LARGE_INTEGER liIdleTime;
923 LARGE_INTEGER IdleTime;
924 LARGE_INTEGER KernelTime;
925 LARGE_INTEGER UserTime;
926 LARGE_INTEGER Reserved1[2];
929 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
931 /* System Information Class 0x05 */
932 typedef struct _SYSTEM_PROCESS_INFORMATION {
937 FILETIME ftCreationTime;
939 WCHAR *pszProcessName;
940 DWORD dwBasePriority;
942 DWORD dwParentProcessID;
946 DWORD dwVirtualBytesPeak;
947 DWORD dwVirtualBytes;
949 DWORD dwWorkingSetPeak;
954 DWORD dwNonPagedPool;
955 DWORD dwPageFileBytesPeak;
956 DWORD dwPrivateBytes;
957 DWORD dwPageFileBytes;
961 ULONG NextEntryOffset;
964 HANDLE UniqueProcessId;
969 SIZE_T PeakPagefileUsage;
970 SIZE_T PrivatePageCount;
971 LARGE_INTEGER Reserved6[6];
973 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
975 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION {
976 ULONG RegistryQuotaAllowed;
977 ULONG RegistryQuotaUsed;
979 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
981 typedef struct _SYSTEM_TIME_ADJUSTMENT {
982 ULONG TimeAdjustment;
983 BOOLEAN TimeAdjustmentDisabled;
984 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
986 /* System Information Class 0x03 */
987 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
989 LARGE_INTEGER liKeBootTime;
990 LARGE_INTEGER liKeSystemTime;
991 LARGE_INTEGER liExpTimeZoneBias;
992 ULONG uCurrentTimeZoneId;
997 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; /* was SYSTEM_TIME_INFORMATION */
999 typedef struct _TIME_FIELDS
1006 CSHORT Milliseconds;
1008 } TIME_FIELDS, *PTIME_FIELDS;
1010 typedef struct _WINSTATIONINFORMATIONW {
1013 BYTE Reserved3[1140];
1014 } WINSTATIONINFORMATIONW, *PWINSTATIONINFORMATIONW;
1016 typedef struct _VM_COUNTERS_ {
1017 SIZE_T PeakVirtualSize;
1019 ULONG PageFaultCount;
1020 SIZE_T PeakWorkingSetSize;
1021 SIZE_T WorkingSetSize;
1022 SIZE_T QuotaPeakPagedPoolUsage;
1023 SIZE_T QuotaPagedPoolUsage;
1024 SIZE_T QuotaPeakNonPagedPoolUsage;
1025 SIZE_T QuotaNonPagedPoolUsage;
1026 SIZE_T PagefileUsage;
1027 SIZE_T PeakPagefileUsage;
1028 } VM_COUNTERS, *PVM_COUNTERS;
1030 typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONW)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
1032 typedef struct _LDR_RESOURCE_INFO
1037 } LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO;
1040 /* debug buffer definitions */
1042 typedef struct _DEBUG_BUFFER {
1043 HANDLE SectionHandle;
1045 PVOID RemoteSectionBase;
1046 ULONG SectionBaseDelta;
1047 HANDLE EventPairHandle;
1049 HANDLE RemoteThreadHandle;
1050 ULONG InfoClassMask;
1052 ULONG AllocatedSize;
1054 PVOID ModuleInformation;
1055 PVOID BackTraceInformation;
1056 PVOID HeapInformation;
1057 PVOID LockInformation;
1059 } DEBUG_BUFFER, *PDEBUG_BUFFER;
1061 #define PDI_MODULES 0x01
1062 #define PDI_BACKTRACE 0x02
1063 #define PDI_HEAPS 0x04
1064 #define PDI_HEAP_TAGS 0x08
1065 #define PDI_HEAP_BLOCKS 0x10
1066 #define PDI_LOCKS 0x20
1068 typedef struct _DEBUG_MODULE_INFORMATION {
1076 USHORT ModuleNameOffset;
1077 CHAR ImageName[256];
1078 } DEBUG_MODULE_INFORMATION, *PDEBUG_MODULE_INFORMATION;
1080 typedef struct _DEBUG_HEAP_INFORMATION {
1092 } DEBUG_HEAP_INFORMATION, *PDEBUG_HEAP_INFORMATION;
1094 typedef struct _DEBUG_LOCK_INFORMATION {
1097 USHORT CreatorBackTraceIndex;
1098 ULONG OwnerThreadId;
1100 ULONG ContentionCount;
1102 ULONG RecursionCount;
1103 ULONG NumberOfSharedWaiters;
1104 ULONG NumberOfExclusiveWaiters;
1105 } DEBUG_LOCK_INFORMATION, *PDEBUG_LOCK_INFORMATION;
1107 typedef struct _PORT_MESSAGE_HEADER {
1111 USHORT VirtualRangesOffset;
1115 } PORT_MESSAGE_HEADER, *PPORT_MESSAGE_HEADER, PORT_MESSAGE, *PPORT_MESSAGE;
1117 /***********************************************************************
1121 /* flags for NtCreateFile and NtOpenFile */
1122 #define FILE_DIRECTORY_FILE 0x00000001
1123 #define FILE_WRITE_THROUGH 0x00000002
1124 #define FILE_SEQUENTIAL_ONLY 0x00000004
1125 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
1126 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
1127 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
1128 #define FILE_NON_DIRECTORY_FILE 0x00000040
1129 #define FILE_CREATE_TREE_CONNECTION 0x00000080
1130 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
1131 #define FILE_NO_EA_KNOWLEDGE 0x00000200
1132 #define FILE_OPEN_FOR_RECOVERY 0x00000400
1133 #define FILE_RANDOM_ACCESS 0x00000800
1134 #define FILE_DELETE_ON_CLOSE 0x00001000
1135 #define FILE_OPEN_BY_FILE_ID 0x00002000
1136 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
1137 #define FILE_NO_COMPRESSION 0x00008000
1138 #define FILE_RESERVE_OPFILTER 0x00100000
1139 #define FILE_TRANSACTED_MODE 0x00200000
1140 #define FILE_OPEN_OFFLINE_FILE 0x00400000
1141 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
1143 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
1144 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
1146 /* status for NtCreateFile or NtOpenFile */
1147 #define FILE_SUPERSEDED 0
1148 #define FILE_OPENED 1
1149 #define FILE_CREATED 2
1150 #define FILE_OVERWRITTEN 3
1151 #define FILE_EXISTS 4
1152 #define FILE_DOES_NOT_EXIST 5
1154 /* disposition for NtCreateFile */
1155 #define FILE_SUPERSEDE 0
1157 #define FILE_CREATE 2
1158 #define FILE_OPEN_IF 3
1159 #define FILE_OVERWRITE 4
1160 #define FILE_OVERWRITE_IF 5
1161 #define FILE_MAXIMUM_DISPOSITION 5
1163 /* Characteristics of a File System */
1164 #define FILE_REMOVABLE_MEDIA 0x00000001
1165 #define FILE_READ_ONLY_DEVICE 0x00000002
1166 #define FILE_FLOPPY_DISKETTE 0x00000004
1167 #define FILE_WRITE_ONE_MEDIA 0x00000008
1168 #define FILE_REMOTE_DEVICE 0x00000010
1169 #define FILE_DEVICE_IS_MOUNTED 0x00000020
1170 #define FILE_VIRTUAL_VOLUME 0x00000040
1171 #define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
1172 #define FILE_DEVICE_SECURE_OPEN 0x00000100
1174 #if (_WIN32_WINNT >= 0x0501)
1175 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
1176 #endif /* (_WIN32_WINNT >= 0x0501) */
1178 #define LOGONID_CURRENT ((ULONG)-1)
1180 #define OBJ_INHERIT 0x00000002L
1181 #define OBJ_PERMANENT 0x00000010L
1182 #define OBJ_EXCLUSIVE 0x00000020L
1183 #define OBJ_CASE_INSENSITIVE 0x00000040L
1184 #define OBJ_OPENIF 0x00000080L
1185 #define OBJ_OPENLINK 0x00000100L
1186 #define OBJ_KERNEL_HANDLE 0x00000200L
1187 #define OBJ_VALID_ATTRIBUTES 0x000003F2L
1189 #define SERVERNAME_CURRENT ((HANDLE)NULL)
1191 typedef void (CALLBACK *PNTAPCFUNC)(ULONG_PTR,ULONG_PTR,ULONG_PTR); /* FIXME: not the right name */
1192 typedef void (CALLBACK *PRTL_THREAD_START_ROUTINE)(LPVOID); /* FIXME: not the right name */
1195 /* DbgPrintEx default levels */
1196 #define DPFLTR_ERROR_LEVEL 0
1197 #define DPFLTR_WARNING_LEVEL 1
1198 #define DPFLTR_TRACE_LEVEL 2
1199 #define DPFLTR_INFO_LEVEL 3
1200 #define DPFLTR_MASK 0x8000000
1202 /***********************************************************************
1203 * Function declarations
1206 extern LPSTR _strlwr(LPSTR str); /* FIXME: Doesn't belong here */
1207 extern LPSTR _strupr(LPSTR str); /* FIXME: Doesn't belong here */
1209 #if defined(__i386__) && defined(__GNUC__)
1210 static inline void WINAPI DbgBreakPoint(void) { __asm__ __volatile__("int3"); }
1211 static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3"); }
1212 #else /* __i386__ && __GNUC__ */
1213 void WINAPI DbgBreakPoint(void);
1214 void WINAPI DbgUserBreakPoint(void);
1215 #endif /* __i386__ && __GNUC__ */
1216 NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
1217 NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
1219 NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
1220 NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
1221 NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
1222 NTSTATUS WINAPI LdrGetDllHandle(ULONG, ULONG, const UNICODE_STRING*, HMODULE*);
1223 NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
1224 void WINAPI LdrInitializeThunk(HANDLE,ULONG,ULONG,ULONG);
1225 NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
1226 void WINAPI LdrShutdownProcess(void);
1227 void WINAPI LdrShutdownThread(void);
1228 NTSTATUS WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,PBOOLEAN);
1229 NTSTATUS WINAPI NtAdjustGroupsToken(HANDLE,BOOLEAN,PTOKEN_GROUPS,ULONG,PTOKEN_GROUPS,PULONG);
1230 NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
1231 NTSTATUS WINAPI NtAlertThread(HANDLE ThreadHandle);
1232 NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,PVOID,ULONG*,ULONG,ULONG);
1233 NTSTATUS WINAPI NtCancelIoFile(HANDLE,PIO_STATUS_BLOCK);
1234 NTSTATUS WINAPI NtCancelTimer(HANDLE, BOOLEAN*);
1235 NTSTATUS WINAPI NtClearEvent(HANDLE);
1236 NTSTATUS WINAPI NtClose(HANDLE);
1237 NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOOLEAN,BOOLEAN);
1238 NTSTATUS WINAPI NtCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
1239 NTSTATUS WINAPI NtCreateIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,ULONG);
1240 NTSTATUS WINAPI NtCreateKey(PHKEY,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
1241 NTSTATUS WINAPI NtCreateNamedPipeFile(PHANDLE,ULONG,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,PLARGE_INTEGER);
1242 NTSTATUS WINAPI NtCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
1243 NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,ULONG);
1244 NTSTATUS WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
1245 NTSTATUS WINAPI NtDelayExecution(BOOLEAN,const LARGE_INTEGER*);
1246 NTSTATUS WINAPI NtDeleteFile(POBJECT_ATTRIBUTES);
1247 NTSTATUS WINAPI NtDeleteKey(HKEY);
1248 NTSTATUS WINAPI NtDeleteValueKey(HKEY,const UNICODE_STRING *);
1249 NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
1250 NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
1251 NTSTATUS WINAPI NtEnumerateKey(HKEY,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1252 NTSTATUS WINAPI NtEnumerateValueKey(HKEY,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1253 NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
1254 NTSTATUS WINAPI NtFlushInstructionCache(HANDLE,LPCVOID,ULONG);
1255 NTSTATUS WINAPI NtFlushKey(HKEY);
1256 NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,ULONG*,ULONG);
1257 NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
1258 NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*);
1259 NTSTATUS WINAPI NtImpersonateAnonymousToken(HANDLE);
1260 NTSTATUS WINAPI NtImpersonateClientOfPort(HANDLE,PPORT_MESSAGE);
1261 NTSTATUS WINAPI NtImpersonateThread(HANDLE,HANDLE,PSECURITY_QUALITY_OF_SERVICE);
1262 NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,const OBJECT_ATTRIBUTES *);
1263 NTSTATUS WINAPI NtLockFile(HANDLE,HANDLE,PIO_APC_ROUTINE,void*,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,ULONG*,BOOLEAN,BOOLEAN);
1264 NTSTATUS WINAPI NtLockVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
1265 NTSTATUS WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,ULONG,const LARGE_INTEGER*,ULONG*,SECTION_INHERIT,ULONG,ULONG);
1266 NTSTATUS WINAPI NtNotifyChangeKey(HKEY,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
1267 NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1268 NTSTATUS WINAPI NtOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
1269 NTSTATUS WINAPI NtOpenIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1270 NTSTATUS WINAPI NtOpenKey(PHKEY,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1271 NTSTATUS WINAPI NtOpenProcessToken(HANDLE,DWORD,HANDLE *);
1272 NTSTATUS WINAPI NtOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1273 NTSTATUS WINAPI NtOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
1274 NTSTATUS WINAPI NtOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
1275 NTSTATUS WINAPI NtOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
1276 NTSTATUS WINAPI NtProtectVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG,ULONG*);
1277 NTSTATUS WINAPI NtPulseEvent(HANDLE,PULONG);
1278 NTSTATUS WINAPI NtQueueApcThread(HANDLE,PNTAPCFUNC,ULONG_PTR,ULONG_PTR,ULONG_PTR);
1279 NTSTATUS WINAPI NtQueryAttributesFile(const OBJECT_ATTRIBUTES*,FILE_BASIC_INFORMATION*);
1280 NTSTATUS WINAPI NtQueryDefaultLocale(BOOLEAN,LCID*);
1281 NTSTATUS WINAPI NtQueryDefaultUILanguage(LANGID*);
1282 NTSTATUS WINAPI NtQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
1283 NTSTATUS WINAPI NtQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PVOID,BOOLEAN);
1284 NTSTATUS WINAPI NtQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*);
1285 NTSTATUS WINAPI NtQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS);
1286 NTSTATUS WINAPI NtQueryInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG,PULONG);
1287 NTSTATUS WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
1288 NTSTATUS WINAPI NtQueryInformationToken(HANDLE,DWORD,LPVOID,DWORD,LPDWORD);
1289 NTSTATUS WINAPI NtQueryInstallUILanguage(LANGID*);
1290 NTSTATUS WINAPI NtQueryKey(HKEY,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1291 NTSTATUS WINAPI NtQueryMultipleValueKey(HKEY,PVALENTW,ULONG,PVOID,ULONG,PULONG);
1292 NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
1293 NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
1294 NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1295 NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER);
1296 NTSTATUS WINAPI NtQueryValueKey(HKEY,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
1297 NTSTATUS WINAPI NtQueryVirtualMemory(HANDLE,LPCVOID,MEMORY_INFORMATION_CLASS,PVOID,ULONG,ULONG*);
1298 NTSTATUS WINAPI NtQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
1299 void WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
1300 NTSTATUS WINAPI NtReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
1301 NTSTATUS WINAPI NtReadVirtualMemory(HANDLE,const void*,void*,SIZE_T,SIZE_T*);
1302 NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
1303 NTSTATUS WINAPI NtRemoveIoCompletion(HANDLE,PULONG,PULONG,PIO_STATUS_BLOCK,PLARGE_INTEGER);
1304 NTSTATUS WINAPI NtReplaceKey(POBJECT_ATTRIBUTES,HKEY,POBJECT_ATTRIBUTES);
1305 NTSTATUS WINAPI NtResetEvent(HANDLE,PULONG);
1306 NTSTATUS WINAPI NtRestoreKey(HKEY,HANDLE,ULONG);
1307 NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG);
1308 NTSTATUS WINAPI NtSaveKey(HKEY,HANDLE);
1309 NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
1310 NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID);
1311 NTSTATUS WINAPI NtSetDefaultUILanguage(LANGID);
1312 NTSTATUS WINAPI NtSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG);
1313 NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
1314 NTSTATUS WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
1315 NTSTATUS WINAPI NtSetInformationKey(HKEY,const int,PVOID,ULONG);
1316 NTSTATUS WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
1317 NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
1318 NTSTATUS WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG);
1319 NTSTATUS WINAPI NtSetIoCompletion(HANDLE,ULONG,ULONG,NTSTATUS,ULONG);
1320 NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
1321 NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
1322 NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMERAPCROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
1323 NTSTATUS WINAPI NtSetValueKey(HKEY,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
1324 NTSTATUS WINAPI NtSuspendThread(HANDLE,PULONG);
1325 NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG);
1326 NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG);
1327 NTSTATUS WINAPI NtUnloadKey(HKEY);
1328 NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
1329 NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
1330 NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
1331 NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
1332 NTSTATUS WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
1333 NTSTATUS WINAPI NtWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
1334 NTSTATUS WINAPI NtWriteVirtualMemory(HANDLE,void*,const void*,SIZE_T,SIZE_T*);
1336 void WINAPI RtlAcquirePebLock(void);
1337 BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK,BYTE);
1338 BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK,BYTE);
1339 NTSTATUS WINAPI RtlAddAce(PACL,DWORD,DWORD,PACE_HEADER,DWORD);
1340 NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
1341 NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
1342 NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
1343 NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
1344 PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
1345 DWORD WINAPI RtlAdjustPrivilege(DWORD,DWORD,DWORD,DWORD);
1346 BOOLEAN WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
1347 PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,ULONG);
1348 DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING *);
1349 NTSTATUS WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING,PCANSI_STRING,BOOLEAN);
1350 NTSTATUS WINAPI RtlAppendAsciizToString(STRING *,LPCSTR);
1351 NTSTATUS WINAPI RtlAppendStringToString(STRING *,const STRING *);
1352 NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING *,const UNICODE_STRING *);
1353 NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING *,LPCWSTR);
1354 BOOLEAN WINAPI RtlAreAllAccessesGranted(ACCESS_MASK,ACCESS_MASK);
1355 BOOLEAN WINAPI RtlAreAnyAccessesGranted(ACCESS_MASK,ACCESS_MASK);
1356 BOOLEAN WINAPI RtlAreBitsSet(PCRTL_BITMAP,ULONG,ULONG);
1357 BOOLEAN WINAPI RtlAreBitsClear(PCRTL_BITMAP,ULONG,ULONG);
1359 NTSTATUS WINAPI RtlCharToInteger(PCSZ,ULONG,PULONG);
1360 void WINAPI RtlClearAllBits(PRTL_BITMAP);
1361 void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
1362 ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
1363 LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
1364 LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1365 DWORD WINAPI RtlComputeCrc32(DWORD,PBYTE,INT);
1366 NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
1367 LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
1368 ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
1369 void WINAPI RtlCopyLuid(PLUID,const LUID*);
1370 void WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
1371 DWORD WINAPI RtlCopySid(DWORD,PSID,PSID);
1372 void WINAPI RtlCopyString(STRING*,const STRING*);
1373 void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
1374 NTSTATUS WINAPI RtlCreateAcl(PACL,DWORD,DWORD);
1375 NTSTATUS WINAPI RtlCreateEnvironment(BOOLEAN, PWSTR*);
1376 HANDLE WINAPI RtlCreateHeap(ULONG,PVOID,ULONG,ULONG,PVOID,PRTL_HEAP_DEFINITION);
1377 NTSTATUS WINAPI RtlCreateProcessParameters(RTL_USER_PROCESS_PARAMETERS**,const UNICODE_STRING*,
1378 const UNICODE_STRING*,const UNICODE_STRING*,
1379 const UNICODE_STRING*,PWSTR,const UNICODE_STRING*,
1380 const UNICODE_STRING*,const UNICODE_STRING*,
1381 const UNICODE_STRING*);
1382 NTSTATUS WINAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
1383 BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
1384 BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
1385 NTSTATUS WINAPI RtlCreateUserThread(HANDLE,const SECURITY_DESCRIPTOR*,BOOLEAN,PVOID,SIZE_T,SIZE_T,PRTL_THREAD_START_ROUTINE,void*,HANDLE*,CLIENT_ID*);
1387 NTSTATUS WINAPI RtlDeleteAce(PACL,DWORD);
1388 NTSTATUS WINAPI RtlDeleteCriticalSection(RTL_CRITICAL_SECTION *);
1389 void WINAPI RtlDeleteResource(LPRTL_RWLOCK);
1390 DWORD WINAPI RtlDeleteSecurityObject(DWORD);
1391 PRTL_USER_PROCESS_PARAMETERS WINAPI RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
1392 NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR);
1393 HANDLE WINAPI RtlDestroyHeap(HANDLE);
1394 void WINAPI RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS*);
1395 DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
1396 BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR);
1397 BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(PCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
1398 ULONG WINAPI RtlDosSearchPath_U(LPCWSTR, LPCWSTR, LPCWSTR, ULONG, LPWSTR, LPWSTR*);
1399 WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
1400 NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1401 void WINAPI RtlDumpResource(LPRTL_RWLOCK);
1402 NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
1404 LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
1405 ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
1406 UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
1407 NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
1408 void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
1409 NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
1410 NTSTATUS WINAPI RtlEqualDomainName(const UNICODE_STRING*,const UNICODE_STRING*);
1411 BOOLEAN WINAPI RtlEqualLuid(const LUID*,const LUID*);
1412 BOOL WINAPI RtlEqualPrefixSid(PSID,PSID);
1413 BOOL WINAPI RtlEqualSid(PSID,PSID);
1414 BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
1415 BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1416 NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*);
1417 LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
1418 LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
1419 LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
1421 NTSTATUS WINAPI RtlFindCharInUnicodeString(int,const UNICODE_STRING*,const UNICODE_STRING*,USHORT*);
1422 ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
1423 ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
1424 ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
1425 ULONG WINAPI RtlFindLastBackwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
1426 ULONG WINAPI RtlFindLastBackwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
1427 CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG);
1428 ULONG WINAPI RtlFindLongestRunSet(PCRTL_BITMAP,PULONG);
1429 ULONG WINAPI RtlFindLongestRunClear(PCRTL_BITMAP,PULONG);
1430 NTSTATUS WINAPI RtlFindMessage(HMODULE,ULONG,ULONG,ULONG,const MESSAGE_RESOURCE_ENTRY**);
1431 CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG);
1432 ULONG WINAPI RtlFindNextForwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
1433 ULONG WINAPI RtlFindNextForwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
1434 ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP,ULONG,ULONG);
1435 ULONG WINAPI RtlFindSetBitsAndClear(PRTL_BITMAP,ULONG,ULONG);
1436 ULONG WINAPI RtlFindSetRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
1437 BOOLEAN WINAPI RtlFirstFreeAce(PACL,PACE_HEADER *);
1438 NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING);
1439 NTSTATUS WINAPI RtlFormatMessage(LPWSTR,UCHAR,BOOLEAN,BOOLEAN,BOOLEAN,va_list *,LPWSTR,ULONG);
1440 void WINAPI RtlFreeAnsiString(PANSI_STRING);
1441 BOOLEAN WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
1442 void WINAPI RtlFreeOemString(POEM_STRING);
1443 DWORD WINAPI RtlFreeSid(PSID);
1444 void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
1446 DWORD WINAPI RtlGetAce(PACL,DWORD,LPVOID *);
1447 NTSTATUS WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
1448 NTSTATUS WINAPI RtlGetCurrentDirectory_U(ULONG, LPWSTR);
1449 NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
1450 ULONG WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*);
1451 NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
1452 DWORD WINAPI RtlGetLastWin32Error(void);
1453 DWORD WINAPI RtlGetLongestNtPathLength(void);
1454 BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
1455 NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
1456 ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
1457 NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
1458 NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
1460 PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
1461 PVOID WINAPI RtlImageDirectoryEntryToData(HMODULE,BOOL,WORD,ULONG *);
1462 PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE);
1463 PIMAGE_SECTION_HEADER WINAPI RtlImageRvaToSection(const IMAGE_NT_HEADERS *,HMODULE,DWORD);
1464 PVOID WINAPI RtlImageRvaToVa(const IMAGE_NT_HEADERS *,HMODULE,DWORD,IMAGE_SECTION_HEADER **);
1465 BOOL WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
1466 void WINAPI RtlInitString(PSTRING,PCSZ);
1467 void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
1468 void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
1469 NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
1470 NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
1471 NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,DWORD);
1472 void WINAPI RtlInitializeBitMap(PRTL_BITMAP,PULONG,ULONG);
1473 void WINAPI RtlInitializeResource(LPRTL_RWLOCK);
1474 BOOL WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
1476 NTSTATUS WINAPI RtlInt64ToUnicodeString(ULONGLONG,ULONG,UNICODE_STRING *);
1477 NTSTATUS WINAPI RtlIntegerToChar(ULONG,ULONG,ULONG,PCHAR);
1478 NTSTATUS WINAPI RtlIntegerToUnicodeString(ULONG,ULONG,UNICODE_STRING *);
1479 ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR);
1480 BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN);
1481 DWORD WINAPI RtlIsTextUnicode(LPVOID,DWORD,DWORD *);
1483 LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
1484 LONGLONG WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
1485 ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
1486 LONGLONG WINAPI RtlLargeIntegerNegate(LONGLONG);
1487 LONGLONG WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
1488 LONGLONG WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
1489 LONGLONG WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
1490 NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
1491 NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *);
1492 DWORD WINAPI RtlLengthRequiredSid(DWORD);
1493 ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR);
1494 DWORD WINAPI RtlLengthSid(PSID);
1495 NTSTATUS WINAPI RtlLocalTimeToSystemTime(const LARGE_INTEGER*,PLARGE_INTEGER);
1496 BOOLEAN WINAPI RtlLockHeap(HANDLE);
1498 NTSTATUS WINAPI RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
1499 void WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*);
1500 NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
1501 NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
1503 DWORD WINAPI RtlNewSecurityObject(DWORD,DWORD,DWORD,DWORD,DWORD,DWORD);
1504 PRTL_USER_PROCESS_PARAMETERS WINAPI RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
1505 ULONG WINAPI RtlNtStatusToDosError(NTSTATUS);
1506 ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS);
1507 ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP);
1508 ULONG WINAPI RtlNumberOfClearBits(PCRTL_BITMAP);
1510 UINT WINAPI RtlOemStringToUnicodeSize(const STRING*);
1511 NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
1512 NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
1513 DWORD WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHKEY);
1515 BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
1516 BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1518 NTSTATUS WINAPI RtlQueryEnvironmentVariable_U(PWSTR,PUNICODE_STRING,PUNICODE_STRING);
1519 NTSTATUS WINAPI RtlQueryInformationAcl(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
1520 NTSTATUS WINAPI RtlQueryTimeZoneInformation(LPTIME_ZONE_INFORMATION);
1522 void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
1523 void WINAPI RtlRaiseStatus(NTSTATUS);
1524 ULONG WINAPI RtlRandom(PULONG);
1525 PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,ULONG);
1526 void WINAPI RtlReleasePebLock(void);
1527 void WINAPI RtlReleaseResource(LPRTL_RWLOCK);
1528 ULONG WINAPI RtlRemoveVectoredExceptionHandler(PVOID);
1529 void WINAPI RtlRestoreLastWin32Error(DWORD);
1531 void WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *);
1532 void WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *);
1533 NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,
1534 PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD);
1535 void WINAPI RtlSetAllBits(PRTL_BITMAP);
1536 void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG);
1537 ULONG WINAPI RtlSetCriticalSectionSpinCount(RTL_CRITICAL_SECTION*,ULONG);
1538 NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING*);
1539 void WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*);
1540 NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
1541 NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR*,PUNICODE_STRING,PUNICODE_STRING);
1542 NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
1543 NTSTATUS WINAPI RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
1544 void WINAPI RtlSetLastWin32Error(DWORD);
1545 NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
1546 NTSTATUS WINAPI RtlSetTimeZoneInformation(const TIME_ZONE_INFORMATION*);
1547 ULONG WINAPI RtlSizeHeap(HANDLE,ULONG,PVOID);
1548 LPDWORD WINAPI RtlSubAuthoritySid(PSID,DWORD);
1549 LPBYTE WINAPI RtlSubAuthorityCountSid(PSID);
1550 NTSTATUS WINAPI RtlSystemTimeToLocalTime(const LARGE_INTEGER*,PLARGE_INTEGER);
1552 void WINAPI RtlTimeToTimeFields(const LARGE_INTEGER*,PTIME_FIELDS);
1553 BOOLEAN WINAPI RtlTimeFieldsToTime(PTIME_FIELDS,PLARGE_INTEGER);
1554 void WINAPI RtlTimeToElapsedTimeFields(const LARGE_INTEGER *,PTIME_FIELDS);
1555 BOOLEAN WINAPI RtlTimeToSecondsSince1970(const LARGE_INTEGER *,LPDWORD);
1556 BOOLEAN WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *,LPDWORD);
1557 BOOL WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *);
1559 ULONGLONG __cdecl RtlUlonglongByteSwap(ULONGLONG);
1560 DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
1561 NTSTATUS WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING,PCUNICODE_STRING,BOOLEAN);
1562 NTSTATUS WINAPI RtlUnicodeStringToInteger(const UNICODE_STRING *,ULONG,ULONG *);
1563 DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
1564 NTSTATUS WINAPI RtlUnicodeStringToOemString(POEM_STRING,PCUNICODE_STRING,BOOLEAN);
1565 NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1566 NTSTATUS WINAPI RtlUnicodeToMultiByteSize(PULONG,PCWSTR,ULONG);
1567 NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1568 ULONG WINAPI RtlUniform(PULONG);
1569 BOOLEAN WINAPI RtlUnlockHeap(HANDLE);
1570 void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID);
1572 void WINAPI RtlUnwind2(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT);
1573 void WINAPI RtlUnwindEx(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
1575 WCHAR WINAPI RtlUpcaseUnicodeChar(WCHAR);
1576 NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
1577 NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
1578 NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
1579 NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
1580 NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1581 NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1582 CHAR WINAPI RtlUpperChar(CHAR);
1583 void WINAPI RtlUpperString(STRING *,const STRING *);
1585 NTSTATUS WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
1586 BOOLEAN WINAPI RtlValidAcl(PACL);
1587 BOOLEAN WINAPI RtlValidSid(PSID);
1588 BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
1589 NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
1591 NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
1593 NTSTATUS WINAPI RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION *);
1594 NTSTATUS WINAPI RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION *);
1596 /* Wine internal functions */
1598 extern NTSTATUS wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRING *unix_name_ret,
1599 UINT disposition, BOOLEAN check_case );
1601 /***********************************************************************
1605 #define InitializeObjectAttributes(p,n,a,r,s) \
1607 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
1608 (p)->RootDirectory = r; \
1609 (p)->Attributes = a; \
1610 (p)->ObjectName = n; \
1611 (p)->SecurityDescriptor = s; \
1612 (p)->SecurityQualityOfService = NULL; \
1615 #define NtCurrentProcess() ((HANDLE)-1)
1617 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
1618 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
1619 #define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1620 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1621 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
1622 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
1623 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
1625 inline static BOOLEAN RtlCheckBit(PCRTL_BITMAP lpBits, ULONG ulBit)
1627 if (lpBits && ulBit < lpBits->SizeOfBitMap &&
1628 lpBits->Buffer[ulBit >> 5] & (1 << (ulBit & 31)))
1633 /* These are implemented as __fastcall, so we can't let Winelib apps link with them */
1634 inline static USHORT RtlUshortByteSwap(USHORT s)
1636 return (s >> 8) | (s << 8);
1638 inline static ULONG RtlUlongByteSwap(ULONG i)
1640 #if defined(__i386__) && defined(__GNUC__)
1642 __asm__("bswap %0" : "=r" (ret) : "0" (i) );
1645 return ((ULONG)RtlUshortByteSwap((USHORT)i) << 16) | RtlUshortByteSwap((USHORT)(i >> 16));
1649 /*************************************************************************
1650 * Loader functions and structures.
1652 * Those are not part of standard Winternl.h
1654 typedef struct _LDR_MODULE
1656 LIST_ENTRY InLoadOrderModuleList;
1657 LIST_ENTRY InMemoryOrderModuleList;
1658 LIST_ENTRY InInitializationOrderModuleList;
1662 UNICODE_STRING FullDllName;
1663 UNICODE_STRING BaseDllName;
1667 HANDLE SectionHandle;
1669 ULONG TimeDateStamp;
1670 } LDR_MODULE, *PLDR_MODULE;
1672 /* those defines are (some of the) regular LDR_MODULE.Flags values */
1673 #define LDR_IMAGE_IS_DLL 0x00000004
1674 #define LDR_LOAD_IN_PROGRESS 0x00001000
1675 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
1676 #define LDR_NO_DLL_CALLS 0x00040000
1677 #define LDR_PROCESS_ATTACHED 0x00080000
1678 #define LDR_MODULE_REBASED 0x00200000
1680 /* these ones is Wine specific */
1681 #define LDR_DONT_RESOLVE_REFS 0x40000000
1682 #define LDR_WINE_INTERNAL 0x80000000
1684 /* FIXME: to be checked */
1685 #define MAXIMUM_FILENAME_LENGTH 256
1687 typedef struct _SYSTEM_MODULE
1691 PVOID ImageBaseAddress;
1698 BYTE Name[MAXIMUM_FILENAME_LENGTH];
1699 } SYSTEM_MODULE, *PSYSTEM_MODULE;
1701 typedef struct _SYSTEM_MODULE_INFORMATION
1704 SYSTEM_MODULE Modules[1]; /* FIXME: should be Modules[0] */
1705 } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
1707 NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
1708 NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_MODULE*);
1709 NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG*);
1710 NTSTATUS WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*);
1711 NTSTATUS WINAPI LdrUnloadDll(HMODULE);
1712 NTSTATUS WINAPI LdrUnlockLoaderLock(ULONG,ULONG);
1714 /* list manipulation macros */
1715 #define InitializeListHead(le) (void)((le)->Flink = (le)->Blink = (le))
1716 #define InsertHeadList(le,e) do { PLIST_ENTRY f = (le)->Flink; (e)->Flink = f; (e)->Blink = (le); f->Blink = (e); (le)->Flink = (e); } while (0)
1717 #define InsertTailList(le,e) do { PLIST_ENTRY b = (le)->Blink; (e)->Flink = (le); (e)->Blink = b; b->Flink = (e); (le)->Blink = (e); } while (0)
1718 #define IsListEmpty(le) ((le)->Flink == (le))
1719 #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)
1720 static inline PLIST_ENTRY RemoveHeadList(PLIST_ENTRY le)
1722 PLIST_ENTRY f, b, e;
1725 f = le->Flink->Flink;
1726 b = le->Flink->Blink;
1730 if (e != le) e->Flink = e->Blink = NULL;
1733 static inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le)
1735 PLIST_ENTRY f, b, e;
1738 f = le->Blink->Flink;
1739 b = le->Blink->Blink;
1743 if (e != le) e->Flink = e->Blink = NULL;
1749 #endif /* defined(__cplusplus) */
1751 #endif /* __WINE_WINTERNL_H */