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 _RTL_USER_PROCESS_PARAMETERS
95 UNICODE_STRING CurrentDirectoryName
;
96 HANDLE CurrentDirectoryHandle
;
97 UNICODE_STRING DllPath
;
98 UNICODE_STRING ImagePathName
;
99 UNICODE_STRING CommandLine
;
107 ULONG dwFillAttribute
;
110 UNICODE_STRING WindowTitle
;
111 UNICODE_STRING Desktop
;
112 UNICODE_STRING ShellInfo
;
113 UNICODE_STRING RuntimeInfo
;
114 RTL_DRIVE_LETTER_CURDIR DLCurrentDirectory
[0x20];
115 } RTL_USER_PROCESS_PARAMETERS
, *PRTL_USER_PROCESS_PARAMETERS
;
117 /* value for Flags field (FIXME: not the correct name) */
118 #define PROCESS_PARAMS_FLAG_NORMALIZED 1
120 typedef struct _PEB_LDR_DATA
125 LIST_ENTRY InLoadOrderModuleList
;
126 LIST_ENTRY InMemoryOrderModuleList
;
127 LIST_ENTRY InInitializationOrderModuleList
;
128 } PEB_LDR_DATA
, *PPEB_LDR_DATA
;
130 /***********************************************************************
135 BYTE Reserved1
[2]; /* 00 */
136 BYTE BeingDebugged
; /* 02 */
137 BYTE Reserved2
[5]; /* 03 */
138 HMODULE ImageBaseAddress
; /* 08 */
139 PPEB_LDR_DATA LdrData
; /* 0c */
140 RTL_USER_PROCESS_PARAMETERS
*ProcessParameters
; /* 10 */
141 PVOID __pad_14
; /* 14 */
142 HANDLE ProcessHeap
; /* 18 */
143 BYTE __pad_1c
[204]; /* 1c */
144 PVOID Reserved3
[59]; /* e8 */
145 ULONG SessionId
; /* 1d4 */
149 /***********************************************************************
152 #if defined(_NTSYSTEM_) || defined(_KERNEL32_) /* hack, should go away */
156 #ifndef WINE_NO_TEB /* don't define TEB if included from thread.h */
157 # ifndef WINE_TEB_DEFINED
158 # define WINE_TEB_DEFINED
161 NT_TIB Tib
; /* 000 */
162 PVOID EnvironmentPointer
; /* 01c */
163 CLIENT_ID ClientId
; /* 020 */
164 PVOID ActiveRpcHandle
; /* 028 */
165 PVOID ThreadLocalStoragePointer
; /* 02c */
167 ULONG LastErrorValue
; /* 034 */
168 BYTE __pad038
[140]; /* 038 */
169 ULONG CurrentLocale
; /* 0c4 */
170 BYTE __pad0c8
[1752]; /* 0c8 */
171 PVOID Reserved2
[278]; /* 7a0 */
172 UNICODE_STRING StaticUnicodeString
; /* bf8 used by advapi32 */
173 WCHAR StaticUnicodeBuffer
[261]; /* c00 used by advapi32 */
174 PVOID DeallocationStack
; /* e0c */
175 PVOID TlsSlots
[64]; /* e10 */
176 LIST_ENTRY TlsLinks
; /* f10 */
177 PVOID Reserved4
[26]; /* f18 */
178 PVOID ReservedForOle
; /* f80 Windows 2000 only */
179 PVOID Reserved5
[4]; /* f84 */
180 PVOID TlsExpansionSlots
; /* f94 */
182 # endif /* WINE_TEB_DEFINED */
183 #endif /* WINE_NO_TEB */
185 /***********************************************************************
189 typedef enum _FILE_INFORMATION_CLASS
{
190 FileDirectoryInformation
= 1,
191 FileFullDirectoryInformation
,
192 FileBothDirectoryInformation
,
193 FileBasicInformation
,
194 FileStandardInformation
,
195 FileInternalInformation
,
197 FileAccessInformation
,
199 FileRenameInformation
,
201 FileNamesInformation
,
202 FileDispositionInformation
,
203 FilePositionInformation
,
204 FileFullEaInformation
,
206 FileAlignmentInformation
,
208 FileAllocationInformation
,
209 FileEndOfFileInformation
,
210 FileAlternateNameInformation
,
211 FileStreamInformation
,
213 FilePipeLocalInformation
,
214 FilePipeRemoteInformation
,
215 FileMailslotQueryInformation
,
216 FileMailslotSetInformation
,
217 FileCompressionInformation
,
218 FileObjectIdInformation
,
219 FileCompletionInformation
,
220 FileMoveClusterInformation
,
221 FileQuotaInformation
,
222 FileReparsePointInformation
,
223 FileNetworkOpenInformation
,
224 FileAttributeTagInformation
,
225 FileTrackingInformation
,
226 FileMaximumInformation
227 } FILE_INFORMATION_CLASS
, *PFILE_INFORMATION_CLASS
;
229 typedef struct _FILE_BASIC_INFORMATION
{
230 LARGE_INTEGER CreationTime
;
231 LARGE_INTEGER LastAccessTime
;
232 LARGE_INTEGER LastWriteTime
;
233 LARGE_INTEGER ChangeTime
;
234 ULONG FileAttributes
;
235 } FILE_BASIC_INFORMATION
, *PFILE_BASIC_INFORMATION
;
237 typedef struct _FILE_STANDARD_INFORMATION
{
238 LARGE_INTEGER AllocationSize
;
239 LARGE_INTEGER EndOfFile
;
241 BOOLEAN DeletePending
;
243 } FILE_STANDARD_INFORMATION
, *PFILE_STANDARD_INFORMATION
;
245 typedef struct _FILE_POSITION_INFORMATION
{
246 LARGE_INTEGER CurrentByteOffset
;
247 } FILE_POSITION_INFORMATION
, *PFILE_POSITION_INFORMATION
;
249 typedef struct _FILE_ALIGNMENT_INFORMATION
{
250 ULONG AlignmentRequirement
;
251 } FILE_ALIGNMENT_INFORMATION
, *PFILE_ALIGNMENT_INFORMATION
;
253 typedef struct _FILE_NETWORK_OPEN_INFORMATION
{
254 LARGE_INTEGER CreationTime
;
255 LARGE_INTEGER LastAccessTime
;
256 LARGE_INTEGER LastWriteTime
;
257 LARGE_INTEGER ChangeTime
;
258 LARGE_INTEGER AllocationSize
;
259 LARGE_INTEGER EndOfFile
;
260 ULONG FileAttributes
;
261 } FILE_NETWORK_OPEN_INFORMATION
, *PFILE_NETWORK_OPEN_INFORMATION
;
263 typedef struct _FILE_FULL_EA_INFORMATION
{
264 ULONG NextEntryOffset
;
267 USHORT EaValueLength
;
269 } FILE_FULL_EA_INFORMATION
, *PFILE_FULL_EA_INFORMATION
;
271 typedef struct _FILE_STREAM_INFORMATION
273 ULONG NextEntryOffset
;
274 ULONG StreamNameLength
;
275 LARGE_INTEGER StreamSize
;
276 LARGE_INTEGER StreamAllocationSize
;
278 } FILE_STREAM_INFORMATION
, *PFILE_STREAM_INFORMATION
;
280 struct _FILE_ATTRIBUTE_TAG_INFORMATION
282 ULONG FileAttributes
;
284 } FILE_ATTRIBUTE_TAG_INFORMATION
, *PFILE_ATTRIBUTE_TAG_INFORMATION
;
286 typedef enum _FSINFOCLASS
{
287 FileFsVolumeInformation
= 1,
288 FileFsLabelInformation
,
289 FileFsSizeInformation
,
290 FileFsDeviceInformation
,
291 FileFsAttributeInformation
,
292 FileFsControlInformation
,
293 FileFsFullSizeInformation
,
294 FileFsObjectIdInformation
,
295 FileFsMaximumInformation
296 } FS_INFORMATION_CLASS
, *PFS_INFORMATION_CLASS
;
298 typedef enum _KEY_INFORMATION_CLASS
{
302 } KEY_INFORMATION_CLASS
;
304 typedef enum _KEY_VALUE_INFORMATION_CLASS
{
305 KeyValueBasicInformation
,
306 KeyValueFullInformation
,
307 KeyValuePartialInformation
,
308 KeyValueFullInformationAlign64
,
309 KeyValuePartialInformationAlign64
310 } KEY_VALUE_INFORMATION_CLASS
;
312 typedef enum _OBJECT_INFORMATION_CLASS
{
313 ObjectBasicInformation
,
314 ObjectNameInformation
,
315 ObjectTypeInformation
,
316 ObjectAllInformation
,
317 ObjectDataInformation
318 } OBJECT_INFORMATION_CLASS
, *POBJECT_INFORMATION_CLASS
;
320 typedef enum _PROCESSINFOCLASS
{
321 ProcessBasicInformation
= 0,
322 ProcessQuotaLimits
= 1,
323 ProcessIoCounters
= 2,
324 ProcessVmCounters
= 3,
326 ProcessBasePriority
= 5,
327 ProcessRaisePriority
= 6,
328 ProcessDebugPort
= 7,
329 ProcessExceptionPort
= 8,
330 ProcessAccessToken
= 9,
331 ProcessLdtInformation
= 10,
333 ProcessDefaultHardErrorMode
= 12,
334 ProcessIoPortHandlers
= 13,
335 ProcessPooledUsageAndLimits
= 14,
336 ProcessWorkingSetWatch
= 15,
337 ProcessUserModeIOPL
= 16,
338 ProcessEnableAlignmentFaultFixup
= 17,
339 ProcessPriorityClass
= 18,
340 ProcessWx86Information
= 19,
341 ProcessHandleCount
= 20,
342 ProcessAffinityMask
= 21,
343 ProcessPriorityBoost
= 22,
344 ProcessDeviceMap
= 23,
345 ProcessSessionInformation
= 24,
346 ProcessForegroundInformation
= 25,
347 ProcessWow64Information
= 26,
351 typedef enum _SECTION_INHERIT
{
356 typedef enum SYSTEM_INFORMATION_CLASS
{
357 SystemBasicInformation
= 0,
359 SystemPerformanceInformation
= 2,
360 SystemTimeOfDayInformation
= 3, /* was SystemTimeInformation */
362 SystemProcessInformation
= 5,
365 SystemProcessorPerformanceInformation
= 8,
368 SystemDriverInformation
,
378 SystemCacheInformation
,
380 SystemInterruptInformation
= 23,
381 SystemExceptionInformation
= 33,
382 SystemRegistryQuotaInformation
= 37,
383 SystemLookasideInformation
= 45
384 } SYSTEM_INFORMATION_CLASS
, *PSYSTEM_INFORMATION_CLASS
;
386 typedef enum _TIMER_TYPE
{
391 typedef enum _THREADINFOCLASS
{
392 ThreadBasicInformation
,
397 ThreadImpersonationToken
,
398 ThreadDescriptorTableEntry
,
399 ThreadEnableAlignmentFaultFixup
,
400 ThreadEventPair_Reusable
,
401 ThreadQuerySetWin32StartAddress
,
403 ThreadPerformanceCount
,
405 ThreadIdealProcessor
,
407 ThreadSetTlsArrayAddress
,
412 typedef struct _THREAD_BASIC_INFORMATION
415 PVOID TebBaseAddress
;
420 } THREAD_BASIC_INFORMATION
, *PTHREAD_BASIC_INFORMATION
;
423 typedef enum _WINSTATIONINFOCLASS
{
424 WinStationInformation
= 8
425 } WINSTATIONINFOCLASS
;
429 MemoryBasicInformation
= 0
430 } MEMORY_INFORMATION_CLASS
;
432 /* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
436 UNC_PATH
, /* "//foo" */
437 ABSOLUTE_DRIVE_PATH
, /* "c:/foo" */
438 RELATIVE_DRIVE_PATH
, /* "c:foo" */
439 ABSOLUTE_PATH
, /* "/foo" */
440 RELATIVE_PATH
, /* "foo" */
441 DEVICE_PATH
, /* "//./foo" */
442 UNC_DOT_PATH
/* "//." */
445 /***********************************************************************
446 * IA64 specific types and data structures
451 typedef struct _FRAME_POINTERS
{
452 ULONGLONG MemoryStackFp
;
453 ULONGLONG BackingStoreFp
;
454 } FRAME_POINTERS
, *PFRAME_POINTERS
;
456 #define UNWIND_HISTORY_TABLE_SIZE 12
458 typedef struct _RUNTIME_FUNCTION
{
461 ULONG UnwindInfoAddress
;
462 } RUNTIME_FUNCTION
, *PRUNTIME_FUNCTION
;
464 typedef struct _UNWIND_HISTORY_TABLE_ENTRY
{
467 PRUNTIME_FUNCTION FunctionEntry
;
468 } UNWIND_HISTORY_TABLE_ENTRY
, *PUNWIND_HISTORY_TABLE_ENTRY
;
470 typedef struct _UNWIND_HISTORY_TABLE
{
475 UNWIND_HISTORY_TABLE_ENTRY Entry
[UNWIND_HISTORY_TABLE_SIZE
];
476 } UNWIND_HISTORY_TABLE
, *PUNWIND_HISTORY_TABLE
;
478 #endif /* defined(__ia64__) */
480 /***********************************************************************
481 * Types and data structures
484 /* This is used by NtQuerySystemInformation */
485 /* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
487 FILETIME ftKernelTime
;
489 FILETIME ftCreateTime
;
491 DWORD dwStartAddress
;
494 DWORD dwCurrentPriority
;
495 DWORD dwBasePriority
;
496 DWORD dwContextSwitches
;
499 } THREADINFO
, *PTHREADINFO
;
501 /* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
502 typedef struct _THREAD_INFO
{
509 } THREAD_INFO
, PTHREAD_INFO
;
511 /***********************************************************************
512 * Types and data structures
515 typedef struct _IO_STATUS_BLOCK
{
521 ULONG_PTR Information
;
522 } IO_STATUS_BLOCK
, *PIO_STATUS_BLOCK
;
524 typedef void (WINAPI
* PIO_APC_ROUTINE
)(PVOID
,PIO_STATUS_BLOCK
,ULONG
);
526 typedef struct _KEY_BASIC_INFORMATION
{
527 LARGE_INTEGER LastWriteTime
;
531 } KEY_BASIC_INFORMATION
, *PKEY_BASIC_INFORMATION
;
533 typedef struct _KEY_NODE_INFORMATION
535 LARGE_INTEGER LastWriteTime
;
542 } KEY_NODE_INFORMATION
, *PKEY_NODE_INFORMATION
;
544 typedef struct _KEY_FULL_INFORMATION
546 LARGE_INTEGER LastWriteTime
;
554 ULONG MaxValueNameLen
;
555 ULONG MaxValueDataLen
;
557 } KEY_FULL_INFORMATION
, *PKEY_FULL_INFORMATION
;
559 typedef struct _KEY_VALUE_ENTRY
561 PUNICODE_STRING ValueName
;
565 } KEY_VALUE_ENTRY
, *PKEY_VALUE_ENTRY
;
567 typedef struct _KEY_VALUE_BASIC_INFORMATION
{
572 } KEY_VALUE_BASIC_INFORMATION
, *PKEY_VALUE_BASIC_INFORMATION
;
574 typedef struct _KEY_VALUE_FULL_INFORMATION
{
581 } KEY_VALUE_FULL_INFORMATION
, *PKEY_VALUE_FULL_INFORMATION
;
583 typedef struct _KEY_VALUE_PARTIAL_INFORMATION
{
588 } KEY_VALUE_PARTIAL_INFORMATION
, *PKEY_VALUE_PARTIAL_INFORMATION
;
590 typedef struct _OBJECT_ATTRIBUTES
{
592 HANDLE RootDirectory
;
593 PUNICODE_STRING ObjectName
;
595 PVOID SecurityDescriptor
; /* type SECURITY_DESCRIPTOR */
596 PVOID SecurityQualityOfService
; /* type SECURITY_QUALITY_OF_SERVICE */
597 } OBJECT_ATTRIBUTES
, *POBJECT_ATTRIBUTES
;
599 typedef struct _OBJECT_DATA_INFORMATION
{
600 BOOLEAN InheritHandle
;
601 BOOLEAN ProtectFromClose
;
602 } OBJECT_DATA_INFORMATION
, *POBJECT_DATA_INFORMATION
;
604 typedef struct _PROCESS_BASIC_INFORMATION
{
607 DWORD PebBaseAddress
;
610 ULONG UniqueProcessId
;
611 ULONG InheritedFromUniqueProcessId
;
616 ULONG_PTR UniqueProcessId
;
619 } PROCESS_BASIC_INFORMATION
, *PPROCESS_BASIC_INFORMATION
;
621 typedef struct _PROCESS_INFO
{
622 DWORD Offset
; /* 00 offset to next PROCESS_INFO ok*/
623 DWORD ThreadCount
; /* 04 number of ThreadInfo member ok */
625 FILETIME CreationTime
; /* 20 */
627 PWCHAR ProcessName
; /* 3c ok */
629 DWORD ProcessID
; /* 44 ok*/
630 DWORD ParentProcessID
;
632 DWORD Unknown3
[2]; /* 50 */
633 ULONG PeakVirtualSize
;
635 ULONG PageFaultCount
;
636 ULONG PeakWorkingSetSize
;
637 ULONG WorkingSetSize
;
638 ULONG QuotaPeakPagedPoolUsage
;
639 ULONG QuotaPagedPoolUsage
;
640 ULONG QuotaPeakNonPagedPoolUsage
;
641 ULONG QuotaNonPagedPoolUsage
;
643 ULONG PeakPagefileUsage
;
646 THREAD_INFO ati
[ANYSIZE_ARRAY
]; /* 94 size=0x40*/
647 } PROCESS_INFO
, PPROCESS_INFO
;
649 typedef struct _RTL_HEAP_DEFINITION
{
650 ULONG Length
; /* = sizeof(RTL_HEAP_DEFINITION) */
653 } RTL_HEAP_DEFINITION
, *PRTL_HEAP_DEFINITION
;
655 typedef struct tagRTL_BITMAP
{
656 ULONG SizeOfBitMap
; /* Number of bits in the bitmap */
657 LPBYTE BitMapBuffer
; /* Bitmap data, assumed sized to a DWORD boundary */
658 } RTL_BITMAP
, *PRTL_BITMAP
;
660 typedef const RTL_BITMAP
*PCRTL_BITMAP
;
662 typedef struct tagRTL_BITMAP_RUN
{
663 ULONG StartOfRun
; /* Bit position at which run starts - FIXME: Name? */
664 ULONG SizeOfRun
; /* Size of the run in bits - FIXME: Name? */
665 } RTL_BITMAP_RUN
, *PRTL_BITMAP_RUN
;
667 typedef const RTL_BITMAP_RUN
*PCRTL_BITMAP_RUN
;
669 typedef struct _RTL_RWLOCK
{
670 RTL_CRITICAL_SECTION rtlCS
;
672 HANDLE hSharedReleaseSemaphore
;
675 HANDLE hExclusiveReleaseSemaphore
;
676 UINT uExclusiveWaiters
;
679 HANDLE hOwningThreadId
;
680 DWORD dwTimeoutBoost
;
682 } RTL_RWLOCK
, *LPRTL_RWLOCK
;
684 /* System Information Class 0x00 */
685 typedef struct _SYSTEM_BASIC_INFORMATION
{
688 ULONG uKeMaximumIncrement
;
690 ULONG uMmNumberOfPhysicalPages
;
691 ULONG uMmLowestPhysicalPage
;
692 ULONG uMmHighestPhysicalPage
;
693 ULONG uAllocationGranularity
;
694 PVOID pLowestUserAddress
;
695 PVOID pMmHighestUserAddress
;
696 ULONG uKeActiveProcessors
;
697 BYTE bKeNumberProcessors
;
703 CCHAR NumberOfProcessors
;
705 } SYSTEM_BASIC_INFORMATION
, *PSYSTEM_BASIC_INFORMATION
;
707 /* System Information Class 0x15 */
711 ULONG PageFaultCount
;
712 ULONG MinimumWorkingSet
;
713 ULONG MaximumWorkingSet
;
715 } SYSTEM_CACHE_INFORMATION
;
717 typedef struct _SYSTEM_CONFIGURATION_INFO
{
721 WORD ProcessorArchitecture
;
726 PVOID MinimumApplicationAddress
;
727 PVOID MaximumApplicationAddress
;
728 ULONG ActiveProcessorMask
;
729 ULONG NumberOfProcessors
;
731 ULONG AllocationGranularity
;
733 WORD ProcessorRevision
;
734 } SYSTEM_CONFIGURATION_INFO
, *PSYSTEM_CONFIGURATION_INFO
;
736 /* System Information Class 0x0b */
743 char szName
[MAX_PATH
+ 1];
744 } SYSTEM_DRIVER_INFORMATION
;
746 typedef struct _SYSTEM_EXCEPTION_INFORMATION
{
748 } SYSTEM_EXCEPTION_INFORMATION
, *PSYSTEM_EXCEPTION_INFORMATION
;
750 typedef struct _SYSTEM_LOOKASIDE_INFORMATION
{
752 } SYSTEM_LOOKASIDE_INFORMATION
, *PSYSTEM_LOOKASIDE_INFORMATION
;
754 typedef struct _SYSTEM_INTERRUPT_INFORMATION
{
756 } SYSTEM_INTERRUPT_INFORMATION
, *PSYSTEM_INTERRUPT_INFORMATION
;
758 /* System Information Class 0x10 */
761 USHORT dwCreatorBackTraceIndex
;
763 BYTE bHandleAttributes
;
764 USHORT usHandleOffset
;
766 ULONG ulGrantedAccess
;
767 } HANDLEINFO
, *PHANDLEINFO
; /* FIXME: SYSTEM_HANDLE_INFORMATION? */
769 typedef struct _SYSTEM_PERFORMANCE_INFORMATION
{
771 } SYSTEM_PERFORMANCE_INFORMATION
, *PSYSTEM_PERFORMANCE_INFORMATION
;
773 /* System Information Class 0x02 */
774 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
{
776 LARGE_INTEGER liIdleTime
;
779 LARGE_INTEGER IdleTime
;
780 LARGE_INTEGER KernelTime
;
781 LARGE_INTEGER UserTime
;
782 LARGE_INTEGER Reserved1
[2];
785 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
;
787 /* System Information Class 0x05 */
788 typedef struct _SYSTEM_PROCESS_INFORMATION
{
793 FILETIME ftCreationTime
;
795 WCHAR
*pszProcessName
;
796 DWORD dwBasePriority
;
798 DWORD dwParentProcessID
;
802 DWORD dwVirtualBytesPeak
;
803 DWORD dwVirtualBytes
;
805 DWORD dwWorkingSetPeak
;
810 DWORD dwNonPagedPool
;
811 DWORD dwPageFileBytesPeak
;
812 DWORD dwPrivateBytes
;
813 DWORD dwPageFileBytes
;
817 ULONG NextEntryOffset
;
820 HANDLE UniqueProcessId
;
825 SIZE_T PeakPagefileUsage
;
826 SIZE_T PrivatePageCount
;
827 LARGE_INTEGER Reserved6
[6];
829 } SYSTEM_PROCESS_INFORMATION
, *PSYSTEM_PROCESS_INFORMATION
;
831 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION
{
832 ULONG RegistryQuotaAllowed
;
833 ULONG RegistryQuotaUsed
;
835 } SYSTEM_REGISTRY_QUOTA_INFORMATION
, *PSYSTEM_REGISTRY_QUOTA_INFORMATION
;
837 typedef struct _SYSTEM_TIME_ADJUSTMENT
{
838 ULONG TimeAdjustment
;
839 BOOLEAN TimeAdjustmentDisabled
;
840 } SYSTEM_TIME_ADJUSTMENT
, *PSYSTEM_TIME_ADJUSTMENT
;
842 /* System Information Class 0x03 */
843 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION
{
845 LARGE_INTEGER liKeBootTime
;
846 LARGE_INTEGER liKeSystemTime
;
847 LARGE_INTEGER liExpTimeZoneBias
;
848 ULONG uCurrentTimeZoneId
;
853 } SYSTEM_TIMEOFDAY_INFORMATION
, *PSYSTEM_TIMEOFDAY_INFORMATION
; /* was SYSTEM_TIME_INFORMATION */
855 typedef struct _TIME_FIELDS
864 } TIME_FIELDS
, *PTIME_FIELDS
;
866 typedef struct _WINSTATIONINFORMATIONW
{
869 BYTE Reserved3
[1140];
870 } WINSTATIONINFORMATIONW
, *PWINSTATIONINFORMATIONW
;
872 typedef struct _VM_COUNTERS_
{
873 ULONG PeakVirtualSize
;
875 ULONG PageFaultCount
;
876 ULONG PeakWorkingSetSize
;
877 ULONG WorkingSetSize
;
878 ULONG QuotaPeakPagedPoolUsage
;
879 ULONG QuotaPagedPoolUsage
;
880 ULONG QuotaPeakNonPagedPoolUsage
;
881 ULONG QuotaNonPagedPoolUsage
;
883 ULONG PeakPagefileUsage
;
884 } VM_COUNTERS
, *PVM_COUNTERS
;
886 typedef BOOLEAN (WINAPI
* PWINSTATIONQUERYINFORMATIONW
)(HANDLE
,ULONG
,WINSTATIONINFOCLASS
,PVOID
,ULONG
,PULONG
);
888 typedef struct _LDR_RESOURCE_INFO
893 } LDR_RESOURCE_INFO
, *PLDR_RESOURCE_INFO
;
895 /***********************************************************************
899 /* flags for NtCreateFile and NtOpenFile */
900 #define FILE_DIRECTORY_FLAG 0x00000001
901 #define FILE_WRITE_THROUGH 0x00000002
902 #define FILE_SEQUENTIAL_ONLY 0x00000004
903 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
904 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
905 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
906 #define FILE_NON_DIRECTORY_FILE 0x00000040
907 #define FILE_CREATE_TREE_CONNECTION 0x00000080
909 /* status for NtCreateFile or NtOpenFile */
910 #define FILE_SUPERSEDED 0x00000000
911 #define FILE_OPENED 0x00000001
912 #define FILE_CREATED 0x00000002
913 #define FILE_OVERWRITTEN 0x00000003
914 #define FILE_EXISTS 0x00000004
915 #define FILE_DOES_NOT_EXIST 0x00000005
917 #if (_WIN32_WINNT >= 0x0501)
918 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
919 #endif /* (_WIN32_WINNT >= 0x0501) */
921 #define LOGONID_CURRENT ((ULONG)-1)
923 #define OBJ_INHERIT 0x00000002L
924 #define OBJ_PERMANENT 0x00000010L
925 #define OBJ_EXCLUSIVE 0x00000020L
926 #define OBJ_CASE_INSENSITIVE 0x00000040L
927 #define OBJ_OPENIF 0x00000080L
928 #define OBJ_OPENLINK 0x00000100L
929 #define OBJ_KERNEL_HANDLE 0x00000200L
930 #define OBJ_VALID_ATTRIBUTES 0x000003F2L
932 #define SERVERNAME_CURRENT ((HANDLE)NULL)
934 typedef void (CALLBACK
*PNTAPCFUNC
)(ULONG_PTR
,ULONG_PTR
,ULONG_PTR
); /* FIXME: not the right name */
936 /***********************************************************************
937 * Function declarations
940 extern LPSTR
_strlwr(LPSTR str
); /* FIXME: Doesn't belong here */
941 extern LPSTR
_strupr(LPSTR str
); /* FIXME: Doesn't belong here */
943 #if defined(__i386__) && defined(__GNUC__)
944 static inline void WINAPI
DbgBreakPoint(void) { __asm__
__volatile__("int3"); }
945 static inline void WINAPI
DbgUserBreakPoint(void) { __asm__
__volatile__("int3"); }
946 #else /* __i386__ && __GNUC__ */
947 void WINAPI
DbgBreakPoint(void);
948 void WINAPI
DbgUserBreakPoint(void);
949 #endif /* __i386__ && __GNUC__ */
950 void WINAPIV
DbgPrint(LPCSTR fmt
, ...);
952 NTSTATUS WINAPI
LdrAccessResource(HMODULE
,const IMAGE_RESOURCE_DATA_ENTRY
*,void**,PULONG
);
953 NTSTATUS WINAPI
LdrFindResourceDirectory_U(HMODULE
,const LDR_RESOURCE_INFO
*,ULONG
,const IMAGE_RESOURCE_DIRECTORY
**);
954 NTSTATUS WINAPI
LdrFindResource_U(HMODULE
,const LDR_RESOURCE_INFO
*,ULONG
,const IMAGE_RESOURCE_DATA_ENTRY
**);
955 NTSTATUS WINAPI
LdrGetDllHandle(ULONG
, ULONG
, const UNICODE_STRING
*, HMODULE
*);
956 NTSTATUS WINAPI
LdrGetProcedureAddress(HMODULE
, const ANSI_STRING
*, ULONG
, void**);
957 void WINAPI
LdrInitializeThunk(HANDLE
,ULONG
,ULONG
,ULONG
);
958 NTSTATUS WINAPI
LdrLoadDll(LPCWSTR
, DWORD
, const UNICODE_STRING
*, HMODULE
*);
959 void WINAPI
LdrShutdownProcess(void);
960 void WINAPI
LdrShutdownThread(void);
961 NTSTATUS WINAPI
NtAccessCheck(PSECURITY_DESCRIPTOR
,HANDLE
,ACCESS_MASK
,PGENERIC_MAPPING
,PPRIVILEGE_SET
,PULONG
,PULONG
,PBOOLEAN
);
962 NTSTATUS WINAPI
NtAdjustPrivilegesToken(HANDLE
,BOOLEAN
,PTOKEN_PRIVILEGES
,DWORD
,PTOKEN_PRIVILEGES
,PDWORD
);
963 NTSTATUS WINAPI
NtAllocateVirtualMemory(HANDLE
,PVOID
*,PVOID
,ULONG
*,ULONG
,ULONG
);
964 NTSTATUS WINAPI
NtCancelTimer(HANDLE
, BOOLEAN
*);
965 NTSTATUS WINAPI
NtClearEvent(HANDLE
);
966 NTSTATUS WINAPI
NtClose(HANDLE
);
967 NTSTATUS WINAPI
NtCreateEvent(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,BOOLEAN
,BOOLEAN
);
968 NTSTATUS WINAPI
NtCreateFile(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
,PIO_STATUS_BLOCK
,PLARGE_INTEGER
,ULONG
,ULONG
,ULONG
,ULONG
,PVOID
,ULONG
);
969 NTSTATUS WINAPI
NtCreateKey(PHKEY
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,ULONG
,const UNICODE_STRING
*,ULONG
,PULONG
);
970 NTSTATUS WINAPI
NtCreateSection(HANDLE
*,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,const LARGE_INTEGER
*,ULONG
,ULONG
,HANDLE
);
971 NTSTATUS WINAPI
NtCreateSemaphore(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,ULONG
,ULONG
);
972 NTSTATUS WINAPI
NtCreateTimer(HANDLE
*, ACCESS_MASK
, const OBJECT_ATTRIBUTES
*, TIMER_TYPE
);
973 NTSTATUS WINAPI
NtDelayExecution(BOOLEAN
,const LARGE_INTEGER
*);
974 NTSTATUS WINAPI
NtDeleteKey(HKEY
);
975 NTSTATUS WINAPI
NtDeleteValueKey(HKEY
,const UNICODE_STRING
*);
976 NTSTATUS WINAPI
NtDeviceIoControlFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,ULONG
,PVOID
,ULONG
,PVOID
,ULONG
);
977 NTSTATUS WINAPI
NtDuplicateObject(HANDLE
,HANDLE
,HANDLE
,PHANDLE
,ACCESS_MASK
,ULONG
,ULONG
);
978 NTSTATUS WINAPI
NtEnumerateKey(HKEY
,ULONG
,KEY_INFORMATION_CLASS
,void *,DWORD
,DWORD
*);
979 NTSTATUS WINAPI
NtEnumerateValueKey(HKEY
,ULONG
,KEY_VALUE_INFORMATION_CLASS
,PVOID
,ULONG
,PULONG
);
980 NTSTATUS WINAPI
NtFlushBuffersFile(HANDLE
,IO_STATUS_BLOCK
*);
981 NTSTATUS WINAPI
NtFlushKey(HKEY
);
982 NTSTATUS WINAPI
NtFlushVirtualMemory(HANDLE
,LPCVOID
*,ULONG
*,ULONG
);
983 NTSTATUS WINAPI
NtFreeVirtualMemory(HANDLE
,PVOID
*,ULONG
*,ULONG
);
984 NTSTATUS WINAPI
NtGetContextThread(HANDLE
,CONTEXT
*);
985 NTSTATUS WINAPI
NtLoadKey(const OBJECT_ATTRIBUTES
*,const OBJECT_ATTRIBUTES
*);
986 NTSTATUS WINAPI
NtLockFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,void*,PIO_STATUS_BLOCK
,PLARGE_INTEGER
,PLARGE_INTEGER
,ULONG
*,BOOLEAN
,BOOLEAN
);
987 NTSTATUS WINAPI
NtLockVirtualMemory(HANDLE
,PVOID
*,ULONG
*,ULONG
);
988 NTSTATUS WINAPI
NtMapViewOfSection(HANDLE
,HANDLE
,PVOID
*,ULONG
,ULONG
,const LARGE_INTEGER
*,ULONG
*,SECTION_INHERIT
,ULONG
,ULONG
);
989 NTSTATUS WINAPI
NtNotifyChangeKey(HKEY
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,ULONG
,BOOLEAN
,PVOID
,ULONG
,BOOLEAN
);
990 NTSTATUS WINAPI
NtOpenEvent(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*);
991 NTSTATUS WINAPI
NtOpenFile(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
,PIO_STATUS_BLOCK
,ULONG
,ULONG
);
992 NTSTATUS WINAPI
NtOpenKey(PHKEY
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*);
993 NTSTATUS WINAPI
NtOpenProcessToken(HANDLE
,DWORD
,HANDLE
*);
994 NTSTATUS WINAPI
NtOpenSection(HANDLE
*,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*);
995 NTSTATUS WINAPI
NtOpenThread(HANDLE
*,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,const CLIENT_ID
*);
996 NTSTATUS WINAPI
NtOpenThreadToken(HANDLE
,DWORD
,BOOLEAN
,HANDLE
*);
997 NTSTATUS WINAPI
NtOpenTimer(HANDLE
*, ACCESS_MASK
, const OBJECT_ATTRIBUTES
*);
998 NTSTATUS WINAPI
NtProtectVirtualMemory(HANDLE
,PVOID
*,ULONG
*,ULONG
,ULONG
*);
999 NTSTATUS WINAPI
NtPulseEvent(HANDLE
,PULONG
);
1000 NTSTATUS WINAPI
NtQueueApcThread(HANDLE
,PNTAPCFUNC
,ULONG_PTR
,ULONG_PTR
,ULONG_PTR
);
1001 NTSTATUS WINAPI
NtQueryDefaultLocale(BOOLEAN
,LCID
*);
1002 NTSTATUS WINAPI
NtQueryInformationFile(HANDLE
,PIO_STATUS_BLOCK
,PVOID
,LONG
,FILE_INFORMATION_CLASS
);
1003 NTSTATUS WINAPI
NtQueryInformationProcess(HANDLE
,PROCESSINFOCLASS
,PVOID
,ULONG
,PULONG
);
1004 NTSTATUS WINAPI
NtQueryInformationThread(HANDLE
,THREADINFOCLASS
,PVOID
,ULONG
,PULONG
);
1005 NTSTATUS WINAPI
NtQueryInformationToken(HANDLE
,DWORD
,LPVOID
,DWORD
,LPDWORD
);
1006 NTSTATUS WINAPI
NtQueryKey(HKEY
,KEY_INFORMATION_CLASS
,void *,DWORD
,DWORD
*);
1007 NTSTATUS WINAPI
NtQueryMultipleValueKey(HKEY
,PVALENTW
,ULONG
,PVOID
,ULONG
,PULONG
);
1008 NTSTATUS WINAPI
NtQueryObject(HANDLE
, OBJECT_INFORMATION_CLASS
, PVOID
, ULONG
, PULONG
);
1009 NTSTATUS WINAPI
NtQuerySecurityObject(HANDLE
,SECURITY_INFORMATION
,PSECURITY_DESCRIPTOR
,ULONG
,PULONG
);
1010 NTSTATUS WINAPI
NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS
,PVOID
,ULONG
,PULONG
);
1011 NTSTATUS WINAPI
NtQuerySystemTime(PLARGE_INTEGER
);
1012 NTSTATUS WINAPI
NtQueryValueKey(HKEY
,const UNICODE_STRING
*,KEY_VALUE_INFORMATION_CLASS
,void *,DWORD
,DWORD
*);
1013 NTSTATUS WINAPI
NtQueryVirtualMemory(HANDLE
,LPCVOID
,MEMORY_INFORMATION_CLASS
,PVOID
,ULONG
,ULONG
*);
1014 void WINAPI
NtRaiseException(PEXCEPTION_RECORD
,PCONTEXT
,BOOL
);
1015 NTSTATUS WINAPI
NtReadFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,PVOID
,ULONG
,PLARGE_INTEGER
,PULONG
);
1016 NTSTATUS WINAPI
NtReadVirtualMemory(HANDLE
,const void*,void*,SIZE_T
,SIZE_T
*);
1017 NTSTATUS WINAPI
NtReleaseSemaphore(HANDLE
,ULONG
,PULONG
);
1018 NTSTATUS WINAPI
NtReplaceKey(POBJECT_ATTRIBUTES
,HKEY
,POBJECT_ATTRIBUTES
);
1019 NTSTATUS WINAPI
NtResetEvent(HANDLE
,PULONG
);
1020 NTSTATUS WINAPI
NtRestoreKey(HKEY
,HANDLE
,ULONG
);
1021 NTSTATUS WINAPI
NtResumeThread(HANDLE
,PULONG
);
1022 NTSTATUS WINAPI
NtSaveKey(HKEY
,HANDLE
);
1023 NTSTATUS WINAPI
NtSetContextThread(HANDLE
,const CONTEXT
*);
1024 NTSTATUS WINAPI
NtSetDefaultLocale(BOOLEAN
,LCID
);
1025 NTSTATUS WINAPI
NtSetEvent(HANDLE
,PULONG
);
1026 NTSTATUS WINAPI
NtSetInformationFile(HANDLE
,PIO_STATUS_BLOCK
,PVOID
,ULONG
,FILE_INFORMATION_CLASS
);
1027 NTSTATUS WINAPI
NtSetInformationKey(HKEY
,const int,PVOID
,ULONG
);
1028 NTSTATUS WINAPI
NtSetInformationObject(HANDLE
, OBJECT_INFORMATION_CLASS
, PVOID
, ULONG
);
1029 NTSTATUS WINAPI
NtSetInformationThread(HANDLE
,THREADINFOCLASS
,LPCVOID
,ULONG
);
1030 NTSTATUS WINAPI
NtSetSecurityObject(HANDLE
,SECURITY_INFORMATION
,PSECURITY_DESCRIPTOR
);
1031 NTSTATUS WINAPI
NtSetSystemTime(const LARGE_INTEGER
*,LARGE_INTEGER
*);
1032 NTSTATUS WINAPI
NtSetTimer(HANDLE
, const LARGE_INTEGER
*, PTIMERAPCROUTINE
, PVOID
, BOOLEAN
, ULONG
, BOOLEAN
*);
1033 NTSTATUS WINAPI
NtSetValueKey(HKEY
,const UNICODE_STRING
*,ULONG
,ULONG
,const void *,ULONG
);
1034 NTSTATUS WINAPI
NtSuspendThread(HANDLE
,PULONG
);
1035 NTSTATUS WINAPI
NtTerminateProcess(HANDLE
,LONG
);
1036 NTSTATUS WINAPI
NtTerminateThread(HANDLE
,LONG
);
1037 NTSTATUS WINAPI
NtUnloadKey(HKEY
);
1038 NTSTATUS WINAPI
NtUnlockFile(HANDLE
,PIO_STATUS_BLOCK
,PLARGE_INTEGER
,PLARGE_INTEGER
,PULONG
);
1039 NTSTATUS WINAPI
NtUnlockVirtualMemory(HANDLE
,PVOID
*,ULONG
*,ULONG
);
1040 NTSTATUS WINAPI
NtUnmapViewOfSection(HANDLE
,PVOID
);
1041 NTSTATUS WINAPI
NtWaitForSingleObject(HANDLE
,BOOLEAN
,const LARGE_INTEGER
*);
1042 NTSTATUS WINAPI
NtWaitForMultipleObjects(ULONG
,const HANDLE
*,BOOLEAN
,BOOLEAN
,const LARGE_INTEGER
*);
1043 NTSTATUS WINAPI
NtWriteFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,const void*,ULONG
,PLARGE_INTEGER
,PULONG
);
1044 NTSTATUS WINAPI
NtWriteVirtualMemory(HANDLE
,void*,const void*,SIZE_T
,SIZE_T
*);
1046 void WINAPI
RtlAcquirePebLock(void);
1047 BYTE WINAPI
RtlAcquireResourceExclusive(LPRTL_RWLOCK
,BYTE
);
1048 BYTE WINAPI
RtlAcquireResourceShared(LPRTL_RWLOCK
,BYTE
);
1049 NTSTATUS WINAPI
RtlAddAce(PACL
,DWORD
,DWORD
,PACE_HEADER
,DWORD
);
1050 NTSTATUS WINAPI
RtlAddAccessAllowedAce(PACL
,DWORD
,DWORD
,PSID
);
1051 NTSTATUS WINAPI
RtlAddAccessAllowedAceEx(PACL
,DWORD
,DWORD
,DWORD
,PSID
);
1052 NTSTATUS WINAPI
RtlAddAccessDeniedAce(PACL
,DWORD
,DWORD
,PSID
);
1053 NTSTATUS WINAPI
RtlAddAccessDeniedAceEx(PACL
,DWORD
,DWORD
,DWORD
,PSID
);
1054 DWORD WINAPI
RtlAdjustPrivilege(DWORD
,DWORD
,DWORD
,DWORD
);
1055 BOOLEAN WINAPI
RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY
,BYTE
,DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,PSID
*);
1056 PVOID WINAPI
RtlAllocateHeap(HANDLE
,ULONG
,ULONG
);
1057 DWORD WINAPI
RtlAnsiStringToUnicodeSize(const STRING
*);
1058 NTSTATUS WINAPI
RtlAnsiStringToUnicodeString(PUNICODE_STRING
,PCANSI_STRING
,BOOLEAN
);
1059 NTSTATUS WINAPI
RtlAppendAsciizToString(STRING
*,LPCSTR
);
1060 NTSTATUS WINAPI
RtlAppendStringToString(STRING
*,const STRING
*);
1061 NTSTATUS WINAPI
RtlAppendUnicodeStringToString(UNICODE_STRING
*,const UNICODE_STRING
*);
1062 NTSTATUS WINAPI
RtlAppendUnicodeToString(UNICODE_STRING
*,LPCWSTR
);
1063 BOOLEAN WINAPI
RtlAreAllAccessesGranted(ACCESS_MASK
,ACCESS_MASK
);
1064 BOOLEAN WINAPI
RtlAreAnyAccessesGranted(ACCESS_MASK
,ACCESS_MASK
);
1065 BOOLEAN WINAPI
RtlAreBitsSet(PCRTL_BITMAP
,ULONG
,ULONG
);
1066 BOOLEAN WINAPI
RtlAreBitsClear(PCRTL_BITMAP
,ULONG
,ULONG
);
1068 NTSTATUS WINAPI
RtlCharToInteger(PCSZ
,ULONG
,PULONG
);
1069 void WINAPI
RtlClearAllBits(PRTL_BITMAP
);
1070 void WINAPI
RtlClearBits(PRTL_BITMAP
,ULONG
,ULONG
);
1071 ULONG WINAPI
RtlCompactHeap(HANDLE
,ULONG
);
1072 LONG WINAPI
RtlCompareString(const STRING
*,const STRING
*,BOOLEAN
);
1073 LONG WINAPI
RtlCompareUnicodeString(const UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1074 DWORD WINAPI
RtlComputeCrc32(DWORD
,PBYTE
,INT
);
1075 NTSTATUS WINAPI
RtlConvertSidToUnicodeString(PUNICODE_STRING
,PSID
,BOOLEAN
);
1076 LONGLONG WINAPI
RtlConvertLongToLargeInteger(LONG
);
1077 ULONGLONG WINAPI
RtlConvertUlongToLargeInteger(ULONG
);
1078 void WINAPI
RtlCopyLuid(PLUID
,const LUID
*);
1079 void WINAPI
RtlCopyLuidAndAttributesArray(ULONG
,const LUID_AND_ATTRIBUTES
*,PLUID_AND_ATTRIBUTES
);
1080 DWORD WINAPI
RtlCopySid(DWORD
,PSID
,PSID
);
1081 void WINAPI
RtlCopyString(STRING
*,const STRING
*);
1082 void WINAPI
RtlCopyUnicodeString(UNICODE_STRING
*,const UNICODE_STRING
*);
1083 NTSTATUS WINAPI
RtlCreateAcl(PACL
,DWORD
,DWORD
);
1084 NTSTATUS WINAPI
RtlCreateEnvironment(BOOLEAN
, PWSTR
*);
1085 HANDLE WINAPI
RtlCreateHeap(ULONG
,PVOID
,ULONG
,ULONG
,PVOID
,PRTL_HEAP_DEFINITION
);
1086 NTSTATUS WINAPI
RtlCreateProcessParameters(RTL_USER_PROCESS_PARAMETERS
**,const UNICODE_STRING
*,
1087 const UNICODE_STRING
*,const UNICODE_STRING
*,
1088 const UNICODE_STRING
*,PWSTR
,const UNICODE_STRING
*,
1089 const UNICODE_STRING
*,const UNICODE_STRING
*,
1090 const UNICODE_STRING
*);
1091 NTSTATUS WINAPI
RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR
,DWORD
);
1092 BOOLEAN WINAPI
RtlCreateUnicodeString(PUNICODE_STRING
,LPCWSTR
);
1093 BOOLEAN WINAPI
RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING
,LPCSTR
);
1095 NTSTATUS WINAPI
RtlDeleteCriticalSection(RTL_CRITICAL_SECTION
*);
1096 void WINAPI
RtlDeleteResource(LPRTL_RWLOCK
);
1097 DWORD WINAPI
RtlDeleteSecurityObject(DWORD
);
1098 PRTL_USER_PROCESS_PARAMETERS WINAPI
RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS
*);
1099 NTSTATUS WINAPI
RtlDestroyEnvironment(PWSTR
);
1100 HANDLE WINAPI
RtlDestroyHeap(HANDLE
);
1101 void WINAPI
RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS
*);
1102 DOS_PATHNAME_TYPE WINAPI
RtlDetermineDosPathNameType_U(PCWSTR
);
1103 BOOLEAN WINAPI
RtlDoesFileExists_U(LPCWSTR
);
1104 BOOLEAN WINAPI
RtlDosPathNameToNtPathName_U(LPWSTR
,PUNICODE_STRING
,PWSTR
*,CURDIR
*);
1105 ULONG WINAPI
RtlDosSearchPath_U(LPCWSTR
, LPCWSTR
, LPCWSTR
, ULONG
, LPWSTR
, LPWSTR
*);
1106 WCHAR WINAPI
RtlDowncaseUnicodeChar(WCHAR
);
1107 NTSTATUS WINAPI
RtlDowncaseUnicodeString(UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1108 void WINAPI
RtlDumpResource(LPRTL_RWLOCK
);
1109 NTSTATUS WINAPI
RtlDuplicateUnicodeString(int,const UNICODE_STRING
*,UNICODE_STRING
*);
1111 LONGLONG WINAPI
RtlEnlargedIntegerMultiply(INT
,INT
);
1112 ULONGLONG WINAPI
RtlEnlargedUnsignedMultiply(UINT
,UINT
);
1113 UINT WINAPI
RtlEnlargedUnsignedDivide(ULONGLONG
,UINT
,UINT
*);
1114 NTSTATUS WINAPI
RtlEnterCriticalSection(RTL_CRITICAL_SECTION
*);
1115 void WINAPI
RtlEraseUnicodeString(UNICODE_STRING
*);
1116 NTSTATUS WINAPI
RtlEqualComputerName(const UNICODE_STRING
*,const UNICODE_STRING
*);
1117 NTSTATUS WINAPI
RtlEqualDomainName(const UNICODE_STRING
*,const UNICODE_STRING
*);
1118 BOOLEAN WINAPI
RtlEqualLuid(const LUID
*,const LUID
*);
1119 BOOL WINAPI
RtlEqualPrefixSid(PSID
,PSID
);
1120 BOOL WINAPI
RtlEqualSid(PSID
,PSID
);
1121 BOOLEAN WINAPI
RtlEqualString(const STRING
*,const STRING
*,BOOLEAN
);
1122 BOOLEAN WINAPI
RtlEqualUnicodeString(const UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1123 NTSTATUS WINAPI
RtlExpandEnvironmentStrings_U(PWSTR
, const UNICODE_STRING
*, UNICODE_STRING
*, ULONG
*);
1124 LONGLONG WINAPI
RtlExtendedMagicDivide(LONGLONG
,LONGLONG
,INT
);
1125 LONGLONG WINAPI
RtlExtendedIntegerMultiply(LONGLONG
,INT
);
1126 LONGLONG WINAPI
RtlExtendedLargeIntegerDivide(LONGLONG
,INT
,INT
*);
1128 NTSTATUS WINAPI
RtlFindCharInUnicodeString(int,const UNICODE_STRING
*,const UNICODE_STRING
*,USHORT
*);
1129 ULONG WINAPI
RtlFindClearBits(PCRTL_BITMAP
,ULONG
,ULONG
);
1130 ULONG WINAPI
RtlFindClearBitsAndSet(PRTL_BITMAP
,ULONG
,ULONG
);
1131 ULONG WINAPI
RtlFindClearRuns(PCRTL_BITMAP
,PRTL_BITMAP_RUN
,ULONG
,BOOLEAN
);
1132 ULONG WINAPI
RtlFindLastBackwardRunSet(PCRTL_BITMAP
,ULONG
,PULONG
);
1133 ULONG WINAPI
RtlFindLastBackwardRunClear(PCRTL_BITMAP
,ULONG
,PULONG
);
1134 CCHAR WINAPI
RtlFindLeastSignificantBit(ULONGLONG
);
1135 ULONG WINAPI
RtlFindLongestRunSet(PCRTL_BITMAP
,PULONG
);
1136 ULONG WINAPI
RtlFindLongestRunClear(PCRTL_BITMAP
,PULONG
);
1137 NTSTATUS WINAPI
RtlFindMessage(HMODULE
,ULONG
,ULONG
,ULONG
,const MESSAGE_RESOURCE_ENTRY
**);
1138 CCHAR WINAPI
RtlFindMostSignificantBit(ULONGLONG
);
1139 ULONG WINAPI
RtlFindNextForwardRunSet(PCRTL_BITMAP
,ULONG
,PULONG
);
1140 ULONG WINAPI
RtlFindNextForwardRunClear(PCRTL_BITMAP
,ULONG
,PULONG
);
1141 ULONG WINAPI
RtlFindSetBits(PCRTL_BITMAP
,ULONG
,ULONG
);
1142 ULONG WINAPI
RtlFindSetBitsAndClear(PRTL_BITMAP
,ULONG
,ULONG
);
1143 ULONG WINAPI
RtlFindSetRuns(PCRTL_BITMAP
,PRTL_BITMAP_RUN
,ULONG
,BOOLEAN
);
1144 BOOLEAN WINAPI
RtlFirstFreeAce(PACL
,PACE_HEADER
*);
1145 NTSTATUS WINAPI
RtlFormatCurrentUserKeyPath(PUNICODE_STRING
);
1146 void WINAPI
RtlFreeAnsiString(PANSI_STRING
);
1147 BOOLEAN WINAPI
RtlFreeHeap(HANDLE
,ULONG
,PVOID
);
1148 void WINAPI
RtlFreeOemString(POEM_STRING
);
1149 DWORD WINAPI
RtlFreeSid(PSID
);
1150 void WINAPI
RtlFreeUnicodeString(PUNICODE_STRING
);
1152 DWORD WINAPI
RtlGetAce(PACL
,DWORD
,LPVOID
*);
1153 NTSTATUS WINAPI
RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR
, PSECURITY_DESCRIPTOR_CONTROL
,LPDWORD
);
1154 NTSTATUS WINAPI
RtlGetCurrentDirectory_U(ULONG
, LPWSTR
);
1155 NTSTATUS WINAPI
RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR
,PBOOLEAN
,PACL
*,PBOOLEAN
);
1156 ULONG WINAPI
RtlGetFullPathName_U(PCWSTR
,ULONG
,PWSTR
,PWSTR
*);
1157 NTSTATUS WINAPI
RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR
,PSID
*,PBOOLEAN
);
1158 DWORD WINAPI
RtlGetLongestNtPathLength(void);
1159 BOOLEAN WINAPI
RtlGetNtProductType(LPDWORD
);
1160 NTSTATUS WINAPI
RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR
,PSID
*,PBOOLEAN
);
1161 ULONG WINAPI
RtlGetProcessHeaps(ULONG
,HANDLE
*);
1162 NTSTATUS WINAPI
RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR
,PBOOLEAN
,PACL
*,PBOOLEAN
);
1163 NTSTATUS WINAPI
RtlGetVersion(RTL_OSVERSIONINFOEXW
*);
1165 PSID_IDENTIFIER_AUTHORITY WINAPI
RtlIdentifierAuthoritySid(PSID
);
1166 PVOID WINAPI
RtlImageDirectoryEntryToData(HMODULE
,BOOL
,WORD
,ULONG
*);
1167 PIMAGE_NT_HEADERS WINAPI
RtlImageNtHeader(HMODULE
);
1168 PIMAGE_SECTION_HEADER WINAPI
RtlImageRvaToSection(const IMAGE_NT_HEADERS
*,HMODULE
,DWORD
);
1169 PVOID WINAPI
RtlImageRvaToVa(const IMAGE_NT_HEADERS
*,HMODULE
,DWORD
,IMAGE_SECTION_HEADER
**);
1170 BOOL WINAPI
RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL
);
1171 void WINAPI
RtlInitString(PSTRING
,PCSZ
);
1172 void WINAPI
RtlInitAnsiString(PANSI_STRING
,PCSZ
);
1173 void WINAPI
RtlInitUnicodeString(PUNICODE_STRING
,PCWSTR
);
1174 NTSTATUS WINAPI
RtlInitUnicodeStringEx(PUNICODE_STRING
,PCWSTR
);
1175 NTSTATUS WINAPI
RtlInitializeCriticalSection(RTL_CRITICAL_SECTION
*);
1176 NTSTATUS WINAPI
RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION
*,DWORD
);
1177 void WINAPI
RtlInitializeBitMap(PRTL_BITMAP
,LPBYTE
,ULONG
);
1178 void WINAPI
RtlInitializeResource(LPRTL_RWLOCK
);
1179 BOOL WINAPI
RtlInitializeSid(PSID
,PSID_IDENTIFIER_AUTHORITY
,BYTE
);
1181 NTSTATUS WINAPI
RtlInt64ToUnicodeString(ULONGLONG
,ULONG
,UNICODE_STRING
*);
1182 NTSTATUS WINAPI
RtlIntegerToChar(ULONG
,ULONG
,ULONG
,PCHAR
);
1183 NTSTATUS WINAPI
RtlIntegerToUnicodeString(ULONG
,ULONG
,UNICODE_STRING
*);
1184 ULONG WINAPI
RtlIsDosDeviceName_U(PCWSTR
);
1185 BOOLEAN WINAPI
RtlIsNameLegalDOS8Dot3(const UNICODE_STRING
*,POEM_STRING
,PBOOLEAN
);
1186 DWORD WINAPI
RtlIsTextUnicode(LPVOID
,DWORD
,DWORD
*);
1188 LONGLONG WINAPI
RtlLargeIntegerAdd(LONGLONG
,LONGLONG
);
1189 LONGLONG WINAPI
RtlLargeIntegerArithmeticShift(LONGLONG
,INT
);
1190 ULONGLONG WINAPI
RtlLargeIntegerDivide( ULONGLONG
,ULONGLONG
,ULONGLONG
*);
1191 LONGLONG WINAPI
RtlLargeIntegerNegate(LONGLONG
);
1192 LONGLONG WINAPI
RtlLargeIntegerShiftLeft(LONGLONG
,INT
);
1193 LONGLONG WINAPI
RtlLargeIntegerShiftRight(LONGLONG
,INT
);
1194 LONGLONG WINAPI
RtlLargeIntegerSubtract(LONGLONG
,LONGLONG
);
1195 NTSTATUS WINAPI
RtlLargeIntegerToChar(const ULONGLONG
*,ULONG
,ULONG
,PCHAR
);
1196 NTSTATUS WINAPI
RtlLeaveCriticalSection(RTL_CRITICAL_SECTION
*);
1197 DWORD WINAPI
RtlLengthRequiredSid(DWORD
);
1198 ULONG WINAPI
RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR
);
1199 DWORD WINAPI
RtlLengthSid(PSID
);
1200 NTSTATUS WINAPI
RtlLocalTimeToSystemTime(const LARGE_INTEGER
*,PLARGE_INTEGER
);
1201 BOOLEAN WINAPI
RtlLockHeap(HANDLE
);
1203 NTSTATUS WINAPI
RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR
,PSECURITY_DESCRIPTOR
,LPDWORD
);
1204 void WINAPI
RtlMapGenericMask(PACCESS_MASK
,const GENERIC_MAPPING
*);
1205 NTSTATUS WINAPI
RtlMultiByteToUnicodeN(LPWSTR
,DWORD
,LPDWORD
,LPCSTR
,DWORD
);
1206 NTSTATUS WINAPI
RtlMultiByteToUnicodeSize(DWORD
*,LPCSTR
,UINT
);
1208 DWORD WINAPI
RtlNewSecurityObject(DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,DWORD
);
1209 PRTL_USER_PROCESS_PARAMETERS WINAPI
RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS
*);
1210 ULONG WINAPI
RtlNtStatusToDosError(NTSTATUS
);
1211 ULONG WINAPI
RtlNumberOfSetBits(PCRTL_BITMAP
);
1212 ULONG WINAPI
RtlNumberOfClearBits(PCRTL_BITMAP
);
1214 UINT WINAPI
RtlOemStringToUnicodeSize(const STRING
*);
1215 NTSTATUS WINAPI
RtlOemStringToUnicodeString(UNICODE_STRING
*,const STRING
*,BOOLEAN
);
1216 NTSTATUS WINAPI
RtlOemToUnicodeN(LPWSTR
,DWORD
,LPDWORD
,LPCSTR
,DWORD
);
1217 DWORD WINAPI
RtlOpenCurrentUser(ACCESS_MASK
,PHKEY
);
1219 BOOLEAN WINAPI
RtlPrefixString(const STRING
*,const STRING
*,BOOLEAN
);
1220 BOOLEAN WINAPI
RtlPrefixUnicodeString(const UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1222 NTSTATUS WINAPI
RtlQueryEnvironmentVariable_U(PWSTR
,PUNICODE_STRING
,PUNICODE_STRING
);
1223 NTSTATUS WINAPI
RtlQueryTimeZoneInformation(LPTIME_ZONE_INFORMATION
);
1225 void WINAPI
RtlRaiseException(PEXCEPTION_RECORD
);
1226 void WINAPI
RtlRaiseStatus(NTSTATUS
);
1227 ULONG WINAPI
RtlRandom(PULONG
);
1228 PVOID WINAPI
RtlReAllocateHeap(HANDLE
,ULONG
,PVOID
,ULONG
);
1229 void WINAPI
RtlReleasePebLock(void);
1230 void WINAPI
RtlReleaseResource(LPRTL_RWLOCK
);
1232 void WINAPI
RtlSecondsSince1970ToTime(DWORD
,LARGE_INTEGER
*);
1233 void WINAPI
RtlSecondsSince1980ToTime(DWORD
,LARGE_INTEGER
*);
1234 void WINAPI
RtlSetAllBits(PRTL_BITMAP
);
1235 void WINAPI
RtlSetBits(PRTL_BITMAP
,ULONG
,ULONG
);
1236 NTSTATUS WINAPI
RtlSetCurrentDirectory_U(const UNICODE_STRING
*);
1237 void WINAPI
RtlSetCurrentEnvironment(PWSTR
, PWSTR
*);
1238 NTSTATUS WINAPI
RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR
,BOOLEAN
,PACL
,BOOLEAN
);
1239 NTSTATUS WINAPI
RtlSetEnvironmentVariable(PWSTR
*,PUNICODE_STRING
,PUNICODE_STRING
);
1240 NTSTATUS WINAPI
RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR
,PSID
,BOOLEAN
);
1241 NTSTATUS WINAPI
RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR
,PSID
,BOOLEAN
);
1242 NTSTATUS WINAPI
RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR
,BOOLEAN
,PACL
,BOOLEAN
);
1243 NTSTATUS WINAPI
RtlSetTimeZoneInformation(const TIME_ZONE_INFORMATION
*);
1244 ULONG WINAPI
RtlSizeHeap(HANDLE
,ULONG
,PVOID
);
1245 LPDWORD WINAPI
RtlSubAuthoritySid(PSID
,DWORD
);
1246 LPBYTE WINAPI
RtlSubAuthorityCountSid(PSID
);
1247 NTSTATUS WINAPI
RtlSystemTimeToLocalTime(const LARGE_INTEGER
*,PLARGE_INTEGER
);
1249 void WINAPI
RtlTimeToTimeFields(const LARGE_INTEGER
*,PTIME_FIELDS
);
1250 BOOLEAN WINAPI
RtlTimeFieldsToTime(PTIME_FIELDS
,PLARGE_INTEGER
);
1251 void WINAPI
RtlTimeToElapsedTimeFields(const LARGE_INTEGER
*,PTIME_FIELDS
);
1252 BOOLEAN WINAPI
RtlTimeToSecondsSince1970(const LARGE_INTEGER
*,LPDWORD
);
1253 BOOLEAN WINAPI
RtlTimeToSecondsSince1980(const LARGE_INTEGER
*,LPDWORD
);
1254 BOOL WINAPI
RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION
*);
1256 ULONGLONG __cdecl
RtlUlonglongByteSwap(ULONGLONG
);
1257 DWORD WINAPI
RtlUnicodeStringToAnsiSize(const UNICODE_STRING
*);
1258 NTSTATUS WINAPI
RtlUnicodeStringToAnsiString(PANSI_STRING
,PCUNICODE_STRING
,BOOLEAN
);
1259 NTSTATUS WINAPI
RtlUnicodeStringToInteger(const UNICODE_STRING
*,ULONG
,ULONG
*);
1260 DWORD WINAPI
RtlUnicodeStringToOemSize(const UNICODE_STRING
*);
1261 NTSTATUS WINAPI
RtlUnicodeStringToOemString(POEM_STRING
,PCUNICODE_STRING
,BOOLEAN
);
1262 NTSTATUS WINAPI
RtlUnicodeToMultiByteN(LPSTR
,DWORD
,LPDWORD
,LPCWSTR
,DWORD
);
1263 NTSTATUS WINAPI
RtlUnicodeToMultiByteSize(PULONG
,PCWSTR
,ULONG
);
1264 NTSTATUS WINAPI
RtlUnicodeToOemN(LPSTR
,DWORD
,LPDWORD
,LPCWSTR
,DWORD
);
1265 ULONG WINAPI
RtlUniform(PULONG
);
1266 BOOLEAN WINAPI
RtlUnlockHeap(HANDLE
);
1267 void WINAPI
RtlUnwind(PVOID
,PVOID
,PEXCEPTION_RECORD
,PVOID
);
1269 void WINAPI
RtlUnwind2(FRAME_POINTERS
,PVOID
,PEXCEPTION_RECORD
,PVOID
,PCONTEXT
);
1270 void WINAPI
RtlUnwindEx(FRAME_POINTERS
,PVOID
,PEXCEPTION_RECORD
,PVOID
,PCONTEXT
,PUNWIND_HISTORY_TABLE
);
1272 WCHAR WINAPI
RtlUpcaseUnicodeChar(WCHAR
);
1273 NTSTATUS WINAPI
RtlUpcaseUnicodeString(UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1274 NTSTATUS WINAPI
RtlUpcaseUnicodeStringToAnsiString(STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1275 NTSTATUS WINAPI
RtlUpcaseUnicodeStringToCountedOemString(STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1276 NTSTATUS WINAPI
RtlUpcaseUnicodeStringToOemString(STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1277 NTSTATUS WINAPI
RtlUpcaseUnicodeToMultiByteN(LPSTR
,DWORD
,LPDWORD
,LPCWSTR
,DWORD
);
1278 NTSTATUS WINAPI
RtlUpcaseUnicodeToOemN(LPSTR
,DWORD
,LPDWORD
,LPCWSTR
,DWORD
);
1279 CHAR WINAPI
RtlUpperChar(CHAR
);
1280 void WINAPI
RtlUpperString(STRING
*,const STRING
*);
1282 NTSTATUS WINAPI
RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR
);
1283 BOOLEAN WINAPI
RtlValidAcl(PACL
);
1284 BOOLEAN WINAPI
RtlValidSid(PSID
);
1285 BOOLEAN WINAPI
RtlValidateHeap(HANDLE
,ULONG
,LPCVOID
);
1286 NTSTATUS WINAPI
RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW
*,DWORD
,DWORDLONG
);
1288 NTSTATUS WINAPI
RtlWalkHeap(HANDLE
,PVOID
);
1290 NTSTATUS WINAPI
RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION
*);
1291 NTSTATUS WINAPI
RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION
*);
1293 /***********************************************************************
1297 #define InitializeObjectAttributes(p,n,a,r,s) \
1299 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
1300 (p)->RootDirectory = r; \
1301 (p)->Attributes = a; \
1302 (p)->ObjectName = n; \
1303 (p)->SecurityDescriptor = s; \
1304 (p)->SecurityQualityOfService = NULL; \
1307 #define NtCurrentProcess() ((HANDLE)-1)
1309 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
1310 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
1311 #define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1312 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1313 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
1314 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
1315 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
1317 inline static BOOLEAN
RtlCheckBit(PCRTL_BITMAP lpBits
, ULONG ulBit
)
1319 if (lpBits
&& ulBit
< lpBits
->SizeOfBitMap
&&
1320 lpBits
->BitMapBuffer
[ulBit
>> 3] & (1 << (ulBit
& 7)))
1325 #define RtlClearAllBits(p) \
1327 PRTL_BITMAP _p = (p); \
1328 memset(_p->BitMapBuffer,0,((_p->SizeOfBitMap + 31) & 0xffffffe0) >> 3); \
1331 #define RtlInitializeBitMap(p,b,s) \
1333 PRTL_BITMAP _p = (p); \
1334 _p->SizeOfBitMap = (s); \
1335 _p->BitMapBuffer = (b); \
1338 #define RtlSetAllBits(p) \
1340 PRTL_BITMAP _p = (p); \
1341 memset(_p->BitMapBuffer,0xff,((_p->SizeOfBitMap + 31) & 0xffffffe0) >> 3); \
1344 /* These are implemented as __fastcall, so we can't let Winelib apps link with them */
1345 inline static USHORT
RtlUshortByteSwap(USHORT s
)
1347 return (s
>> 8) | (s
<< 8);
1349 inline static ULONG
RtlUlongByteSwap(ULONG i
)
1351 #if defined(__i386__) && defined(__GNUC__)
1353 __asm__("bswap %0" : "=r" (ret
) : "0" (i
) );
1356 return ((ULONG
)RtlUshortByteSwap((USHORT
)i
) << 16) | RtlUshortByteSwap((USHORT
)(i
>> 16));
1360 /*************************************************************************
1361 * Loader functions and structures.
1363 * Those are not part of standard Winternl.h
1365 typedef struct _LDR_MODULE
1367 LIST_ENTRY InLoadOrderModuleList
;
1368 LIST_ENTRY InMemoryOrderModuleList
;
1369 LIST_ENTRY InInitializationOrderModuleList
;
1373 UNICODE_STRING FullDllName
;
1374 UNICODE_STRING BaseDllName
;
1378 HANDLE SectionHandle
;
1380 ULONG TimeDateStamp
;
1381 } LDR_MODULE
, *PLDR_MODULE
;
1383 /* those defines are (some of the) regular LDR_MODULE.Flags values */
1384 #define LDR_IMAGE_IS_DLL 0x00000004
1385 #define LDR_LOAD_IN_PROGRESS 0x00001000
1386 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
1387 #define LDR_NO_DLL_CALLS 0x00040000
1388 #define LDR_PROCESS_ATTACHED 0x00080000
1389 #define LDR_MODULE_REBASED 0x00200000
1391 /* these ones is Wine specific */
1392 #define LDR_DONT_RESOLVE_REFS 0x40000000
1393 #define LDR_WINE_INTERNAL 0x80000000
1395 /* FIXME: to be checked */
1396 #define MAXIMUM_FILENAME_LENGTH 256
1398 typedef struct _SYSTEM_MODULE
1402 PVOID ImageBaseAddress
;
1409 BYTE Name
[MAXIMUM_FILENAME_LENGTH
];
1410 } SYSTEM_MODULE
, *PSYSTEM_MODULE
;
1412 typedef struct _SYSTEM_MODULE_INFORMATION
1415 SYSTEM_MODULE Modules
[1]; /* FIXME: should be Modules[0] */
1416 } SYSTEM_MODULE_INFORMATION
, *PSYSTEM_MODULE_INFORMATION
;
1418 NTSTATUS WINAPI
LdrDisableThreadCalloutsForDll(HMODULE
);
1419 NTSTATUS WINAPI
LdrFindEntryForAddress(const void*, PLDR_MODULE
*);
1420 NTSTATUS WINAPI
LdrLockLoaderLock(ULONG
,ULONG
*,ULONG
*);
1421 NTSTATUS WINAPI
LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION
*, ULONG
, ULONG
*);
1422 NTSTATUS WINAPI
LdrUnloadDll(HMODULE
);
1423 NTSTATUS WINAPI
LdrUnlockLoaderLock(ULONG
,ULONG
);
1425 /* list manipulation macros */
1426 #define InitializeListHead(le) (void)((le)->Flink = (le)->Blink = (le))
1427 #define InsertHeadList(le,e) do { PLIST_ENTRY f = (le)->Flink; (e)->Flink = f; (e)->Blink = (le); f->Blink = (e); (le)->Flink = (e); } while (0)
1428 #define InsertTailList(le,e) do { PLIST_ENTRY b = (le)->Blink; (e)->Flink = (le); (e)->Blink = b; b->Flink = (e); (le)->Blink = (e); } while (0)
1429 #define IsListEmpty(le) ((le)->Flink == (le))
1430 #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)
1431 static inline PLIST_ENTRY
RemoveHeadList(PLIST_ENTRY le
)
1433 PLIST_ENTRY f
, b
, e
;
1436 f
= le
->Flink
->Flink
;
1437 b
= le
->Flink
->Blink
;
1441 if (e
!= le
) e
->Flink
= e
->Blink
= NULL
;
1444 static inline PLIST_ENTRY
RemoveTailList(PLIST_ENTRY le
)
1446 PLIST_ENTRY f
, b
, e
;
1449 f
= le
->Blink
->Flink
;
1450 b
= le
->Blink
->Blink
;
1454 if (e
!= le
) e
->Flink
= e
->Blink
= NULL
;
1460 #endif /* defined(__cplusplus) */
1462 #endif /* __WINE_WINTERNAL_H */