2 this file defines interfaces mainly exposed to device drivers and
11 #include "winbase.h" /* fixme: should be taken out sometimes */
22 #undef Status /* conflict with X11-includes*/
24 typedef struct _IO_STATUS_BLOCK
30 ULONG_PTR Information
;
31 } IO_STATUS_BLOCK
, *PIO_STATUS_BLOCK
;
33 typedef VOID (NTAPI
*PIO_APC_ROUTINE
) ( PVOID ApcContext
, PIO_STATUS_BLOCK IoStatusBlock
, ULONG Reserved
);
40 typedef struct _KEY_BASIC_INFORMATION
{
41 FILETIME LastWriteTime
;
45 } KEY_BASIC_INFORMATION
, *PKEY_BASIC_INFORMATION
;
47 typedef struct _KEY_NODE_INFORMATION
49 FILETIME LastWriteTime
;
56 } KEY_NODE_INFORMATION
, *PKEY_NODE_INFORMATION
;
58 typedef struct _KEY_FULL_INFORMATION
60 FILETIME LastWriteTime
;
68 ULONG MaxValueNameLen
;
69 ULONG MaxValueDataLen
;
71 } KEY_FULL_INFORMATION
, *PKEY_FULL_INFORMATION
;
73 typedef enum _KEY_INFORMATION_CLASS
78 } KEY_INFORMATION_CLASS
;
80 typedef struct _KEY_VALUE_ENTRY
82 PUNICODE_STRING ValueName
;
86 } KEY_VALUE_ENTRY
, *PKEY_VALUE_ENTRY
;
88 /* value information */
89 typedef struct _KEY_VALUE_BASIC_INFORMATION
95 } KEY_VALUE_BASIC_INFORMATION
, *PKEY_VALUE_BASIC_INFORMATION
;
97 typedef struct _KEY_VALUE_FULL_INFORMATION
106 } KEY_VALUE_FULL_INFORMATION
, *PKEY_VALUE_FULL_INFORMATION
;
108 typedef struct _KEY_VALUE_PARTIAL_INFORMATION
114 } KEY_VALUE_PARTIAL_INFORMATION
, *PKEY_VALUE_PARTIAL_INFORMATION
;
116 typedef enum _KEY_VALUE_INFORMATION_CLASS
118 KeyValueBasicInformation
,
119 KeyValueFullInformation
,
120 KeyValuePartialInformation
,
121 KeyValueFullInformationAlign64
,
122 KeyValuePartialInformationAlign64
123 } KEY_VALUE_INFORMATION_CLASS
;
125 NTSTATUS WINAPI
RtlFormatCurrentUserKeyPath(
126 PUNICODE_STRING KeyPath
);
128 /* thread information */
130 typedef enum _THREADINFOCLASS
131 { ThreadBasicInformation
,
136 ThreadImpersonationToken
,
137 ThreadDescriptorTableEntry
,
138 ThreadEnableAlignmentFaultFixup
,
139 ThreadEventPair_Reusable
,
140 ThreadQuerySetWin32StartAddress
,
142 ThreadPerformanceCount
,
144 ThreadIdealProcessor
,
146 ThreadSetTlsArrayAddress
,
151 /* file information */
153 typedef enum _FILE_INFORMATION_CLASS
{
154 FileDirectoryInformation
= 1,
155 FileFullDirectoryInformation
,
156 FileBothDirectoryInformation
,
157 FileBasicInformation
,
158 FileStandardInformation
,
159 FileInternalInformation
,
161 FileAccessInformation
,
163 FileRenameInformation
,
165 FileNamesInformation
,
166 FileDispositionInformation
,
167 FilePositionInformation
,
168 FileFullEaInformation
,
170 FileAlignmentInformation
,
172 FileAllocationInformation
,
173 FileEndOfFileInformation
,
174 FileAlternateNameInformation
,
175 FileStreamInformation
,
177 FilePipeLocalInformation
,
178 FilePipeRemoteInformation
,
179 FileMailslotQueryInformation
,
180 FileMailslotSetInformation
,
181 FileCompressionInformation
,
182 FileObjectIdInformation
,
183 FileCompletionInformation
,
184 FileMoveClusterInformation
,
185 FileQuotaInformation
,
186 FileReparsePointInformation
,
187 FileNetworkOpenInformation
,
188 FileAttributeTagInformation
,
189 FileTrackingInformation
,
190 FileMaximumInformation
191 } FILE_INFORMATION_CLASS
, *PFILE_INFORMATION_CLASS
;
193 typedef enum _FSINFOCLASS
{
194 FileFsVolumeInformation
= 1,
195 FileFsLabelInformation
,
196 FileFsSizeInformation
,
197 FileFsDeviceInformation
,
198 FileFsAttributeInformation
,
199 FileFsControlInformation
,
200 FileFsFullSizeInformation
,
201 FileFsObjectIdInformation
,
202 FileFsMaximumInformation
203 } FS_INFORMATION_CLASS
, *PFS_INFORMATION_CLASS
;
205 typedef enum _SECTION_INHERIT
212 /* object information */
214 typedef enum _OBJECT_INFORMATION_CLASS
218 } OBJECT_INFORMATION_CLASS
, *POBJECT_INFORMATION_CLASS
;
221 /* system information */
223 typedef enum SYSTEM_INFORMATION_CLASS
228 SystemPerformanceInformation
229 } SYSTEM_INFORMATION_CLASS
, *PSYSTEM_INFORMATION_CLASS
;
231 /* reading coffee grounds... */
232 typedef struct _THREAD_INFO
239 } THREAD_INFO
, PTHREAD_INFO
;
241 typedef struct _VM_COUNTERS_
242 { ULONG PeakVirtualSize
;
244 ULONG PageFaultCount
;
245 ULONG PeakWorkingSetSize
;
246 ULONG WorkingSetSize
;
247 ULONG QuotaPeakPagedPoolUsage
;
248 ULONG QuotaPagedPoolUsage
;
249 ULONG QuotaPeakNonPagedPoolUsage
;
250 ULONG QuotaNonPagedPoolUsage
;
252 ULONG PeakPagefileUsage
;
253 } VM_COUNTERS
, *PVM_COUNTERS
;
255 /* process information */
257 typedef struct _PROCESS_INFO
258 { DWORD Offset
; /* 00 offset to next PROCESS_INFO ok*/
259 DWORD ThreadCount
; /* 04 number of ThreadInfo member ok */
261 FILETIME CreationTime
; /* 20 */
263 PWCHAR ProcessName
; /* 3c ok */
265 DWORD ProcessID
; /* 44 ok*/
266 DWORD ParentProcessID
;
268 DWORD Unknown3
[2]; /* 50 */
269 ULONG PeakVirtualSize
;
271 ULONG PageFaultCount
;
272 ULONG PeakWorkingSetSize
;
273 ULONG WorkingSetSize
;
274 ULONG QuotaPeakPagedPoolUsage
;
275 ULONG QuotaPagedPoolUsage
;
276 ULONG QuotaPeakNonPagedPoolUsage
;
277 ULONG QuotaNonPagedPoolUsage
;
279 ULONG PeakPagefileUsage
;
282 THREAD_INFO ati
[ANYSIZE_ARRAY
]; /* 94 size=0x40*/
283 } PROCESS_INFO
, PPROCESS_INFO
;
285 NTSTATUS WINAPI
NtQuerySystemInformation(
286 IN SYSTEM_INFORMATION_CLASS SystemInformationClass
,
287 OUT PVOID SystemInformation
,
289 OUT PULONG ResultLength
);
292 * system configuration
296 typedef struct _SYSTEM_TIME_ADJUSTMENT
298 ULONG TimeAdjustment
;
299 BOOLEAN TimeAdjustmentDisabled
;
301 } SYSTEM_TIME_ADJUSTMENT
, *PSYSTEM_TIME_ADJUSTMENT
;
303 typedef struct _SYSTEM_CONFIGURATION_INFO
308 { WORD ProcessorArchitecture
;
313 PVOID MinimumApplicationAddress
;
314 PVOID MaximumApplicationAddress
;
315 ULONG ActiveProcessorMask
;
316 ULONG NumberOfProcessors
;
318 ULONG AllocationGranularity
;
320 WORD ProcessorRevision
;
322 } SYSTEM_CONFIGURATION_INFO
, *PSYSTEM_CONFIGURATION_INFO
;
325 typedef struct _SYSTEM_CACHE_INFORMATION
329 ULONG PageFaultCount
;
330 ULONG MinimumWorkingSet
;
331 ULONG MaximumWorkingSet
;
334 } SYSTEM_CACHE_INFORMATION
;
337 * NtQueryProcessInformation
340 /* parameter ProcessInformationClass */
342 typedef enum _PROCESSINFOCLASS
343 { ProcessBasicInformation
,
349 ProcessRaisePriority
,
351 ProcessExceptionPort
,
353 ProcessLdtInformation
,
355 ProcessDefaultHardErrorMode
,
356 ProcessIoPortHandlers
,
357 ProcessPooledUsageAndLimits
,
358 ProcessWorkingSetWatch
,
360 ProcessEnableAlignmentFaultFixup
,
361 ProcessPriorityClass
,
362 ProcessWx86Information
,
365 ProcessPriorityBoost
,
367 ProcessSessionInformation
,
368 ProcessForegroundInformation
,
369 ProcessWow64Information
,
373 /* parameter ProcessInformation (depending on ProcessInformationClass) */
375 typedef struct _PROCESS_BASIC_INFORMATION
377 DWORD PebBaseAddress
;
380 ULONG UniqueProcessId
;
381 ULONG InheritedFromUniqueProcessId
;
382 } PROCESS_BASIC_INFORMATION
;
384 NTSTATUS WINAPI
NtQueryInformationProcess(
385 IN HANDLE ProcessHandle
,
386 IN PROCESSINFOCLASS ProcessInformationClass
,
387 OUT PVOID ProcessInformation
,
388 IN ULONG ProcessInformationLength
,
389 OUT PULONG ReturnLength
);
391 #define NtCurrentProcess() ( (HANDLE) -1 )
397 typedef enum _TIMER_TYPE
404 /* token functions */
406 NTSTATUS WINAPI
NtOpenProcessToken(
407 HANDLE ProcessHandle
,
409 HANDLE
*TokenHandle
);
411 NTSTATUS WINAPI
NtOpenThreadToken(
415 HANDLE
*TokenHandle
);
417 NTSTATUS WINAPI
NtAdjustPrivilegesToken(
418 IN HANDLE TokenHandle
,
419 IN BOOLEAN DisableAllPrivileges
,
420 IN PTOKEN_PRIVILEGES NewState
,
421 IN DWORD BufferLength
,
422 OUT PTOKEN_PRIVILEGES PreviousState
,
423 OUT PDWORD ReturnLength
);
425 NTSTATUS WINAPI
NtQueryInformationToken(
427 DWORD tokeninfoclass
,
429 DWORD tokeninfolength
,
434 BOOLEAN WINAPI
RtlAllocateAndInitializeSid (
435 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority
,
436 BYTE nSubAuthorityCount
,
437 DWORD nSubAuthority0
, DWORD nSubAuthority1
,
438 DWORD nSubAuthority2
, DWORD nSubAuthority3
,
439 DWORD nSubAuthority4
, DWORD nSubAuthority5
,
440 DWORD nSubAuthority6
, DWORD nSubAuthority7
,
443 BOOL WINAPI
RtlInitializeSid(
445 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority
,
446 BYTE nSubAuthorityCount
);
448 DWORD WINAPI
RtlFreeSid(
451 BOOL WINAPI
RtlEqualSid(
455 DWORD WINAPI
RtlLengthRequiredSid(
458 DWORD WINAPI
RtlLengthSid(
461 LPDWORD WINAPI
RtlSubAuthoritySid(
465 LPBYTE WINAPI
RtlSubAuthorityCountSid(
468 DWORD WINAPI
RtlCopySid(
473 BOOL WINAPI
RtlValidSid(
476 BOOL WINAPI
RtlEqualPrefixSid(
480 PSID_IDENTIFIER_AUTHORITY WINAPI
RtlIdentifierAuthoritySid(
483 /* security descriptor functions */
485 NTSTATUS WINAPI
RtlCreateSecurityDescriptor(
486 PSECURITY_DESCRIPTOR lpsd
,
489 NTSTATUS WINAPI
RtlValidSecurityDescriptor(
490 PSECURITY_DESCRIPTOR SecurityDescriptor
);
492 ULONG WINAPI
RtlLengthSecurityDescriptor(
493 PSECURITY_DESCRIPTOR SecurityDescriptor
);
495 NTSTATUS WINAPI
RtlGetDaclSecurityDescriptor(
496 IN PSECURITY_DESCRIPTOR pSecurityDescriptor
,
497 OUT PBOOLEAN lpbDaclPresent
,
499 OUT PBOOLEAN lpbDaclDefaulted
);
501 NTSTATUS WINAPI
RtlSetDaclSecurityDescriptor (
502 PSECURITY_DESCRIPTOR lpsd
,
505 BOOLEAN dacldefaulted
);
507 NTSTATUS WINAPI
RtlGetSaclSecurityDescriptor(
508 IN PSECURITY_DESCRIPTOR pSecurityDescriptor
,
509 OUT PBOOLEAN lpbSaclPresent
,
511 OUT PBOOLEAN lpbSaclDefaulted
);
513 NTSTATUS WINAPI
RtlSetSaclSecurityDescriptor (
514 PSECURITY_DESCRIPTOR lpsd
,
517 BOOLEAN sacldefaulted
);
519 NTSTATUS WINAPI
RtlGetOwnerSecurityDescriptor(
520 PSECURITY_DESCRIPTOR SecurityDescriptor
,
522 PBOOLEAN OwnerDefaulted
);
524 NTSTATUS WINAPI
RtlSetOwnerSecurityDescriptor(
525 PSECURITY_DESCRIPTOR lpsd
,
527 BOOLEAN ownerdefaulted
);
529 NTSTATUS WINAPI
RtlSetGroupSecurityDescriptor (
530 PSECURITY_DESCRIPTOR lpsd
,
532 BOOLEAN groupdefaulted
);
534 NTSTATUS WINAPI
RtlGetGroupSecurityDescriptor(
535 PSECURITY_DESCRIPTOR SecurityDescriptor
,
537 PBOOLEAN GroupDefaulted
);
539 NTSTATUS WINAPI
RtlMakeSelfRelativeSD(
540 IN PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor
,
541 IN PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor
,
542 IN OUT LPDWORD lpdwBufferLength
);
544 NTSTATUS WINAPI
RtlGetControlSecurityDescriptor(
545 PSECURITY_DESCRIPTOR pSecurityDescriptor
,
546 PSECURITY_DESCRIPTOR_CONTROL pControl
,
547 LPDWORD lpdwRevision
);
551 NTSTATUS WINAPI
RtlCreateAcl(
556 BOOLEAN WINAPI
RtlFirstFreeAce(
560 NTSTATUS WINAPI
RtlAddAce(
564 PACE_HEADER acestart
,
567 BOOL WINAPI
RtlAddAccessAllowedAce(
569 IN DWORD dwAceRevision
,
573 BOOL WINAPI
AddAccessAllowedAceEx(
575 IN DWORD dwAceRevision
,
580 DWORD WINAPI
RtlGetAce(
585 /* string functions */
587 VOID WINAPI
RtlInitAnsiString(
591 VOID WINAPI
RtlInitString(
595 VOID WINAPI
RtlInitUnicodeString(
596 PUNICODE_STRING target
,
599 VOID WINAPI
RtlFreeUnicodeString(
600 PUNICODE_STRING str
);
602 VOID WINAPI
RtlFreeAnsiString(
603 PANSI_STRING AnsiString
);
605 NTSTATUS WINAPI
RtlAnsiStringToUnicodeString(
610 NTSTATUS WINAPI
RtlOemStringToUnicodeString(
615 NTSTATUS WINAPI
RtlMultiByteToUnicodeN(
622 NTSTATUS WINAPI
RtlOemToUnicodeN(
629 NTSTATUS WINAPI
RtlUnicodeToOemN(
636 NTSTATUS WINAPI
RtlUnicodeStringToOemString(
641 NTSTATUS WINAPI
RtlUnicodeStringToAnsiString(
646 BOOLEAN WINAPI
RtlEqualUnicodeString(
651 DWORD WINAPI
RtlUpcaseUnicodeString(
652 PUNICODE_STRING dest
,
656 UINT WINAPI
RtlxOemStringToUnicodeSize(
659 UINT WINAPI
RtlxAnsiStringToUnicodeSize(
662 DWORD WINAPI
RtlIsTextUnicode(
667 NTSTATUS WINAPI
RtlCompareUnicodeString(
668 PUNICODE_STRING String1
,
669 PUNICODE_STRING String2
,
670 BOOLEAN CaseInSensitive
);
672 /* resource functions */
674 typedef struct _RTL_RWLOCK
{
675 CRITICAL_SECTION rtlCS
;
676 HANDLE hSharedReleaseSemaphore
;
678 HANDLE hExclusiveReleaseSemaphore
;
679 UINT uExclusiveWaiters
;
681 HANDLE hOwningThreadId
;
682 DWORD dwTimeoutBoost
;
684 } RTL_RWLOCK
, *LPRTL_RWLOCK
;
686 VOID WINAPI
RtlInitializeResource(
689 VOID WINAPI
RtlDeleteResource(
692 BYTE WINAPI
RtlAcquireResourceExclusive(
693 LPRTL_RWLOCK
, BYTE fWait
);
695 BYTE WINAPI
RtlAcquireResourceShared(
696 LPRTL_RWLOCK
, BYTE fWait
);
698 VOID WINAPI
RtlReleaseResource(
701 VOID WINAPI
RtlDumpResource(
706 typedef struct _TIME_FIELDS
717 typedef TIME_FIELDS
*PTIME_FIELDS
;
719 VOID WINAPI
RtlSystemTimeToLocalTime(
720 IN PLARGE_INTEGER SystemTime
,
721 OUT PLARGE_INTEGER LocalTime
);
723 VOID WINAPI
RtlTimeToTimeFields(
724 PLARGE_INTEGER liTime
,
725 PTIME_FIELDS TimeFields
);
727 BOOLEAN WINAPI
RtlTimeFieldsToTime(
728 PTIME_FIELDS tfTimeFields
,
729 PLARGE_INTEGER Time
);
731 VOID WINAPI
RtlTimeToElapsedTimeFields(
732 PLARGE_INTEGER liTime
,
733 PTIME_FIELDS TimeFields
);
735 BOOLEAN WINAPI
RtlTimeToSecondsSince1980(
739 BOOLEAN WINAPI
RtlTimeToSecondsSince1970(
745 /* Data structure for heap definition. This includes various
746 sizing parameters and callback routines, which, if left NULL,
747 result in default behavior */
750 { ULONG Length
; /* = sizeof(RTL_HEAP_DEFINITION) */
752 } RTL_HEAP_DEFINITION
, *PRTL_HEAP_DEFINITION
;
754 HANDLE WINAPI
RtlCreateHeap(
760 PRTL_HEAP_DEFINITION Definition
);
762 PVOID WINAPI
RtlAllocateHeap(
768 BOOLEAN WINAPI
RtlFreeHeap(
775 void WINAPI
NtRaiseException(
776 PEXCEPTION_RECORD
,PCONTEXT
,BOOL
);
778 void WINAPI
RtlRaiseException(
781 void WINAPI
RtlRaiseStatus(
784 void WINAPI
RtlUnwind(
787 PEXCEPTION_RECORD
,DWORD
);
789 /* process environment block */
790 VOID WINAPI
RtlAcquirePebLock(void);
791 VOID WINAPI
RtlReleasePebLock(void);
794 INT WINAPI
RtlExtendedLargeIntegerDivide(
795 LARGE_INTEGER dividend
,
799 LARGE_INTEGER WINAPI
RtlExtendedIntegerMultiply(
800 LARGE_INTEGER factor1
,
804 DWORD WINAPI
RtlCreateEnvironment(
808 DWORD WINAPI
RtlDestroyEnvironment(
811 DWORD WINAPI
RtlQueryEnvironmentVariable_U(
814 PUNICODE_STRING val
) ;
816 DWORD WINAPI
RtlSetEnvironmentVariable(
819 PUNICODE_STRING val
);
821 /* object security */
823 DWORD WINAPI
RtlNewSecurityObject(
831 DWORD WINAPI
RtlDeleteSecurityObject(
835 NtQuerySecurityObject(
837 IN SECURITY_INFORMATION RequestedInformation
,
838 OUT PSECURITY_DESCRIPTOR pSecurityDesriptor
,
840 OUT PULONG ResultLength
);
845 IN SECURITY_INFORMATION SecurityInformation
,
846 IN PSECURITY_DESCRIPTOR SecurityDescriptor
);
851 void WINAPIV
DbgPrint(LPCSTR fmt
, ...);
853 DWORD WINAPI
RtlAdjustPrivilege(DWORD x1
,DWORD x2
,DWORD x3
,DWORD x4
);
854 DWORD WINAPI
RtlIntegerToChar(DWORD x1
,DWORD x2
,DWORD x3
,DWORD x4
);
855 LPVOID WINAPI
RtlNormalizeProcessParams(LPVOID x
);
856 DWORD WINAPI
RtlNtStatusToDosError(DWORD error
);
857 BOOLEAN WINAPI
RtlGetNtProductType(LPDWORD type
);
859 DWORD WINAPI
RtlOpenCurrentUser(
860 IN ACCESS_MASK DesiredAccess
,
861 OUT PHANDLE KeyHandle
);
863 BOOLEAN WINAPI
RtlDosPathNameToNtPathName_U( LPWSTR from
,PUNICODE_STRING us
,DWORD x2
,DWORD x3
);
864 BOOL WINAPI
RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
);
868 IN PSECURITY_DESCRIPTOR SecurityDescriptor
,
869 IN HANDLE ClientToken
,
870 IN ACCESS_MASK DesiredAccess
,
871 IN PGENERIC_MAPPING GenericMapping
,
872 OUT PPRIVILEGE_SET PrivilegeSet
,
873 OUT PULONG ReturnLength
,
874 OUT PULONG GrantedAccess
,
875 OUT PBOOLEAN AccessStatus
);