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
30 #endif /* defined(__cplusplus) */
32 /***********************************************************************
43 /***********************************************************************
53 PVOID ReservedForOle
; /* Windows 2000 only */
55 PVOID TlsExpansionSlots
;
59 /**********************************************************************
60 * Fundamental types and data structures
63 typedef LONG NTSTATUS
;
65 typedef CONST
char *PCSZ
;
68 typedef CSHORT
*PCSHORT
;
70 typedef struct _STRING
{
76 typedef STRING ANSI_STRING
;
77 typedef PSTRING PANSI_STRING
;
78 typedef const STRING
*PCANSI_STRING
;
80 typedef STRING OEM_STRING
;
81 typedef PSTRING POEM_STRING
;
82 typedef const STRING
*PCOEM_STRING
;
84 typedef struct _UNICODE_STRING
{
85 USHORT Length
; /* bytes */
86 USHORT MaximumLength
; /* bytes */
88 } UNICODE_STRING
, *PUNICODE_STRING
;
90 typedef const UNICODE_STRING
*PCUNICODE_STRING
;
92 typedef struct _CLIENT_ID
96 } CLIENT_ID
, *PCLIENT_ID
;
98 /***********************************************************************
102 typedef enum _FILE_INFORMATION_CLASS
{
103 FileDirectoryInformation
= 1,
104 FileFullDirectoryInformation
,
105 FileBothDirectoryInformation
,
106 FileBasicInformation
,
107 FileStandardInformation
,
108 FileInternalInformation
,
110 FileAccessInformation
,
112 FileRenameInformation
,
114 FileNamesInformation
,
115 FileDispositionInformation
,
116 FilePositionInformation
,
117 FileFullEaInformation
,
119 FileAlignmentInformation
,
121 FileAllocationInformation
,
122 FileEndOfFileInformation
,
123 FileAlternateNameInformation
,
124 FileStreamInformation
,
126 FilePipeLocalInformation
,
127 FilePipeRemoteInformation
,
128 FileMailslotQueryInformation
,
129 FileMailslotSetInformation
,
130 FileCompressionInformation
,
131 FileObjectIdInformation
,
132 FileCompletionInformation
,
133 FileMoveClusterInformation
,
134 FileQuotaInformation
,
135 FileReparsePointInformation
,
136 FileNetworkOpenInformation
,
137 FileAttributeTagInformation
,
138 FileTrackingInformation
,
139 FileMaximumInformation
140 } FILE_INFORMATION_CLASS
, *PFILE_INFORMATION_CLASS
;
142 typedef struct _FILE_BASIC_INFORMATION
{
143 LARGE_INTEGER CreationTime
;
144 LARGE_INTEGER LastAccessTime
;
145 LARGE_INTEGER LastWriteTime
;
146 LARGE_INTEGER ChangeTime
;
147 ULONG FileAttributes
;
148 } FILE_BASIC_INFORMATION
, *PFILE_BASIC_INFORMATION
;
150 typedef struct _FILE_STANDARD_INFORMATION
{
151 LARGE_INTEGER AllocationSize
;
152 LARGE_INTEGER EndOfFile
;
154 BOOLEAN DeletePending
;
156 } FILE_STANDARD_INFORMATION
, *PFILE_STANDARD_INFORMATION
;
158 typedef struct _FILE_POSITION_INFORMATION
{
159 LARGE_INTEGER CurrentByteOffset
;
160 } FILE_POSITION_INFORMATION
, *PFILE_POSITION_INFORMATION
;
162 typedef struct _FILE_ALIGNMENT_INFORMATION
{
163 ULONG AlignmentRequirement
;
164 } FILE_ALIGNMENT_INFORMATION
, *PFILE_ALIGNMENT_INFORMATION
;
166 typedef struct _FILE_NETWORK_OPEN_INFORMATION
{
167 LARGE_INTEGER CreationTime
;
168 LARGE_INTEGER LastAccessTime
;
169 LARGE_INTEGER LastWriteTime
;
170 LARGE_INTEGER ChangeTime
;
171 LARGE_INTEGER AllocationSize
;
172 LARGE_INTEGER EndOfFile
;
173 ULONG FileAttributes
;
174 } FILE_NETWORK_OPEN_INFORMATION
, *PFILE_NETWORK_OPEN_INFORMATION
;
176 typedef struct _FILE_FULL_EA_INFORMATION
{
177 ULONG NextEntryOffset
;
180 USHORT EaValueLength
;
182 } FILE_FULL_EA_INFORMATION
, *PFILE_FULL_EA_INFORMATION
;
184 typedef struct _FILE_STREAM_INFORMATION
186 ULONG NextEntryOffset
;
187 ULONG StreamNameLength
;
188 LARGE_INTEGER StreamSize
;
189 LARGE_INTEGER StreamAllocationSize
;
191 } FILE_STREAM_INFORMATION
, *PFILE_STREAM_INFORMATION
;
193 struct _FILE_ATTRIBUTE_TAG_INFORMATION
195 ULONG FileAttributes
;
197 } FILE_ATTRIBUTE_TAG_INFORMATION
, *PFILE_ATTRIBUTE_TAG_INFORMATION
;
199 typedef enum _FSINFOCLASS
{
200 FileFsVolumeInformation
= 1,
201 FileFsLabelInformation
,
202 FileFsSizeInformation
,
203 FileFsDeviceInformation
,
204 FileFsAttributeInformation
,
205 FileFsControlInformation
,
206 FileFsFullSizeInformation
,
207 FileFsObjectIdInformation
,
208 FileFsMaximumInformation
209 } FS_INFORMATION_CLASS
, *PFS_INFORMATION_CLASS
;
211 typedef enum _KEY_INFORMATION_CLASS
{
215 } KEY_INFORMATION_CLASS
;
217 typedef enum _KEY_VALUE_INFORMATION_CLASS
{
218 KeyValueBasicInformation
,
219 KeyValueFullInformation
,
220 KeyValuePartialInformation
,
221 KeyValueFullInformationAlign64
,
222 KeyValuePartialInformationAlign64
223 } KEY_VALUE_INFORMATION_CLASS
;
225 typedef enum _OBJECT_INFORMATION_CLASS
{
226 DunnoTheConstants1
/* FIXME */
227 } OBJECT_INFORMATION_CLASS
, *POBJECT_INFORMATION_CLASS
;
229 typedef enum _PROCESSINFOCLASS
{
230 ProcessBasicInformation
= 0,
231 ProcessQuotaLimits
= 1,
232 ProcessIoCounters
= 2,
233 ProcessVmCounters
= 3,
235 ProcessBasePriority
= 5,
236 ProcessRaisePriority
= 6,
237 ProcessDebugPort
= 7,
238 ProcessExceptionPort
= 8,
239 ProcessAccessToken
= 9,
240 ProcessLdtInformation
= 10,
242 ProcessDefaultHardErrorMode
= 12,
243 ProcessIoPortHandlers
= 13,
244 ProcessPooledUsageAndLimits
= 14,
245 ProcessWorkingSetWatch
= 15,
246 ProcessUserModeIOPL
= 16,
247 ProcessEnableAlignmentFaultFixup
= 17,
248 ProcessPriorityClass
= 18,
249 ProcessWx86Information
= 19,
250 ProcessHandleCount
= 20,
251 ProcessAffinityMask
= 21,
252 ProcessPriorityBoost
= 22,
253 ProcessDeviceMap
= 23,
254 ProcessSessionInformation
= 24,
255 ProcessForegroundInformation
= 25,
256 ProcessWow64Information
= 26,
260 typedef enum _SECTION_INHERIT
{
265 typedef enum SYSTEM_INFORMATION_CLASS
{
266 SystemBasicInformation
= 0,
268 SystemPerformanceInformation
= 2,
269 SystemTimeOfDayInformation
= 3, /* was SystemTimeInformation */
271 SystemProcessInformation
= 5,
274 SystemProcessorPerformanceInformation
= 8,
277 SystemDriverInformation
,
287 SystemCacheInformation
,
289 SystemInterruptInformation
= 23,
290 SystemExceptionInformation
= 33,
291 SystemRegistryQuotaInformation
= 37,
292 SystemLookasideInformation
= 45
293 } SYSTEM_INFORMATION_CLASS
, *PSYSTEM_INFORMATION_CLASS
;
295 typedef enum _TIMER_TYPE
{
300 typedef enum _THREADINFOCLASS
{
301 ThreadBasicInformation
,
306 ThreadImpersonationToken
,
307 ThreadDescriptorTableEntry
,
308 ThreadEnableAlignmentFaultFixup
,
309 ThreadEventPair_Reusable
,
310 ThreadQuerySetWin32StartAddress
,
312 ThreadPerformanceCount
,
314 ThreadIdealProcessor
,
316 ThreadSetTlsArrayAddress
,
321 typedef enum _WINSTATIONINFOCLASS
{
322 WinStationInformation
= 8
323 } WINSTATIONINFOCLASS
;
327 MemoryBasicInformation
= 0
328 } MEMORY_INFORMATION_CLASS
;
330 /* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
334 UNC_PATH
, /* "//foo" */
335 ABSOLUTE_DRIVE_PATH
, /* "c:/foo" */
336 RELATIVE_DRIVE_PATH
, /* "c:foo" */
337 ABSOLUTE_PATH
, /* "/foo" */
338 RELATIVE_PATH
, /* "foo" */
339 DEVICE_PATH
, /* "//./foo" */
340 UNC_DOT_PATH
/* "//." */
343 /***********************************************************************
344 * IA64 specific types and data structures
349 typedef struct _FRAME_POINTERS
{
350 ULONGLONG MemoryStackFp
;
351 ULONGLONG BackingStoreFp
;
352 } FRAME_POINTERS
, *PFRAME_POINTERS
;
354 #define UNWIND_HISTORY_TABLE_SIZE 12
356 typedef struct _RUNTIME_FUNCTION
{
359 ULONG UnwindInfoAddress
;
360 } RUNTIME_FUNCTION
, *PRUNTIME_FUNCTION
;
362 typedef struct _UNWIND_HISTORY_TABLE_ENTRY
{
365 PRUNTIME_FUNCTION FunctionEntry
;
366 } UNWIND_HISTORY_TABLE_ENTRY
, *PUNWIND_HISTORY_TABLE_ENTRY
;
368 typedef struct _UNWIND_HISTORY_TABLE
{
373 UNWIND_HISTORY_TABLE_ENTRY Entry
[UNWIND_HISTORY_TABLE_SIZE
];
374 } UNWIND_HISTORY_TABLE
, *PUNWIND_HISTORY_TABLE
;
376 #endif /* defined(__ia64__) */
378 /***********************************************************************
379 * Types and data structures
382 /* This is used by NtQuerySystemInformation */
383 /* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
385 FILETIME ftCreationTime
;
387 DWORD dwStartAddress
;
390 DWORD dwCurrentPriority
;
391 DWORD dwBasePriority
;
392 DWORD dwContextSwitches
;
396 } THREADINFO
, *PTHREADINFO
;
398 /* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
399 typedef struct _THREAD_INFO
{
406 } THREAD_INFO
, PTHREAD_INFO
;
408 /***********************************************************************
409 * Types and data structures
412 typedef struct _IO_STATUS_BLOCK
{
418 ULONG_PTR Information
;
419 } IO_STATUS_BLOCK
, *PIO_STATUS_BLOCK
;
421 typedef void (WINAPI
* PIO_APC_ROUTINE
)(PVOID
,PIO_STATUS_BLOCK
,ULONG
);
423 typedef struct _KEY_BASIC_INFORMATION
{
424 LARGE_INTEGER LastWriteTime
;
428 } KEY_BASIC_INFORMATION
, *PKEY_BASIC_INFORMATION
;
430 typedef struct _KEY_NODE_INFORMATION
432 LARGE_INTEGER LastWriteTime
;
439 } KEY_NODE_INFORMATION
, *PKEY_NODE_INFORMATION
;
441 typedef struct _KEY_FULL_INFORMATION
443 LARGE_INTEGER LastWriteTime
;
451 ULONG MaxValueNameLen
;
452 ULONG MaxValueDataLen
;
454 } KEY_FULL_INFORMATION
, *PKEY_FULL_INFORMATION
;
456 typedef struct _KEY_VALUE_ENTRY
458 PUNICODE_STRING ValueName
;
462 } KEY_VALUE_ENTRY
, *PKEY_VALUE_ENTRY
;
464 typedef struct _KEY_VALUE_BASIC_INFORMATION
{
469 } KEY_VALUE_BASIC_INFORMATION
, *PKEY_VALUE_BASIC_INFORMATION
;
471 typedef struct _KEY_VALUE_FULL_INFORMATION
{
478 } KEY_VALUE_FULL_INFORMATION
, *PKEY_VALUE_FULL_INFORMATION
;
480 typedef struct _KEY_VALUE_PARTIAL_INFORMATION
{
485 } KEY_VALUE_PARTIAL_INFORMATION
, *PKEY_VALUE_PARTIAL_INFORMATION
;
487 typedef struct _OBJECT_ATTRIBUTES
{
489 HANDLE RootDirectory
;
490 PUNICODE_STRING ObjectName
;
492 PVOID SecurityDescriptor
; /* type SECURITY_DESCRIPTOR */
493 PVOID SecurityQualityOfService
; /* type SECURITY_QUALITY_OF_SERVICE */
494 } OBJECT_ATTRIBUTES
, *POBJECT_ATTRIBUTES
;
496 typedef struct _PROCESS_BASIC_INFORMATION
{
499 DWORD PebBaseAddress
;
502 ULONG UniqueProcessId
;
503 ULONG InheritedFromUniqueProcessId
;
508 ULONG_PTR UniqueProcessId
;
511 } PROCESS_BASIC_INFORMATION
, *PPROCESS_BASIC_INFORMATION
;
513 typedef struct _PROCESS_INFO
{
514 DWORD Offset
; /* 00 offset to next PROCESS_INFO ok*/
515 DWORD ThreadCount
; /* 04 number of ThreadInfo member ok */
517 FILETIME CreationTime
; /* 20 */
519 PWCHAR ProcessName
; /* 3c ok */
521 DWORD ProcessID
; /* 44 ok*/
522 DWORD ParentProcessID
;
524 DWORD Unknown3
[2]; /* 50 */
525 ULONG PeakVirtualSize
;
527 ULONG PageFaultCount
;
528 ULONG PeakWorkingSetSize
;
529 ULONG WorkingSetSize
;
530 ULONG QuotaPeakPagedPoolUsage
;
531 ULONG QuotaPagedPoolUsage
;
532 ULONG QuotaPeakNonPagedPoolUsage
;
533 ULONG QuotaNonPagedPoolUsage
;
535 ULONG PeakPagefileUsage
;
538 THREAD_INFO ati
[ANYSIZE_ARRAY
]; /* 94 size=0x40*/
539 } PROCESS_INFO
, PPROCESS_INFO
;
541 typedef struct _RTL_HEAP_DEFINITION
{
542 ULONG Length
; /* = sizeof(RTL_HEAP_DEFINITION) */
545 } RTL_HEAP_DEFINITION
, *PRTL_HEAP_DEFINITION
;
547 typedef struct tagRTL_BITMAP
{
548 ULONG SizeOfBitMap
; /* Number of bits in the bitmap */
549 LPBYTE BitMapBuffer
; /* Bitmap data, assumed sized to a DWORD boundary */
550 } RTL_BITMAP
, *PRTL_BITMAP
;
552 typedef const RTL_BITMAP
*PCRTL_BITMAP
;
554 typedef struct tagRTL_BITMAP_RUN
{
555 ULONG StartOfRun
; /* Bit position at which run starts - FIXME: Name? */
556 ULONG SizeOfRun
; /* Size of the run in bits - FIXME: Name? */
557 } RTL_BITMAP_RUN
, *PRTL_BITMAP_RUN
;
559 typedef const RTL_BITMAP_RUN
*PCRTL_BITMAP_RUN
;
561 typedef struct _RTL_RWLOCK
{
562 RTL_CRITICAL_SECTION rtlCS
;
564 HANDLE hSharedReleaseSemaphore
;
567 HANDLE hExclusiveReleaseSemaphore
;
568 UINT uExclusiveWaiters
;
571 HANDLE hOwningThreadId
;
572 DWORD dwTimeoutBoost
;
574 } RTL_RWLOCK
, *LPRTL_RWLOCK
;
576 /* System Information Class 0x00 */
577 typedef struct _SYSTEM_BASIC_INFORMATION
{
580 ULONG uKeMaximumIncrement
;
582 ULONG uMmNumberOfPhysicalPages
;
583 ULONG uMmLowestPhysicalPage
;
584 ULONG uMmHighestPhysicalPage
;
585 ULONG uAllocationGranularity
;
586 PVOID pLowestUserAddress
;
587 PVOID pMmHighestUserAddress
;
588 ULONG uKeActiveProcessors
;
589 BYTE bKeNumberProcessors
;
595 CCHAR NumberOfProcessors
;
597 } SYSTEM_BASIC_INFORMATION
, *PSYSTEM_BASIC_INFORMATION
;
599 /* System Information Class 0x15 */
603 ULONG PageFaultCount
;
604 ULONG MinimumWorkingSet
;
605 ULONG MaximumWorkingSet
;
607 } SYSTEM_CACHE_INFORMATION
;
609 typedef struct _SYSTEM_CONFIGURATION_INFO
{
613 WORD ProcessorArchitecture
;
618 PVOID MinimumApplicationAddress
;
619 PVOID MaximumApplicationAddress
;
620 ULONG ActiveProcessorMask
;
621 ULONG NumberOfProcessors
;
623 ULONG AllocationGranularity
;
625 WORD ProcessorRevision
;
626 } SYSTEM_CONFIGURATION_INFO
, *PSYSTEM_CONFIGURATION_INFO
;
628 /* System Information Class 0x0b */
635 char szName
[MAX_PATH
+ 1];
636 } SYSTEM_DRIVER_INFORMATION
;
638 typedef struct _SYSTEM_EXCEPTION_INFORMATION
{
640 } SYSTEM_EXCEPTION_INFORMATION
, *PSYSTEM_EXCEPTION_INFORMATION
;
642 typedef struct _SYSTEM_LOOKASIDE_INFORMATION
{
644 } SYSTEM_LOOKASIDE_INFORMATION
, *PSYSTEM_LOOKASIDE_INFORMATION
;
646 typedef struct _SYSTEM_INTERRUPT_INFORMATION
{
648 } SYSTEM_INTERRUPT_INFORMATION
, *PSYSTEM_INTERRUPT_INFORMATION
;
650 /* System Information Class 0x10 */
653 USHORT dwCreatorBackTraceIndex
;
655 BYTE bHandleAttributes
;
656 USHORT usHandleOffset
;
658 ULONG ulGrantedAccess
;
659 } HANDLEINFO
, *PHANDLEINFO
; /* FIXME: SYSTEM_HANDLE_INFORMATION? */
661 typedef struct _SYSTEM_PERFORMANCE_INFORMATION
{
663 } SYSTEM_PERFORMANCE_INFORMATION
, *PSYSTEM_PERFORMANCE_INFORMATION
;
665 /* System Information Class 0x02 */
666 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
{
668 LARGE_INTEGER liIdleTime
;
671 LARGE_INTEGER IdleTime
;
672 LARGE_INTEGER KernelTime
;
673 LARGE_INTEGER UserTime
;
674 LARGE_INTEGER Reserved1
[2];
677 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
;
679 /* System Information Class 0x05 */
680 typedef struct _SYSTEM_PROCESS_INFORMATION
{
685 FILETIME ftCreationTime
;
687 WCHAR
*pszProcessName
;
688 DWORD dwBasePriority
;
690 DWORD dwParentProcessID
;
694 DWORD dwVirtualBytesPeak
;
695 DWORD dwVirtualBytes
;
697 DWORD dwWorkingSetPeak
;
702 DWORD dwNonPagedPool
;
703 DWORD dwPageFileBytesPeak
;
704 DWORD dwPrivateBytes
;
705 DWORD dwPageFileBytes
;
709 ULONG NextEntryOffset
;
712 HANDLE UniqueProcessId
;
717 SIZE_T PeakPagefileUsage
;
718 SIZE_T PrivatePageCount
;
719 LARGE_INTEGER Reserved6
[6];
721 } SYSTEM_PROCESS_INFORMATION
, *PSYSTEM_PROCESS_INFORMATION
;
723 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION
{
724 ULONG RegistryQuotaAllowed
;
725 ULONG RegistryQuotaUsed
;
727 } SYSTEM_REGISTRY_QUOTA_INFORMATION
, *PSYSTEM_REGISTRY_QUOTA_INFORMATION
;
729 typedef struct _SYSTEM_TIME_ADJUSTMENT
{
730 ULONG TimeAdjustment
;
731 BOOLEAN TimeAdjustmentDisabled
;
732 } SYSTEM_TIME_ADJUSTMENT
, *PSYSTEM_TIME_ADJUSTMENT
;
734 /* System Information Class 0x03 */
735 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION
{
737 LARGE_INTEGER liKeBootTime
;
738 LARGE_INTEGER liKeSystemTime
;
739 LARGE_INTEGER liExpTimeZoneBias
;
740 ULONG uCurrentTimeZoneId
;
745 } SYSTEM_TIMEOFDAY_INFORMATION
, *PSYSTEM_TIMEOFDAY_INFORMATION
; /* was SYSTEM_TIME_INFORMATION */
747 typedef struct _TIME_FIELDS
756 } TIME_FIELDS
, *PTIME_FIELDS
;
758 typedef struct _WINSTATIONINFORMATIONW
{
761 BYTE Reserved3
[1140];
762 } WINSTATIONINFORMATIONW
, *PWINSTATIONINFORMATIONW
;
764 typedef struct _VM_COUNTERS_
{
765 ULONG PeakVirtualSize
;
767 ULONG PageFaultCount
;
768 ULONG PeakWorkingSetSize
;
769 ULONG WorkingSetSize
;
770 ULONG QuotaPeakPagedPoolUsage
;
771 ULONG QuotaPagedPoolUsage
;
772 ULONG QuotaPeakNonPagedPoolUsage
;
773 ULONG QuotaNonPagedPoolUsage
;
775 ULONG PeakPagefileUsage
;
776 } VM_COUNTERS
, *PVM_COUNTERS
;
778 typedef BOOLEAN (WINAPI
* PWINSTATIONQUERYINFORMATIONW
)(HANDLE
,ULONG
,WINSTATIONINFOCLASS
,PVOID
,ULONG
,PULONG
);
780 /***********************************************************************
784 /* flags for NtCreateFile and NtOpenFile */
785 #define FILE_DIRECTORY_FLAG 0x00000001
786 #define FILE_WRITE_THROUGH 0x00000002
787 #define FILE_SEQUENTIAL_ONLY 0x00000004
788 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
789 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
790 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
791 #define FILE_NON_DIRECTORY_FILE 0x00000040
792 #define FILE_CREATE_TREE_CONNECTION 0x00000080
794 /* status for NtCreateFile or NtOpenFile */
795 #define FILE_SUPERSEDED 0x00000000
796 #define FILE_OPENED 0x00000001
797 #define FILE_CREATED 0x00000002
798 #define FILE_OVERWRITTEN 0x00000003
799 #define FILE_EXISTS 0x00000004
800 #define FILE_DOES_NOT_EXIST 0x00000005
802 #if (_WIN32_WINNT >= 0x0501)
803 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
804 #endif /* (_WIN32_WINNT >= 0x0501) */
806 #define LOGONID_CURRENT ((ULONG)-1)
808 #define OBJ_INHERIT 0x00000002L
809 #define OBJ_PERMANENT 0x00000010L
810 #define OBJ_EXCLUSIVE 0x00000020L
811 #define OBJ_CASE_INSENSITIVE 0x00000040L
812 #define OBJ_OPENIF 0x00000080L
813 #define OBJ_OPENLINK 0x00000100L
814 #define OBJ_KERNEL_HANDLE 0x00000200L
815 #define OBJ_VALID_ATTRIBUTES 0x000003F2L
817 #define SERVERNAME_CURRENT ((HANDLE)NULL)
819 typedef void (CALLBACK
*PNTAPCFUNC
)(ULONG_PTR
,ULONG_PTR
,ULONG_PTR
); /* FIXME: not the right name */
821 /***********************************************************************
822 * Function declarations
825 extern LPSTR
_strlwr(LPSTR str
); /* FIXME: Doesn't belong here */
826 extern LPSTR
_strupr(LPSTR str
); /* FIXME: Doesn't belong here */
828 #if defined(__i386__) && defined(__GNUC__)
829 static inline void WINAPI
DbgBreakPoint(void) { __asm__
__volatile__("int3"); }
830 static inline void WINAPI
DbgUserBreakPoint(void) { __asm__
__volatile__("int3"); }
831 #else /* __i386__ && __GNUC__ */
832 void WINAPI
DbgBreakPoint(void);
833 void WINAPI
DbgUserBreakPoint(void);
834 #endif /* __i386__ && __GNUC__ */
835 void WINAPIV
DbgPrint(LPCSTR fmt
, ...);
837 NTSTATUS WINAPI
NtAccessCheck(PSECURITY_DESCRIPTOR
,HANDLE
,ACCESS_MASK
,PGENERIC_MAPPING
,PPRIVILEGE_SET
,PULONG
,PULONG
,PBOOLEAN
);
838 NTSTATUS WINAPI
NtAdjustPrivilegesToken(HANDLE
,BOOLEAN
,PTOKEN_PRIVILEGES
,DWORD
,PTOKEN_PRIVILEGES
,PDWORD
);
839 NTSTATUS WINAPI
NtAllocateVirtualMemory(HANDLE
,PVOID
*,PVOID
,ULONG
*,ULONG
,ULONG
);
840 NTSTATUS WINAPI
NtClearEvent(HANDLE
);
841 NTSTATUS WINAPI
NtClose(HANDLE
);
842 NTSTATUS WINAPI
NtCreateEvent(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,BOOLEAN
,BOOLEAN
);
843 NTSTATUS WINAPI
NtCreateFile(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
,PIO_STATUS_BLOCK
,PLARGE_INTEGER
,ULONG
,ULONG
,ULONG
,ULONG
,PVOID
,ULONG
);
844 NTSTATUS WINAPI
NtCreateKey(PHKEY
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,ULONG
,const UNICODE_STRING
*,ULONG
,PULONG
);
845 NTSTATUS WINAPI
NtCreateSection(HANDLE
*,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,const LARGE_INTEGER
*,ULONG
,ULONG
,HANDLE
);
846 NTSTATUS WINAPI
NtCreateSemaphore(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,ULONG
,ULONG
);
847 NTSTATUS WINAPI
NtDeleteKey(HKEY
);
848 NTSTATUS WINAPI
NtDeleteValueKey(HKEY
,const UNICODE_STRING
*);
849 NTSTATUS WINAPI
NtDeviceIoControlFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,ULONG
,PVOID
,ULONG
,PVOID
,ULONG
);
850 NTSTATUS WINAPI
NtDuplicateObject(HANDLE
,HANDLE
,HANDLE
,PHANDLE
,ACCESS_MASK
,ULONG
,ULONG
);
851 NTSTATUS WINAPI
NtEnumerateKey(HKEY
,ULONG
,KEY_INFORMATION_CLASS
,void *,DWORD
,DWORD
*);
852 NTSTATUS WINAPI
NtEnumerateValueKey(HKEY
,ULONG
,KEY_VALUE_INFORMATION_CLASS
,PVOID
,ULONG
,PULONG
);
853 NTSTATUS WINAPI
NtFlushBuffersFile(HANDLE
,IO_STATUS_BLOCK
*);
854 NTSTATUS WINAPI
NtFlushKey(HKEY
);
855 NTSTATUS WINAPI
NtFlushVirtualMemory(HANDLE
,LPCVOID
*,ULONG
*,ULONG
);
856 NTSTATUS WINAPI
NtFreeVirtualMemory(HANDLE
,PVOID
*,ULONG
*,ULONG
);
857 NTSTATUS WINAPI
NtGetContextThread(HANDLE
,CONTEXT
*);
858 NTSTATUS WINAPI
NtLoadKey(const OBJECT_ATTRIBUTES
*,const OBJECT_ATTRIBUTES
*);
859 NTSTATUS WINAPI
NtLockVirtualMemory(HANDLE
,PVOID
*,ULONG
*,ULONG
);
860 NTSTATUS WINAPI
NtMapViewOfSection(HANDLE
,HANDLE
,PVOID
*,ULONG
,ULONG
,const LARGE_INTEGER
*,ULONG
*,SECTION_INHERIT
,ULONG
,ULONG
);
861 NTSTATUS WINAPI
NtNotifyChangeKey(HKEY
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,ULONG
,BOOLEAN
,PVOID
,ULONG
,BOOLEAN
);
862 NTSTATUS WINAPI
NtOpenEvent(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*);
863 NTSTATUS WINAPI
NtOpenFile(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
,PIO_STATUS_BLOCK
,ULONG
,ULONG
);
864 NTSTATUS WINAPI
NtOpenKey(PHKEY
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*);
865 NTSTATUS WINAPI
NtOpenProcessToken(HANDLE
,DWORD
,HANDLE
*);
866 NTSTATUS WINAPI
NtOpenSection(HANDLE
*,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*);
867 NTSTATUS WINAPI
NtOpenThread(HANDLE
*,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,const CLIENT_ID
*);
868 NTSTATUS WINAPI
NtOpenThreadToken(HANDLE
,DWORD
,BOOLEAN
,HANDLE
*);
869 NTSTATUS WINAPI
NtProtectVirtualMemory(HANDLE
,PVOID
*,ULONG
*,ULONG
,ULONG
*);
870 NTSTATUS WINAPI
NtPulseEvent(HANDLE
,PULONG
);
871 NTSTATUS WINAPI
NtQueueApcThread(HANDLE
,PNTAPCFUNC
,ULONG_PTR
,ULONG_PTR
,ULONG_PTR
);
872 NTSTATUS WINAPI
NtQueryInformationProcess(HANDLE
,PROCESSINFOCLASS
,PVOID
,ULONG
,PULONG
);
873 NTSTATUS WINAPI
NtQueryInformationThread(HANDLE
,THREADINFOCLASS
,PVOID
,ULONG
,PULONG
);
874 NTSTATUS WINAPI
NtQueryInformationToken(HANDLE
,DWORD
,LPVOID
,DWORD
,LPDWORD
);
875 NTSTATUS WINAPI
NtQueryKey(HKEY
,KEY_INFORMATION_CLASS
,void *,DWORD
,DWORD
*);
876 NTSTATUS WINAPI
NtQueryMultipleValueKey(HKEY
,PVALENTW
,ULONG
,PVOID
,ULONG
,PULONG
);
877 NTSTATUS WINAPI
NtQuerySecurityObject(HANDLE
,SECURITY_INFORMATION
,PSECURITY_DESCRIPTOR
,ULONG
,PULONG
);
878 NTSTATUS WINAPI
NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS
,PVOID
,ULONG
,PULONG
);
879 NTSTATUS WINAPI
NtQuerySystemTime(PLARGE_INTEGER
);
880 NTSTATUS WINAPI
NtQueryValueKey(HKEY
,const UNICODE_STRING
*,KEY_VALUE_INFORMATION_CLASS
,void *,DWORD
,DWORD
*);
881 NTSTATUS WINAPI
NtQueryVirtualMemory(HANDLE
,LPCVOID
,MEMORY_INFORMATION_CLASS
,PVOID
,ULONG
,ULONG
*);
882 void WINAPI
NtRaiseException(PEXCEPTION_RECORD
,PCONTEXT
,BOOL
);
883 NTSTATUS WINAPI
NtReadFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,PVOID
,ULONG
,PLARGE_INTEGER
,PULONG
);
884 NTSTATUS WINAPI
NtReleaseSemaphore(HANDLE
,ULONG
,PULONG
);
885 NTSTATUS WINAPI
NtReplaceKey(POBJECT_ATTRIBUTES
,HKEY
,POBJECT_ATTRIBUTES
);
886 NTSTATUS WINAPI
NtResetEvent(HANDLE
,PULONG
);
887 NTSTATUS WINAPI
NtRestoreKey(HKEY
,HANDLE
,ULONG
);
888 NTSTATUS WINAPI
NtResumeThread(HANDLE
,PULONG
);
889 NTSTATUS WINAPI
NtSaveKey(HKEY
,HANDLE
);
890 NTSTATUS WINAPI
NtSetContextThread(HANDLE
,const CONTEXT
*);
891 NTSTATUS WINAPI
NtSetEvent(HANDLE
,PULONG
);
892 NTSTATUS WINAPI
NtSetInformationKey(HKEY
,const int,PVOID
,ULONG
);
893 NTSTATUS WINAPI
NtSetSecurityObject(HANDLE
,SECURITY_INFORMATION
,PSECURITY_DESCRIPTOR
);
894 NTSTATUS WINAPI
NtSetSystemTime(const LARGE_INTEGER
*,LARGE_INTEGER
*);
895 NTSTATUS WINAPI
NtSetValueKey(HKEY
,const UNICODE_STRING
*,ULONG
,ULONG
,const void *,ULONG
);
896 NTSTATUS WINAPI
NtSuspendThread(HANDLE
,PULONG
);
897 NTSTATUS WINAPI
NtTerminateProcess(HANDLE
,LONG
);
898 NTSTATUS WINAPI
NtTerminateThread(HANDLE
,LONG
);
899 NTSTATUS WINAPI
NtUnloadKey(HKEY
);
900 NTSTATUS WINAPI
NtUnlockVirtualMemory(HANDLE
,PVOID
*,ULONG
*,ULONG
);
901 NTSTATUS WINAPI
NtUnmapViewOfSection(HANDLE
,PVOID
);
902 NTSTATUS WINAPI
NtWaitForSingleObject(HANDLE
,BOOLEAN
,PLARGE_INTEGER
);
903 NTSTATUS WINAPI
NtWaitForMultipleObjects(ULONG
,const HANDLE
*,BOOLEAN
,BOOLEAN
,PLARGE_INTEGER
);
905 void WINAPI
RtlAcquirePebLock(void);
906 BYTE WINAPI
RtlAcquireResourceExclusive(LPRTL_RWLOCK
,BYTE
);
907 BYTE WINAPI
RtlAcquireResourceShared(LPRTL_RWLOCK
,BYTE
);
908 NTSTATUS WINAPI
RtlAddAce(PACL
,DWORD
,DWORD
,PACE_HEADER
,DWORD
);
909 BOOL WINAPI
RtlAddAccessAllowedAce(PACL
,DWORD
,DWORD
,PSID
);
910 BOOL WINAPI
RtlAddAccessAllowedAceEx(PACL
,DWORD
,DWORD
,DWORD
,PSID
);
911 DWORD WINAPI
RtlAdjustPrivilege(DWORD
,DWORD
,DWORD
,DWORD
);
912 BOOLEAN WINAPI
RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY
,BYTE
,DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,PSID
*);
913 PVOID WINAPI
RtlAllocateHeap(HANDLE
,ULONG
,ULONG
);
914 DWORD WINAPI
RtlAnsiStringToUnicodeSize(const STRING
*);
915 NTSTATUS WINAPI
RtlAnsiStringToUnicodeString(PUNICODE_STRING
,PCANSI_STRING
,BOOLEAN
);
916 NTSTATUS WINAPI
RtlAppendAsciizToString(STRING
*,LPCSTR
);
917 NTSTATUS WINAPI
RtlAppendStringToString(STRING
*,const STRING
*);
918 NTSTATUS WINAPI
RtlAppendUnicodeStringToString(UNICODE_STRING
*,const UNICODE_STRING
*);
919 NTSTATUS WINAPI
RtlAppendUnicodeToString(UNICODE_STRING
*,LPCWSTR
);
920 BOOLEAN WINAPI
RtlAreAllAccessesGranted(ACCESS_MASK
,ACCESS_MASK
);
921 BOOLEAN WINAPI
RtlAreAnyAccessesGranted(ACCESS_MASK
,ACCESS_MASK
);
922 BOOLEAN WINAPI
RtlAreBitsSet(PCRTL_BITMAP
,ULONG
,ULONG
);
923 BOOLEAN WINAPI
RtlAreBitsClear(PCRTL_BITMAP
,ULONG
,ULONG
);
925 NTSTATUS WINAPI
RtlCharToInteger(PCSZ
,ULONG
,PULONG
);
926 void WINAPI
RtlClearAllBits(PRTL_BITMAP
);
927 void WINAPI
RtlClearBits(PRTL_BITMAP
,ULONG
,ULONG
);
928 ULONG WINAPI
RtlCompactHeap(HANDLE
,ULONG
);
929 LONG WINAPI
RtlCompareString(const STRING
*,const STRING
*,BOOLEAN
);
930 LONG WINAPI
RtlCompareUnicodeString(const UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
931 DWORD WINAPI
RtlComputeCrc32(DWORD
,PBYTE
,INT
);
932 NTSTATUS WINAPI
RtlConvertSidToUnicodeString(PUNICODE_STRING
,PSID
,BOOLEAN
);
933 LONGLONG WINAPI
RtlConvertLongToLargeInteger(LONG
);
934 ULONGLONG WINAPI
RtlConvertUlongToLargeInteger(ULONG
);
935 void WINAPI
RtlCopyLuid(PLUID
,const LUID
*);
936 void WINAPI
RtlCopyLuidAndAttributesArray(ULONG
,const LUID_AND_ATTRIBUTES
*,PLUID_AND_ATTRIBUTES
);
937 DWORD WINAPI
RtlCopySid(DWORD
,PSID
,PSID
);
938 void WINAPI
RtlCopyString(STRING
*,const STRING
*);
939 void WINAPI
RtlCopyUnicodeString(UNICODE_STRING
*,const UNICODE_STRING
*);
940 NTSTATUS WINAPI
RtlCreateAcl(PACL
,DWORD
,DWORD
);
941 DWORD WINAPI
RtlCreateEnvironment(DWORD
,DWORD
);
942 HANDLE WINAPI
RtlCreateHeap(ULONG
,PVOID
,ULONG
,ULONG
,PVOID
,PRTL_HEAP_DEFINITION
);
943 NTSTATUS WINAPI
RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR
,DWORD
);
944 BOOLEAN WINAPI
RtlCreateUnicodeString(PUNICODE_STRING
,LPCWSTR
);
945 BOOLEAN WINAPI
RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING
,LPCSTR
);
947 NTSTATUS WINAPI
RtlDeleteCriticalSection(RTL_CRITICAL_SECTION
*);
948 void WINAPI
RtlDeleteResource(LPRTL_RWLOCK
);
949 DWORD WINAPI
RtlDeleteSecurityObject(DWORD
);
950 DWORD WINAPI
RtlDestroyEnvironment(DWORD
);
951 HANDLE WINAPI
RtlDestroyHeap(HANDLE
);
952 DOS_PATHNAME_TYPE WINAPI
RtlDetermineDosPathNameType_U(PCWSTR
);
953 BOOLEAN WINAPI
RtlDosPathNameToNtPathName_U(LPWSTR
,PUNICODE_STRING
,DWORD
,DWORD
);
954 WCHAR WINAPI
RtlDowncaseUnicodeChar(WCHAR
);
955 NTSTATUS WINAPI
RtlDowncaseUnicodeString(UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
956 void WINAPI
RtlDumpResource(LPRTL_RWLOCK
);
958 LONGLONG WINAPI
RtlEnlargedIntegerMultiply(INT
,INT
);
959 ULONGLONG WINAPI
RtlEnlargedUnsignedMultiply(UINT
,UINT
);
960 UINT WINAPI
RtlEnlargedUnsignedDivide(ULONGLONG
,UINT
,UINT
*);
961 NTSTATUS WINAPI
RtlEnterCriticalSection(RTL_CRITICAL_SECTION
*);
962 void WINAPI
RtlEraseUnicodeString(UNICODE_STRING
*);
963 NTSTATUS WINAPI
RtlEqualComputerName(const UNICODE_STRING
*,const UNICODE_STRING
*);
964 NTSTATUS WINAPI
RtlEqualDomainName(const UNICODE_STRING
*,const UNICODE_STRING
*);
965 BOOLEAN WINAPI
RtlEqualLuid(const LUID
*,const LUID
*);
966 BOOL WINAPI
RtlEqualPrefixSid(PSID
,PSID
);
967 BOOL WINAPI
RtlEqualSid(PSID
,PSID
);
968 BOOLEAN WINAPI
RtlEqualString(const STRING
*,const STRING
*,BOOLEAN
);
969 BOOLEAN WINAPI
RtlEqualUnicodeString(const UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
970 LONGLONG WINAPI
RtlExtendedMagicDivide(LONGLONG
,LONGLONG
,INT
);
971 LONGLONG WINAPI
RtlExtendedIntegerMultiply(LONGLONG
,INT
);
972 LONGLONG WINAPI
RtlExtendedLargeIntegerDivide(LONGLONG
,INT
,INT
*);
974 ULONG WINAPI
RtlFindClearBits(PCRTL_BITMAP
,ULONG
,ULONG
);
975 ULONG WINAPI
RtlFindClearBitsAndSet(PRTL_BITMAP
,ULONG
,ULONG
);
976 ULONG WINAPI
RtlFindClearRuns(PCRTL_BITMAP
,PRTL_BITMAP_RUN
,ULONG
,BOOLEAN
);
977 ULONG WINAPI
RtlFindLastBackwardRunSet(PCRTL_BITMAP
,ULONG
,PULONG
);
978 ULONG WINAPI
RtlFindLastBackwardRunClear(PCRTL_BITMAP
,ULONG
,PULONG
);
979 CCHAR WINAPI
RtlFindLeastSignificantBit(ULONGLONG
);
980 ULONG WINAPI
RtlFindLongestRunSet(PCRTL_BITMAP
,PULONG
);
981 ULONG WINAPI
RtlFindLongestRunClear(PCRTL_BITMAP
,PULONG
);
982 CCHAR WINAPI
RtlFindMostSignificantBit(ULONGLONG
);
983 ULONG WINAPI
RtlFindNextForwardRunSet(PCRTL_BITMAP
,ULONG
,PULONG
);
984 ULONG WINAPI
RtlFindNextForwardRunClear(PCRTL_BITMAP
,ULONG
,PULONG
);
985 ULONG WINAPI
RtlFindSetBits(PCRTL_BITMAP
,ULONG
,ULONG
);
986 ULONG WINAPI
RtlFindSetBitsAndClear(PRTL_BITMAP
,ULONG
,ULONG
);
987 ULONG WINAPI
RtlFindSetRuns(PCRTL_BITMAP
,PRTL_BITMAP_RUN
,ULONG
,BOOLEAN
);
988 BOOLEAN WINAPI
RtlFirstFreeAce(PACL
,PACE_HEADER
*);
989 NTSTATUS WINAPI
RtlFormatCurrentUserKeyPath(PUNICODE_STRING
);
990 void WINAPI
RtlFreeAnsiString(PANSI_STRING
);
991 BOOLEAN WINAPI
RtlFreeHeap(HANDLE
,ULONG
,PVOID
);
992 void WINAPI
RtlFreeOemString(POEM_STRING
);
993 DWORD WINAPI
RtlFreeSid(PSID
);
994 void WINAPI
RtlFreeUnicodeString(PUNICODE_STRING
);
996 DWORD WINAPI
RtlGetAce(PACL
,DWORD
,LPVOID
*);
997 NTSTATUS WINAPI
RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR
, PSECURITY_DESCRIPTOR_CONTROL
,LPDWORD
);
998 NTSTATUS WINAPI
RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR
,PBOOLEAN
,PACL
*,PBOOLEAN
);
999 ULONG WINAPI
RtlGetFullPathName_U(PCWSTR
,ULONG
,PWSTR
,PWSTR
*);
1000 NTSTATUS WINAPI
RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR
,PSID
*,PBOOLEAN
);
1001 BOOLEAN WINAPI
RtlGetNtProductType(LPDWORD
);
1002 NTSTATUS WINAPI
RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR
,PSID
*,PBOOLEAN
);
1003 ULONG WINAPI
RtlGetProcessHeaps(ULONG
,HANDLE
*);
1004 NTSTATUS WINAPI
RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR
,PBOOLEAN
,PACL
*,PBOOLEAN
);
1006 PSID_IDENTIFIER_AUTHORITY WINAPI
RtlIdentifierAuthoritySid(PSID
);
1007 PVOID WINAPI
RtlImageDirectoryEntryToData(HMODULE
,BOOL
,WORD
,ULONG
*);
1008 PIMAGE_NT_HEADERS WINAPI
RtlImageNtHeader(HMODULE
);
1009 PIMAGE_SECTION_HEADER WINAPI
RtlImageRvaToSection(const IMAGE_NT_HEADERS
*,HMODULE
,DWORD
);
1010 PVOID WINAPI
RtlImageRvaToVa(const IMAGE_NT_HEADERS
*,HMODULE
,DWORD
,IMAGE_SECTION_HEADER
**);
1011 BOOL WINAPI
RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL
);
1012 void WINAPI
RtlInitString(PSTRING
,PCSZ
);
1013 void WINAPI
RtlInitAnsiString(PANSI_STRING
,PCSZ
);
1014 void WINAPI
RtlInitUnicodeString(PUNICODE_STRING
,PCWSTR
);
1015 NTSTATUS WINAPI
RtlInitializeCriticalSection(RTL_CRITICAL_SECTION
*);
1016 NTSTATUS WINAPI
RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION
*,DWORD
);
1017 void WINAPI
RtlInitializeBitMap(PRTL_BITMAP
,LPBYTE
,ULONG
);
1018 void WINAPI
RtlInitializeResource(LPRTL_RWLOCK
);
1019 BOOL WINAPI
RtlInitializeSid(PSID
,PSID_IDENTIFIER_AUTHORITY
,BYTE
);
1021 NTSTATUS WINAPI
RtlInt64ToUnicodeString(ULONGLONG
,ULONG
,UNICODE_STRING
*);
1022 NTSTATUS WINAPI
RtlIntegerToChar(ULONG
,ULONG
,ULONG
,PCHAR
);
1023 NTSTATUS WINAPI
RtlIntegerToUnicodeString(ULONG
,ULONG
,UNICODE_STRING
*);
1024 ULONG WINAPI
RtlIsDosDeviceName_U(PCWSTR
);
1025 BOOLEAN WINAPI
RtlIsNameLegalDOS8Dot3(const UNICODE_STRING
*,POEM_STRING
,PBOOLEAN
);
1026 DWORD WINAPI
RtlIsTextUnicode(LPVOID
,DWORD
,DWORD
*);
1028 LONGLONG WINAPI
RtlLargeIntegerAdd(LONGLONG
,LONGLONG
);
1029 LONGLONG WINAPI
RtlLargeIntegerArithmeticShift(LONGLONG
,INT
);
1030 ULONGLONG WINAPI
RtlLargeIntegerDivide( ULONGLONG
,ULONGLONG
,ULONGLONG
*);
1031 LONGLONG WINAPI
RtlLargeIntegerNegate(LONGLONG
);
1032 LONGLONG WINAPI
RtlLargeIntegerShiftLeft(LONGLONG
,INT
);
1033 LONGLONG WINAPI
RtlLargeIntegerShiftRight(LONGLONG
,INT
);
1034 LONGLONG WINAPI
RtlLargeIntegerSubtract(LONGLONG
,LONGLONG
);
1035 NTSTATUS WINAPI
RtlLargeIntegerToChar(const ULONGLONG
*,ULONG
,ULONG
,PCHAR
);
1036 NTSTATUS WINAPI
RtlLeaveCriticalSection(RTL_CRITICAL_SECTION
*);
1037 DWORD WINAPI
RtlLengthRequiredSid(DWORD
);
1038 ULONG WINAPI
RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR
);
1039 DWORD WINAPI
RtlLengthSid(PSID
);
1040 NTSTATUS WINAPI
RtlLocalTimeToSystemTime(const LARGE_INTEGER
*,PLARGE_INTEGER
);
1041 BOOLEAN WINAPI
RtlLockHeap(HANDLE
);
1043 NTSTATUS WINAPI
RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR
,PSECURITY_DESCRIPTOR
,LPDWORD
);
1044 void WINAPI
RtlMapGenericMask(PACCESS_MASK
,const GENERIC_MAPPING
*);
1045 NTSTATUS WINAPI
RtlMultiByteToUnicodeN(LPWSTR
,DWORD
,LPDWORD
,LPCSTR
,DWORD
);
1046 NTSTATUS WINAPI
RtlMultiByteToUnicodeSize(DWORD
*,LPCSTR
,UINT
);
1048 DWORD WINAPI
RtlNewSecurityObject(DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,DWORD
);
1049 LPVOID WINAPI
RtlNormalizeProcessParams(LPVOID
);
1050 ULONG WINAPI
RtlNtStatusToDosError(NTSTATUS
);
1051 ULONG WINAPI
RtlNumberOfSetBits(PCRTL_BITMAP
);
1052 ULONG WINAPI
RtlNumberOfClearBits(PCRTL_BITMAP
);
1054 UINT WINAPI
RtlOemStringToUnicodeSize(const STRING
*);
1055 NTSTATUS WINAPI
RtlOemStringToUnicodeString(UNICODE_STRING
*,const STRING
*,BOOLEAN
);
1056 NTSTATUS WINAPI
RtlOemToUnicodeN(LPWSTR
,DWORD
,LPDWORD
,LPCSTR
,DWORD
);
1057 DWORD WINAPI
RtlOpenCurrentUser(ACCESS_MASK
,PHKEY
);
1059 BOOLEAN WINAPI
RtlPrefixString(const STRING
*,const STRING
*,BOOLEAN
);
1060 BOOLEAN WINAPI
RtlPrefixUnicodeString(const UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1062 DWORD WINAPI
RtlQueryEnvironmentVariable_U(DWORD
,PUNICODE_STRING
,PUNICODE_STRING
) ;
1063 NTSTATUS WINAPI
RtlQueryTimeZoneInformation(LPTIME_ZONE_INFORMATION
);
1065 void WINAPI
RtlRaiseException(PEXCEPTION_RECORD
);
1066 void WINAPI
RtlRaiseStatus(NTSTATUS
);
1067 ULONG WINAPI
RtlRandom(PULONG
);
1068 PVOID WINAPI
RtlReAllocateHeap(HANDLE
,ULONG
,PVOID
,ULONG
);
1069 void WINAPI
RtlReleasePebLock(void);
1070 void WINAPI
RtlReleaseResource(LPRTL_RWLOCK
);
1072 void WINAPI
RtlSecondsSince1970ToTime(DWORD
,LARGE_INTEGER
*);
1073 void WINAPI
RtlSecondsSince1980ToTime(DWORD
,LARGE_INTEGER
*);
1074 void WINAPI
RtlSetAllBits(PRTL_BITMAP
);
1075 void WINAPI
RtlSetBits(PRTL_BITMAP
,ULONG
,ULONG
);
1076 NTSTATUS WINAPI
RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR
,BOOLEAN
,PACL
,BOOLEAN
);
1077 DWORD WINAPI
RtlSetEnvironmentVariable(DWORD
,PUNICODE_STRING
,PUNICODE_STRING
);
1078 NTSTATUS WINAPI
RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR
,PSID
,BOOLEAN
);
1079 NTSTATUS WINAPI
RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR
,PSID
,BOOLEAN
);
1080 NTSTATUS WINAPI
RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR
,BOOLEAN
,PACL
,BOOLEAN
);
1081 NTSTATUS WINAPI
RtlSetTimeZoneInformation(const TIME_ZONE_INFORMATION
*);
1082 ULONG WINAPI
RtlSizeHeap(HANDLE
,ULONG
,PVOID
);
1083 LPDWORD WINAPI
RtlSubAuthoritySid(PSID
,DWORD
);
1084 LPBYTE WINAPI
RtlSubAuthorityCountSid(PSID
);
1085 NTSTATUS WINAPI
RtlSystemTimeToLocalTime(const LARGE_INTEGER
*,PLARGE_INTEGER
);
1087 void WINAPI
RtlTimeToTimeFields(const LARGE_INTEGER
*,PTIME_FIELDS
);
1088 BOOLEAN WINAPI
RtlTimeFieldsToTime(PTIME_FIELDS
,PLARGE_INTEGER
);
1089 void WINAPI
RtlTimeToElapsedTimeFields(const LARGE_INTEGER
*,PTIME_FIELDS
);
1090 BOOLEAN WINAPI
RtlTimeToSecondsSince1970(const LARGE_INTEGER
*,PULONG
);
1091 BOOLEAN WINAPI
RtlTimeToSecondsSince1980(const LARGE_INTEGER
*,LPDWORD
);
1092 BOOL WINAPI
RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION
*);
1094 ULONGLONG __cdecl
RtlUlonglongByteSwap(ULONGLONG
);
1095 DWORD WINAPI
RtlUnicodeStringToAnsiSize(const UNICODE_STRING
*);
1096 NTSTATUS WINAPI
RtlUnicodeStringToAnsiString(PANSI_STRING
,PCUNICODE_STRING
,BOOLEAN
);
1097 NTSTATUS WINAPI
RtlUnicodeStringToInteger(const UNICODE_STRING
*,ULONG
,ULONG
*);
1098 DWORD WINAPI
RtlUnicodeStringToOemSize(const UNICODE_STRING
*);
1099 NTSTATUS WINAPI
RtlUnicodeStringToOemString(POEM_STRING
,PCUNICODE_STRING
,BOOLEAN
);
1100 NTSTATUS WINAPI
RtlUnicodeToMultiByteN(LPSTR
,DWORD
,LPDWORD
,LPCWSTR
,DWORD
);
1101 NTSTATUS WINAPI
RtlUnicodeToMultiByteSize(PULONG
,PCWSTR
,ULONG
);
1102 NTSTATUS WINAPI
RtlUnicodeToOemN(LPSTR
,DWORD
,LPDWORD
,LPCWSTR
,DWORD
);
1103 ULONG WINAPI
RtlUniform(PULONG
);
1104 BOOLEAN WINAPI
RtlUnlockHeap(HANDLE
);
1105 void WINAPI
RtlUnwind(PVOID
,PVOID
,PEXCEPTION_RECORD
,PVOID
);
1107 void WINAPI
RtlUnwind2(FRAME_POINTERS
,PVOID
,PEXCEPTION_RECORD
,PVOID
,PCONTEXT
);
1108 void WINAPI
RtlUnwindEx(FRAME_POINTERS
,PVOID
,PEXCEPTION_RECORD
,PVOID
,PCONTEXT
,PUNWIND_HISTORY_TABLE
);
1110 WCHAR WINAPI
RtlUpcaseUnicodeChar(WCHAR
);
1111 NTSTATUS WINAPI
RtlUpcaseUnicodeString(UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1112 NTSTATUS WINAPI
RtlUpcaseUnicodeStringToAnsiString(STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1113 NTSTATUS WINAPI
RtlUpcaseUnicodeStringToCountedOemString(STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1114 NTSTATUS WINAPI
RtlUpcaseUnicodeStringToOemString(STRING
*,const UNICODE_STRING
*,BOOLEAN
);
1115 NTSTATUS WINAPI
RtlUpcaseUnicodeToMultiByteN(LPSTR
,DWORD
,LPDWORD
,LPCWSTR
,DWORD
);
1116 NTSTATUS WINAPI
RtlUpcaseUnicodeToOemN(LPSTR
,DWORD
,LPDWORD
,LPCWSTR
,DWORD
);
1117 CHAR WINAPI
RtlUpperChar(CHAR
);
1118 void WINAPI
RtlUpperString(STRING
*,const STRING
*);
1120 NTSTATUS WINAPI
RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR
);
1121 BOOL WINAPI
RtlValidSid(PSID
);
1122 BOOLEAN WINAPI
RtlValidateHeap(HANDLE
,ULONG
,LPCVOID
);
1124 NTSTATUS WINAPI
RtlWalkHeap(HANDLE
,PVOID
);
1126 NTSTATUS WINAPI
RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION
*);
1127 NTSTATUS WINAPI
RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION
*);
1129 /***********************************************************************
1133 #define InitializeObjectAttributes(p,n,a,r,s) \
1135 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
1136 (p)->RootDirectory = r; \
1137 (p)->Attributes = a; \
1138 (p)->ObjectName = n; \
1139 (p)->SecurityDescriptor = s; \
1140 (p)->SecurityQualityOfService = NULL; \
1143 #define NtCurrentProcess() ((HANDLE)-1)
1145 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
1146 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
1147 #define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1148 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1149 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
1150 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
1151 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
1153 inline static BOOLEAN
RtlCheckBit(PCRTL_BITMAP lpBits
, ULONG ulBit
)
1155 if (lpBits
&& ulBit
< lpBits
->SizeOfBitMap
&&
1156 lpBits
->BitMapBuffer
[ulBit
>> 3] & (1 << (ulBit
& 7)))
1161 #define RtlClearAllBits(p) \
1163 PRTL_BITMAP _p = (p); \
1164 memset(_p->BitMapBuffer,0,((_p->SizeOfBitMap + 31) & 0xffffffe0) >> 3); \
1167 #define RtlInitializeBitMap(p,b,s) \
1169 PRTL_BITMAP _p = (p); \
1170 _p->SizeOfBitMap = (s); \
1171 _p->BitMapBuffer = (b); \
1174 #define RtlSetAllBits(p) \
1176 PRTL_BITMAP _p = (p); \
1177 memset(_p->BitMapBuffer,0xff,((_p->SizeOfBitMap + 31) & 0xffffffe0) >> 3); \
1180 /* These are implemented as __fastcall, so we can't let Winelib apps link with them */
1181 inline static USHORT
RtlUshortByteSwap(USHORT s
)
1183 return (s
>> 8) | (s
<< 8);
1185 inline static ULONG
RtlUlongByteSwap(ULONG i
)
1187 #if defined(__i386__) && defined(__GNUC__)
1189 __asm__("bswap %0" : "=r" (ret
) : "0" (i
) );
1192 return ((ULONG
)RtlUshortByteSwap(i
) << 16) | RtlUshortByteSwap(i
>> 16);
1196 /*************************************************************************
1197 * Loader functions and structures.
1199 * Those are not part of standard Winternl.h
1201 typedef struct _LDR_MODULE
1203 LIST_ENTRY InLoadOrderModuleList
;
1204 LIST_ENTRY InMemoryOrderModuleList
;
1205 LIST_ENTRY InInitializationOrderModuleList
;
1209 UNICODE_STRING FullDllName
;
1210 UNICODE_STRING BaseDllName
;
1214 HANDLE SectionHandle
;
1216 ULONG TimeDateStamp
;
1217 } LDR_MODULE
, *PLDR_MODULE
;
1219 /* those defines are (some of the) regular LDR_MODULE.Flags values */
1220 #define LDR_IMAGE_IS_DLL 0x00000004
1221 #define LDR_LOAD_IN_PROGRESS 0x00001000
1222 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
1223 #define LDR_NO_DLL_CALLS 0x00040000
1224 #define LDR_PROCESS_ATTACHED 0x00080000
1225 #define LDR_MODULE_REBASED 0x00200000
1227 /* these ones is Wine specific */
1228 #define LDR_DONT_RESOLVE_REFS 0x40000000
1229 #define LDR_WINE_INTERNAL 0x80000000
1231 /* FIXME: to be checked */
1232 #define MAXIMUM_FILENAME_LENGTH 256
1234 typedef struct _SYSTEM_MODULE
1238 PVOID ImageBaseAddress
;
1245 BYTE Name
[MAXIMUM_FILENAME_LENGTH
];
1246 } SYSTEM_MODULE
, *PSYSTEM_MODULE
;
1248 typedef struct _SYSTEM_MODULE_INFORMATION
1251 SYSTEM_MODULE Modules
[1]; /* FIXME: should be Modules[0] */
1252 } SYSTEM_MODULE_INFORMATION
, *PSYSTEM_MODULE_INFORMATION
;
1254 typedef struct _LDR_RESOURCE_INFO
1259 } LDR_RESOURCE_INFO
, *PLDR_RESOURCE_INFO
;
1261 NTSTATUS WINAPI
LdrAccessResource(HMODULE
, PIMAGE_RESOURCE_DATA_ENTRY
, void**, PULONG
);
1262 NTSTATUS WINAPI
LdrDisableThreadCalloutsForDll(HMODULE
);
1263 NTSTATUS WINAPI
LdrFindEntryForAddress(const void*, PLDR_MODULE
*);
1264 NTSTATUS WINAPI
LdrFindResourceDirectory_U(HMODULE
,PLDR_RESOURCE_INFO
, DWORD
,
1265 PIMAGE_RESOURCE_DIRECTORY_ENTRY
*);
1266 NTSTATUS WINAPI
LdrFindResource_U(HMODULE
, PLDR_RESOURCE_INFO
, ULONG
,
1267 PIMAGE_RESOURCE_DATA_ENTRY
*);
1268 NTSTATUS WINAPI
LdrGetDllHandle(ULONG
, ULONG
, PUNICODE_STRING
, HMODULE
*);
1269 NTSTATUS WINAPI
LdrGetProcedureAddress(HMODULE
, PANSI_STRING
, ULONG
, void**);
1270 NTSTATUS WINAPI
LdrLoadDll(LPCWSTR
, DWORD
, PUNICODE_STRING
, HMODULE
*);
1271 NTSTATUS WINAPI
LdrLockLoaderLock(ULONG
,ULONG
*,ULONG
*);
1272 NTSTATUS WINAPI
LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION
*, ULONG
, ULONG
*);
1273 NTSTATUS WINAPI
LdrShutdownProcess(void);
1274 NTSTATUS WINAPI
LdrShutdownThread(void);
1275 NTSTATUS WINAPI
LdrUnloadDll(HMODULE
);
1276 NTSTATUS WINAPI
LdrUnlockLoaderLock(ULONG
,ULONG
);
1280 #endif /* defined(__cplusplus) */
1282 #endif /* __WINE_WINTERNAL_H */