Removed "elfdll" load order option and updated documentation.
[wine/multimedia.git] / include / ntddk.h
blob06bd08373987efc476c392588d36de6fc9b24469
1 /*
2 this file defines interfaces mainly exposed to device drivers and
3 native nt dll's
5 */
6 #ifndef __WINE_NTDDK_H
7 #define __WINE_NTDDK_H
9 #include "ntdef.h"
10 #include "winnt.h"
11 #include "winreg.h"
12 #include "winbase.h" /* fixme: should be taken out sometimes */
14 #include "pshpack1.h"
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
20 /******************
21 * asynchronous I/O
23 #undef Status /* conflict with X11-includes*/
25 typedef struct _IO_STATUS_BLOCK
27 union {
28 NTSTATUS Status;
29 PVOID Pointer;
30 } DUMMYUNIONNAME;
31 ULONG_PTR Information;
32 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
34 typedef VOID NTAPI (*PIO_APC_ROUTINE) ( PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG Reserved );
37 registry
40 /* key information */
41 typedef struct _KEY_BASIC_INFORMATION {
42 FILETIME LastWriteTime;
43 ULONG TitleIndex;
44 ULONG NameLength;
45 WCHAR Name[1];
46 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
48 typedef struct _KEY_NODE_INFORMATION
50 FILETIME LastWriteTime;
51 ULONG TitleIndex;
52 ULONG ClassOffset;
53 ULONG ClassLength;
54 ULONG NameLength;
55 WCHAR Name[1];
56 /* Class[1]; */
57 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
59 typedef struct _KEY_FULL_INFORMATION
61 FILETIME LastWriteTime;
62 ULONG TitleIndex;
63 ULONG ClassOffset;
64 ULONG ClassLength;
65 ULONG SubKeys;
66 ULONG MaxNameLen;
67 ULONG MaxClassLen;
68 ULONG Values;
69 ULONG MaxValueNameLen;
70 ULONG MaxValueDataLen;
71 WCHAR Class[1];
72 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
74 typedef enum _KEY_INFORMATION_CLASS
76 KeyBasicInformation,
77 KeyNodeInformation,
78 KeyFullInformation
79 } KEY_INFORMATION_CLASS;
81 typedef struct _KEY_VALUE_ENTRY
83 PUNICODE_STRING ValueName;
84 ULONG DataLength;
85 ULONG DataOffset;
86 ULONG Type;
87 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
89 /* value information */
90 typedef struct _KEY_VALUE_BASIC_INFORMATION
92 ULONG TitleIndex;
93 ULONG Type;
94 ULONG NameLength;
95 WCHAR Name[1];
96 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
98 typedef struct _KEY_VALUE_FULL_INFORMATION
100 ULONG TitleIndex;
101 ULONG Type;
102 ULONG DataOffset;
103 ULONG DataLength;
104 ULONG NameLength;
105 WCHAR Name[1];
106 /* UCHAR Data[1];*/
107 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
109 typedef struct _KEY_VALUE_PARTIAL_INFORMATION
111 ULONG TitleIndex;
112 ULONG Type;
113 ULONG DataLength;
114 UCHAR Data[1];
115 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
117 typedef enum _KEY_VALUE_INFORMATION_CLASS
119 KeyValueBasicInformation,
120 KeyValueFullInformation,
121 KeyValuePartialInformation,
122 KeyValueFullInformationAlign64,
123 KeyValuePartialInformationAlign64
124 } KEY_VALUE_INFORMATION_CLASS;
126 NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(
127 PUNICODE_STRING KeyPath);
129 /* thread information */
131 typedef enum _THREADINFOCLASS
132 { ThreadBasicInformation,
133 ThreadTimes,
134 ThreadPriority,
135 ThreadBasePriority,
136 ThreadAffinityMask,
137 ThreadImpersonationToken,
138 ThreadDescriptorTableEntry,
139 ThreadEnableAlignmentFaultFixup,
140 ThreadEventPair_Reusable,
141 ThreadQuerySetWin32StartAddress,
142 ThreadZeroTlsCell,
143 ThreadPerformanceCount,
144 ThreadAmILastThread,
145 ThreadIdealProcessor,
146 ThreadPriorityBoost,
147 ThreadSetTlsArrayAddress,
148 ThreadIsIoPending,
149 MaxThreadInfoClass
150 } THREADINFOCLASS;
152 /* file information */
154 typedef enum _FILE_INFORMATION_CLASS {
155 FileDirectoryInformation = 1,
156 FileFullDirectoryInformation,
157 FileBothDirectoryInformation,
158 FileBasicInformation,
159 FileStandardInformation,
160 FileInternalInformation,
161 FileEaInformation,
162 FileAccessInformation,
163 FileNameInformation,
164 FileRenameInformation,
165 FileLinkInformation,
166 FileNamesInformation,
167 FileDispositionInformation,
168 FilePositionInformation,
169 FileFullEaInformation,
170 FileModeInformation,
171 FileAlignmentInformation,
172 FileAllInformation,
173 FileAllocationInformation,
174 FileEndOfFileInformation,
175 FileAlternateNameInformation,
176 FileStreamInformation,
177 FilePipeInformation,
178 FilePipeLocalInformation,
179 FilePipeRemoteInformation,
180 FileMailslotQueryInformation,
181 FileMailslotSetInformation,
182 FileCompressionInformation,
183 FileObjectIdInformation,
184 FileCompletionInformation,
185 FileMoveClusterInformation,
186 FileQuotaInformation,
187 FileReparsePointInformation,
188 FileNetworkOpenInformation,
189 FileAttributeTagInformation,
190 FileTrackingInformation,
191 FileMaximumInformation
192 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
194 typedef enum _FSINFOCLASS {
195 FileFsVolumeInformation = 1,
196 FileFsLabelInformation,
197 FileFsSizeInformation,
198 FileFsDeviceInformation,
199 FileFsAttributeInformation,
200 FileFsControlInformation,
201 FileFsFullSizeInformation,
202 FileFsObjectIdInformation,
203 FileFsMaximumInformation
204 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
206 typedef enum _SECTION_INHERIT
208 ViewShare = 1,
209 ViewUnmap = 2
211 } SECTION_INHERIT;
213 /* object information */
215 typedef enum _OBJECT_INFORMATION_CLASS
217 DunnoTheConstants1
219 } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
222 /* system information */
224 typedef enum SYSTEM_INFORMATION_CLASS
225 { Unknown1 = 1,
226 Unknown2,
227 Unknown3,
228 Unknown4,
229 SystemPerformanceInformation
230 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
232 /* reading coffee grounds... */
233 typedef struct _THREAD_INFO
234 { DWORD Unknown1[6];
235 DWORD ThreadID;
236 DWORD Unknown2[3];
237 DWORD Status;
238 DWORD WaitReason;
239 DWORD Unknown3[4];
240 } THREAD_INFO, PTHREAD_INFO;
242 typedef struct _VM_COUNTERS_
243 { ULONG PeakVirtualSize;
244 ULONG VirtualSize;
245 ULONG PageFaultCount;
246 ULONG PeakWorkingSetSize;
247 ULONG WorkingSetSize;
248 ULONG QuotaPeakPagedPoolUsage;
249 ULONG QuotaPagedPoolUsage;
250 ULONG QuotaPeakNonPagedPoolUsage;
251 ULONG QuotaNonPagedPoolUsage;
252 ULONG PagefileUsage;
253 ULONG PeakPagefileUsage;
254 } VM_COUNTERS, *PVM_COUNTERS;
256 /* process information */
258 typedef struct _PROCESS_INFO
259 { DWORD Offset; /* 00 offset to next PROCESS_INFO ok*/
260 DWORD ThreadCount; /* 04 number of ThreadInfo member ok */
261 DWORD Unknown1[6];
262 FILETIME CreationTime; /* 20 */
263 DWORD Unknown2[5];
264 PWCHAR ProcessName; /* 3c ok */
265 DWORD BasePriority;
266 DWORD ProcessID; /* 44 ok*/
267 DWORD ParentProcessID;
268 DWORD HandleCount;
269 DWORD Unknown3[2]; /* 50 */
270 ULONG PeakVirtualSize;
271 ULONG VirtualSize;
272 ULONG PageFaultCount;
273 ULONG PeakWorkingSetSize;
274 ULONG WorkingSetSize;
275 ULONG QuotaPeakPagedPoolUsage;
276 ULONG QuotaPagedPoolUsage;
277 ULONG QuotaPeakNonPagedPoolUsage;
278 ULONG QuotaNonPagedPoolUsage;
279 ULONG PagefileUsage;
280 ULONG PeakPagefileUsage;
281 DWORD PrivateBytes;
282 DWORD Unknown6[4];
283 THREAD_INFO ati[ANYSIZE_ARRAY]; /* 94 size=0x40*/
284 } PROCESS_INFO, PPROCESS_INFO;
286 NTSTATUS WINAPI NtQuerySystemInformation(
287 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
288 OUT PVOID SystemInformation,
289 IN ULONG Length,
290 OUT PULONG ResultLength);
293 * system configuration
297 typedef struct _SYSTEM_TIME_ADJUSTMENT
299 ULONG TimeAdjustment;
300 BOOLEAN TimeAdjustmentDisabled;
302 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
304 typedef struct _SYSTEM_CONFIGURATION_INFO
306 union
307 { ULONG OemId;
308 struct
309 { WORD ProcessorArchitecture;
310 WORD Reserved;
311 } tag1;
312 } tag2;
313 ULONG PageSize;
314 PVOID MinimumApplicationAddress;
315 PVOID MaximumApplicationAddress;
316 ULONG ActiveProcessorMask;
317 ULONG NumberOfProcessors;
318 ULONG ProcessorType;
319 ULONG AllocationGranularity;
320 WORD ProcessorLevel;
321 WORD ProcessorRevision;
323 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
326 typedef struct _SYSTEM_CACHE_INFORMATION
328 ULONG CurrentSize;
329 ULONG PeakSize;
330 ULONG PageFaultCount;
331 ULONG MinimumWorkingSet;
332 ULONG MaximumWorkingSet;
333 ULONG Unused[4];
335 } SYSTEM_CACHE_INFORMATION;
338 * NtQueryProcessInformation
341 /* parameter ProcessInformationClass */
343 typedef enum _PROCESSINFOCLASS
344 { ProcessBasicInformation,
345 ProcessQuotaLimits,
346 ProcessIoCounters,
347 ProcessVmCounters,
348 ProcessTimes,
349 ProcessBasePriority,
350 ProcessRaisePriority,
351 ProcessDebugPort,
352 ProcessExceptionPort,
353 ProcessAccessToken,
354 ProcessLdtInformation,
355 ProcessLdtSize,
356 ProcessDefaultHardErrorMode,
357 ProcessIoPortHandlers,
358 ProcessPooledUsageAndLimits,
359 ProcessWorkingSetWatch,
360 ProcessUserModeIOPL,
361 ProcessEnableAlignmentFaultFixup,
362 ProcessPriorityClass,
363 ProcessWx86Information,
364 ProcessHandleCount,
365 ProcessAffinityMask,
366 ProcessPriorityBoost,
367 ProcessDeviceMap,
368 ProcessSessionInformation,
369 ProcessForegroundInformation,
370 ProcessWow64Information,
371 MaxProcessInfoClass
372 } PROCESSINFOCLASS;
374 /* parameter ProcessInformation (depending on ProcessInformationClass) */
376 typedef struct _PROCESS_BASIC_INFORMATION
377 { DWORD ExitStatus;
378 DWORD PebBaseAddress;
379 DWORD AffinityMask;
380 DWORD BasePriority;
381 ULONG UniqueProcessId;
382 ULONG InheritedFromUniqueProcessId;
383 } PROCESS_BASIC_INFORMATION;
385 NTSTATUS WINAPI NtQueryInformationProcess(
386 IN HANDLE ProcessHandle,
387 IN PROCESSINFOCLASS ProcessInformationClass,
388 OUT PVOID ProcessInformation,
389 IN ULONG ProcessInformationLength,
390 OUT PULONG ReturnLength);
392 #define NtCurrentProcess() ( (HANDLE) -1 )
395 * timer
398 typedef enum _TIMER_TYPE
400 NotificationTimer,
401 SynchronizationTimer
403 } TIMER_TYPE;
405 /* token functions */
407 NTSTATUS WINAPI NtOpenProcessToken(
408 HANDLE ProcessHandle,
409 DWORD DesiredAccess,
410 HANDLE *TokenHandle);
412 NTSTATUS WINAPI NtOpenThreadToken(
413 HANDLE ThreadHandle,
414 DWORD DesiredAccess,
415 BOOLEAN OpenAsSelf,
416 HANDLE *TokenHandle);
418 NTSTATUS WINAPI NtAdjustPrivilegesToken(
419 IN HANDLE TokenHandle,
420 IN BOOLEAN DisableAllPrivileges,
421 IN PTOKEN_PRIVILEGES NewState,
422 IN DWORD BufferLength,
423 OUT PTOKEN_PRIVILEGES PreviousState,
424 OUT PDWORD ReturnLength);
426 NTSTATUS WINAPI NtQueryInformationToken(
427 HANDLE token,
428 DWORD tokeninfoclass,
429 LPVOID tokeninfo,
430 DWORD tokeninfolength,
431 LPDWORD retlen );
433 /* sid functions */
435 BOOLEAN WINAPI RtlAllocateAndInitializeSid (
436 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
437 BYTE nSubAuthorityCount,
438 DWORD nSubAuthority0, DWORD nSubAuthority1,
439 DWORD nSubAuthority2, DWORD nSubAuthority3,
440 DWORD nSubAuthority4, DWORD nSubAuthority5,
441 DWORD nSubAuthority6, DWORD nSubAuthority7,
442 PSID *pSid );
444 BOOL WINAPI RtlInitializeSid(
445 PSID pSid,
446 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
447 BYTE nSubAuthorityCount);
449 DWORD WINAPI RtlFreeSid(
450 PSID pSid);
452 BOOL WINAPI RtlEqualSid(
453 PSID pSid1,
454 PSID pSid2 );
456 DWORD WINAPI RtlLengthRequiredSid(
457 DWORD nrofsubauths);
459 DWORD WINAPI RtlLengthSid(
460 PSID sid);
462 LPDWORD WINAPI RtlSubAuthoritySid(
463 PSID PSID,
464 DWORD nr);
466 LPBYTE WINAPI RtlSubAuthorityCountSid(
467 PSID pSid);
469 DWORD WINAPI RtlCopySid(
470 DWORD len,
471 PSID to,
472 PSID from);
474 BOOL WINAPI RtlValidSid(
475 PSID pSid);
477 BOOL WINAPI RtlEqualPrefixSid(
478 PSID pSid1,
479 PSID pSid2);
481 PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(
482 PSID pSid );
484 /* security descriptor functions */
486 NTSTATUS WINAPI RtlCreateSecurityDescriptor(
487 PSECURITY_DESCRIPTOR lpsd,
488 DWORD rev);
490 NTSTATUS WINAPI RtlValidSecurityDescriptor(
491 PSECURITY_DESCRIPTOR SecurityDescriptor);
493 ULONG WINAPI RtlLengthSecurityDescriptor(
494 PSECURITY_DESCRIPTOR SecurityDescriptor);
496 NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(
497 IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
498 OUT PBOOLEAN lpbDaclPresent,
499 OUT PACL *pDacl,
500 OUT PBOOLEAN lpbDaclDefaulted);
502 NTSTATUS WINAPI RtlSetDaclSecurityDescriptor (
503 PSECURITY_DESCRIPTOR lpsd,
504 BOOLEAN daclpresent,
505 PACL dacl,
506 BOOLEAN dacldefaulted );
508 NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(
509 IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
510 OUT PBOOLEAN lpbSaclPresent,
511 OUT PACL *pSacl,
512 OUT PBOOLEAN lpbSaclDefaulted);
514 NTSTATUS WINAPI RtlSetSaclSecurityDescriptor (
515 PSECURITY_DESCRIPTOR lpsd,
516 BOOLEAN saclpresent,
517 PACL sacl,
518 BOOLEAN sacldefaulted);
520 NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(
521 PSECURITY_DESCRIPTOR SecurityDescriptor,
522 PSID *Owner,
523 PBOOLEAN OwnerDefaulted);
525 NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(
526 PSECURITY_DESCRIPTOR lpsd,
527 PSID owner,
528 BOOLEAN ownerdefaulted);
530 NTSTATUS WINAPI RtlSetGroupSecurityDescriptor (
531 PSECURITY_DESCRIPTOR lpsd,
532 PSID group,
533 BOOLEAN groupdefaulted);
535 NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(
536 PSECURITY_DESCRIPTOR SecurityDescriptor,
537 PSID *Group,
538 PBOOLEAN GroupDefaulted);
540 NTSTATUS WINAPI RtlMakeSelfRelativeSD(
541 IN PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
542 IN PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
543 IN OUT LPDWORD lpdwBufferLength);
545 NTSTATUS WINAPI RtlGetControlSecurityDescriptor(
546 PSECURITY_DESCRIPTOR pSecurityDescriptor,
547 PSECURITY_DESCRIPTOR_CONTROL pControl,
548 LPDWORD lpdwRevision);
550 /* acl functions */
552 NTSTATUS WINAPI RtlCreateAcl(
553 PACL acl,
554 DWORD size,
555 DWORD rev);
557 BOOLEAN WINAPI RtlFirstFreeAce(
558 PACL acl,
559 PACE_HEADER *x);
561 NTSTATUS WINAPI RtlAddAce(
562 PACL acl,
563 DWORD rev,
564 DWORD xnrofaces,
565 PACE_HEADER acestart,
566 DWORD acelen);
568 BOOL WINAPI RtlAddAccessAllowedAce(
569 IN OUT PACL pAcl,
570 IN DWORD dwAceRevision,
571 IN DWORD AccessMask,
572 IN PSID pSid);
574 BOOL WINAPI AddAccessAllowedAceEx(
575 IN OUT PACL pAcl,
576 IN DWORD dwAceRevision,
577 IN DWORD AceFlags,
578 IN DWORD AccessMask,
579 IN PSID pSid);
581 DWORD WINAPI RtlGetAce(
582 PACL pAcl,
583 DWORD dwAceIndex,
584 LPVOID *pAce );
586 /* string functions */
588 DWORD WINAPI RtlAnsiStringToUnicodeSize(PSTRING);
589 NTSTATUS WINAPI RtlAnsiStringToUnicodeString(UNICODE_STRING*,const STRING *,BOOLEAN);
590 NTSTATUS WINAPI RtlAppendAsciizToString(STRING*,LPCSTR);
591 NTSTATUS WINAPI RtlAppendStringToString(STRING*,const STRING*);
592 NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING*,const UNICODE_STRING*);
593 NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING*,LPCWSTR);
594 LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
595 LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
596 void WINAPI RtlCopyString(STRING*,const STRING*);
597 void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
598 BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
599 BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
600 void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
601 BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
602 BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
603 void WINAPI RtlFreeAnsiString(PSTRING);
604 void WINAPI RtlFreeOemString(PSTRING);
605 void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
606 void WINAPI RtlInitAnsiString(PSTRING,LPCSTR);
607 void WINAPI RtlInitString(PSTRING,LPCSTR);
608 void WINAPI RtlInitUnicodeString(PUNICODE_STRING,LPCWSTR);
609 NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
610 NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
611 UINT WINAPI RtlOemStringToUnicodeSize(PSTRING);
612 NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
613 NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
614 BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
615 BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
616 DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
617 NTSTATUS WINAPI RtlUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
618 DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
619 NTSTATUS WINAPI RtlUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
620 NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
621 NTSTATUS WINAPI RtlUnicodeToMultiByteSize(DWORD*,LPCWSTR,UINT);
622 NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
623 NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
624 NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
625 NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
626 NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
627 NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
629 DWORD WINAPI RtlIsTextUnicode(
630 LPVOID buf,
631 DWORD len,
632 DWORD *pf);
634 /* resource functions */
636 typedef struct _RTL_RWLOCK {
637 CRITICAL_SECTION rtlCS;
638 HANDLE hSharedReleaseSemaphore;
639 UINT uSharedWaiters;
640 HANDLE hExclusiveReleaseSemaphore;
641 UINT uExclusiveWaiters;
642 INT iNumberActive;
643 HANDLE hOwningThreadId;
644 DWORD dwTimeoutBoost;
645 PVOID pDebugInfo;
646 } RTL_RWLOCK, *LPRTL_RWLOCK;
648 VOID WINAPI RtlInitializeResource(
649 LPRTL_RWLOCK);
651 VOID WINAPI RtlDeleteResource(
652 LPRTL_RWLOCK);
654 BYTE WINAPI RtlAcquireResourceExclusive(
655 LPRTL_RWLOCK, BYTE fWait);
657 BYTE WINAPI RtlAcquireResourceShared(
658 LPRTL_RWLOCK, BYTE fWait);
660 VOID WINAPI RtlReleaseResource(
661 LPRTL_RWLOCK);
663 VOID WINAPI RtlDumpResource(
664 LPRTL_RWLOCK);
666 /* time functions */
668 typedef struct _TIME_FIELDS
669 { CSHORT Year;
670 CSHORT Month;
671 CSHORT Day;
672 CSHORT Hour;
673 CSHORT Minute;
674 CSHORT Second;
675 CSHORT Milliseconds;
676 CSHORT Weekday;
677 } TIME_FIELDS;
679 typedef TIME_FIELDS *PTIME_FIELDS;
681 VOID WINAPI RtlSystemTimeToLocalTime(
682 IN PLARGE_INTEGER SystemTime,
683 OUT PLARGE_INTEGER LocalTime);
685 VOID WINAPI RtlTimeToTimeFields(
686 PLARGE_INTEGER liTime,
687 PTIME_FIELDS TimeFields);
689 BOOLEAN WINAPI RtlTimeFieldsToTime(
690 PTIME_FIELDS tfTimeFields,
691 PLARGE_INTEGER Time);
693 VOID WINAPI RtlTimeToElapsedTimeFields(
694 PLARGE_INTEGER liTime,
695 PTIME_FIELDS TimeFields);
697 void WINAPI NtQuerySystemTime( LARGE_INTEGER *time );
699 BOOLEAN WINAPI RtlTimeToSecondsSince1980( const FILETIME *time, LPDWORD res );
700 BOOLEAN WINAPI RtlTimeToSecondsSince1970( const FILETIME *time, LPDWORD res );
701 void WINAPI RtlSecondsSince1970ToTime( DWORD time, FILETIME *res );
702 void WINAPI RtlSecondsSince1980ToTime( DWORD time, FILETIME *res );
704 /* heap functions */
706 /* Data structure for heap definition. This includes various
707 sizing parameters and callback routines, which, if left NULL,
708 result in default behavior */
710 typedef struct
711 { ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
712 ULONG Unknown[11];
713 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
715 HANDLE WINAPI RtlCreateHeap(
716 ULONG Flags,
717 PVOID BaseAddress,
718 ULONG SizeToReserve,
719 ULONG SizeToCommit,
720 PVOID Unknown,
721 PRTL_HEAP_DEFINITION Definition);
723 PVOID WINAPI RtlAllocateHeap(
724 HANDLE Heap,
725 ULONG Flags,
726 ULONG Size);
729 BOOLEAN WINAPI RtlFreeHeap(
730 HANDLE Heap,
731 ULONG Flags,
732 PVOID Address);
734 /* exception */
736 void WINAPI NtRaiseException(
737 PEXCEPTION_RECORD,PCONTEXT,BOOL);
739 void WINAPI RtlRaiseException(
740 PEXCEPTION_RECORD);
742 void WINAPI RtlRaiseStatus(
743 NTSTATUS);
745 void WINAPI RtlUnwind(
746 PEXCEPTION_FRAME,
747 LPVOID,
748 PEXCEPTION_RECORD,DWORD);
750 /* process environment block */
751 VOID WINAPI RtlAcquirePebLock(void);
752 VOID WINAPI RtlReleasePebLock(void);
754 /* mathematics */
755 LONGLONG WINAPI RtlConvertLongToLargeInteger( LONG a );
756 LONGLONG WINAPI RtlEnlargedIntegerMultiply( INT a, INT b );
757 LONGLONG WINAPI RtlExtendedMagicDivide( LONGLONG a, LONGLONG b, INT shift );
758 LONGLONG WINAPI RtlExtendedIntegerMultiply( LONGLONG a, INT b );
759 LONGLONG WINAPI RtlExtendedLargeIntegerDivide( LONGLONG a, INT b, INT *rem );
760 LONGLONG WINAPI RtlLargeIntegerAdd( LONGLONG a, LONGLONG b );
761 LONGLONG WINAPI RtlLargeIntegerArithmeticShift( LONGLONG a, INT count );
762 LONGLONG WINAPI RtlLargeIntegerNegate( LONGLONG a );
763 LONGLONG WINAPI RtlLargeIntegerShiftLeft( LONGLONG a, INT count );
764 LONGLONG WINAPI RtlLargeIntegerShiftRight( LONGLONG a, INT count );
765 LONGLONG WINAPI RtlLargeIntegerSubtract( LONGLONG a, LONGLONG b );
766 ULONGLONG WINAPI RtlEnlargedUnsignedMultiply( UINT a, UINT b );
767 UINT WINAPI RtlEnlargedUnsignedDivide( ULONGLONG a, UINT b, UINT *remptr );
768 ULONGLONG WINAPI RtlConvertUlongToLargeInteger( ULONG a );
769 ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG a, ULONGLONG b, ULONGLONG *rem );
771 /* environment */
772 DWORD WINAPI RtlCreateEnvironment(
773 DWORD x1,
774 DWORD x2);
776 DWORD WINAPI RtlDestroyEnvironment(
777 DWORD x);
779 DWORD WINAPI RtlQueryEnvironmentVariable_U(
780 DWORD x1,
781 PUNICODE_STRING key,
782 PUNICODE_STRING val) ;
784 DWORD WINAPI RtlSetEnvironmentVariable(
785 DWORD x1,
786 PUNICODE_STRING key,
787 PUNICODE_STRING val);
789 /* object security */
791 DWORD WINAPI RtlNewSecurityObject(
792 DWORD x1,
793 DWORD x2,
794 DWORD x3,
795 DWORD x4,
796 DWORD x5,
797 DWORD x6);
799 DWORD WINAPI RtlDeleteSecurityObject(
800 DWORD x1);
802 NTSTATUS WINAPI
803 NtQuerySecurityObject(
804 IN HANDLE Object,
805 IN SECURITY_INFORMATION RequestedInformation,
806 OUT PSECURITY_DESCRIPTOR pSecurityDesriptor,
807 IN ULONG Length,
808 OUT PULONG ResultLength);
810 NTSTATUS WINAPI
811 NtSetSecurityObject(
812 IN HANDLE Handle,
813 IN SECURITY_INFORMATION SecurityInformation,
814 IN PSECURITY_DESCRIPTOR SecurityDescriptor);
816 /* registry functions */
818 NTSTATUS WINAPI NtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,
819 const UNICODE_STRING*,ULONG,PULONG);
820 NTSTATUS WINAPI NtDeleteKey(HANDLE);
821 NTSTATUS WINAPI NtDeleteValueKey(HANDLE,const UNICODE_STRING*);
822 NTSTATUS WINAPI NtOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
823 NTSTATUS WINAPI NtQueryKey(HANDLE,KEY_INFORMATION_CLASS,void*,DWORD,DWORD*);
824 NTSTATUS WINAPI NtSetValueKey(HANDLE,const UNICODE_STRING*,ULONG,ULONG,const void*,ULONG);
825 NTSTATUS WINAPI NtEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void*,DWORD,DWORD*);
826 NTSTATUS WINAPI NtQueryValueKey(HANDLE,const UNICODE_STRING*,KEY_VALUE_INFORMATION_CLASS,
827 void*,DWORD,DWORD*);
828 NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES*,const OBJECT_ATTRIBUTES*);
831 NTSTATUS WINAPI NtEnumerateValueKey(
832 HANDLE KeyHandle,
833 ULONG Index,
834 KEY_VALUE_INFORMATION_CLASS KeyInformationClass,
835 PVOID KeyInformation,
836 ULONG Length,
837 PULONG ResultLength);
839 NTSTATUS WINAPI NtFlushKey(HANDLE KeyHandle);
841 NTSTATUS WINAPI NtNotifyChangeKey(
842 IN HANDLE KeyHandle,
843 IN HANDLE Event,
844 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
845 IN PVOID ApcContext OPTIONAL,
846 OUT PIO_STATUS_BLOCK IoStatusBlock,
847 IN ULONG CompletionFilter,
848 IN BOOLEAN Asynchroneous,
849 OUT PVOID ChangeBuffer,
850 IN ULONG Length,
851 IN BOOLEAN WatchSubtree);
853 NTSTATUS WINAPI NtQueryMultipleValueKey(
854 HANDLE KeyHandle,
855 PVALENTW ListOfValuesToQuery,
856 ULONG NumberOfItems,
857 PVOID MultipleValueInformation,
858 ULONG Length,
859 PULONG ReturnLength);
861 NTSTATUS WINAPI NtReplaceKey(
862 IN POBJECT_ATTRIBUTES ObjectAttributes,
863 IN HANDLE Key,
864 IN POBJECT_ATTRIBUTES ReplacedObjectAttributes);
866 NTSTATUS WINAPI NtRestoreKey(
867 HANDLE KeyHandle,
868 HANDLE FileHandle,
869 ULONG RestoreFlags);
871 NTSTATUS WINAPI NtSaveKey(
872 IN HANDLE KeyHandle,
873 IN HANDLE FileHandle);
875 NTSTATUS WINAPI NtSetInformationKey(
876 IN HANDLE KeyHandle,
877 IN const int KeyInformationClass,
878 IN PVOID KeyInformation,
879 IN ULONG KeyInformationLength);
881 NTSTATUS WINAPI NtUnloadKey(
882 IN HANDLE KeyHandle);
884 NTSTATUS WINAPI NtClose(
885 HANDLE Handle);
887 NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code );
888 NTSTATUS WINAPI NtTerminateThread( HANDLE handle, LONG exit_code );
890 NTSTATUS WINAPI NtClearEvent(HANDLE);
891 NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOOLEAN,BOOLEAN);
892 NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,ULONG);
893 NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *attr);
894 NTSTATUS WINAPI NtPulseEvent(HANDLE,PULONG);
895 NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
896 NTSTATUS WINAPI NtResetEvent(HANDLE,PULONG);
897 NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
899 NTSTATUS WINAPI RtlInitializeCriticalSection( RTL_CRITICAL_SECTION *crit );
900 NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount( RTL_CRITICAL_SECTION *crit, DWORD spincount );
901 NTSTATUS WINAPI RtlDeleteCriticalSection( RTL_CRITICAL_SECTION *crit );
902 NTSTATUS WINAPI RtlpWaitForCriticalSection( RTL_CRITICAL_SECTION *crit );
903 NTSTATUS WINAPI RtlpUnWaitCriticalSection( RTL_CRITICAL_SECTION *crit );
904 NTSTATUS WINAPI RtlEnterCriticalSection( RTL_CRITICAL_SECTION *crit );
905 BOOL WINAPI RtlTryEnterCriticalSection( RTL_CRITICAL_SECTION *crit );
906 NTSTATUS WINAPI RtlLeaveCriticalSection( RTL_CRITICAL_SECTION *crit );
908 /* string functions */
909 extern LPSTR _strlwr( LPSTR str );
910 extern LPSTR _strupr( LPSTR str );
912 /* misc */
914 #if defined(__i386__) && defined(__GNUC__)
915 static inline void WINAPI DbgBreakPoint(void) { __asm__ __volatile__("int3"); }
916 static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3"); }
917 #else /* __i386__ && __GNUC__ */
918 void WINAPI DbgBreakPoint(void);
919 void WINAPI DbgUserBreakPoint(void);
920 #endif /* __i386__ && __GNUC__ */
921 void WINAPIV DbgPrint(LPCSTR fmt, ...);
923 DWORD WINAPI RtlAdjustPrivilege(DWORD x1,DWORD x2,DWORD x3,DWORD x4);
924 DWORD WINAPI RtlIntegerToChar(DWORD x1,DWORD x2,DWORD x3,DWORD x4);
925 LPVOID WINAPI RtlNormalizeProcessParams(LPVOID x);
926 DWORD WINAPI RtlNtStatusToDosError(DWORD error);
927 BOOLEAN WINAPI RtlGetNtProductType(LPDWORD type);
928 PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule);
930 DWORD WINAPI RtlOpenCurrentUser(
931 IN ACCESS_MASK DesiredAccess,
932 OUT PHANDLE KeyHandle);
934 BOOLEAN WINAPI RtlDosPathNameToNtPathName_U( LPWSTR from,PUNICODE_STRING us,DWORD x2,DWORD x3);
935 BOOL WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel);
937 NTSTATUS WINAPI
938 NtAccessCheck(
939 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
940 IN HANDLE ClientToken,
941 IN ACCESS_MASK DesiredAccess,
942 IN PGENERIC_MAPPING GenericMapping,
943 OUT PPRIVILEGE_SET PrivilegeSet,
944 OUT PULONG ReturnLength,
945 OUT PULONG GrantedAccess,
946 OUT PBOOLEAN AccessStatus);
948 #ifdef __cplusplus
950 #endif
952 #include "poppack.h"
954 #endif