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_WINTERNAL_H
22 #define __WINE_WINTERNAL_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 LPBYTE BitMapBuffer; /* 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 StartOfRun; /* Bit position at which run starts - FIXME: Name? */
93 ULONG SizeOfRun; /* Size of the run in bits - FIXME: Name? */
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 UNICODE_STRING CurrentDirectoryName;
110 HANDLE CurrentDirectoryHandle;
111 UNICODE_STRING DllPath;
112 UNICODE_STRING ImagePathName;
113 UNICODE_STRING CommandLine;
121 ULONG dwFillAttribute;
124 UNICODE_STRING WindowTitle;
125 UNICODE_STRING Desktop;
126 UNICODE_STRING ShellInfo;
127 UNICODE_STRING RuntimeInfo;
128 RTL_DRIVE_LETTER_CURDIR DLCurrentDirectory[0x20];
129 } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
131 /* value for Flags field (FIXME: not the correct name) */
132 #define PROCESS_PARAMS_FLAG_NORMALIZED 1
134 typedef struct _PEB_LDR_DATA
139 LIST_ENTRY InLoadOrderModuleList;
140 LIST_ENTRY InMemoryOrderModuleList;
141 LIST_ENTRY InInitializationOrderModuleList;
142 } PEB_LDR_DATA, *PPEB_LDR_DATA;
144 /***********************************************************************
149 BYTE Reserved1[2]; /* 00 */
150 BYTE BeingDebugged; /* 02 */
151 BYTE Reserved2[5]; /* 03 */
152 HMODULE ImageBaseAddress; /* 08 */
153 PPEB_LDR_DATA LdrData; /* 0c */
154 RTL_USER_PROCESS_PARAMETERS *ProcessParameters; /* 10 */
155 PVOID __pad_14; /* 14 */
156 HANDLE ProcessHeap; /* 18 */
157 BYTE __pad_1c[36]; /* 1c */
158 PRTL_BITMAP TlsBitmap; /* 40 */
159 ULONG TlsBitmapBits[2]; /* 44 */
160 BYTE __pad_4c[156]; /* 4c */
161 PVOID Reserved3[59]; /* e8 */
162 ULONG SessionId; /* 1d4 */
166 /***********************************************************************
169 #if defined(_NTSYSTEM_) || defined(_KERNEL32_) /* hack, should go away */
173 #ifndef WINE_NO_TEB /* don't define TEB if included from thread.h */
174 # ifndef WINE_TEB_DEFINED
175 # define WINE_TEB_DEFINED
178 NT_TIB Tib; /* 000 */
179 PVOID EnvironmentPointer; /* 01c */
180 CLIENT_ID ClientId; /* 020 */
181 PVOID ActiveRpcHandle; /* 028 */
182 PVOID ThreadLocalStoragePointer; /* 02c */
184 ULONG LastErrorValue; /* 034 */
185 BYTE __pad038[140]; /* 038 */
186 ULONG CurrentLocale; /* 0c4 */
187 BYTE __pad0c8[1752]; /* 0c8 */
188 PVOID Reserved2[278]; /* 7a0 */
189 UNICODE_STRING StaticUnicodeString; /* bf8 used by advapi32 */
190 WCHAR StaticUnicodeBuffer[261]; /* c00 used by advapi32 */
191 PVOID DeallocationStack; /* e0c */
192 PVOID TlsSlots[64]; /* e10 */
193 LIST_ENTRY TlsLinks; /* f10 */
194 PVOID Reserved4[26]; /* f18 */
195 PVOID ReservedForOle; /* f80 Windows 2000 only */
196 PVOID Reserved5[4]; /* f84 */
197 PVOID TlsExpansionSlots; /* f94 */
199 # endif /* WINE_TEB_DEFINED */
200 #endif /* WINE_NO_TEB */
202 /***********************************************************************
206 typedef enum _FILE_INFORMATION_CLASS {
207 FileDirectoryInformation = 1,
208 FileFullDirectoryInformation,
209 FileBothDirectoryInformation,
210 FileBasicInformation,
211 FileStandardInformation,
212 FileInternalInformation,
214 FileAccessInformation,
216 FileRenameInformation,
218 FileNamesInformation,
219 FileDispositionInformation,
220 FilePositionInformation,
221 FileFullEaInformation,
223 FileAlignmentInformation,
225 FileAllocationInformation,
226 FileEndOfFileInformation,
227 FileAlternateNameInformation,
228 FileStreamInformation,
230 FilePipeLocalInformation,
231 FilePipeRemoteInformation,
232 FileMailslotQueryInformation,
233 FileMailslotSetInformation,
234 FileCompressionInformation,
235 FileObjectIdInformation,
236 FileCompletionInformation,
237 FileMoveClusterInformation,
238 FileQuotaInformation,
239 FileReparsePointInformation,
240 FileNetworkOpenInformation,
241 FileAttributeTagInformation,
242 FileTrackingInformation,
243 FileMaximumInformation
244 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
246 typedef struct _FILE_BASIC_INFORMATION {
247 LARGE_INTEGER CreationTime;
248 LARGE_INTEGER LastAccessTime;
249 LARGE_INTEGER LastWriteTime;
250 LARGE_INTEGER ChangeTime;
251 ULONG FileAttributes;
252 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
254 typedef struct _FILE_STANDARD_INFORMATION {
255 LARGE_INTEGER AllocationSize;
256 LARGE_INTEGER EndOfFile;
258 BOOLEAN DeletePending;
260 } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
262 typedef struct _FILE_POSITION_INFORMATION {
263 LARGE_INTEGER CurrentByteOffset;
264 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
266 typedef struct _FILE_ALIGNMENT_INFORMATION {
267 ULONG AlignmentRequirement;
268 } FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION;
270 typedef struct _FILE_NETWORK_OPEN_INFORMATION {
271 LARGE_INTEGER CreationTime;
272 LARGE_INTEGER LastAccessTime;
273 LARGE_INTEGER LastWriteTime;
274 LARGE_INTEGER ChangeTime;
275 LARGE_INTEGER AllocationSize;
276 LARGE_INTEGER EndOfFile;
277 ULONG FileAttributes;
278 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
280 typedef struct _FILE_FULL_EA_INFORMATION {
281 ULONG NextEntryOffset;
284 USHORT EaValueLength;
286 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
288 typedef struct _FILE_STREAM_INFORMATION
290 ULONG NextEntryOffset;
291 ULONG StreamNameLength;
292 LARGE_INTEGER StreamSize;
293 LARGE_INTEGER StreamAllocationSize;
295 } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
297 struct _FILE_ATTRIBUTE_TAG_INFORMATION
299 ULONG FileAttributes;
301 } FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
303 typedef enum _FSINFOCLASS {
304 FileFsVolumeInformation = 1,
305 FileFsLabelInformation,
306 FileFsSizeInformation,
307 FileFsDeviceInformation,
308 FileFsAttributeInformation,
309 FileFsControlInformation,
310 FileFsFullSizeInformation,
311 FileFsObjectIdInformation,
312 FileFsMaximumInformation
313 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
315 typedef enum _KEY_INFORMATION_CLASS {
319 } KEY_INFORMATION_CLASS;
321 typedef enum _KEY_VALUE_INFORMATION_CLASS {
322 KeyValueBasicInformation,
323 KeyValueFullInformation,
324 KeyValuePartialInformation,
325 KeyValueFullInformationAlign64,
326 KeyValuePartialInformationAlign64
327 } KEY_VALUE_INFORMATION_CLASS;
329 typedef enum _OBJECT_INFORMATION_CLASS {
330 ObjectBasicInformation,
331 ObjectNameInformation,
332 ObjectTypeInformation,
333 ObjectAllInformation,
334 ObjectDataInformation
335 } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
337 typedef enum _PROCESSINFOCLASS {
338 ProcessBasicInformation = 0,
339 ProcessQuotaLimits = 1,
340 ProcessIoCounters = 2,
341 ProcessVmCounters = 3,
343 ProcessBasePriority = 5,
344 ProcessRaisePriority = 6,
345 ProcessDebugPort = 7,
346 ProcessExceptionPort = 8,
347 ProcessAccessToken = 9,
348 ProcessLdtInformation = 10,
350 ProcessDefaultHardErrorMode = 12,
351 ProcessIoPortHandlers = 13,
352 ProcessPooledUsageAndLimits = 14,
353 ProcessWorkingSetWatch = 15,
354 ProcessUserModeIOPL = 16,
355 ProcessEnableAlignmentFaultFixup = 17,
356 ProcessPriorityClass = 18,
357 ProcessWx86Information = 19,
358 ProcessHandleCount = 20,
359 ProcessAffinityMask = 21,
360 ProcessPriorityBoost = 22,
361 ProcessDeviceMap = 23,
362 ProcessSessionInformation = 24,
363 ProcessForegroundInformation = 25,
364 ProcessWow64Information = 26,
368 typedef enum _SECTION_INHERIT {
373 typedef enum SYSTEM_INFORMATION_CLASS {
374 SystemBasicInformation = 0,
376 SystemPerformanceInformation = 2,
377 SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
379 SystemProcessInformation = 5,
382 SystemProcessorPerformanceInformation = 8,
385 SystemDriverInformation,
395 SystemCacheInformation,
397 SystemInterruptInformation = 23,
398 SystemExceptionInformation = 33,
399 SystemRegistryQuotaInformation = 37,
400 SystemLookasideInformation = 45
401 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
403 typedef enum _TIMER_TYPE {
408 typedef enum _THREADINFOCLASS {
409 ThreadBasicInformation,
414 ThreadImpersonationToken,
415 ThreadDescriptorTableEntry,
416 ThreadEnableAlignmentFaultFixup,
417 ThreadEventPair_Reusable,
418 ThreadQuerySetWin32StartAddress,
420 ThreadPerformanceCount,
422 ThreadIdealProcessor,
424 ThreadSetTlsArrayAddress,
429 typedef struct _THREAD_BASIC_INFORMATION
432 PVOID TebBaseAddress;
437 } THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
440 typedef enum _WINSTATIONINFOCLASS {
441 WinStationInformation = 8
442 } WINSTATIONINFOCLASS;
446 MemoryBasicInformation = 0
447 } MEMORY_INFORMATION_CLASS;
449 /* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
453 UNC_PATH, /* "//foo" */
454 ABSOLUTE_DRIVE_PATH, /* "c:/foo" */
455 RELATIVE_DRIVE_PATH, /* "c:foo" */
456 ABSOLUTE_PATH, /* "/foo" */
457 RELATIVE_PATH, /* "foo" */
458 DEVICE_PATH, /* "//./foo" */
459 UNC_DOT_PATH /* "//." */
462 /***********************************************************************
463 * IA64 specific types and data structures
468 typedef struct _FRAME_POINTERS {
469 ULONGLONG MemoryStackFp;
470 ULONGLONG BackingStoreFp;
471 } FRAME_POINTERS, *PFRAME_POINTERS;
473 #define UNWIND_HISTORY_TABLE_SIZE 12
475 typedef struct _RUNTIME_FUNCTION {
478 ULONG UnwindInfoAddress;
479 } RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
481 typedef struct _UNWIND_HISTORY_TABLE_ENTRY {
484 PRUNTIME_FUNCTION FunctionEntry;
485 } UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY;
487 typedef struct _UNWIND_HISTORY_TABLE {
492 UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE];
493 } UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE;
495 #endif /* defined(__ia64__) */
497 /***********************************************************************
498 * Types and data structures
501 /* This is used by NtQuerySystemInformation */
502 /* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
504 FILETIME ftKernelTime;
506 FILETIME ftCreateTime;
508 DWORD dwStartAddress;
511 DWORD dwCurrentPriority;
512 DWORD dwBasePriority;
513 DWORD dwContextSwitches;
516 } THREADINFO, *PTHREADINFO;
518 /* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
519 typedef struct _THREAD_INFO{
526 } THREAD_INFO, PTHREAD_INFO;
528 /***********************************************************************
529 * Types and data structures
532 typedef struct _IO_STATUS_BLOCK {
538 ULONG_PTR Information;
539 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
541 typedef void (WINAPI * PIO_APC_ROUTINE)(PVOID,PIO_STATUS_BLOCK,ULONG);
543 typedef struct _KEY_BASIC_INFORMATION {
544 LARGE_INTEGER LastWriteTime;
548 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
550 typedef struct _KEY_NODE_INFORMATION
552 LARGE_INTEGER LastWriteTime;
559 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
561 typedef struct _KEY_FULL_INFORMATION
563 LARGE_INTEGER LastWriteTime;
571 ULONG MaxValueNameLen;
572 ULONG MaxValueDataLen;
574 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
576 typedef struct _KEY_VALUE_ENTRY
578 PUNICODE_STRING ValueName;
582 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
584 typedef struct _KEY_VALUE_BASIC_INFORMATION {
589 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
591 typedef struct _KEY_VALUE_FULL_INFORMATION {
598 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
600 typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
605 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
607 typedef struct _OBJECT_ATTRIBUTES {
609 HANDLE RootDirectory;
610 PUNICODE_STRING ObjectName;
612 PVOID SecurityDescriptor; /* type SECURITY_DESCRIPTOR */
613 PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
614 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
616 typedef struct _OBJECT_DATA_INFORMATION {
617 BOOLEAN InheritHandle;
618 BOOLEAN ProtectFromClose;
619 } OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION;
621 typedef struct _PROCESS_BASIC_INFORMATION {
624 DWORD PebBaseAddress;
627 ULONG UniqueProcessId;
628 ULONG InheritedFromUniqueProcessId;
633 ULONG_PTR UniqueProcessId;
636 } PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION;
638 typedef struct _PROCESS_INFO {
639 DWORD Offset; /* 00 offset to next PROCESS_INFO ok*/
640 DWORD ThreadCount; /* 04 number of ThreadInfo member ok */
642 FILETIME CreationTime; /* 20 */
644 PWCHAR ProcessName; /* 3c ok */
646 DWORD ProcessID; /* 44 ok*/
647 DWORD ParentProcessID;
649 DWORD Unknown3[2]; /* 50 */
650 ULONG PeakVirtualSize;
652 ULONG PageFaultCount;
653 ULONG PeakWorkingSetSize;
654 ULONG WorkingSetSize;
655 ULONG QuotaPeakPagedPoolUsage;
656 ULONG QuotaPagedPoolUsage;
657 ULONG QuotaPeakNonPagedPoolUsage;
658 ULONG QuotaNonPagedPoolUsage;
660 ULONG PeakPagefileUsage;
663 THREAD_INFO ati[ANYSIZE_ARRAY]; /* 94 size=0x40*/
664 } PROCESS_INFO, PPROCESS_INFO;
666 typedef struct _RTL_HEAP_DEFINITION {
667 ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
670 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
672 typedef struct _RTL_RWLOCK {
673 RTL_CRITICAL_SECTION rtlCS;
675 HANDLE hSharedReleaseSemaphore;
678 HANDLE hExclusiveReleaseSemaphore;
679 UINT uExclusiveWaiters;
682 HANDLE hOwningThreadId;
683 DWORD dwTimeoutBoost;
685 } RTL_RWLOCK, *LPRTL_RWLOCK;
687 /* System Information Class 0x00 */
688 typedef struct _SYSTEM_BASIC_INFORMATION {
691 ULONG uKeMaximumIncrement;
693 ULONG uMmNumberOfPhysicalPages;
694 ULONG uMmLowestPhysicalPage;
695 ULONG uMmHighestPhysicalPage;
696 ULONG uAllocationGranularity;
697 PVOID pLowestUserAddress;
698 PVOID pMmHighestUserAddress;
699 ULONG uKeActiveProcessors;
700 BYTE bKeNumberProcessors;
706 CCHAR NumberOfProcessors;
708 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
710 /* System Information Class 0x15 */
714 ULONG PageFaultCount;
715 ULONG MinimumWorkingSet;
716 ULONG MaximumWorkingSet;
718 } SYSTEM_CACHE_INFORMATION;
720 typedef struct _SYSTEM_CONFIGURATION_INFO {
724 WORD ProcessorArchitecture;
729 PVOID MinimumApplicationAddress;
730 PVOID MaximumApplicationAddress;
731 ULONG ActiveProcessorMask;
732 ULONG NumberOfProcessors;
734 ULONG AllocationGranularity;
736 WORD ProcessorRevision;
737 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
739 /* System Information Class 0x0b */
746 char szName[MAX_PATH + 1];
747 } SYSTEM_DRIVER_INFORMATION;
749 typedef struct _SYSTEM_EXCEPTION_INFORMATION {
751 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
753 typedef struct _SYSTEM_LOOKASIDE_INFORMATION {
755 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
757 typedef struct _SYSTEM_INTERRUPT_INFORMATION {
759 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
761 /* System Information Class 0x10 */
764 USHORT dwCreatorBackTraceIndex;
766 BYTE bHandleAttributes;
767 USHORT usHandleOffset;
769 ULONG ulGrantedAccess;
770 } HANDLEINFO, *PHANDLEINFO; /* FIXME: SYSTEM_HANDLE_INFORMATION? */
772 typedef struct _SYSTEM_PERFORMANCE_INFORMATION {
774 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
776 /* System Information Class 0x02 */
777 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
779 LARGE_INTEGER liIdleTime;
782 LARGE_INTEGER IdleTime;
783 LARGE_INTEGER KernelTime;
784 LARGE_INTEGER UserTime;
785 LARGE_INTEGER Reserved1[2];
788 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
790 /* System Information Class 0x05 */
791 typedef struct _SYSTEM_PROCESS_INFORMATION {
796 FILETIME ftCreationTime;
798 WCHAR *pszProcessName;
799 DWORD dwBasePriority;
801 DWORD dwParentProcessID;
805 DWORD dwVirtualBytesPeak;
806 DWORD dwVirtualBytes;
808 DWORD dwWorkingSetPeak;
813 DWORD dwNonPagedPool;
814 DWORD dwPageFileBytesPeak;
815 DWORD dwPrivateBytes;
816 DWORD dwPageFileBytes;
820 ULONG NextEntryOffset;
823 HANDLE UniqueProcessId;
828 SIZE_T PeakPagefileUsage;
829 SIZE_T PrivatePageCount;
830 LARGE_INTEGER Reserved6[6];
832 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
834 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION {
835 ULONG RegistryQuotaAllowed;
836 ULONG RegistryQuotaUsed;
838 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
840 typedef struct _SYSTEM_TIME_ADJUSTMENT {
841 ULONG TimeAdjustment;
842 BOOLEAN TimeAdjustmentDisabled;
843 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
845 /* System Information Class 0x03 */
846 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
848 LARGE_INTEGER liKeBootTime;
849 LARGE_INTEGER liKeSystemTime;
850 LARGE_INTEGER liExpTimeZoneBias;
851 ULONG uCurrentTimeZoneId;
856 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; /* was SYSTEM_TIME_INFORMATION */
858 typedef struct _TIME_FIELDS
867 } TIME_FIELDS, *PTIME_FIELDS;
869 typedef struct _WINSTATIONINFORMATIONW {
872 BYTE Reserved3[1140];
873 } WINSTATIONINFORMATIONW, *PWINSTATIONINFORMATIONW;
875 typedef struct _VM_COUNTERS_ {
876 ULONG PeakVirtualSize;
878 ULONG PageFaultCount;
879 ULONG PeakWorkingSetSize;
880 ULONG WorkingSetSize;
881 ULONG QuotaPeakPagedPoolUsage;
882 ULONG QuotaPagedPoolUsage;
883 ULONG QuotaPeakNonPagedPoolUsage;
884 ULONG QuotaNonPagedPoolUsage;
886 ULONG PeakPagefileUsage;
887 } VM_COUNTERS, *PVM_COUNTERS;
889 typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONW)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
891 typedef struct _LDR_RESOURCE_INFO
896 } LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO;
898 /***********************************************************************
902 /* flags for NtCreateFile and NtOpenFile */
903 #define FILE_DIRECTORY_FILE 0x00000001
904 #define FILE_WRITE_THROUGH 0x00000002
905 #define FILE_SEQUENTIAL_ONLY 0x00000004
906 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
907 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
908 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
909 #define FILE_NON_DIRECTORY_FILE 0x00000040
910 #define FILE_CREATE_TREE_CONNECTION 0x00000080
911 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
912 #define FILE_NO_EA_KNOWLEDGE 0x00000200
913 #define FILE_OPEN_FOR_RECOVERY 0x00000400
914 #define FILE_RANDOM_ACCESS 0x00000800
915 #define FILE_DELETE_ON_CLOSE 0x00001000
916 #define FILE_OPEN_BY_FILE_ID 0x00002000
917 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
918 #define FILE_NO_COMPRESSION 0x00008000
919 #define FILE_RESERVE_OPFILTER 0x00100000
920 #define FILE_TRANSACTED_MODE 0x00200000
921 #define FILE_OPEN_OFFLINE_FILE 0x00400000
923 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
924 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
926 /* status for NtCreateFile or NtOpenFile */
927 #define FILE_SUPERSEDED 0
928 #define FILE_OPENED 1
929 #define FILE_CREATED 2
930 #define FILE_OVERWRITTEN 3
931 #define FILE_EXISTS 4
932 #define FILE_DOES_NOT_EXIST 5
934 /* disposition for NtCreateFile */
935 #define FILE_SUPERSEDE 0
937 #define FILE_CREATE 2
938 #define FILE_OPEN_IF 3
939 #define FILE_OVERWRITE 4
940 #define FILE_OVERWRITE_IF 5
941 #define FILE_MAXIMUM_DISPOSITION 5
943 /* Characteristics of a File System */
944 #define FILE_REMOVABLE_MEDIA 0x00000001
945 #define FILE_READ_ONLY_DEVICE 0x00000002
946 #define FILE_FLOPPY_DISKETTE 0x00000004
947 #define FILE_WRITE_ONE_MEDIA 0x00000008
948 #define FILE_REMOTE_DEVICE 0x00000010
949 #define FILE_DEVICE_IS_MOUNTED 0x00000020
950 #define FILE_VIRTUAL_VOLUME 0x00000040
952 #if (_WIN32_WINNT >= 0x0501)
953 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
954 #endif /* (_WIN32_WINNT >= 0x0501) */
956 #define LOGONID_CURRENT ((ULONG)-1)
958 #define OBJ_INHERIT 0x00000002L
959 #define OBJ_PERMANENT 0x00000010L
960 #define OBJ_EXCLUSIVE 0x00000020L
961 #define OBJ_CASE_INSENSITIVE 0x00000040L
962 #define OBJ_OPENIF 0x00000080L
963 #define OBJ_OPENLINK 0x00000100L
964 #define OBJ_KERNEL_HANDLE 0x00000200L
965 #define OBJ_VALID_ATTRIBUTES 0x000003F2L
967 #define SERVERNAME_CURRENT ((HANDLE)NULL)
969 typedef void (CALLBACK *PNTAPCFUNC)(ULONG_PTR,ULONG_PTR,ULONG_PTR); /* FIXME: not the right name */
970 typedef void (CALLBACK *PRTL_THREAD_START_ROUTINE)(LPVOID); /* FIXME: not the right name */
972 /***********************************************************************
973 * Function declarations
976 extern LPSTR _strlwr(LPSTR str); /* FIXME: Doesn't belong here */
977 extern LPSTR _strupr(LPSTR str); /* FIXME: Doesn't belong here */
979 #if defined(__i386__) && defined(__GNUC__)
980 static inline void WINAPI DbgBreakPoint(void) { __asm__ __volatile__("int3"); }
981 static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3"); }
982 #else /* __i386__ && __GNUC__ */
983 void WINAPI DbgBreakPoint(void);
984 void WINAPI DbgUserBreakPoint(void);
985 #endif /* __i386__ && __GNUC__ */
986 void WINAPIV DbgPrint(LPCSTR fmt, ...);
988 NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
989 NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
990 NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
991 NTSTATUS WINAPI LdrGetDllHandle(ULONG, ULONG, const UNICODE_STRING*, HMODULE*);
992 NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
993 void WINAPI LdrInitializeThunk(HANDLE,ULONG,ULONG,ULONG);
994 NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
995 void WINAPI LdrShutdownProcess(void);
996 void WINAPI LdrShutdownThread(void);
997 NTSTATUS WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,PBOOLEAN);
998 NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
999 NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,PVOID,ULONG*,ULONG,ULONG);
1000 NTSTATUS WINAPI NtCancelTimer(HANDLE, BOOLEAN*);
1001 NTSTATUS WINAPI NtClearEvent(HANDLE);
1002 NTSTATUS WINAPI NtClose(HANDLE);
1003 NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOOLEAN,BOOLEAN);
1004 NTSTATUS WINAPI NtCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
1005 NTSTATUS WINAPI NtCreateKey(PHKEY,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
1006 NTSTATUS WINAPI NtCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
1007 NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,ULONG);
1008 NTSTATUS WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
1009 NTSTATUS WINAPI NtDelayExecution(BOOLEAN,const LARGE_INTEGER*);
1010 NTSTATUS WINAPI NtDeleteKey(HKEY);
1011 NTSTATUS WINAPI NtDeleteValueKey(HKEY,const UNICODE_STRING *);
1012 NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
1013 NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
1014 NTSTATUS WINAPI NtEnumerateKey(HKEY,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1015 NTSTATUS WINAPI NtEnumerateValueKey(HKEY,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1016 NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
1017 NTSTATUS WINAPI NtFlushKey(HKEY);
1018 NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,ULONG*,ULONG);
1019 NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
1020 NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*);
1021 NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,const OBJECT_ATTRIBUTES *);
1022 NTSTATUS WINAPI NtLockFile(HANDLE,HANDLE,PIO_APC_ROUTINE,void*,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,ULONG*,BOOLEAN,BOOLEAN);
1023 NTSTATUS WINAPI NtLockVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
1024 NTSTATUS WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,ULONG,const LARGE_INTEGER*,ULONG*,SECTION_INHERIT,ULONG,ULONG);
1025 NTSTATUS WINAPI NtNotifyChangeKey(HKEY,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
1026 NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1027 NTSTATUS WINAPI NtOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
1028 NTSTATUS WINAPI NtOpenKey(PHKEY,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1029 NTSTATUS WINAPI NtOpenProcessToken(HANDLE,DWORD,HANDLE *);
1030 NTSTATUS WINAPI NtOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1031 NTSTATUS WINAPI NtOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
1032 NTSTATUS WINAPI NtOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
1033 NTSTATUS WINAPI NtOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
1034 NTSTATUS WINAPI NtProtectVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG,ULONG*);
1035 NTSTATUS WINAPI NtPulseEvent(HANDLE,PULONG);
1036 NTSTATUS WINAPI NtQueueApcThread(HANDLE,PNTAPCFUNC,ULONG_PTR,ULONG_PTR,ULONG_PTR);
1037 NTSTATUS WINAPI NtQueryDefaultLocale(BOOLEAN,LCID*);
1038 NTSTATUS WINAPI NtQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS);
1039 NTSTATUS WINAPI NtQueryInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG,PULONG);
1040 NTSTATUS WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
1041 NTSTATUS WINAPI NtQueryInformationToken(HANDLE,DWORD,LPVOID,DWORD,LPDWORD);
1042 NTSTATUS WINAPI NtQueryKey(HKEY,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1043 NTSTATUS WINAPI NtQueryMultipleValueKey(HKEY,PVALENTW,ULONG,PVOID,ULONG,PULONG);
1044 NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
1045 NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
1046 NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1047 NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER);
1048 NTSTATUS WINAPI NtQueryValueKey(HKEY,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
1049 NTSTATUS WINAPI NtQueryVirtualMemory(HANDLE,LPCVOID,MEMORY_INFORMATION_CLASS,PVOID,ULONG,ULONG*);
1050 void WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
1051 NTSTATUS WINAPI NtReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
1052 NTSTATUS WINAPI NtReadVirtualMemory(HANDLE,const void*,void*,SIZE_T,SIZE_T*);
1053 NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
1054 NTSTATUS WINAPI NtReplaceKey(POBJECT_ATTRIBUTES,HKEY,POBJECT_ATTRIBUTES);
1055 NTSTATUS WINAPI NtResetEvent(HANDLE,PULONG);
1056 NTSTATUS WINAPI NtRestoreKey(HKEY,HANDLE,ULONG);
1057 NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG);
1058 NTSTATUS WINAPI NtSaveKey(HKEY,HANDLE);
1059 NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
1060 NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID);
1061 NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
1062 NTSTATUS WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
1063 NTSTATUS WINAPI NtSetInformationKey(HKEY,const int,PVOID,ULONG);
1064 NTSTATUS WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
1065 NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
1066 NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
1067 NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
1068 NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMERAPCROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
1069 NTSTATUS WINAPI NtSetValueKey(HKEY,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
1070 NTSTATUS WINAPI NtSuspendThread(HANDLE,PULONG);
1071 NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG);
1072 NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG);
1073 NTSTATUS WINAPI NtUnloadKey(HKEY);
1074 NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
1075 NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
1076 NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
1077 NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
1078 NTSTATUS WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
1079 NTSTATUS WINAPI NtWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
1080 NTSTATUS WINAPI NtWriteVirtualMemory(HANDLE,void*,const void*,SIZE_T,SIZE_T*);
1082 void WINAPI RtlAcquirePebLock(void);
1083 BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK,BYTE);
1084 BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK,BYTE);
1085 NTSTATUS WINAPI RtlAddAce(PACL,DWORD,DWORD,PACE_HEADER,DWORD);
1086 NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
1087 NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
1088 NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
1089 NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
1090 PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
1091 DWORD WINAPI RtlAdjustPrivilege(DWORD,DWORD,DWORD,DWORD);
1092 BOOLEAN WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
1093 PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,ULONG);
1094 DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING *);
1095 NTSTATUS WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING,PCANSI_STRING,BOOLEAN);
1096 NTSTATUS WINAPI RtlAppendAsciizToString(STRING *,LPCSTR);
1097 NTSTATUS WINAPI RtlAppendStringToString(STRING *,const STRING *);
1098 NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING *,const UNICODE_STRING *);
1099 NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING *,LPCWSTR);
1100 BOOLEAN WINAPI RtlAreAllAccessesGranted(ACCESS_MASK,ACCESS_MASK);
1101 BOOLEAN WINAPI RtlAreAnyAccessesGranted(ACCESS_MASK,ACCESS_MASK);
1102 BOOLEAN WINAPI RtlAreBitsSet(PCRTL_BITMAP,ULONG,ULONG);
1103 BOOLEAN WINAPI RtlAreBitsClear(PCRTL_BITMAP,ULONG,ULONG);
1105 NTSTATUS WINAPI RtlCharToInteger(PCSZ,ULONG,PULONG);
1106 void WINAPI RtlClearAllBits(PRTL_BITMAP);
1107 void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
1108 ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
1109 LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
1110 LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1111 DWORD WINAPI RtlComputeCrc32(DWORD,PBYTE,INT);
1112 NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
1113 LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
1114 ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
1115 void WINAPI RtlCopyLuid(PLUID,const LUID*);
1116 void WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
1117 DWORD WINAPI RtlCopySid(DWORD,PSID,PSID);
1118 void WINAPI RtlCopyString(STRING*,const STRING*);
1119 void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
1120 NTSTATUS WINAPI RtlCreateAcl(PACL,DWORD,DWORD);
1121 NTSTATUS WINAPI RtlCreateEnvironment(BOOLEAN, PWSTR*);
1122 HANDLE WINAPI RtlCreateHeap(ULONG,PVOID,ULONG,ULONG,PVOID,PRTL_HEAP_DEFINITION);
1123 NTSTATUS WINAPI RtlCreateProcessParameters(RTL_USER_PROCESS_PARAMETERS**,const UNICODE_STRING*,
1124 const UNICODE_STRING*,const UNICODE_STRING*,
1125 const UNICODE_STRING*,PWSTR,const UNICODE_STRING*,
1126 const UNICODE_STRING*,const UNICODE_STRING*,
1127 const UNICODE_STRING*);
1128 NTSTATUS WINAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
1129 BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
1130 BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
1131 NTSTATUS WINAPI RtlCreateUserThread(HANDLE,const SECURITY_DESCRIPTOR*,BOOLEAN,PVOID,SIZE_T,SIZE_T,PRTL_THREAD_START_ROUTINE,void*,HANDLE*,CLIENT_ID*);
1133 NTSTATUS WINAPI RtlDeleteAce(PACL,DWORD);
1134 NTSTATUS WINAPI RtlDeleteCriticalSection(RTL_CRITICAL_SECTION *);
1135 void WINAPI RtlDeleteResource(LPRTL_RWLOCK);
1136 DWORD WINAPI RtlDeleteSecurityObject(DWORD);
1137 PRTL_USER_PROCESS_PARAMETERS WINAPI RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
1138 NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR);
1139 HANDLE WINAPI RtlDestroyHeap(HANDLE);
1140 void WINAPI RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS*);
1141 DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
1142 BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR);
1143 BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(LPWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
1144 ULONG WINAPI RtlDosSearchPath_U(LPCWSTR, LPCWSTR, LPCWSTR, ULONG, LPWSTR, LPWSTR*);
1145 WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
1146 NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1147 void WINAPI RtlDumpResource(LPRTL_RWLOCK);
1148 NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
1150 LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
1151 ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
1152 UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
1153 NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
1154 void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
1155 NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
1156 NTSTATUS WINAPI RtlEqualDomainName(const UNICODE_STRING*,const UNICODE_STRING*);
1157 BOOLEAN WINAPI RtlEqualLuid(const LUID*,const LUID*);
1158 BOOL WINAPI RtlEqualPrefixSid(PSID,PSID);
1159 BOOL WINAPI RtlEqualSid(PSID,PSID);
1160 BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
1161 BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1162 NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*);
1163 LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
1164 LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
1165 LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
1167 NTSTATUS WINAPI RtlFindCharInUnicodeString(int,const UNICODE_STRING*,const UNICODE_STRING*,USHORT*);
1168 ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
1169 ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
1170 ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
1171 ULONG WINAPI RtlFindLastBackwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
1172 ULONG WINAPI RtlFindLastBackwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
1173 CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG);
1174 ULONG WINAPI RtlFindLongestRunSet(PCRTL_BITMAP,PULONG);
1175 ULONG WINAPI RtlFindLongestRunClear(PCRTL_BITMAP,PULONG);
1176 NTSTATUS WINAPI RtlFindMessage(HMODULE,ULONG,ULONG,ULONG,const MESSAGE_RESOURCE_ENTRY**);
1177 CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG);
1178 ULONG WINAPI RtlFindNextForwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
1179 ULONG WINAPI RtlFindNextForwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
1180 ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP,ULONG,ULONG);
1181 ULONG WINAPI RtlFindSetBitsAndClear(PRTL_BITMAP,ULONG,ULONG);
1182 ULONG WINAPI RtlFindSetRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
1183 BOOLEAN WINAPI RtlFirstFreeAce(PACL,PACE_HEADER *);
1184 NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING);
1185 void WINAPI RtlFreeAnsiString(PANSI_STRING);
1186 BOOLEAN WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
1187 void WINAPI RtlFreeOemString(POEM_STRING);
1188 DWORD WINAPI RtlFreeSid(PSID);
1189 void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
1191 DWORD WINAPI RtlGetAce(PACL,DWORD,LPVOID *);
1192 NTSTATUS WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
1193 NTSTATUS WINAPI RtlGetCurrentDirectory_U(ULONG, LPWSTR);
1194 NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
1195 ULONG WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*);
1196 NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
1197 DWORD WINAPI RtlGetLastWin32Error(void);
1198 DWORD WINAPI RtlGetLongestNtPathLength(void);
1199 BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
1200 NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
1201 ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
1202 NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
1203 NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
1205 PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
1206 PVOID WINAPI RtlImageDirectoryEntryToData(HMODULE,BOOL,WORD,ULONG *);
1207 PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE);
1208 PIMAGE_SECTION_HEADER WINAPI RtlImageRvaToSection(const IMAGE_NT_HEADERS *,HMODULE,DWORD);
1209 PVOID WINAPI RtlImageRvaToVa(const IMAGE_NT_HEADERS *,HMODULE,DWORD,IMAGE_SECTION_HEADER **);
1210 BOOL WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
1211 void WINAPI RtlInitString(PSTRING,PCSZ);
1212 void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
1213 void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
1214 NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
1215 NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
1216 NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,DWORD);
1217 void WINAPI RtlInitializeBitMap(PRTL_BITMAP,LPBYTE,ULONG);
1218 void WINAPI RtlInitializeResource(LPRTL_RWLOCK);
1219 BOOL WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
1221 NTSTATUS WINAPI RtlInt64ToUnicodeString(ULONGLONG,ULONG,UNICODE_STRING *);
1222 NTSTATUS WINAPI RtlIntegerToChar(ULONG,ULONG,ULONG,PCHAR);
1223 NTSTATUS WINAPI RtlIntegerToUnicodeString(ULONG,ULONG,UNICODE_STRING *);
1224 ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR);
1225 BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN);
1226 DWORD WINAPI RtlIsTextUnicode(LPVOID,DWORD,DWORD *);
1228 LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
1229 LONGLONG WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
1230 ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
1231 LONGLONG WINAPI RtlLargeIntegerNegate(LONGLONG);
1232 LONGLONG WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
1233 LONGLONG WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
1234 LONGLONG WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
1235 NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
1236 NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *);
1237 DWORD WINAPI RtlLengthRequiredSid(DWORD);
1238 ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR);
1239 DWORD WINAPI RtlLengthSid(PSID);
1240 NTSTATUS WINAPI RtlLocalTimeToSystemTime(const LARGE_INTEGER*,PLARGE_INTEGER);
1241 BOOLEAN WINAPI RtlLockHeap(HANDLE);
1243 NTSTATUS WINAPI RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
1244 void WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*);
1245 NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
1246 NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
1248 DWORD WINAPI RtlNewSecurityObject(DWORD,DWORD,DWORD,DWORD,DWORD,DWORD);
1249 PRTL_USER_PROCESS_PARAMETERS WINAPI RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
1250 ULONG WINAPI RtlNtStatusToDosError(NTSTATUS);
1251 ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS);
1252 ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP);
1253 ULONG WINAPI RtlNumberOfClearBits(PCRTL_BITMAP);
1255 UINT WINAPI RtlOemStringToUnicodeSize(const STRING*);
1256 NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
1257 NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
1258 DWORD WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHKEY);
1260 BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
1261 BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1263 NTSTATUS WINAPI RtlQueryEnvironmentVariable_U(PWSTR,PUNICODE_STRING,PUNICODE_STRING);
1264 NTSTATUS WINAPI RtlQueryInformationAcl(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
1265 NTSTATUS WINAPI RtlQueryTimeZoneInformation(LPTIME_ZONE_INFORMATION);
1267 void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
1268 void WINAPI RtlRaiseStatus(NTSTATUS);
1269 ULONG WINAPI RtlRandom(PULONG);
1270 PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,ULONG);
1271 void WINAPI RtlReleasePebLock(void);
1272 void WINAPI RtlReleaseResource(LPRTL_RWLOCK);
1273 ULONG WINAPI RtlRemoveVectoredExceptionHandler(PVOID);
1274 void WINAPI RtlRestoreLastWin32Error(DWORD);
1276 void WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *);
1277 void WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *);
1278 NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,
1279 PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD);
1280 void WINAPI RtlSetAllBits(PRTL_BITMAP);
1281 void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG);
1282 NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING*);
1283 void WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*);
1284 NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
1285 NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR*,PUNICODE_STRING,PUNICODE_STRING);
1286 NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
1287 NTSTATUS WINAPI RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
1288 void WINAPI RtlSetLastWin32Error(DWORD);
1289 NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
1290 NTSTATUS WINAPI RtlSetTimeZoneInformation(const TIME_ZONE_INFORMATION*);
1291 ULONG WINAPI RtlSizeHeap(HANDLE,ULONG,PVOID);
1292 LPDWORD WINAPI RtlSubAuthoritySid(PSID,DWORD);
1293 LPBYTE WINAPI RtlSubAuthorityCountSid(PSID);
1294 NTSTATUS WINAPI RtlSystemTimeToLocalTime(const LARGE_INTEGER*,PLARGE_INTEGER);
1296 void WINAPI RtlTimeToTimeFields(const LARGE_INTEGER*,PTIME_FIELDS);
1297 BOOLEAN WINAPI RtlTimeFieldsToTime(PTIME_FIELDS,PLARGE_INTEGER);
1298 void WINAPI RtlTimeToElapsedTimeFields(const LARGE_INTEGER *,PTIME_FIELDS);
1299 BOOLEAN WINAPI RtlTimeToSecondsSince1970(const LARGE_INTEGER *,LPDWORD);
1300 BOOLEAN WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *,LPDWORD);
1301 BOOL WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *);
1303 ULONGLONG __cdecl RtlUlonglongByteSwap(ULONGLONG);
1304 DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
1305 NTSTATUS WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING,PCUNICODE_STRING,BOOLEAN);
1306 NTSTATUS WINAPI RtlUnicodeStringToInteger(const UNICODE_STRING *,ULONG,ULONG *);
1307 DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
1308 NTSTATUS WINAPI RtlUnicodeStringToOemString(POEM_STRING,PCUNICODE_STRING,BOOLEAN);
1309 NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1310 NTSTATUS WINAPI RtlUnicodeToMultiByteSize(PULONG,PCWSTR,ULONG);
1311 NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1312 ULONG WINAPI RtlUniform(PULONG);
1313 BOOLEAN WINAPI RtlUnlockHeap(HANDLE);
1314 void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID);
1316 void WINAPI RtlUnwind2(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT);
1317 void WINAPI RtlUnwindEx(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
1319 WCHAR WINAPI RtlUpcaseUnicodeChar(WCHAR);
1320 NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
1321 NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
1322 NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
1323 NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
1324 NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1325 NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1326 CHAR WINAPI RtlUpperChar(CHAR);
1327 void WINAPI RtlUpperString(STRING *,const STRING *);
1329 NTSTATUS WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
1330 BOOLEAN WINAPI RtlValidAcl(PACL);
1331 BOOLEAN WINAPI RtlValidSid(PSID);
1332 BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
1333 NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
1335 NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
1337 NTSTATUS WINAPI RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION *);
1338 NTSTATUS WINAPI RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION *);
1340 /***********************************************************************
1344 #define InitializeObjectAttributes(p,n,a,r,s) \
1346 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
1347 (p)->RootDirectory = r; \
1348 (p)->Attributes = a; \
1349 (p)->ObjectName = n; \
1350 (p)->SecurityDescriptor = s; \
1351 (p)->SecurityQualityOfService = NULL; \
1354 #define NtCurrentProcess() ((HANDLE)-1)
1356 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
1357 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
1358 #define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1359 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1360 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
1361 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
1362 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
1364 inline static BOOLEAN RtlCheckBit(PCRTL_BITMAP lpBits, ULONG ulBit)
1366 if (lpBits && ulBit < lpBits->SizeOfBitMap &&
1367 lpBits->BitMapBuffer[ulBit >> 3] & (1 << (ulBit & 7)))
1372 #define RtlClearAllBits(p) \
1374 PRTL_BITMAP _p = (p); \
1375 memset(_p->BitMapBuffer,0,((_p->SizeOfBitMap + 31) & 0xffffffe0) >> 3); \
1378 #define RtlInitializeBitMap(p,b,s) \
1380 PRTL_BITMAP _p = (p); \
1381 _p->SizeOfBitMap = (s); \
1382 _p->BitMapBuffer = (b); \
1385 #define RtlSetAllBits(p) \
1387 PRTL_BITMAP _p = (p); \
1388 memset(_p->BitMapBuffer,0xff,((_p->SizeOfBitMap + 31) & 0xffffffe0) >> 3); \
1391 /* These are implemented as __fastcall, so we can't let Winelib apps link with them */
1392 inline static USHORT RtlUshortByteSwap(USHORT s)
1394 return (s >> 8) | (s << 8);
1396 inline static ULONG RtlUlongByteSwap(ULONG i)
1398 #if defined(__i386__) && defined(__GNUC__)
1400 __asm__("bswap %0" : "=r" (ret) : "0" (i) );
1403 return ((ULONG)RtlUshortByteSwap((USHORT)i) << 16) | RtlUshortByteSwap((USHORT)(i >> 16));
1407 /*************************************************************************
1408 * Loader functions and structures.
1410 * Those are not part of standard Winternl.h
1412 typedef struct _LDR_MODULE
1414 LIST_ENTRY InLoadOrderModuleList;
1415 LIST_ENTRY InMemoryOrderModuleList;
1416 LIST_ENTRY InInitializationOrderModuleList;
1420 UNICODE_STRING FullDllName;
1421 UNICODE_STRING BaseDllName;
1425 HANDLE SectionHandle;
1427 ULONG TimeDateStamp;
1428 } LDR_MODULE, *PLDR_MODULE;
1430 /* those defines are (some of the) regular LDR_MODULE.Flags values */
1431 #define LDR_IMAGE_IS_DLL 0x00000004
1432 #define LDR_LOAD_IN_PROGRESS 0x00001000
1433 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
1434 #define LDR_NO_DLL_CALLS 0x00040000
1435 #define LDR_PROCESS_ATTACHED 0x00080000
1436 #define LDR_MODULE_REBASED 0x00200000
1438 /* these ones is Wine specific */
1439 #define LDR_DONT_RESOLVE_REFS 0x40000000
1440 #define LDR_WINE_INTERNAL 0x80000000
1442 /* FIXME: to be checked */
1443 #define MAXIMUM_FILENAME_LENGTH 256
1445 typedef struct _SYSTEM_MODULE
1449 PVOID ImageBaseAddress;
1456 BYTE Name[MAXIMUM_FILENAME_LENGTH];
1457 } SYSTEM_MODULE, *PSYSTEM_MODULE;
1459 typedef struct _SYSTEM_MODULE_INFORMATION
1462 SYSTEM_MODULE Modules[1]; /* FIXME: should be Modules[0] */
1463 } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
1465 NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
1466 NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_MODULE*);
1467 NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG*);
1468 NTSTATUS WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*);
1469 NTSTATUS WINAPI LdrUnloadDll(HMODULE);
1470 NTSTATUS WINAPI LdrUnlockLoaderLock(ULONG,ULONG);
1472 /* list manipulation macros */
1473 #define InitializeListHead(le) (void)((le)->Flink = (le)->Blink = (le))
1474 #define InsertHeadList(le,e) do { PLIST_ENTRY f = (le)->Flink; (e)->Flink = f; (e)->Blink = (le); f->Blink = (e); (le)->Flink = (e); } while (0)
1475 #define InsertTailList(le,e) do { PLIST_ENTRY b = (le)->Blink; (e)->Flink = (le); (e)->Blink = b; b->Flink = (e); (le)->Blink = (e); } while (0)
1476 #define IsListEmpty(le) ((le)->Flink == (le))
1477 #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)
1478 static inline PLIST_ENTRY RemoveHeadList(PLIST_ENTRY le)
1480 PLIST_ENTRY f, b, e;
1483 f = le->Flink->Flink;
1484 b = le->Flink->Blink;
1488 if (e != le) e->Flink = e->Blink = NULL;
1491 static inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le)
1493 PLIST_ENTRY f, b, e;
1496 f = le->Blink->Flink;
1497 b = le->Blink->Blink;
1501 if (e != le) e->Flink = e->Blink = NULL;
1507 #endif /* defined(__cplusplus) */
1509 #endif /* __WINE_WINTERNAL_H */