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 _FSINFOCLASS {
108 FileFsVolumeInformation = 1,
109 FileFsLabelInformation,
110 FileFsSizeInformation,
111 FileFsDeviceInformation,
112 FileFsAttributeInformation,
113 FileFsControlInformation,
114 FileFsFullSizeInformation,
115 FileFsObjectIdInformation,
116 FileFsMaximumInformation
117 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
119 typedef enum _SECTION_INHERIT
129 typedef enum _OBJECT_INFORMATION_CLASS
133 } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
137 * NtQuerySystemInformation
140 typedef enum SYSTEM_INFORMATION_CLASS
145 SystemPerformanceInformation
146 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
148 /* reading coffee grounds... */
149 typedef struct _THREAD_INFO
156 } THREAD_INFO, PTHREAD_INFO;
158 typedef struct _VM_COUNTERS_
159 { ULONG PeakVirtualSize;
161 ULONG PageFaultCount;
162 ULONG PeakWorkingSetSize;
163 ULONG WorkingSetSize;
164 ULONG QuotaPeakPagedPoolUsage;
165 ULONG QuotaPagedPoolUsage;
166 ULONG QuotaPeakNonPagedPoolUsage;
167 ULONG QuotaNonPagedPoolUsage;
169 ULONG PeakPagefileUsage;
170 } VM_COUNTERS, *PVM_COUNTERS;
172 typedef struct _PROCESS_INFO
173 { DWORD Offset; /* 00 offset to next PROCESS_INFO ok*/
174 DWORD ThreadCount; /* 04 number of ThreadInfo member ok */
176 FILETIME CreationTime; /* 20 */
178 PWCHAR ProcessName; /* 3c ok */
180 DWORD ProcessID; /* 44 ok*/
181 DWORD ParentProcessID;
183 DWORD Unknown3[2]; /* 50 */
184 ULONG PeakVirtualSize;
186 ULONG PageFaultCount;
187 ULONG PeakWorkingSetSize;
188 ULONG WorkingSetSize;
189 ULONG QuotaPeakPagedPoolUsage;
190 ULONG QuotaPagedPoolUsage;
191 ULONG QuotaPeakNonPagedPoolUsage;
192 ULONG QuotaNonPagedPoolUsage;
194 ULONG PeakPagefileUsage;
197 THREAD_INFO ati[ANYSIZE_ARRAY]; /* 94 size=0x40*/
198 } PROCESS_INFO, PPROCESS_INFO;
200 NTSTATUS WINAPI NtQuerySystemInformation(
201 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
202 OUT PVOID SystemInformation,
204 OUT PULONG ResultLength);
207 * system configuration
211 typedef struct _SYSTEM_TIME_ADJUSTMENT
213 ULONG TimeAdjustment;
214 BOOLEAN TimeAdjustmentDisabled;
216 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
218 typedef struct _SYSTEM_CONFIGURATION_INFO
223 { WORD ProcessorArchitecture;
228 PVOID MinimumApplicationAddress;
229 PVOID MaximumApplicationAddress;
230 ULONG ActiveProcessorMask;
231 ULONG NumberOfProcessors;
233 ULONG AllocationGranularity;
235 WORD ProcessorRevision;
237 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
240 typedef struct _SYSTEM_CACHE_INFORMATION
244 ULONG PageFaultCount;
245 ULONG MinimumWorkingSet;
246 ULONG MaximumWorkingSet;
249 } SYSTEM_CACHE_INFORMATION;
252 * NtQueryProcessInformation
255 /* parameter ProcessInformationClass */
257 typedef enum _PROCESSINFOCLASS
258 { ProcessBasicInformation,
264 ProcessRaisePriority,
266 ProcessExceptionPort,
268 ProcessLdtInformation,
270 ProcessDefaultHardErrorMode,
271 ProcessIoPortHandlers,
272 ProcessPooledUsageAndLimits,
273 ProcessWorkingSetWatch,
275 ProcessEnableAlignmentFaultFixup,
276 ProcessPriorityClass,
277 ProcessWx86Information,
280 ProcessPriorityBoost,
282 ProcessSessionInformation,
283 ProcessForegroundInformation,
284 ProcessWow64Information,
288 /* parameter ProcessInformation (depending on ProcessInformationClass) */
290 typedef struct _PROCESS_BASIC_INFORMATION
292 DWORD PebBaseAddress;
295 ULONG UniqueProcessId;
296 ULONG InheritedFromUniqueProcessId;
297 } PROCESS_BASIC_INFORMATION;
299 NTSTATUS WINAPI NtQueryInformationProcess(
300 IN HANDLE ProcessHandle,
301 IN PROCESSINFOCLASS ProcessInformationClass,
302 OUT PVOID ProcessInformation,
303 IN ULONG ProcessInformationLength,
304 OUT PULONG ReturnLength);
306 #define NtCurrentProcess() ( (HANDLE) -1 )
312 typedef enum _TIMER_TYPE
323 NTSTATUS WINAPI NtOpenProcessToken(
324 HANDLE ProcessHandle,
326 HANDLE *TokenHandle);
328 NTSTATUS WINAPI NtOpenThreadToken(
332 HANDLE *TokenHandle);
334 NTSTATUS WINAPI NtAdjustPrivilegesToken(
335 IN HANDLE TokenHandle,
336 IN BOOLEAN DisableAllPrivileges,
337 IN PTOKEN_PRIVILEGES NewState,
338 IN DWORD BufferLength,
339 OUT PTOKEN_PRIVILEGES PreviousState,
340 OUT PDWORD ReturnLength);
342 NTSTATUS WINAPI NtQueryInformationToken(
344 DWORD tokeninfoclass,
346 DWORD tokeninfolength,
353 BOOLEAN WINAPI RtlAllocateAndInitializeSid (
354 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
355 DWORD nSubAuthorityCount,
366 DWORD WINAPI RtlEqualSid(DWORD x1,DWORD x2);
367 DWORD WINAPI RtlFreeSid(DWORD x1);
368 DWORD WINAPI RtlLengthRequiredSid(DWORD nrofsubauths);
369 DWORD WINAPI RtlLengthSid(PSID sid);
370 DWORD WINAPI RtlInitializeSid(PSID PSID,PSID_IDENTIFIER_AUTHORITY PSIDauth, DWORD c);
371 LPDWORD WINAPI RtlSubAuthoritySid(PSID PSID,DWORD nr);
372 LPBYTE WINAPI RtlSubAuthorityCountSid(PSID PSID);
373 DWORD WINAPI RtlCopySid(DWORD len,PSID to,PSID from);
376 * security descriptor functions
379 NTSTATUS WINAPI RtlCreateSecurityDescriptor(
380 PSECURITY_DESCRIPTOR lpsd,
383 NTSTATUS WINAPI RtlValidSecurityDescriptor(
384 PSECURITY_DESCRIPTOR SecurityDescriptor);
386 ULONG WINAPI RtlLengthSecurityDescriptor(
387 PSECURITY_DESCRIPTOR SecurityDescriptor);
389 NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(
390 IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
391 OUT PBOOLEAN lpbDaclPresent,
393 OUT PBOOLEAN lpbDaclDefaulted);
395 NTSTATUS WINAPI RtlSetDaclSecurityDescriptor (
396 PSECURITY_DESCRIPTOR lpsd,
399 BOOLEAN dacldefaulted );
401 NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(
402 IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
403 OUT PBOOLEAN lpbSaclPresent,
405 OUT PBOOLEAN lpbSaclDefaulted);
407 NTSTATUS WINAPI RtlSetSaclSecurityDescriptor (
408 PSECURITY_DESCRIPTOR lpsd,
411 BOOLEAN sacldefaulted);
413 NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(
414 PSECURITY_DESCRIPTOR SecurityDescriptor,
416 PBOOLEAN OwnerDefaulted);
418 NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(
419 PSECURITY_DESCRIPTOR lpsd,
421 BOOLEAN ownerdefaulted);
423 NTSTATUS WINAPI RtlSetGroupSecurityDescriptor (
424 PSECURITY_DESCRIPTOR lpsd,
426 BOOLEAN groupdefaulted);
428 NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(
429 PSECURITY_DESCRIPTOR SecurityDescriptor,
431 PBOOLEAN GroupDefaulted);
433 /* ##############################
434 ###### ACL FUNCTIONS ######
435 ##############################
438 DWORD WINAPI RtlCreateAcl(PACL acl,DWORD size,DWORD rev);
440 BOOLEAN WINAPI RtlFirstFreeAce(
444 NTSTATUS WINAPI RtlAddAce(
448 PACE_HEADER acestart,
451 DWORD WINAPI RtlAddAccessAllowedAce(DWORD x1,DWORD x2,DWORD x3,DWORD x4);
452 DWORD WINAPI RtlGetAce(PACL pAcl,DWORD dwAceIndex,LPVOID *pAce );
458 DWORD WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING uni,PANSI_STRING ansi,BOOLEAN doalloc);
459 DWORD WINAPI RtlOemStringToUnicodeString(PUNICODE_STRING uni,PSTRING ansi,BOOLEAN doalloc);
460 DWORD WINAPI RtlMultiByteToUnicodeN(LPWSTR unistr,DWORD unilen,LPDWORD reslen,LPSTR oemstr,DWORD oemlen);
461 DWORD WINAPI RtlOemToUnicodeN(LPWSTR unistr,DWORD unilen,LPDWORD reslen,LPSTR oemstr,DWORD oemlen);
462 VOID WINAPI RtlInitAnsiString(PANSI_STRING target,LPCSTR source);
463 VOID WINAPI RtlInitString(PSTRING target,LPCSTR source);
464 VOID WINAPI RtlInitUnicodeString(PUNICODE_STRING target,LPCWSTR source);
465 VOID WINAPI RtlFreeUnicodeString(PUNICODE_STRING str);
466 VOID WINAPI RtlFreeAnsiString(PANSI_STRING AnsiString);
467 DWORD WINAPI RtlUnicodeToOemN(LPSTR oemstr,DWORD oemlen,LPDWORD reslen,LPWSTR unistr,DWORD unilen);
468 DWORD WINAPI RtlUnicodeStringToOemString(PANSI_STRING oem,PUNICODE_STRING uni,BOOLEAN alloc);
469 DWORD WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING oem,PUNICODE_STRING uni,BOOLEAN alloc);
470 DWORD WINAPI RtlEqualUnicodeString(PUNICODE_STRING s1,PUNICODE_STRING s2,DWORD x);
471 DWORD WINAPI RtlUpcaseUnicodeString(PUNICODE_STRING dest,PUNICODE_STRING src,BOOLEAN doalloc);
472 UINT WINAPI RtlxOemStringToUnicodeSize(PSTRING str);
473 UINT WINAPI RtlxAnsiStringToUnicodeSize(PANSI_STRING str);
474 DWORD WINAPI RtlIsTextUnicode(LPVOID buf, DWORD len, DWORD *pf);
475 NTSTATUS WINAPI RtlCompareUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive);
481 typedef struct _RTL_RWLOCK {
482 CRITICAL_SECTION rtlCS;
483 HANDLE hSharedReleaseSemaphore;
485 HANDLE hExclusiveReleaseSemaphore;
486 UINT uExclusiveWaiters;
488 HANDLE hOwningThreadId;
489 DWORD dwTimeoutBoost;
491 } RTL_RWLOCK, *LPRTL_RWLOCK;
493 VOID WINAPI RtlInitializeResource(
496 VOID WINAPI RtlDeleteResource(
499 BYTE WINAPI RtlAcquireResourceExclusive(
500 LPRTL_RWLOCK, BYTE fWait);
502 BYTE WINAPI RtlAcquireResourceShared(
503 LPRTL_RWLOCK, BYTE fWait);
505 VOID WINAPI RtlReleaseResource(
508 VOID WINAPI RtlDumpResource(
515 typedef struct _TIME_FIELDS
526 typedef TIME_FIELDS *PTIME_FIELDS;
528 VOID WINAPI RtlSystemTimeToLocalTime(
529 IN PLARGE_INTEGER SystemTime,
530 OUT PLARGE_INTEGER LocalTime);
532 VOID WINAPI RtlTimeToTimeFields(
533 PLARGE_INTEGER liTime,
534 PTIME_FIELDS TimeFields);
536 BOOLEAN WINAPI RtlTimeFieldsToTime(
537 PTIME_FIELDS tfTimeFields,
538 PLARGE_INTEGER Time);
540 VOID WINAPI RtlTimeToElapsedTimeFields(
541 PLARGE_INTEGER liTime,
542 PTIME_FIELDS TimeFields);
544 BOOLEAN WINAPI RtlTimeToSecondsSince1980(
548 BOOLEAN WINAPI RtlTimeToSecondsSince1970(
556 /* Data structure for heap definition. This includes various
557 sizing parameters and callback routines, which, if left NULL,
558 result in default behavior */
561 { ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
563 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
565 HANDLE WINAPI RtlCreateHeap(
571 PRTL_HEAP_DEFINITION Definition);
573 PVOID WINAPI RtlAllocateHeap(
579 BOOLEAN WINAPI RtlFreeHeap(
587 void WINAPIV DbgPrint(LPCSTR fmt, ...);
588 DWORD WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
589 void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
590 void WINAPI RtlRaiseStatus(NTSTATUS);
591 void WINAPI RtlUnwind(PEXCEPTION_FRAME,LPVOID,PEXCEPTION_RECORD,DWORD);
592 VOID WINAPI RtlAcquirePebLock(void);
593 VOID WINAPI RtlReleasePebLock(void);
594 DWORD WINAPI RtlAdjustPrivilege(DWORD x1,DWORD x2,DWORD x3,DWORD x4);
595 DWORD WINAPI RtlIntegerToChar(DWORD x1,DWORD x2,DWORD x3,DWORD x4);
596 DWORD WINAPI RtlSetEnvironmentVariable(DWORD x1,PUNICODE_STRING key,PUNICODE_STRING val);
597 DWORD WINAPI RtlNewSecurityObject(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6);
598 DWORD WINAPI RtlDeleteSecurityObject(DWORD x1);
599 LPVOID WINAPI RtlNormalizeProcessParams(LPVOID x);
600 DWORD WINAPI RtlNtStatusToDosError(DWORD error);
601 BOOLEAN WINAPI RtlGetNtProductType(LPDWORD type);
602 INT WINAPI RtlExtendedLargeIntegerDivide(LARGE_INTEGER dividend, DWORD divisor, LPDWORD rest);
603 long long WINAPI RtlExtendedIntegerMultiply(LARGE_INTEGER factor1,INT factor2);
604 DWORD WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING String);
605 DWORD WINAPI RtlOpenCurrentUser(DWORD x1, DWORD *x2);
606 BOOLEAN WINAPI RtlDosPathNameToNtPathName_U( LPWSTR from,PUNICODE_STRING us,DWORD x2,DWORD x3);
607 DWORD WINAPI RtlCreateEnvironment(DWORD x1,DWORD x2);
608 DWORD WINAPI RtlDestroyEnvironment(DWORD x);
609 DWORD WINAPI RtlQueryEnvironmentVariable_U(DWORD x1,PUNICODE_STRING key,PUNICODE_STRING val) ;
611 BOOL WINAPI IsValidSid(PSID);
612 BOOL WINAPI EqualSid(PSID,PSID);
613 BOOL WINAPI EqualPrefixSid(PSID,PSID);
614 DWORD WINAPI GetSidLengthRequired(BYTE);
615 BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,
616 DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,
618 VOID* WINAPI FreeSid(PSID);
619 BOOL WINAPI InitializeSecurityDescriptor(SECURITY_DESCRIPTOR*,DWORD);
620 BOOL WINAPI InitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
621 DWORD* WINAPI GetSidSubAuthority(PSID,DWORD);
622 BYTE * WINAPI GetSidSubAuthorityCount(PSID);
623 DWORD WINAPI GetLengthSid(PSID);
624 BOOL WINAPI CopySid(DWORD,PSID,PSID);
625 BOOL WINAPI LookupAccountSidA(LPCSTR,PSID,LPCSTR,LPDWORD,LPCSTR,LPDWORD,
627 BOOL WINAPI LookupAccountSidW(LPCWSTR,PSID,LPCWSTR,LPDWORD,LPCWSTR,LPDWORD,
629 PSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority(PSID);