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_FLAG 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
912 /* status for NtCreateFile or NtOpenFile */
913 #define FILE_SUPERSEDED 0x00000000
914 #define FILE_OPENED 0x00000001
915 #define FILE_CREATED 0x00000002
916 #define FILE_OVERWRITTEN 0x00000003
917 #define FILE_EXISTS 0x00000004
918 #define FILE_DOES_NOT_EXIST 0x00000005
920 #if (_WIN32_WINNT >= 0x0501)
921 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
922 #endif /* (_WIN32_WINNT >= 0x0501) */
924 #define LOGONID_CURRENT ((ULONG)-1)
926 #define OBJ_INHERIT 0x00000002L
927 #define OBJ_PERMANENT 0x00000010L
928 #define OBJ_EXCLUSIVE 0x00000020L
929 #define OBJ_CASE_INSENSITIVE 0x00000040L
930 #define OBJ_OPENIF 0x00000080L
931 #define OBJ_OPENLINK 0x00000100L
932 #define OBJ_KERNEL_HANDLE 0x00000200L
933 #define OBJ_VALID_ATTRIBUTES 0x000003F2L
935 #define SERVERNAME_CURRENT ((HANDLE)NULL)
937 typedef void (CALLBACK
*PNTAPCFUNC
)(ULONG_PTR
,ULONG_PTR
,ULONG_PTR
); /* FIXME: not the right name */
938 typedef void (CALLBACK
*PRTL_THREAD_START_ROUTINE
)(LPVOID
); /* FIXME: not the right name */
940 /***********************************************************************
941 * Function declarations
944 extern LPSTR
_strlwr(LPSTR str
); /* FIXME: Doesn't belong here */
945 extern LPSTR
_strupr(LPSTR str
); /* FIXME: Doesn't belong here */
947 #if defined(__i386__) && defined(__GNUC__)
948 static inline void WINAPI
DbgBreakPoint(void) { __asm__
__volatile__("int3"); }
949 static inline void WINAPI
DbgUserBreakPoint(void) { __asm__
__volatile__("int3"); }
950 #else /* __i386__ && __GNUC__ */
951 void WINAPI
DbgBreakPoint(void);
952 void WINAPI
DbgUserBreakPoint(void);
953 #endif /* __i386__ && __GNUC__ */
954 void WINAPIV
DbgPrint(LPCSTR fmt
, ...);
956 NTSTATUS WINAPI
LdrAccessResource(HMODULE
,const IMAGE_RESOURCE_DATA_ENTRY
*,void**,PULONG
);
957 NTSTATUS WINAPI
LdrFindResourceDirectory_U(HMODULE
,const LDR_RESOURCE_INFO
*,ULONG
,const IMAGE_RESOURCE_DIRECTORY
**);
958 NTSTATUS WINAPI
LdrFindResource_U(HMODULE
,const LDR_RESOURCE_INFO
*,ULONG
,const IMAGE_RESOURCE_DATA_ENTRY
**);
959 NTSTATUS WINAPI
LdrGetDllHandle(ULONG
, ULONG
, const UNICODE_STRING
*, HMODULE
*);
960 NTSTATUS WINAPI
LdrGetProcedureAddress(HMODULE
, const ANSI_STRING
*, ULONG
, void**);
961 void WINAPI
LdrInitializeThunk(HANDLE
,LPVOID
,ULONG
,ULONG
);
962 NTSTATUS WINAPI
LdrLoadDll(LPCWSTR
, DWORD
, const UNICODE_STRING
*, HMODULE
*);
963 void WINAPI
LdrShutdownProcess(void);
964 void WINAPI
LdrShutdownThread(void);
965 NTSTATUS WINAPI
NtAccessCheck(PSECURITY_DESCRIPTOR
,HANDLE
,ACCESS_MASK
,PGENERIC_MAPPING
,PPRIVILEGE_SET
,PULONG
,PULONG
,PBOOLEAN
);
966 NTSTATUS WINAPI
NtAdjustPrivilegesToken(HANDLE
,BOOLEAN
,PTOKEN_PRIVILEGES
,DWORD
,PTOKEN_PRIVILEGES
,PDWORD
);
967 NTSTATUS WINAPI
NtAllocateVirtualMemory(HANDLE
,PVOID
*,PVOID
,ULONG
*,ULONG
,ULONG
);
968 NTSTATUS WINAPI
NtCancelTimer(HANDLE
, BOOLEAN
*);
969 NTSTATUS WINAPI
NtClearEvent(HANDLE
);
970 NTSTATUS WINAPI
NtClose(HANDLE
);
971 NTSTATUS WINAPI
NtCreateEvent(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,BOOLEAN
,BOOLEAN
);
972 NTSTATUS WINAPI
NtCreateFile(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
,PIO_STATUS_BLOCK
,PLARGE_INTEGER
,ULONG
,ULONG
,ULONG
,ULONG
,PVOID
,ULONG
);
973 NTSTATUS WINAPI
NtCreateKey(PHKEY
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,ULONG
,const UNICODE_STRING
*,ULONG
,PULONG
);
974 NTSTATUS WINAPI
NtCreateSection(HANDLE
*,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,const LARGE_INTEGER
*,ULONG
,ULONG
,HANDLE
);
975 NTSTATUS WINAPI
NtCreateSemaphore(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,ULONG
,ULONG
);
976 NTSTATUS WINAPI
NtCreateTimer(HANDLE
*, ACCESS_MASK
, const OBJECT_ATTRIBUTES
*, TIMER_TYPE
);
977 NTSTATUS WINAPI
NtDelayExecution(BOOLEAN
,const LARGE_INTEGER
*);
978 NTSTATUS WINAPI
NtDeleteKey(HKEY
);
979 NTSTATUS WINAPI
NtDeleteValueKey(HKEY
,const UNICODE_STRING
*);
980 NTSTATUS WINAPI
NtDeviceIoControlFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,ULONG
,PVOID
,ULONG
,PVOID
,ULONG
);
981 NTSTATUS WINAPI
NtDuplicateObject(HANDLE
,HANDLE
,HANDLE
,PHANDLE
,ACCESS_MASK
,ULONG
,ULONG
);
982 NTSTATUS WINAPI
NtEnumerateKey(HKEY
,ULONG
,KEY_INFORMATION_CLASS
,void *,DWORD
,DWORD
*);
983 NTSTATUS WINAPI
NtEnumerateValueKey(HKEY
,ULONG
,KEY_VALUE_INFORMATION_CLASS
,PVOID
,ULONG
,PULONG
);
984 NTSTATUS WINAPI
NtFlushBuffersFile(HANDLE
,IO_STATUS_BLOCK
*);
985 NTSTATUS WINAPI
NtFlushKey(HKEY
);
986 NTSTATUS WINAPI
NtFlushVirtualMemory(HANDLE
,LPCVOID
*,ULONG
*,ULONG
);
987 NTSTATUS WINAPI
NtFreeVirtualMemory(HANDLE
,PVOID
*,ULONG
*,ULONG
);
988 NTSTATUS WINAPI
NtGetContextThread(HANDLE
,CONTEXT
*);
989 NTSTATUS WINAPI
NtLoadKey(const OBJECT_ATTRIBUTES
*,const OBJECT_ATTRIBUTES
*);
990 NTSTATUS WINAPI
NtLockFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,void*,PIO_STATUS_BLOCK
,PLARGE_INTEGER
,PLARGE_INTEGER
,ULONG
*,BOOLEAN
,BOOLEAN
);
991 NTSTATUS WINAPI
NtLockVirtualMemory(HANDLE
,PVOID
*,ULONG
*,ULONG
);
992 NTSTATUS WINAPI
NtMapViewOfSection(HANDLE
,HANDLE
,PVOID
*,ULONG
,ULONG
,const LARGE_INTEGER
*,ULONG
*,SECTION_INHERIT
,ULONG
,ULONG
);
993 NTSTATUS WINAPI
NtNotifyChangeKey(HKEY
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,ULONG
,BOOLEAN
,PVOID
,ULONG
,BOOLEAN
);
994 NTSTATUS WINAPI
NtOpenEvent(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*);
995 NTSTATUS WINAPI
NtOpenFile(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
,PIO_STATUS_BLOCK
,ULONG
,ULONG
);
996 NTSTATUS WINAPI
NtOpenKey(PHKEY
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*);
997 NTSTATUS WINAPI
NtOpenProcessToken(HANDLE
,DWORD
,HANDLE
*);
998 NTSTATUS WINAPI
NtOpenSection(HANDLE
*,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*);
999 NTSTATUS WINAPI
NtOpenThread(HANDLE
*,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,const CLIENT_ID
*);
1000 NTSTATUS WINAPI
NtOpenThreadToken(HANDLE
,DWORD
,BOOLEAN
,HANDLE
*);
1001 NTSTATUS WINAPI
NtOpenTimer(HANDLE
*, ACCESS_MASK
, const OBJECT_ATTRIBUTES
*);
1002 NTSTATUS WINAPI
NtProtectVirtualMemory(HANDLE
,PVOID
*,ULONG
*,ULONG
,ULONG
*);
1003 NTSTATUS WINAPI
NtPulseEvent(HANDLE
,PULONG
);
1004 NTSTATUS WINAPI
NtQueueApcThread(HANDLE
,PNTAPCFUNC
,ULONG_PTR
,ULONG_PTR
,ULONG_PTR
);
1005 NTSTATUS WINAPI
NtQueryDefaultLocale(BOOLEAN
,LCID
*);
1006 NTSTATUS WINAPI
NtQueryInformationFile(HANDLE
,PIO_STATUS_BLOCK
,PVOID
,LONG
,FILE_INFORMATION_CLASS
);
1007 NTSTATUS WINAPI
NtQueryInformationProcess(HANDLE
,PROCESSINFOCLASS
,PVOID
,ULONG
,PULONG
);
1008 NTSTATUS WINAPI
NtQueryInformationThread(HANDLE
,THREADINFOCLASS
,PVOID
,ULONG
,PULONG
);
1009 NTSTATUS WINAPI
NtQueryInformationToken(HANDLE
,DWORD
,LPVOID
,DWORD
,LPDWORD
);
1010 NTSTATUS WINAPI
NtQueryKey(HKEY
,KEY_INFORMATION_CLASS
,void *,DWORD
,DWORD
*);
1011 NTSTATUS WINAPI
NtQueryMultipleValueKey(HKEY
,PVALENTW
,ULONG
,PVOID
,ULONG
,PULONG
);
1012 NTSTATUS WINAPI
NtQueryObject(HANDLE
, OBJECT_INFORMATION_CLASS
, PVOID
, ULONG
, PULONG
);
1013 NTSTATUS WINAPI
NtQuerySecurityObject(HANDLE
,SECURITY_INFORMATION
,PSECURITY_DESCRIPTOR
,ULONG
,PULONG
);
1014 NTSTATUS WINAPI
NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS
,PVOID
,ULONG
,PULONG
);
1015 NTSTATUS WINAPI
NtQuerySystemTime(PLARGE_INTEGER
);
1016 NTSTATUS WINAPI
NtQueryValueKey(HKEY
,const UNICODE_STRING
*,KEY_VALUE_INFORMATION_CLASS
,void *,DWORD
,DWORD
*);
1017 NTSTATUS WINAPI
NtQueryVirtualMemory(HANDLE
,LPCVOID
,MEMORY_INFORMATION_CLASS
,PVOID
,ULONG
,ULONG
*);
1018 void WINAPI
NtRaiseException(PEXCEPTION_RECORD
,PCONTEXT
,BOOL
);
1019 NTSTATUS WINAPI
NtReadFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,PVOID
,ULONG
,PLARGE_INTEGER
,PULONG
);
1020 NTSTATUS WINAPI
NtReadVirtualMemory(HANDLE
,const void*,void*,SIZE_T
,SIZE_T
*);
1021 NTSTATUS WINAPI
NtReleaseSemaphore(HANDLE
,ULONG
,PULONG
);
1022 NTSTATUS WINAPI
NtReplaceKey(POBJECT_ATTRIBUTES
,HKEY
,POBJECT_ATTRIBUTES
);
1023 NTSTATUS WINAPI
NtResetEvent(HANDLE
,PULONG
);
1024 NTSTATUS WINAPI
NtRestoreKey(HKEY
,HANDLE
,ULONG
);
1025 NTSTATUS WINAPI
NtResumeThread(HANDLE
,PULONG
);
1026 NTSTATUS WINAPI
NtSaveKey(HKEY
,HANDLE
);
1027 NTSTATUS WINAPI
NtSetContextThread(HANDLE
,const CONTEXT
*);
1028 NTSTATUS WINAPI
NtSetDefaultLocale(BOOLEAN
,LCID
);
1029 NTSTATUS WINAPI
NtSetEvent(HANDLE
,PULONG
);
1030 NTSTATUS WINAPI
NtSetInformationFile(HANDLE
,PIO_STATUS_BLOCK
,PVOID
,ULONG
,FILE_INFORMATION_CLASS
);
1031 NTSTATUS WINAPI
NtSetInformationKey(HKEY
,const int,PVOID
,ULONG
);
1032 NTSTATUS WINAPI
NtSetInformationObject(HANDLE
, OBJECT_INFORMATION_CLASS
, PVOID
, ULONG
);
1033 NTSTATUS WINAPI
NtSetInformationThread(HANDLE
,THREADINFOCLASS
,LPCVOID
,ULONG
);
1034 NTSTATUS WINAPI
NtSetSecurityObject(HANDLE
,SECURITY_INFORMATION
,PSECURITY_DESCRIPTOR
);
1035 NTSTATUS WINAPI
NtSetSystemTime(const LARGE_INTEGER
*,LARGE_INTEGER
*);
1036 NTSTATUS WINAPI
NtSetTimer(HANDLE
, const LARGE_INTEGER
*, PTIMERAPCROUTINE
, PVOID
, BOOLEAN
, ULONG
, BOOLEAN
*);
1037 NTSTATUS WINAPI
NtSetValueKey(HKEY
,const UNICODE_STRING
*,ULONG
,ULONG
,const void *,ULONG
);
1038 NTSTATUS WINAPI
NtSuspendThread(HANDLE
,PULONG
);
1039 NTSTATUS WINAPI
NtTerminateProcess(HANDLE
,LONG
);
1040 NTSTATUS WINAPI
NtTerminateThread(HANDLE
,LONG
);
1041 NTSTATUS WINAPI
NtUnloadKey(HKEY
);
1042 NTSTATUS WINAPI
NtUnlockFile(HANDLE
,PIO_STATUS_BLOCK
,PLARGE_INTEGER
,PLARGE_INTEGER
,PULONG
);
1043 NTSTATUS WINAPI
NtUnlockVirtualMemory(HANDLE
,PVOID
*,ULONG
*,ULONG
);
1044 NTSTATUS WINAPI
NtUnmapViewOfSection(HANDLE
,PVOID
);
1045 NTSTATUS WINAPI
NtWaitForSingleObject(HANDLE
,BOOLEAN
,const LARGE_INTEGER
*);
1046 NTSTATUS WINAPI
NtWaitForMultipleObjects(ULONG
,const HANDLE
*,BOOLEAN
,BOOLEAN
,const LARGE_INTEGER
*);
1047 NTSTATUS WINAPI
NtWriteFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,const void*,ULONG
,PLARGE_INTEGER
,PULONG
);
1048 NTSTATUS WINAPI
NtWriteVirtualMemory(HANDLE
,void*,const void*,SIZE_T
,SIZE_T
*);
1050 void WINAPI
RtlAcquirePebLock(void);
1051 BYTE WINAPI
RtlAcquireResourceExclusive(LPRTL_RWLOCK
,BYTE
);
1052 BYTE WINAPI
RtlAcquireResourceShared(LPRTL_RWLOCK
,BYTE
);
1053 NTSTATUS WINAPI
RtlAddAce(PACL
,DWORD
,DWORD
,PACE_HEADER
,DWORD
);
1054 NTSTATUS WINAPI
RtlAddAccessAllowedAce(PACL
,DWORD
,DWORD
,PSID
);
1055 NTSTATUS WINAPI
RtlAddAccessAllowedAceEx(PACL
,DWORD
,DWORD
,DWORD
,PSID
);
1056 NTSTATUS WINAPI
RtlAddAccessDeniedAce(PACL
,DWORD
,DWORD
,PSID
);
1057 NTSTATUS WINAPI
RtlAddAccessDeniedAceEx(PACL
,DWORD
,DWORD
,DWORD
,PSID
);
1058 PVOID WINAPI
RtlAddVectoredExceptionHandler(ULONG
,PVECTORED_EXCEPTION_HANDLER
);
1059 DWORD WINAPI
RtlAdjustPrivilege(DWORD
,DWORD
,DWORD
,DWORD
);
1060 BOOLEAN WINAPI
RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY
,BYTE
,DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,PSID
*);
1061 PVOID WINAPI
RtlAllocateHeap(HANDLE
,ULONG
,ULONG
);
1062 DWORD WINAPI
RtlAnsiStringToUnicodeSize(const STRING
*);
1063 NTSTATUS WINAPI
RtlAnsiStringToUnicodeString(PUNICODE_STRING
,PCANSI_STRING
,BOOLEAN
);
1064 NTSTATUS WINAPI
RtlAppendAsciizToString(STRING
*,LPCSTR
);
1065 NTSTATUS WINAPI
RtlAppendStringToString(STRING
*,const STRING
*);
1066 NTSTATUS WINAPI
RtlAppendUnicodeStringToString(UNICODE_STRING
*,const UNICODE_STRING
*);
1067 NTSTATUS WINAPI
RtlAppendUnicodeToString(UNICODE_STRING
*,LPCWSTR
);
1068 BOOLEAN WINAPI
RtlAreAllAccessesGranted(ACCESS_MASK
,ACCESS_MASK
);
1069 BOOLEAN WINAPI
RtlAreAnyAccessesGranted(ACCESS_MASK
,ACCESS_MASK
);
1070 BOOLEAN WINAPI
RtlAreBitsSet(PCRTL_BITMAP
,ULONG
,ULONG
);
1071 BOOLEAN WINAPI
RtlAreBitsClear(PCRTL_BITMAP
,ULONG
,ULONG
);
1073 NTSTATUS WINAPI
RtlCharToInteger(PCSZ
,ULONG
,PULONG
);
1074 void WINAPI
RtlClearAllBits(PRTL_BITMAP
);
1075 void WINAPI
RtlClearBits(PRTL_BITMAP
,ULONG
,ULONG
);
1076 ULONG WINAPI
RtlCompactHeap(HANDLE
,ULONG
);
1077 LONG WINAPI
RtlCompareString(const STRING
*,const STRING
*,BOOLEAN
);
1078 LONG WINAPI
RtlCompareUnicodeString(const UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1079 DWORD WINAPI
RtlComputeCrc32(DWORD
,PBYTE
,INT
);
1080 NTSTATUS WINAPI
RtlConvertSidToUnicodeString(PUNICODE_STRING
,PSID
,BOOLEAN
);
1081 LONGLONG WINAPI
RtlConvertLongToLargeInteger(LONG
);
1082 ULONGLONG WINAPI
RtlConvertUlongToLargeInteger(ULONG
);
1083 void WINAPI
RtlCopyLuid(PLUID
,const LUID
*);
1084 void WINAPI
RtlCopyLuidAndAttributesArray(ULONG
,const LUID_AND_ATTRIBUTES
*,PLUID_AND_ATTRIBUTES
);
1085 DWORD WINAPI
RtlCopySid(DWORD
,PSID
,PSID
);
1086 void WINAPI
RtlCopyString(STRING
*,const STRING
*);
1087 void WINAPI
RtlCopyUnicodeString(UNICODE_STRING
*,const UNICODE_STRING
*);
1088 NTSTATUS WINAPI
RtlCreateAcl(PACL
,DWORD
,DWORD
);
1089 NTSTATUS WINAPI
RtlCreateEnvironment(BOOLEAN
, PWSTR
*);
1090 HANDLE WINAPI
RtlCreateHeap(ULONG
,PVOID
,ULONG
,ULONG
,PVOID
,PRTL_HEAP_DEFINITION
);
1091 NTSTATUS WINAPI
RtlCreateProcessParameters(RTL_USER_PROCESS_PARAMETERS
**,const UNICODE_STRING
*,
1092 const UNICODE_STRING
*,const UNICODE_STRING
*,
1093 const UNICODE_STRING
*,PWSTR
,const UNICODE_STRING
*,
1094 const UNICODE_STRING
*,const UNICODE_STRING
*,
1095 const UNICODE_STRING
*);
1096 NTSTATUS WINAPI
RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR
,DWORD
);
1097 BOOLEAN WINAPI
RtlCreateUnicodeString(PUNICODE_STRING
,LPCWSTR
);
1098 BOOLEAN WINAPI
RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING
,LPCSTR
);
1099 NTSTATUS WINAPI
RtlCreateUserThread(HANDLE
,const SECURITY_DESCRIPTOR
*,BOOLEAN
,PVOID
,SIZE_T
,SIZE_T
,PRTL_THREAD_START_ROUTINE
,void*,HANDLE
*,CLIENT_ID
*);
1101 NTSTATUS WINAPI
RtlDeleteCriticalSection(RTL_CRITICAL_SECTION
*);
1102 void WINAPI
RtlDeleteResource(LPRTL_RWLOCK
);
1103 DWORD WINAPI
RtlDeleteSecurityObject(DWORD
);
1104 PRTL_USER_PROCESS_PARAMETERS WINAPI
RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS
*);
1105 NTSTATUS WINAPI
RtlDestroyEnvironment(PWSTR
);
1106 HANDLE WINAPI
RtlDestroyHeap(HANDLE
);
1107 void WINAPI
RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS
*);
1108 DOS_PATHNAME_TYPE WINAPI
RtlDetermineDosPathNameType_U(PCWSTR
);
1109 BOOLEAN WINAPI
RtlDoesFileExists_U(LPCWSTR
);
1110 BOOLEAN WINAPI
RtlDosPathNameToNtPathName_U(LPWSTR
,PUNICODE_STRING
,PWSTR
*,CURDIR
*);
1111 ULONG WINAPI
RtlDosSearchPath_U(LPCWSTR
, LPCWSTR
, LPCWSTR
, ULONG
, LPWSTR
, LPWSTR
*);
1112 WCHAR WINAPI
RtlDowncaseUnicodeChar(WCHAR
);
1113 NTSTATUS WINAPI
RtlDowncaseUnicodeString(UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1114 void WINAPI
RtlDumpResource(LPRTL_RWLOCK
);
1115 NTSTATUS WINAPI
RtlDuplicateUnicodeString(int,const UNICODE_STRING
*,UNICODE_STRING
*);
1117 LONGLONG WINAPI
RtlEnlargedIntegerMultiply(INT
,INT
);
1118 ULONGLONG WINAPI
RtlEnlargedUnsignedMultiply(UINT
,UINT
);
1119 UINT WINAPI
RtlEnlargedUnsignedDivide(ULONGLONG
,UINT
,UINT
*);
1120 NTSTATUS WINAPI
RtlEnterCriticalSection(RTL_CRITICAL_SECTION
*);
1121 void WINAPI
RtlEraseUnicodeString(UNICODE_STRING
*);
1122 NTSTATUS WINAPI
RtlEqualComputerName(const UNICODE_STRING
*,const UNICODE_STRING
*);
1123 NTSTATUS WINAPI
RtlEqualDomainName(const UNICODE_STRING
*,const UNICODE_STRING
*);
1124 BOOLEAN WINAPI
RtlEqualLuid(const LUID
*,const LUID
*);
1125 BOOL WINAPI
RtlEqualPrefixSid(PSID
,PSID
);
1126 BOOL WINAPI
RtlEqualSid(PSID
,PSID
);
1127 BOOLEAN WINAPI
RtlEqualString(const STRING
*,const STRING
*,BOOLEAN
);
1128 BOOLEAN WINAPI
RtlEqualUnicodeString(const UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1129 NTSTATUS WINAPI
RtlExpandEnvironmentStrings_U(PWSTR
, const UNICODE_STRING
*, UNICODE_STRING
*, ULONG
*);
1130 LONGLONG WINAPI
RtlExtendedMagicDivide(LONGLONG
,LONGLONG
,INT
);
1131 LONGLONG WINAPI
RtlExtendedIntegerMultiply(LONGLONG
,INT
);
1132 LONGLONG WINAPI
RtlExtendedLargeIntegerDivide(LONGLONG
,INT
,INT
*);
1134 NTSTATUS WINAPI
RtlFindCharInUnicodeString(int,const UNICODE_STRING
*,const UNICODE_STRING
*,USHORT
*);
1135 ULONG WINAPI
RtlFindClearBits(PCRTL_BITMAP
,ULONG
,ULONG
);
1136 ULONG WINAPI
RtlFindClearBitsAndSet(PRTL_BITMAP
,ULONG
,ULONG
);
1137 ULONG WINAPI
RtlFindClearRuns(PCRTL_BITMAP
,PRTL_BITMAP_RUN
,ULONG
,BOOLEAN
);
1138 ULONG WINAPI
RtlFindLastBackwardRunSet(PCRTL_BITMAP
,ULONG
,PULONG
);
1139 ULONG WINAPI
RtlFindLastBackwardRunClear(PCRTL_BITMAP
,ULONG
,PULONG
);
1140 CCHAR WINAPI
RtlFindLeastSignificantBit(ULONGLONG
);
1141 ULONG WINAPI
RtlFindLongestRunSet(PCRTL_BITMAP
,PULONG
);
1142 ULONG WINAPI
RtlFindLongestRunClear(PCRTL_BITMAP
,PULONG
);
1143 NTSTATUS WINAPI
RtlFindMessage(HMODULE
,ULONG
,ULONG
,ULONG
,const MESSAGE_RESOURCE_ENTRY
**);
1144 CCHAR WINAPI
RtlFindMostSignificantBit(ULONGLONG
);
1145 ULONG WINAPI
RtlFindNextForwardRunSet(PCRTL_BITMAP
,ULONG
,PULONG
);
1146 ULONG WINAPI
RtlFindNextForwardRunClear(PCRTL_BITMAP
,ULONG
,PULONG
);
1147 ULONG WINAPI
RtlFindSetBits(PCRTL_BITMAP
,ULONG
,ULONG
);
1148 ULONG WINAPI
RtlFindSetBitsAndClear(PRTL_BITMAP
,ULONG
,ULONG
);
1149 ULONG WINAPI
RtlFindSetRuns(PCRTL_BITMAP
,PRTL_BITMAP_RUN
,ULONG
,BOOLEAN
);
1150 BOOLEAN WINAPI
RtlFirstFreeAce(PACL
,PACE_HEADER
*);
1151 NTSTATUS WINAPI
RtlFormatCurrentUserKeyPath(PUNICODE_STRING
);
1152 void WINAPI
RtlFreeAnsiString(PANSI_STRING
);
1153 BOOLEAN WINAPI
RtlFreeHeap(HANDLE
,ULONG
,PVOID
);
1154 void WINAPI
RtlFreeOemString(POEM_STRING
);
1155 DWORD WINAPI
RtlFreeSid(PSID
);
1156 void WINAPI
RtlFreeUnicodeString(PUNICODE_STRING
);
1158 DWORD WINAPI
RtlGetAce(PACL
,DWORD
,LPVOID
*);
1159 NTSTATUS WINAPI
RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR
, PSECURITY_DESCRIPTOR_CONTROL
,LPDWORD
);
1160 NTSTATUS WINAPI
RtlGetCurrentDirectory_U(ULONG
, LPWSTR
);
1161 NTSTATUS WINAPI
RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR
,PBOOLEAN
,PACL
*,PBOOLEAN
);
1162 ULONG WINAPI
RtlGetFullPathName_U(PCWSTR
,ULONG
,PWSTR
,PWSTR
*);
1163 NTSTATUS WINAPI
RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR
,PSID
*,PBOOLEAN
);
1164 DWORD WINAPI
RtlGetLongestNtPathLength(void);
1165 BOOLEAN WINAPI
RtlGetNtProductType(LPDWORD
);
1166 NTSTATUS WINAPI
RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR
,PSID
*,PBOOLEAN
);
1167 ULONG WINAPI
RtlGetProcessHeaps(ULONG
,HANDLE
*);
1168 NTSTATUS WINAPI
RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR
,PBOOLEAN
,PACL
*,PBOOLEAN
);
1169 NTSTATUS WINAPI
RtlGetVersion(RTL_OSVERSIONINFOEXW
*);
1171 PSID_IDENTIFIER_AUTHORITY WINAPI
RtlIdentifierAuthoritySid(PSID
);
1172 PVOID WINAPI
RtlImageDirectoryEntryToData(HMODULE
,BOOL
,WORD
,ULONG
*);
1173 PIMAGE_NT_HEADERS WINAPI
RtlImageNtHeader(HMODULE
);
1174 PIMAGE_SECTION_HEADER WINAPI
RtlImageRvaToSection(const IMAGE_NT_HEADERS
*,HMODULE
,DWORD
);
1175 PVOID WINAPI
RtlImageRvaToVa(const IMAGE_NT_HEADERS
*,HMODULE
,DWORD
,IMAGE_SECTION_HEADER
**);
1176 BOOL WINAPI
RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL
);
1177 void WINAPI
RtlInitString(PSTRING
,PCSZ
);
1178 void WINAPI
RtlInitAnsiString(PANSI_STRING
,PCSZ
);
1179 void WINAPI
RtlInitUnicodeString(PUNICODE_STRING
,PCWSTR
);
1180 NTSTATUS WINAPI
RtlInitUnicodeStringEx(PUNICODE_STRING
,PCWSTR
);
1181 NTSTATUS WINAPI
RtlInitializeCriticalSection(RTL_CRITICAL_SECTION
*);
1182 NTSTATUS WINAPI
RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION
*,DWORD
);
1183 void WINAPI
RtlInitializeBitMap(PRTL_BITMAP
,LPBYTE
,ULONG
);
1184 void WINAPI
RtlInitializeResource(LPRTL_RWLOCK
);
1185 BOOL WINAPI
RtlInitializeSid(PSID
,PSID_IDENTIFIER_AUTHORITY
,BYTE
);
1187 NTSTATUS WINAPI
RtlInt64ToUnicodeString(ULONGLONG
,ULONG
,UNICODE_STRING
*);
1188 NTSTATUS WINAPI
RtlIntegerToChar(ULONG
,ULONG
,ULONG
,PCHAR
);
1189 NTSTATUS WINAPI
RtlIntegerToUnicodeString(ULONG
,ULONG
,UNICODE_STRING
*);
1190 ULONG WINAPI
RtlIsDosDeviceName_U(PCWSTR
);
1191 BOOLEAN WINAPI
RtlIsNameLegalDOS8Dot3(const UNICODE_STRING
*,POEM_STRING
,PBOOLEAN
);
1192 DWORD WINAPI
RtlIsTextUnicode(LPVOID
,DWORD
,DWORD
*);
1194 LONGLONG WINAPI
RtlLargeIntegerAdd(LONGLONG
,LONGLONG
);
1195 LONGLONG WINAPI
RtlLargeIntegerArithmeticShift(LONGLONG
,INT
);
1196 ULONGLONG WINAPI
RtlLargeIntegerDivide( ULONGLONG
,ULONGLONG
,ULONGLONG
*);
1197 LONGLONG WINAPI
RtlLargeIntegerNegate(LONGLONG
);
1198 LONGLONG WINAPI
RtlLargeIntegerShiftLeft(LONGLONG
,INT
);
1199 LONGLONG WINAPI
RtlLargeIntegerShiftRight(LONGLONG
,INT
);
1200 LONGLONG WINAPI
RtlLargeIntegerSubtract(LONGLONG
,LONGLONG
);
1201 NTSTATUS WINAPI
RtlLargeIntegerToChar(const ULONGLONG
*,ULONG
,ULONG
,PCHAR
);
1202 NTSTATUS WINAPI
RtlLeaveCriticalSection(RTL_CRITICAL_SECTION
*);
1203 DWORD WINAPI
RtlLengthRequiredSid(DWORD
);
1204 ULONG WINAPI
RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR
);
1205 DWORD WINAPI
RtlLengthSid(PSID
);
1206 NTSTATUS WINAPI
RtlLocalTimeToSystemTime(const LARGE_INTEGER
*,PLARGE_INTEGER
);
1207 BOOLEAN WINAPI
RtlLockHeap(HANDLE
);
1209 NTSTATUS WINAPI
RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR
,PSECURITY_DESCRIPTOR
,LPDWORD
);
1210 void WINAPI
RtlMapGenericMask(PACCESS_MASK
,const GENERIC_MAPPING
*);
1211 NTSTATUS WINAPI
RtlMultiByteToUnicodeN(LPWSTR
,DWORD
,LPDWORD
,LPCSTR
,DWORD
);
1212 NTSTATUS WINAPI
RtlMultiByteToUnicodeSize(DWORD
*,LPCSTR
,UINT
);
1214 DWORD WINAPI
RtlNewSecurityObject(DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,DWORD
);
1215 PRTL_USER_PROCESS_PARAMETERS WINAPI
RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS
*);
1216 ULONG WINAPI
RtlNtStatusToDosError(NTSTATUS
);
1217 ULONG WINAPI
RtlNumberOfSetBits(PCRTL_BITMAP
);
1218 ULONG WINAPI
RtlNumberOfClearBits(PCRTL_BITMAP
);
1220 UINT WINAPI
RtlOemStringToUnicodeSize(const STRING
*);
1221 NTSTATUS WINAPI
RtlOemStringToUnicodeString(UNICODE_STRING
*,const STRING
*,BOOLEAN
);
1222 NTSTATUS WINAPI
RtlOemToUnicodeN(LPWSTR
,DWORD
,LPDWORD
,LPCSTR
,DWORD
);
1223 DWORD WINAPI
RtlOpenCurrentUser(ACCESS_MASK
,PHKEY
);
1225 BOOLEAN WINAPI
RtlPrefixString(const STRING
*,const STRING
*,BOOLEAN
);
1226 BOOLEAN WINAPI
RtlPrefixUnicodeString(const UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1228 NTSTATUS WINAPI
RtlQueryEnvironmentVariable_U(PWSTR
,PUNICODE_STRING
,PUNICODE_STRING
);
1229 NTSTATUS WINAPI
RtlQueryTimeZoneInformation(LPTIME_ZONE_INFORMATION
);
1231 void WINAPI
RtlRaiseException(PEXCEPTION_RECORD
);
1232 void WINAPI
RtlRaiseStatus(NTSTATUS
);
1233 ULONG WINAPI
RtlRandom(PULONG
);
1234 PVOID WINAPI
RtlReAllocateHeap(HANDLE
,ULONG
,PVOID
,ULONG
);
1235 void WINAPI
RtlReleasePebLock(void);
1236 void WINAPI
RtlReleaseResource(LPRTL_RWLOCK
);
1237 ULONG WINAPI
RtlRemoveVectoredExceptionHandler(PVOID
);
1239 void WINAPI
RtlSecondsSince1970ToTime(DWORD
,LARGE_INTEGER
*);
1240 void WINAPI
RtlSecondsSince1980ToTime(DWORD
,LARGE_INTEGER
*);
1241 void WINAPI
RtlSetAllBits(PRTL_BITMAP
);
1242 void WINAPI
RtlSetBits(PRTL_BITMAP
,ULONG
,ULONG
);
1243 NTSTATUS WINAPI
RtlSetCurrentDirectory_U(const UNICODE_STRING
*);
1244 void WINAPI
RtlSetCurrentEnvironment(PWSTR
, PWSTR
*);
1245 NTSTATUS WINAPI
RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR
,BOOLEAN
,PACL
,BOOLEAN
);
1246 NTSTATUS WINAPI
RtlSetEnvironmentVariable(PWSTR
*,PUNICODE_STRING
,PUNICODE_STRING
);
1247 NTSTATUS WINAPI
RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR
,PSID
,BOOLEAN
);
1248 NTSTATUS WINAPI
RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR
,PSID
,BOOLEAN
);
1249 NTSTATUS WINAPI
RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR
,BOOLEAN
,PACL
,BOOLEAN
);
1250 NTSTATUS WINAPI
RtlSetTimeZoneInformation(const TIME_ZONE_INFORMATION
*);
1251 ULONG WINAPI
RtlSizeHeap(HANDLE
,ULONG
,PVOID
);
1252 LPDWORD WINAPI
RtlSubAuthoritySid(PSID
,DWORD
);
1253 LPBYTE WINAPI
RtlSubAuthorityCountSid(PSID
);
1254 NTSTATUS WINAPI
RtlSystemTimeToLocalTime(const LARGE_INTEGER
*,PLARGE_INTEGER
);
1256 void WINAPI
RtlTimeToTimeFields(const LARGE_INTEGER
*,PTIME_FIELDS
);
1257 BOOLEAN WINAPI
RtlTimeFieldsToTime(PTIME_FIELDS
,PLARGE_INTEGER
);
1258 void WINAPI
RtlTimeToElapsedTimeFields(const LARGE_INTEGER
*,PTIME_FIELDS
);
1259 BOOLEAN WINAPI
RtlTimeToSecondsSince1970(const LARGE_INTEGER
*,LPDWORD
);
1260 BOOLEAN WINAPI
RtlTimeToSecondsSince1980(const LARGE_INTEGER
*,LPDWORD
);
1261 BOOL WINAPI
RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION
*);
1263 ULONGLONG __cdecl
RtlUlonglongByteSwap(ULONGLONG
);
1264 DWORD WINAPI
RtlUnicodeStringToAnsiSize(const UNICODE_STRING
*);
1265 NTSTATUS WINAPI
RtlUnicodeStringToAnsiString(PANSI_STRING
,PCUNICODE_STRING
,BOOLEAN
);
1266 NTSTATUS WINAPI
RtlUnicodeStringToInteger(const UNICODE_STRING
*,ULONG
,ULONG
*);
1267 DWORD WINAPI
RtlUnicodeStringToOemSize(const UNICODE_STRING
*);
1268 NTSTATUS WINAPI
RtlUnicodeStringToOemString(POEM_STRING
,PCUNICODE_STRING
,BOOLEAN
);
1269 NTSTATUS WINAPI
RtlUnicodeToMultiByteN(LPSTR
,DWORD
,LPDWORD
,LPCWSTR
,DWORD
);
1270 NTSTATUS WINAPI
RtlUnicodeToMultiByteSize(PULONG
,PCWSTR
,ULONG
);
1271 NTSTATUS WINAPI
RtlUnicodeToOemN(LPSTR
,DWORD
,LPDWORD
,LPCWSTR
,DWORD
);
1272 ULONG WINAPI
RtlUniform(PULONG
);
1273 BOOLEAN WINAPI
RtlUnlockHeap(HANDLE
);
1274 void WINAPI
RtlUnwind(PVOID
,PVOID
,PEXCEPTION_RECORD
,PVOID
);
1276 void WINAPI
RtlUnwind2(FRAME_POINTERS
,PVOID
,PEXCEPTION_RECORD
,PVOID
,PCONTEXT
);
1277 void WINAPI
RtlUnwindEx(FRAME_POINTERS
,PVOID
,PEXCEPTION_RECORD
,PVOID
,PCONTEXT
,PUNWIND_HISTORY_TABLE
);
1279 WCHAR WINAPI
RtlUpcaseUnicodeChar(WCHAR
);
1280 NTSTATUS WINAPI
RtlUpcaseUnicodeString(UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1281 NTSTATUS WINAPI
RtlUpcaseUnicodeStringToAnsiString(STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1282 NTSTATUS WINAPI
RtlUpcaseUnicodeStringToCountedOemString(STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1283 NTSTATUS WINAPI
RtlUpcaseUnicodeStringToOemString(STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1284 NTSTATUS WINAPI
RtlUpcaseUnicodeToMultiByteN(LPSTR
,DWORD
,LPDWORD
,LPCWSTR
,DWORD
);
1285 NTSTATUS WINAPI
RtlUpcaseUnicodeToOemN(LPSTR
,DWORD
,LPDWORD
,LPCWSTR
,DWORD
);
1286 CHAR WINAPI
RtlUpperChar(CHAR
);
1287 void WINAPI
RtlUpperString(STRING
*,const STRING
*);
1289 NTSTATUS WINAPI
RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR
);
1290 BOOLEAN WINAPI
RtlValidAcl(PACL
);
1291 BOOLEAN WINAPI
RtlValidSid(PSID
);
1292 BOOLEAN WINAPI
RtlValidateHeap(HANDLE
,ULONG
,LPCVOID
);
1293 NTSTATUS WINAPI
RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW
*,DWORD
,DWORDLONG
);
1295 NTSTATUS WINAPI
RtlWalkHeap(HANDLE
,PVOID
);
1297 NTSTATUS WINAPI
RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION
*);
1298 NTSTATUS WINAPI
RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION
*);
1300 /***********************************************************************
1304 #define InitializeObjectAttributes(p,n,a,r,s) \
1306 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
1307 (p)->RootDirectory = r; \
1308 (p)->Attributes = a; \
1309 (p)->ObjectName = n; \
1310 (p)->SecurityDescriptor = s; \
1311 (p)->SecurityQualityOfService = NULL; \
1314 #define NtCurrentProcess() ((HANDLE)-1)
1316 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
1317 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
1318 #define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1319 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1320 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
1321 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
1322 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
1324 inline static BOOLEAN
RtlCheckBit(PCRTL_BITMAP lpBits
, ULONG ulBit
)
1326 if (lpBits
&& ulBit
< lpBits
->SizeOfBitMap
&&
1327 lpBits
->BitMapBuffer
[ulBit
>> 3] & (1 << (ulBit
& 7)))
1332 #define RtlClearAllBits(p) \
1334 PRTL_BITMAP _p = (p); \
1335 memset(_p->BitMapBuffer,0,((_p->SizeOfBitMap + 31) & 0xffffffe0) >> 3); \
1338 #define RtlInitializeBitMap(p,b,s) \
1340 PRTL_BITMAP _p = (p); \
1341 _p->SizeOfBitMap = (s); \
1342 _p->BitMapBuffer = (b); \
1345 #define RtlSetAllBits(p) \
1347 PRTL_BITMAP _p = (p); \
1348 memset(_p->BitMapBuffer,0xff,((_p->SizeOfBitMap + 31) & 0xffffffe0) >> 3); \
1351 /* These are implemented as __fastcall, so we can't let Winelib apps link with them */
1352 inline static USHORT
RtlUshortByteSwap(USHORT s
)
1354 return (s
>> 8) | (s
<< 8);
1356 inline static ULONG
RtlUlongByteSwap(ULONG i
)
1358 #if defined(__i386__) && defined(__GNUC__)
1360 __asm__("bswap %0" : "=r" (ret
) : "0" (i
) );
1363 return ((ULONG
)RtlUshortByteSwap((USHORT
)i
) << 16) | RtlUshortByteSwap((USHORT
)(i
>> 16));
1367 /*************************************************************************
1368 * Loader functions and structures.
1370 * Those are not part of standard Winternl.h
1372 typedef struct _LDR_MODULE
1374 LIST_ENTRY InLoadOrderModuleList
;
1375 LIST_ENTRY InMemoryOrderModuleList
;
1376 LIST_ENTRY InInitializationOrderModuleList
;
1380 UNICODE_STRING FullDllName
;
1381 UNICODE_STRING BaseDllName
;
1385 HANDLE SectionHandle
;
1387 ULONG TimeDateStamp
;
1388 } LDR_MODULE
, *PLDR_MODULE
;
1390 /* those defines are (some of the) regular LDR_MODULE.Flags values */
1391 #define LDR_IMAGE_IS_DLL 0x00000004
1392 #define LDR_LOAD_IN_PROGRESS 0x00001000
1393 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
1394 #define LDR_NO_DLL_CALLS 0x00040000
1395 #define LDR_PROCESS_ATTACHED 0x00080000
1396 #define LDR_MODULE_REBASED 0x00200000
1398 /* these ones is Wine specific */
1399 #define LDR_DONT_RESOLVE_REFS 0x40000000
1400 #define LDR_WINE_INTERNAL 0x80000000
1402 /* FIXME: to be checked */
1403 #define MAXIMUM_FILENAME_LENGTH 256
1405 typedef struct _SYSTEM_MODULE
1409 PVOID ImageBaseAddress
;
1416 BYTE Name
[MAXIMUM_FILENAME_LENGTH
];
1417 } SYSTEM_MODULE
, *PSYSTEM_MODULE
;
1419 typedef struct _SYSTEM_MODULE_INFORMATION
1422 SYSTEM_MODULE Modules
[1]; /* FIXME: should be Modules[0] */
1423 } SYSTEM_MODULE_INFORMATION
, *PSYSTEM_MODULE_INFORMATION
;
1425 NTSTATUS WINAPI
LdrDisableThreadCalloutsForDll(HMODULE
);
1426 NTSTATUS WINAPI
LdrFindEntryForAddress(const void*, PLDR_MODULE
*);
1427 NTSTATUS WINAPI
LdrLockLoaderLock(ULONG
,ULONG
*,ULONG
*);
1428 NTSTATUS WINAPI
LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION
*, ULONG
, ULONG
*);
1429 NTSTATUS WINAPI
LdrUnloadDll(HMODULE
);
1430 NTSTATUS WINAPI
LdrUnlockLoaderLock(ULONG
,ULONG
);
1432 /* list manipulation macros */
1433 #define InitializeListHead(le) (void)((le)->Flink = (le)->Blink = (le))
1434 #define InsertHeadList(le,e) do { PLIST_ENTRY f = (le)->Flink; (e)->Flink = f; (e)->Blink = (le); f->Blink = (e); (le)->Flink = (e); } while (0)
1435 #define InsertTailList(le,e) do { PLIST_ENTRY b = (le)->Blink; (e)->Flink = (le); (e)->Blink = b; b->Flink = (e); (le)->Blink = (e); } while (0)
1436 #define IsListEmpty(le) ((le)->Flink == (le))
1437 #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)
1438 static inline PLIST_ENTRY
RemoveHeadList(PLIST_ENTRY le
)
1440 PLIST_ENTRY f
, b
, e
;
1443 f
= le
->Flink
->Flink
;
1444 b
= le
->Flink
->Blink
;
1448 if (e
!= le
) e
->Flink
= e
->Blink
= NULL
;
1451 static inline PLIST_ENTRY
RemoveTailList(PLIST_ENTRY le
)
1453 PLIST_ENTRY f
, b
, e
;
1456 f
= le
->Blink
->Flink
;
1457 b
= le
->Blink
->Blink
;
1461 if (e
!= le
) e
->Flink
= e
->Blink
= NULL
;
1467 #endif /* defined(__cplusplus) */
1469 #endif /* __WINE_WINTERNAL_H */