2 this file defines interfaces mainly exposed to device drivers and
11 #include "winbase.h" /* fixme: should be taken out sometimes */
20 #undef Status /* conflict with X11-includes*/
22 typedef struct _IO_STATUS_BLOCK
27 ULONG_PTR Information
;
28 } IO_STATUS_BLOCK
, *PIO_STATUS_BLOCK
;
30 typedef VOID (NTAPI
*PIO_APC_ROUTINE
) ( PVOID ApcContext
, PIO_STATUS_BLOCK IoStatusBlock
, ULONG Reserved
);
32 typedef enum _KEY_INFORMATION_CLASS
{
36 } KEY_INFORMATION_CLASS
;
38 typedef enum _KEY_VALUE_INFORMATION_CLASS
{
39 KeyValueBasicInformation
,
40 KeyValueFullInformation
,
41 KeyValuePartialInformation
,
42 KeyValueFullInformationAlign64
,
43 KeyValuePartialInformationAlign64
44 } KEY_VALUE_INFORMATION_CLASS
;
46 typedef enum _THREADINFOCLASS
47 { ThreadBasicInformation
,
52 ThreadImpersonationToken
,
53 ThreadDescriptorTableEntry
,
54 ThreadEnableAlignmentFaultFixup
,
55 ThreadEventPair_Reusable
,
56 ThreadQuerySetWin32StartAddress
,
58 ThreadPerformanceCount
,
62 ThreadSetTlsArrayAddress
,
67 typedef enum _FILE_INFORMATION_CLASS
{
68 FileDirectoryInformation
= 1,
69 FileFullDirectoryInformation
,
70 FileBothDirectoryInformation
,
72 FileStandardInformation
,
73 FileInternalInformation
,
75 FileAccessInformation
,
77 FileRenameInformation
,
80 FileDispositionInformation
,
81 FilePositionInformation
,
82 FileFullEaInformation
,
84 FileAlignmentInformation
,
86 FileAllocationInformation
,
87 FileEndOfFileInformation
,
88 FileAlternateNameInformation
,
89 FileStreamInformation
,
91 FilePipeLocalInformation
,
92 FilePipeRemoteInformation
,
93 FileMailslotQueryInformation
,
94 FileMailslotSetInformation
,
95 FileCompressionInformation
,
96 FileObjectIdInformation
,
97 FileCompletionInformation
,
98 FileMoveClusterInformation
,
100 FileReparsePointInformation
,
101 FileNetworkOpenInformation
,
102 FileAttributeTagInformation
,
103 FileTrackingInformation
,
104 FileMaximumInformation
105 } FILE_INFORMATION_CLASS
, *PFILE_INFORMATION_CLASS
;
107 typedef enum _SECTION_INHERIT
117 typedef enum _OBJECT_INFORMATION_CLASS
121 } OBJECT_INFORMATION_CLASS
, *POBJECT_INFORMATION_CLASS
;
125 * NtQuerySystemInformation
128 typedef enum SYSTEM_INFORMATION_CLASS
133 SystemPerformanceInformation
134 } SYSTEM_INFORMATION_CLASS
, *PSYSTEM_INFORMATION_CLASS
;
136 /* reading coffee grounds... */
137 typedef struct _THREAD_INFO
144 } THREAD_INFO
, PTHREAD_INFO
;
146 typedef struct _VM_COUNTERS_
147 { ULONG PeakVirtualSize
;
149 ULONG PageFaultCount
;
150 ULONG PeakWorkingSetSize
;
151 ULONG WorkingSetSize
;
152 ULONG QuotaPeakPagedPoolUsage
;
153 ULONG QuotaPagedPoolUsage
;
154 ULONG QuotaPeakNonPagedPoolUsage
;
155 ULONG QuotaNonPagedPoolUsage
;
157 ULONG PeakPagefileUsage
;
158 } VM_COUNTERS
, *PVM_COUNTERS
;
160 typedef struct _PROCESS_INFO
161 { DWORD Offset
; /* 00 offset to next PROCESS_INFO ok*/
162 DWORD ThreadCount
; /* 04 number of ThreadInfo member ok */
164 FILETIME CreationTime
; /* 20 */
166 PWCHAR ProcessName
; /* 3c ok */
168 DWORD ProcessID
; /* 44 ok*/
169 DWORD ParentProcessID
;
171 DWORD Unknown3
[2]; /* 50 */
172 ULONG PeakVirtualSize
;
174 ULONG PageFaultCount
;
175 ULONG PeakWorkingSetSize
;
176 ULONG WorkingSetSize
;
177 ULONG QuotaPeakPagedPoolUsage
;
178 ULONG QuotaPagedPoolUsage
;
179 ULONG QuotaPeakNonPagedPoolUsage
;
180 ULONG QuotaNonPagedPoolUsage
;
182 ULONG PeakPagefileUsage
;
185 THREAD_INFO ati
[ANYSIZE_ARRAY
]; /* 94 size=0x40*/
186 } PROCESS_INFO
, PPROCESS_INFO
;
188 NTSTATUS WINAPI
NtQuerySystemInformation(
189 IN SYSTEM_INFORMATION_CLASS SystemInformationClass
,
190 OUT PVOID SystemInformation
,
192 OUT PULONG ResultLength
);
195 * system configuration
199 typedef struct _SYSTEM_TIME_ADJUSTMENT
201 ULONG TimeAdjustment
;
202 BOOLEAN TimeAdjustmentDisabled
;
204 } SYSTEM_TIME_ADJUSTMENT
, *PSYSTEM_TIME_ADJUSTMENT
;
206 typedef struct _SYSTEM_CONFIGURATION_INFO
211 { WORD ProcessorArchitecture
;
216 PVOID MinimumApplicationAddress
;
217 PVOID MaximumApplicationAddress
;
218 ULONG ActiveProcessorMask
;
219 ULONG NumberOfProcessors
;
221 ULONG AllocationGranularity
;
223 WORD ProcessorRevision
;
225 } SYSTEM_CONFIGURATION_INFO
, *PSYSTEM_CONFIGURATION_INFO
;
228 typedef struct _SYSTEM_CACHE_INFORMATION
232 ULONG PageFaultCount
;
233 ULONG MinimumWorkingSet
;
234 ULONG MaximumWorkingSet
;
237 } SYSTEM_CACHE_INFORMATION
;
240 * NtQueryProcessInformation
243 /* parameter ProcessInformationClass */
245 typedef enum _PROCESSINFOCLASS
246 { ProcessBasicInformation
,
252 ProcessRaisePriority
,
254 ProcessExceptionPort
,
256 ProcessLdtInformation
,
258 ProcessDefaultHardErrorMode
,
259 ProcessIoPortHandlers
,
260 ProcessPooledUsageAndLimits
,
261 ProcessWorkingSetWatch
,
263 ProcessEnableAlignmentFaultFixup
,
264 ProcessPriorityClass
,
265 ProcessWx86Information
,
268 ProcessPriorityBoost
,
270 ProcessSessionInformation
,
271 ProcessForegroundInformation
,
272 ProcessWow64Information
,
276 /* parameter ProcessInformation (depending on ProcessInformationClass) */
278 typedef struct _PROCESS_BASIC_INFORMATION
280 DWORD PebBaseAddress
;
283 ULONG UniqueProcessId
;
284 ULONG InheritedFromUniqueProcessId
;
285 } PROCESS_BASIC_INFORMATION
;
287 NTSTATUS WINAPI
NtQueryInformationProcess(
288 IN HANDLE ProcessHandle
,
289 IN PROCESSINFOCLASS ProcessInformationClass
,
290 OUT PVOID ProcessInformation
,
291 IN ULONG ProcessInformationLength
,
292 OUT PULONG ReturnLength
);
294 #define NtCurrentProcess() ( (HANDLE) -1 )
300 typedef enum _TIMER_TYPE
311 NTSTATUS WINAPI
NtOpenProcessToken(
312 HANDLE ProcessHandle
,
314 HANDLE
*TokenHandle
);
316 NTSTATUS WINAPI
NtOpenThreadToken(
320 HANDLE
*TokenHandle
);
322 NTSTATUS WINAPI
NtAdjustPrivilegesToken(
323 IN HANDLE TokenHandle
,
324 IN BOOLEAN DisableAllPrivileges
,
325 IN PTOKEN_PRIVILEGES NewState
,
326 IN DWORD BufferLength
,
327 OUT PTOKEN_PRIVILEGES PreviousState
,
328 OUT PDWORD ReturnLength
);
330 NTSTATUS WINAPI
NtQueryInformationToken(
332 DWORD tokeninfoclass
,
334 DWORD tokeninfolength
,
341 BOOLEAN WINAPI
RtlAllocateAndInitializeSid (
342 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority
,
343 DWORD nSubAuthorityCount
,
354 DWORD WINAPI
RtlEqualSid(DWORD x1
,DWORD x2
);
355 DWORD WINAPI
RtlFreeSid(DWORD x1
);
356 DWORD WINAPI
RtlLengthRequiredSid(DWORD nrofsubauths
);
357 DWORD WINAPI
RtlLengthSid(PSID sid
);
358 DWORD WINAPI
RtlInitializeSid(PSID PSID
,PSID_IDENTIFIER_AUTHORITY PSIDauth
, DWORD c
);
359 LPDWORD WINAPI
RtlSubAuthoritySid(PSID PSID
,DWORD nr
);
360 LPBYTE WINAPI
RtlSubAuthorityCountSid(PSID PSID
);
361 DWORD WINAPI
RtlCopySid(DWORD len
,PSID to
,PSID from
);
364 * security descriptor functions
367 NTSTATUS WINAPI
RtlCreateSecurityDescriptor(
368 PSECURITY_DESCRIPTOR lpsd
,
371 NTSTATUS WINAPI
RtlValidSecurityDescriptor(
372 PSECURITY_DESCRIPTOR SecurityDescriptor
);
374 ULONG WINAPI
RtlLengthSecurityDescriptor(
375 PSECURITY_DESCRIPTOR SecurityDescriptor
);
377 NTSTATUS WINAPI
RtlGetDaclSecurityDescriptor(
378 IN PSECURITY_DESCRIPTOR pSecurityDescriptor
,
379 OUT PBOOLEAN lpbDaclPresent
,
381 OUT PBOOLEAN lpbDaclDefaulted
);
383 NTSTATUS WINAPI
RtlSetDaclSecurityDescriptor (
384 PSECURITY_DESCRIPTOR lpsd
,
387 BOOLEAN dacldefaulted
);
389 NTSTATUS WINAPI
RtlGetSaclSecurityDescriptor(
390 IN PSECURITY_DESCRIPTOR pSecurityDescriptor
,
391 OUT PBOOLEAN lpbSaclPresent
,
393 OUT PBOOLEAN lpbSaclDefaulted
);
395 NTSTATUS WINAPI
RtlSetSaclSecurityDescriptor (
396 PSECURITY_DESCRIPTOR lpsd
,
399 BOOLEAN sacldefaulted
);
401 NTSTATUS WINAPI
RtlGetOwnerSecurityDescriptor(
402 PSECURITY_DESCRIPTOR SecurityDescriptor
,
404 PBOOLEAN OwnerDefaulted
);
406 NTSTATUS WINAPI
RtlSetOwnerSecurityDescriptor(
407 PSECURITY_DESCRIPTOR lpsd
,
409 BOOLEAN ownerdefaulted
);
411 NTSTATUS WINAPI
RtlSetGroupSecurityDescriptor (
412 PSECURITY_DESCRIPTOR lpsd
,
414 BOOLEAN groupdefaulted
);
416 NTSTATUS WINAPI
RtlGetGroupSecurityDescriptor(
417 PSECURITY_DESCRIPTOR SecurityDescriptor
,
419 PBOOLEAN GroupDefaulted
);
421 /* ##############################
422 ###### ACL FUNCTIONS ######
423 ##############################
426 DWORD WINAPI
RtlCreateAcl(PACL acl
,DWORD size
,DWORD rev
);
428 BOOLEAN WINAPI
RtlFirstFreeAce(
432 NTSTATUS WINAPI
RtlAddAce(
436 PACE_HEADER acestart
,
439 DWORD WINAPI
RtlAddAccessAllowedAce(DWORD x1
,DWORD x2
,DWORD x3
,DWORD x4
);
440 DWORD WINAPI
RtlGetAce(PACL pAcl
,DWORD dwAceIndex
,LPVOID
*pAce
);
446 DWORD WINAPI
RtlAnsiStringToUnicodeString(PUNICODE_STRING uni
,PANSI_STRING ansi
,BOOLEAN doalloc
);
447 DWORD WINAPI
RtlOemStringToUnicodeString(PUNICODE_STRING uni
,PSTRING ansi
,BOOLEAN doalloc
);
448 DWORD WINAPI
RtlMultiByteToUnicodeN(LPWSTR unistr
,DWORD unilen
,LPDWORD reslen
,LPSTR oemstr
,DWORD oemlen
);
449 DWORD WINAPI
RtlOemToUnicodeN(LPWSTR unistr
,DWORD unilen
,LPDWORD reslen
,LPSTR oemstr
,DWORD oemlen
);
450 VOID WINAPI
RtlInitAnsiString(PANSI_STRING target
,LPCSTR source
);
451 VOID WINAPI
RtlInitString(PSTRING target
,LPCSTR source
);
452 VOID WINAPI
RtlInitUnicodeString(PUNICODE_STRING target
,LPCWSTR source
);
453 VOID WINAPI
RtlFreeUnicodeString(PUNICODE_STRING str
);
454 VOID WINAPI
RtlFreeAnsiString(PANSI_STRING AnsiString
);
455 DWORD WINAPI
RtlUnicodeToOemN(LPSTR oemstr
,DWORD oemlen
,LPDWORD reslen
,LPWSTR unistr
,DWORD unilen
);
456 DWORD WINAPI
RtlUnicodeStringToOemString(PANSI_STRING oem
,PUNICODE_STRING uni
,BOOLEAN alloc
);
457 DWORD WINAPI
RtlUnicodeStringToAnsiString(PANSI_STRING oem
,PUNICODE_STRING uni
,BOOLEAN alloc
);
458 DWORD WINAPI
RtlEqualUnicodeString(PUNICODE_STRING s1
,PUNICODE_STRING s2
,DWORD x
);
459 DWORD WINAPI
RtlUpcaseUnicodeString(PUNICODE_STRING dest
,PUNICODE_STRING src
,BOOLEAN doalloc
);
460 UINT WINAPI
RtlxOemStringToUnicodeSize(PSTRING str
);
461 UINT WINAPI
RtlxAnsiStringToUnicodeSize(PANSI_STRING str
);
462 DWORD WINAPI
RtlIsTextUnicode(LPVOID buf
, DWORD len
, DWORD
*pf
);
463 NTSTATUS WINAPI
RtlCompareUnicodeString(PUNICODE_STRING String1
, PUNICODE_STRING String2
, BOOLEAN CaseInSensitive
);
469 typedef struct _RTL_RWLOCK
{
470 CRITICAL_SECTION rtlCS
;
471 HANDLE hSharedReleaseSemaphore
;
473 HANDLE hExclusiveReleaseSemaphore
;
474 UINT uExclusiveWaiters
;
476 HANDLE hOwningThreadId
;
477 DWORD dwTimeoutBoost
;
479 } RTL_RWLOCK
, *LPRTL_RWLOCK
;
481 VOID WINAPI
RtlInitializeResource(
484 VOID WINAPI
RtlDeleteResource(
487 BYTE WINAPI
RtlAcquireResourceExclusive(
488 LPRTL_RWLOCK
, BYTE fWait
);
490 BYTE WINAPI
RtlAcquireResourceShared(
491 LPRTL_RWLOCK
, BYTE fWait
);
493 VOID WINAPI
RtlReleaseResource(
496 VOID WINAPI
RtlDumpResource(
503 typedef struct _TIME_FIELDS
514 typedef TIME_FIELDS
*PTIME_FIELDS
;
516 VOID WINAPI
RtlSystemTimeToLocalTime(
517 IN PLARGE_INTEGER SystemTime
,
518 OUT PLARGE_INTEGER LocalTime
);
520 VOID WINAPI
RtlTimeToTimeFields(
521 PLARGE_INTEGER liTime
,
522 PTIME_FIELDS TimeFields
);
524 BOOLEAN WINAPI
RtlTimeFieldsToTime(
525 PTIME_FIELDS tfTimeFields
,
526 PLARGE_INTEGER Time
);
528 VOID WINAPI
RtlTimeToElapsedTimeFields(
529 PLARGE_INTEGER liTime
,
530 PTIME_FIELDS TimeFields
);
532 BOOLEAN WINAPI
RtlTimeToSecondsSince1980(
536 BOOLEAN WINAPI
RtlTimeToSecondsSince1970(
544 /* Data structure for heap definition. This includes various
545 sizing parameters and callback routines, which, if left NULL,
546 result in default behavior */
549 { ULONG Length
; /* = sizeof(RTL_HEAP_DEFINITION) */
551 } RTL_HEAP_DEFINITION
, *PRTL_HEAP_DEFINITION
;
553 HANDLE WINAPI
RtlCreateHeap(
559 PRTL_HEAP_DEFINITION Definition
);
561 PVOID WINAPI
RtlAllocateHeap(
567 BOOLEAN WINAPI
RtlFreeHeap(
575 void __cdecl
DbgPrint(LPCSTR fmt
,LPVOID args
);
576 DWORD
NtRaiseException ( DWORD dwExceptionCode
, DWORD dwExceptionFlags
, DWORD nNumberOfArguments
,CONST ULONG_PTR
*lpArguments
);
577 DWORD
RtlRaiseException ( DWORD x
);
578 VOID WINAPI
RtlAcquirePebLock(void);
579 VOID WINAPI
RtlReleasePebLock(void);
580 DWORD WINAPI
RtlAdjustPrivilege(DWORD x1
,DWORD x2
,DWORD x3
,DWORD x4
);
581 DWORD WINAPI
RtlIntegerToChar(DWORD x1
,DWORD x2
,DWORD x3
,DWORD x4
);
582 DWORD WINAPI
RtlSetEnvironmentVariable(DWORD x1
,PUNICODE_STRING key
,PUNICODE_STRING val
);
583 DWORD WINAPI
RtlNewSecurityObject(DWORD x1
,DWORD x2
,DWORD x3
,DWORD x4
,DWORD x5
,DWORD x6
);
584 DWORD WINAPI
RtlDeleteSecurityObject(DWORD x1
);
585 LPVOID WINAPI
RtlNormalizeProcessParams(LPVOID x
);
586 DWORD WINAPI
RtlNtStatusToDosError(DWORD error
);
587 BOOLEAN WINAPI
RtlGetNtProductType(LPDWORD type
);
588 INT WINAPI
RtlExtendedLargeIntegerDivide(LARGE_INTEGER dividend
, DWORD divisor
, LPDWORD rest
);
589 long long WINAPI
RtlExtendedIntegerMultiply(LARGE_INTEGER factor1
,INT factor2
);
590 DWORD WINAPI
RtlFormatCurrentUserKeyPath(DWORD x
);
591 DWORD WINAPI
RtlOpenCurrentUser(DWORD x1
, DWORD
*x2
);
592 BOOLEAN WINAPI
RtlDosPathNameToNtPathName_U( LPWSTR from
,PUNICODE_STRING us
,DWORD x2
,DWORD x3
);
593 DWORD WINAPI
RtlCreateEnvironment(DWORD x1
,DWORD x2
);
594 DWORD WINAPI
RtlDestroyEnvironment(DWORD x
);
595 DWORD WINAPI
RtlQueryEnvironmentVariable_U(DWORD x1
,PUNICODE_STRING key
,PUNICODE_STRING val
) ;
597 BOOL WINAPI
IsValidSid(PSID
);
598 BOOL WINAPI
EqualSid(PSID
,PSID
);
599 BOOL WINAPI
EqualPrefixSid(PSID
,PSID
);
600 DWORD WINAPI
GetSidLengthRequired(BYTE
);
601 BOOL WINAPI
AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY
,BYTE
,DWORD
,
602 DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,
604 VOID
* WINAPI
FreeSid(PSID
);
605 BOOL WINAPI
InitializeSecurityDescriptor(SECURITY_DESCRIPTOR
*,DWORD
);
606 BOOL WINAPI
InitializeSid(PSID
,PSID_IDENTIFIER_AUTHORITY
,BYTE
);
607 DWORD
* WINAPI
GetSidSubAuthority(PSID
,DWORD
);
608 BYTE
* WINAPI
GetSidSubAuthorityCount(PSID
);
609 DWORD WINAPI
GetLengthSid(PSID
);
610 BOOL WINAPI
CopySid(DWORD
,PSID
,PSID
);
611 BOOL WINAPI
LookupAccountSidA(LPCSTR
,PSID
,LPCSTR
,LPDWORD
,LPCSTR
,LPDWORD
,
613 BOOL WINAPI
LookupAccountSidW(LPCWSTR
,PSID
,LPCWSTR
,LPDWORD
,LPCWSTR
,LPDWORD
,
615 PSID_IDENTIFIER_AUTHORITY WINAPI
GetSidIdentifierAuthority(PSID
);