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);
299 typedef enum _TIMER_TYPE
310 NTSTATUS WINAPI NtOpenProcessToken(
311 HANDLE ProcessHandle,
313 HANDLE *TokenHandle);
315 NTSTATUS WINAPI NtOpenThreadToken(
319 HANDLE *TokenHandle);
321 NTSTATUS WINAPI NtAdjustPrivilegesToken(
322 IN HANDLE TokenHandle,
323 IN BOOLEAN DisableAllPrivileges,
324 IN PTOKEN_PRIVILEGES NewState,
325 IN DWORD BufferLength,
326 OUT PTOKEN_PRIVILEGES PreviousState,
327 OUT PDWORD ReturnLength);
329 NTSTATUS WINAPI NtQueryInformationToken(
331 DWORD tokeninfoclass,
333 DWORD tokeninfolength,
340 BOOLEAN WINAPI RtlAllocateAndInitializeSid (
341 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
342 DWORD nSubAuthorityCount,
353 DWORD WINAPI RtlEqualSid(DWORD x1,DWORD x2);
354 DWORD WINAPI RtlFreeSid(DWORD x1);
355 DWORD WINAPI RtlLengthRequiredSid(DWORD nrofsubauths);
356 DWORD WINAPI RtlLengthSid(PSID sid);
357 DWORD WINAPI RtlInitializeSid(PSID PSID,PSID_IDENTIFIER_AUTHORITY PSIDauth, DWORD c);
358 LPDWORD WINAPI RtlSubAuthoritySid(PSID PSID,DWORD nr);
359 LPBYTE WINAPI RtlSubAuthorityCountSid(PSID PSID);
360 DWORD WINAPI RtlCopySid(DWORD len,PSID to,PSID from);
363 * security descriptor functions
366 NTSTATUS WINAPI RtlCreateSecurityDescriptor(
367 PSECURITY_DESCRIPTOR lpsd,
370 NTSTATUS WINAPI RtlValidSecurityDescriptor(
371 PSECURITY_DESCRIPTOR SecurityDescriptor);
373 ULONG WINAPI RtlLengthSecurityDescriptor(
374 PSECURITY_DESCRIPTOR SecurityDescriptor);
376 NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(
377 IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
378 OUT PBOOLEAN lpbDaclPresent,
380 OUT PBOOLEAN lpbDaclDefaulted);
382 NTSTATUS WINAPI RtlSetDaclSecurityDescriptor (
383 PSECURITY_DESCRIPTOR lpsd,
386 BOOLEAN dacldefaulted );
388 NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(
389 IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
390 OUT PBOOLEAN lpbSaclPresent,
392 OUT PBOOLEAN lpbSaclDefaulted);
394 NTSTATUS WINAPI RtlSetSaclSecurityDescriptor (
395 PSECURITY_DESCRIPTOR lpsd,
398 BOOLEAN sacldefaulted);
400 NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(
401 PSECURITY_DESCRIPTOR SecurityDescriptor,
403 PBOOLEAN OwnerDefaulted);
405 NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(
406 PSECURITY_DESCRIPTOR lpsd,
408 BOOLEAN ownerdefaulted);
410 NTSTATUS WINAPI RtlSetGroupSecurityDescriptor (
411 PSECURITY_DESCRIPTOR lpsd,
413 BOOLEAN groupdefaulted);
415 NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(
416 PSECURITY_DESCRIPTOR SecurityDescriptor,
418 PBOOLEAN GroupDefaulted);
420 /* ##############################
421 ###### ACL FUNCTIONS ######
422 ##############################
425 DWORD WINAPI RtlCreateAcl(PACL acl,DWORD size,DWORD rev);
427 BOOLEAN WINAPI RtlFirstFreeAce(
431 NTSTATUS WINAPI RtlAddAce(
435 PACE_HEADER acestart,
438 DWORD WINAPI RtlAddAccessAllowedAce(DWORD x1,DWORD x2,DWORD x3,DWORD x4);
439 DWORD WINAPI RtlGetAce(PACL pAcl,DWORD dwAceIndex,LPVOID *pAce );
445 DWORD WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING uni,PANSI_STRING ansi,BOOLEAN doalloc);
446 DWORD WINAPI RtlOemStringToUnicodeString(PUNICODE_STRING uni,PSTRING ansi,BOOLEAN doalloc);
447 DWORD WINAPI RtlMultiByteToUnicodeN(LPWSTR unistr,DWORD unilen,LPDWORD reslen,LPSTR oemstr,DWORD oemlen);
448 DWORD WINAPI RtlOemToUnicodeN(LPWSTR unistr,DWORD unilen,LPDWORD reslen,LPSTR oemstr,DWORD oemlen);
449 VOID WINAPI RtlInitAnsiString(PANSI_STRING target,LPCSTR source);
450 VOID WINAPI RtlInitString(PSTRING target,LPCSTR source);
451 VOID WINAPI RtlInitUnicodeString(PUNICODE_STRING target,LPCWSTR source);
452 VOID WINAPI RtlFreeUnicodeString(PUNICODE_STRING str);
453 VOID WINAPI RtlFreeAnsiString(PANSI_STRING AnsiString);
454 DWORD WINAPI RtlUnicodeToOemN(LPSTR oemstr,DWORD oemlen,LPDWORD reslen,LPWSTR unistr,DWORD unilen);
455 DWORD WINAPI RtlUnicodeStringToOemString(PANSI_STRING oem,PUNICODE_STRING uni,BOOLEAN alloc);
456 DWORD WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING oem,PUNICODE_STRING uni,BOOLEAN alloc);
457 DWORD WINAPI RtlEqualUnicodeString(PUNICODE_STRING s1,PUNICODE_STRING s2,DWORD x);
458 DWORD WINAPI RtlUpcaseUnicodeString(PUNICODE_STRING dest,PUNICODE_STRING src,BOOLEAN doalloc);
459 UINT WINAPI RtlxOemStringToUnicodeSize(PSTRING str);
460 UINT WINAPI RtlxAnsiStringToUnicodeSize(PANSI_STRING str);
461 DWORD WINAPI RtlIsTextUnicode(LPVOID buf, DWORD len, DWORD *pf);
462 NTSTATUS WINAPI RtlCompareUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive);
468 typedef struct _RTL_RWLOCK {
469 CRITICAL_SECTION rtlCS;
470 HANDLE hSharedReleaseSemaphore;
472 HANDLE hExclusiveReleaseSemaphore;
473 UINT uExclusiveWaiters;
475 HANDLE hOwningThreadId;
476 DWORD dwTimeoutBoost;
478 } RTL_RWLOCK, *LPRTL_RWLOCK;
480 VOID WINAPI RtlInitializeResource(
483 VOID WINAPI RtlDeleteResource(
486 BYTE WINAPI RtlAcquireResourceExclusive(
487 LPRTL_RWLOCK, BYTE fWait);
489 BYTE WINAPI RtlAcquireResourceShared(
490 LPRTL_RWLOCK, BYTE fWait);
492 VOID WINAPI RtlReleaseResource(
495 VOID WINAPI RtlDumpResource(
502 typedef struct _TIME_FIELDS
513 typedef TIME_FIELDS *PTIME_FIELDS;
515 VOID WINAPI RtlSystemTimeToLocalTime(
516 IN PLARGE_INTEGER SystemTime,
517 OUT PLARGE_INTEGER LocalTime);
519 VOID WINAPI RtlTimeToTimeFields(
520 PLARGE_INTEGER liTime,
521 PTIME_FIELDS TimeFields);
523 BOOLEAN WINAPI RtlTimeFieldsToTime(
524 PTIME_FIELDS tfTimeFields,
525 PLARGE_INTEGER Time);
527 VOID WINAPI RtlTimeToElapsedTimeFields(
528 PLARGE_INTEGER liTime,
529 PTIME_FIELDS TimeFields);
531 BOOLEAN WINAPI RtlTimeToSecondsSince1980(
535 BOOLEAN WINAPI RtlTimeToSecondsSince1970(
543 /* Data structure for heap definition. This includes various
544 sizing parameters and callback routines, which, if left NULL,
545 result in default behavior */
548 { ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
550 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
552 HANDLE WINAPI RtlCreateHeap(
558 PRTL_HEAP_DEFINITION Definition);
560 PVOID WINAPI RtlAllocateHeap(
566 BOOLEAN WINAPI RtlFreeHeap(
574 void __cdecl DbgPrint(LPCSTR fmt,LPVOID args);
575 DWORD NtRaiseException ( DWORD dwExceptionCode, DWORD dwExceptionFlags, DWORD nNumberOfArguments,CONST ULONG_PTR *lpArguments);
576 DWORD RtlRaiseException ( DWORD x);
577 VOID WINAPI RtlAcquirePebLock(void);
578 VOID WINAPI RtlReleasePebLock(void);
579 DWORD WINAPI RtlAdjustPrivilege(DWORD x1,DWORD x2,DWORD x3,DWORD x4);
580 DWORD WINAPI RtlIntegerToChar(DWORD x1,DWORD x2,DWORD x3,DWORD x4);
581 DWORD WINAPI RtlSetEnvironmentVariable(DWORD x1,PUNICODE_STRING key,PUNICODE_STRING val);
582 DWORD WINAPI RtlNewSecurityObject(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6);
583 DWORD WINAPI RtlDeleteSecurityObject(DWORD x1);
584 LPVOID WINAPI RtlNormalizeProcessParams(LPVOID x);
585 DWORD WINAPI RtlNtStatusToDosError(DWORD error);
586 BOOLEAN WINAPI RtlGetNtProductType(LPDWORD type);
587 INT WINAPI RtlExtendedLargeIntegerDivide(LARGE_INTEGER dividend, DWORD divisor, LPDWORD rest);
588 long long WINAPI RtlExtendedIntegerMultiply(LARGE_INTEGER factor1,INT factor2);
589 DWORD WINAPI RtlFormatCurrentUserKeyPath(DWORD x);
590 DWORD WINAPI RtlOpenCurrentUser(DWORD x1, DWORD *x2);
591 BOOLEAN WINAPI RtlDosPathNameToNtPathName_U( LPWSTR from,PUNICODE_STRING us,DWORD x2,DWORD x3);
592 DWORD WINAPI RtlCreateEnvironment(DWORD x1,DWORD x2);
593 DWORD WINAPI RtlDestroyEnvironment(DWORD x);
594 DWORD WINAPI RtlQueryEnvironmentVariable_U(DWORD x1,PUNICODE_STRING key,PUNICODE_STRING val) ;
596 BOOL WINAPI IsValidSid(PSID);
597 BOOL WINAPI EqualSid(PSID,PSID);
598 BOOL WINAPI EqualPrefixSid(PSID,PSID);
599 DWORD WINAPI GetSidLengthRequired(BYTE);
600 BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,
601 DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,
603 VOID* WINAPI FreeSid(PSID);
604 BOOL WINAPI InitializeSecurityDescriptor(SECURITY_DESCRIPTOR*,DWORD);
605 BOOL WINAPI InitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
606 DWORD* WINAPI GetSidSubAuthority(PSID,DWORD);
607 BYTE * WINAPI GetSidSubAuthorityCount(PSID);
608 DWORD WINAPI GetLengthSid(PSID);
609 BOOL WINAPI CopySid(DWORD,PSID,PSID);
610 BOOL WINAPI LookupAccountSidA(LPCSTR,PSID,LPCSTR,LPDWORD,LPCSTR,LPDWORD,
612 BOOL WINAPI LookupAccountSidW(LPCWSTR,PSID,LPCWSTR,LPDWORD,LPCWSTR,LPDWORD,
614 PSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority(PSID);