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
28 ULONG_PTR Information;
29 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
31 typedef VOID (NTAPI *PIO_APC_ROUTINE) ( PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG Reserved );
33 typedef enum _KEY_INFORMATION_CLASS {
37 } KEY_INFORMATION_CLASS;
39 typedef enum _KEY_VALUE_INFORMATION_CLASS {
40 KeyValueBasicInformation,
41 KeyValueFullInformation,
42 KeyValuePartialInformation,
43 KeyValueFullInformationAlign64,
44 KeyValuePartialInformationAlign64
45 } KEY_VALUE_INFORMATION_CLASS;
47 typedef enum _THREADINFOCLASS
48 { ThreadBasicInformation,
53 ThreadImpersonationToken,
54 ThreadDescriptorTableEntry,
55 ThreadEnableAlignmentFaultFixup,
56 ThreadEventPair_Reusable,
57 ThreadQuerySetWin32StartAddress,
59 ThreadPerformanceCount,
63 ThreadSetTlsArrayAddress,
68 typedef enum _FILE_INFORMATION_CLASS {
69 FileDirectoryInformation = 1,
70 FileFullDirectoryInformation,
71 FileBothDirectoryInformation,
73 FileStandardInformation,
74 FileInternalInformation,
76 FileAccessInformation,
78 FileRenameInformation,
81 FileDispositionInformation,
82 FilePositionInformation,
83 FileFullEaInformation,
85 FileAlignmentInformation,
87 FileAllocationInformation,
88 FileEndOfFileInformation,
89 FileAlternateNameInformation,
90 FileStreamInformation,
92 FilePipeLocalInformation,
93 FilePipeRemoteInformation,
94 FileMailslotQueryInformation,
95 FileMailslotSetInformation,
96 FileCompressionInformation,
97 FileObjectIdInformation,
98 FileCompletionInformation,
99 FileMoveClusterInformation,
100 FileQuotaInformation,
101 FileReparsePointInformation,
102 FileNetworkOpenInformation,
103 FileAttributeTagInformation,
104 FileTrackingInformation,
105 FileMaximumInformation
106 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
108 typedef enum _FSINFOCLASS {
109 FileFsVolumeInformation = 1,
110 FileFsLabelInformation,
111 FileFsSizeInformation,
112 FileFsDeviceInformation,
113 FileFsAttributeInformation,
114 FileFsControlInformation,
115 FileFsFullSizeInformation,
116 FileFsObjectIdInformation,
117 FileFsMaximumInformation
118 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
120 typedef enum _SECTION_INHERIT
130 typedef enum _OBJECT_INFORMATION_CLASS
134 } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
138 * NtQuerySystemInformation
141 typedef enum SYSTEM_INFORMATION_CLASS
146 SystemPerformanceInformation
147 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
149 /* reading coffee grounds... */
150 typedef struct _THREAD_INFO
157 } THREAD_INFO, PTHREAD_INFO;
159 typedef struct _VM_COUNTERS_
160 { ULONG PeakVirtualSize;
162 ULONG PageFaultCount;
163 ULONG PeakWorkingSetSize;
164 ULONG WorkingSetSize;
165 ULONG QuotaPeakPagedPoolUsage;
166 ULONG QuotaPagedPoolUsage;
167 ULONG QuotaPeakNonPagedPoolUsage;
168 ULONG QuotaNonPagedPoolUsage;
170 ULONG PeakPagefileUsage;
171 } VM_COUNTERS, *PVM_COUNTERS;
173 typedef struct _PROCESS_INFO
174 { DWORD Offset; /* 00 offset to next PROCESS_INFO ok*/
175 DWORD ThreadCount; /* 04 number of ThreadInfo member ok */
177 FILETIME CreationTime; /* 20 */
179 PWCHAR ProcessName; /* 3c ok */
181 DWORD ProcessID; /* 44 ok*/
182 DWORD ParentProcessID;
184 DWORD Unknown3[2]; /* 50 */
185 ULONG PeakVirtualSize;
187 ULONG PageFaultCount;
188 ULONG PeakWorkingSetSize;
189 ULONG WorkingSetSize;
190 ULONG QuotaPeakPagedPoolUsage;
191 ULONG QuotaPagedPoolUsage;
192 ULONG QuotaPeakNonPagedPoolUsage;
193 ULONG QuotaNonPagedPoolUsage;
195 ULONG PeakPagefileUsage;
198 THREAD_INFO ati[ANYSIZE_ARRAY]; /* 94 size=0x40*/
199 } PROCESS_INFO, PPROCESS_INFO;
201 NTSTATUS WINAPI NtQuerySystemInformation(
202 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
203 OUT PVOID SystemInformation,
205 OUT PULONG ResultLength);
208 * system configuration
212 typedef struct _SYSTEM_TIME_ADJUSTMENT
214 ULONG TimeAdjustment;
215 BOOLEAN TimeAdjustmentDisabled;
217 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
219 typedef struct _SYSTEM_CONFIGURATION_INFO
224 { WORD ProcessorArchitecture;
229 PVOID MinimumApplicationAddress;
230 PVOID MaximumApplicationAddress;
231 ULONG ActiveProcessorMask;
232 ULONG NumberOfProcessors;
234 ULONG AllocationGranularity;
236 WORD ProcessorRevision;
238 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
241 typedef struct _SYSTEM_CACHE_INFORMATION
245 ULONG PageFaultCount;
246 ULONG MinimumWorkingSet;
247 ULONG MaximumWorkingSet;
250 } SYSTEM_CACHE_INFORMATION;
253 * NtQueryProcessInformation
256 /* parameter ProcessInformationClass */
258 typedef enum _PROCESSINFOCLASS
259 { ProcessBasicInformation,
265 ProcessRaisePriority,
267 ProcessExceptionPort,
269 ProcessLdtInformation,
271 ProcessDefaultHardErrorMode,
272 ProcessIoPortHandlers,
273 ProcessPooledUsageAndLimits,
274 ProcessWorkingSetWatch,
276 ProcessEnableAlignmentFaultFixup,
277 ProcessPriorityClass,
278 ProcessWx86Information,
281 ProcessPriorityBoost,
283 ProcessSessionInformation,
284 ProcessForegroundInformation,
285 ProcessWow64Information,
289 /* parameter ProcessInformation (depending on ProcessInformationClass) */
291 typedef struct _PROCESS_BASIC_INFORMATION
293 DWORD PebBaseAddress;
296 ULONG UniqueProcessId;
297 ULONG InheritedFromUniqueProcessId;
298 } PROCESS_BASIC_INFORMATION;
300 NTSTATUS WINAPI NtQueryInformationProcess(
301 IN HANDLE ProcessHandle,
302 IN PROCESSINFOCLASS ProcessInformationClass,
303 OUT PVOID ProcessInformation,
304 IN ULONG ProcessInformationLength,
305 OUT PULONG ReturnLength);
307 #define NtCurrentProcess() ( (HANDLE) -1 )
313 typedef enum _TIMER_TYPE
324 NTSTATUS WINAPI NtOpenProcessToken(
325 HANDLE ProcessHandle,
327 HANDLE *TokenHandle);
329 NTSTATUS WINAPI NtOpenThreadToken(
333 HANDLE *TokenHandle);
335 NTSTATUS WINAPI NtAdjustPrivilegesToken(
336 IN HANDLE TokenHandle,
337 IN BOOLEAN DisableAllPrivileges,
338 IN PTOKEN_PRIVILEGES NewState,
339 IN DWORD BufferLength,
340 OUT PTOKEN_PRIVILEGES PreviousState,
341 OUT PDWORD ReturnLength);
343 NTSTATUS WINAPI NtQueryInformationToken(
345 DWORD tokeninfoclass,
347 DWORD tokeninfolength,
354 BOOLEAN WINAPI RtlAllocateAndInitializeSid (
355 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
356 DWORD nSubAuthorityCount,
367 DWORD WINAPI RtlEqualSid(DWORD x1,DWORD x2);
368 DWORD WINAPI RtlFreeSid(DWORD x1);
369 DWORD WINAPI RtlLengthRequiredSid(DWORD nrofsubauths);
370 DWORD WINAPI RtlLengthSid(PSID sid);
371 DWORD WINAPI RtlInitializeSid(PSID PSID,PSID_IDENTIFIER_AUTHORITY PSIDauth, DWORD c);
372 LPDWORD WINAPI RtlSubAuthoritySid(PSID PSID,DWORD nr);
373 LPBYTE WINAPI RtlSubAuthorityCountSid(PSID PSID);
374 DWORD WINAPI RtlCopySid(DWORD len,PSID to,PSID from);
377 * security descriptor functions
380 NTSTATUS WINAPI RtlCreateSecurityDescriptor(
381 PSECURITY_DESCRIPTOR lpsd,
384 NTSTATUS WINAPI RtlValidSecurityDescriptor(
385 PSECURITY_DESCRIPTOR SecurityDescriptor);
387 ULONG WINAPI RtlLengthSecurityDescriptor(
388 PSECURITY_DESCRIPTOR SecurityDescriptor);
390 NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(
391 IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
392 OUT PBOOLEAN lpbDaclPresent,
394 OUT PBOOLEAN lpbDaclDefaulted);
396 NTSTATUS WINAPI RtlSetDaclSecurityDescriptor (
397 PSECURITY_DESCRIPTOR lpsd,
400 BOOLEAN dacldefaulted );
402 NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(
403 IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
404 OUT PBOOLEAN lpbSaclPresent,
406 OUT PBOOLEAN lpbSaclDefaulted);
408 NTSTATUS WINAPI RtlSetSaclSecurityDescriptor (
409 PSECURITY_DESCRIPTOR lpsd,
412 BOOLEAN sacldefaulted);
414 NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(
415 PSECURITY_DESCRIPTOR SecurityDescriptor,
417 PBOOLEAN OwnerDefaulted);
419 NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(
420 PSECURITY_DESCRIPTOR lpsd,
422 BOOLEAN ownerdefaulted);
424 NTSTATUS WINAPI RtlSetGroupSecurityDescriptor (
425 PSECURITY_DESCRIPTOR lpsd,
427 BOOLEAN groupdefaulted);
429 NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(
430 PSECURITY_DESCRIPTOR SecurityDescriptor,
432 PBOOLEAN GroupDefaulted);
434 /* ##############################
435 ###### ACL FUNCTIONS ######
436 ##############################
439 DWORD WINAPI RtlCreateAcl(PACL acl,DWORD size,DWORD rev);
441 BOOLEAN WINAPI RtlFirstFreeAce(
445 NTSTATUS WINAPI RtlAddAce(
449 PACE_HEADER acestart,
452 DWORD WINAPI RtlAddAccessAllowedAce(DWORD x1,DWORD x2,DWORD x3,DWORD x4);
453 DWORD WINAPI RtlGetAce(PACL pAcl,DWORD dwAceIndex,LPVOID *pAce );
459 DWORD WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING uni,PANSI_STRING ansi,BOOLEAN doalloc);
460 DWORD WINAPI RtlOemStringToUnicodeString(PUNICODE_STRING uni,PSTRING ansi,BOOLEAN doalloc);
461 DWORD WINAPI RtlMultiByteToUnicodeN(LPWSTR unistr,DWORD unilen,LPDWORD reslen,LPSTR oemstr,DWORD oemlen);
462 DWORD WINAPI RtlOemToUnicodeN(LPWSTR unistr,DWORD unilen,LPDWORD reslen,LPSTR oemstr,DWORD oemlen);
463 VOID WINAPI RtlInitAnsiString(PANSI_STRING target,LPCSTR source);
464 VOID WINAPI RtlInitString(PSTRING target,LPCSTR source);
465 VOID WINAPI RtlInitUnicodeString(PUNICODE_STRING target,LPCWSTR source);
466 VOID WINAPI RtlFreeUnicodeString(PUNICODE_STRING str);
467 VOID WINAPI RtlFreeAnsiString(PANSI_STRING AnsiString);
468 DWORD WINAPI RtlUnicodeToOemN(LPSTR oemstr,DWORD oemlen,LPDWORD reslen,LPWSTR unistr,DWORD unilen);
469 DWORD WINAPI RtlUnicodeStringToOemString(PANSI_STRING oem,PUNICODE_STRING uni,BOOLEAN alloc);
470 DWORD WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING oem,PUNICODE_STRING uni,BOOLEAN alloc);
471 DWORD WINAPI RtlEqualUnicodeString(PUNICODE_STRING s1,PUNICODE_STRING s2,DWORD x);
472 DWORD WINAPI RtlUpcaseUnicodeString(PUNICODE_STRING dest,PUNICODE_STRING src,BOOLEAN doalloc);
473 UINT WINAPI RtlxOemStringToUnicodeSize(PSTRING str);
474 UINT WINAPI RtlxAnsiStringToUnicodeSize(PANSI_STRING str);
475 DWORD WINAPI RtlIsTextUnicode(LPVOID buf, DWORD len, DWORD *pf);
476 NTSTATUS WINAPI RtlCompareUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive);
482 typedef struct _RTL_RWLOCK {
483 CRITICAL_SECTION rtlCS;
484 HANDLE hSharedReleaseSemaphore;
486 HANDLE hExclusiveReleaseSemaphore;
487 UINT uExclusiveWaiters;
489 HANDLE hOwningThreadId;
490 DWORD dwTimeoutBoost;
492 } RTL_RWLOCK, *LPRTL_RWLOCK;
494 VOID WINAPI RtlInitializeResource(
497 VOID WINAPI RtlDeleteResource(
500 BYTE WINAPI RtlAcquireResourceExclusive(
501 LPRTL_RWLOCK, BYTE fWait);
503 BYTE WINAPI RtlAcquireResourceShared(
504 LPRTL_RWLOCK, BYTE fWait);
506 VOID WINAPI RtlReleaseResource(
509 VOID WINAPI RtlDumpResource(
516 typedef struct _TIME_FIELDS
527 typedef TIME_FIELDS *PTIME_FIELDS;
529 VOID WINAPI RtlSystemTimeToLocalTime(
530 IN PLARGE_INTEGER SystemTime,
531 OUT PLARGE_INTEGER LocalTime);
533 VOID WINAPI RtlTimeToTimeFields(
534 PLARGE_INTEGER liTime,
535 PTIME_FIELDS TimeFields);
537 BOOLEAN WINAPI RtlTimeFieldsToTime(
538 PTIME_FIELDS tfTimeFields,
539 PLARGE_INTEGER Time);
541 VOID WINAPI RtlTimeToElapsedTimeFields(
542 PLARGE_INTEGER liTime,
543 PTIME_FIELDS TimeFields);
545 BOOLEAN WINAPI RtlTimeToSecondsSince1980(
549 BOOLEAN WINAPI RtlTimeToSecondsSince1970(
557 /* Data structure for heap definition. This includes various
558 sizing parameters and callback routines, which, if left NULL,
559 result in default behavior */
562 { ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
564 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
566 HANDLE WINAPI RtlCreateHeap(
572 PRTL_HEAP_DEFINITION Definition);
574 PVOID WINAPI RtlAllocateHeap(
580 BOOLEAN WINAPI RtlFreeHeap(
588 void WINAPIV DbgPrint(LPCSTR fmt, ...);
589 DWORD WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
590 void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
591 void WINAPI RtlRaiseStatus(NTSTATUS);
592 void WINAPI RtlUnwind(PEXCEPTION_FRAME,LPVOID,PEXCEPTION_RECORD,DWORD);
593 VOID WINAPI RtlAcquirePebLock(void);
594 VOID WINAPI RtlReleasePebLock(void);
595 DWORD WINAPI RtlAdjustPrivilege(DWORD x1,DWORD x2,DWORD x3,DWORD x4);
596 DWORD WINAPI RtlIntegerToChar(DWORD x1,DWORD x2,DWORD x3,DWORD x4);
597 DWORD WINAPI RtlSetEnvironmentVariable(DWORD x1,PUNICODE_STRING key,PUNICODE_STRING val);
598 DWORD WINAPI RtlNewSecurityObject(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6);
599 DWORD WINAPI RtlDeleteSecurityObject(DWORD x1);
600 LPVOID WINAPI RtlNormalizeProcessParams(LPVOID x);
601 DWORD WINAPI RtlNtStatusToDosError(DWORD error);
602 BOOLEAN WINAPI RtlGetNtProductType(LPDWORD type);
603 INT WINAPI RtlExtendedLargeIntegerDivide(LARGE_INTEGER dividend, DWORD divisor, LPDWORD rest);
604 LARGE_INTEGER WINAPI RtlExtendedIntegerMultiply(LARGE_INTEGER factor1,INT factor2);
605 DWORD WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING String);
606 DWORD WINAPI RtlOpenCurrentUser(DWORD x1, DWORD *x2);
607 BOOLEAN WINAPI RtlDosPathNameToNtPathName_U( LPWSTR from,PUNICODE_STRING us,DWORD x2,DWORD x3);
608 DWORD WINAPI RtlCreateEnvironment(DWORD x1,DWORD x2);
609 DWORD WINAPI RtlDestroyEnvironment(DWORD x);
610 DWORD WINAPI RtlQueryEnvironmentVariable_U(DWORD x1,PUNICODE_STRING key,PUNICODE_STRING val) ;
612 BOOL WINAPI IsValidSid(PSID);
613 BOOL WINAPI EqualSid(PSID,PSID);
614 BOOL WINAPI EqualPrefixSid(PSID,PSID);
615 DWORD WINAPI GetSidLengthRequired(BYTE);
616 BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,
617 DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,
619 VOID* WINAPI FreeSid(PSID);
620 BOOL WINAPI InitializeSecurityDescriptor(SECURITY_DESCRIPTOR*,DWORD);
621 BOOL WINAPI InitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
622 DWORD* WINAPI GetSidSubAuthority(PSID,DWORD);
623 BYTE * WINAPI GetSidSubAuthorityCount(PSID);
624 DWORD WINAPI GetLengthSid(PSID);
625 BOOL WINAPI CopySid(DWORD,PSID,PSID);
626 BOOL WINAPI LookupAccountSidA(LPCSTR,PSID,LPCSTR,LPDWORD,LPCSTR,LPDWORD,
628 BOOL WINAPI LookupAccountSidW(LPCWSTR,PSID,LPCWSTR,LPDWORD,LPCWSTR,LPDWORD,
630 PSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority(PSID);