2 * this file defines interfaces mainly exposed to device drivers and
5 * Copyright (C) the Wine project
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef __WINE_NTDDK_H
23 #define __WINE_NTDDK_H
28 #include "winbase.h" /* FIXME: should be taken out sometimes */
37 #undef Status /* conflict with X11-includes*/
39 typedef struct _IO_STATUS_BLOCK
45 ULONG_PTR Information;
46 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
48 typedef VOID (NTAPI *PIO_APC_ROUTINE) ( PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG Reserved );
55 typedef struct _KEY_BASIC_INFORMATION {
56 LARGE_INTEGER LastWriteTime;
60 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
62 typedef struct _KEY_NODE_INFORMATION
64 LARGE_INTEGER LastWriteTime;
71 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
73 typedef struct _KEY_FULL_INFORMATION
75 LARGE_INTEGER LastWriteTime;
83 ULONG MaxValueNameLen;
84 ULONG MaxValueDataLen;
86 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
88 typedef enum _KEY_INFORMATION_CLASS
93 } KEY_INFORMATION_CLASS;
95 typedef struct _KEY_VALUE_ENTRY
97 PUNICODE_STRING ValueName;
101 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
103 /* value information */
104 typedef struct _KEY_VALUE_BASIC_INFORMATION
110 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
112 typedef struct _KEY_VALUE_FULL_INFORMATION
121 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
123 typedef struct _KEY_VALUE_PARTIAL_INFORMATION
129 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
131 typedef enum _KEY_VALUE_INFORMATION_CLASS
133 KeyValueBasicInformation,
134 KeyValueFullInformation,
135 KeyValuePartialInformation,
136 KeyValueFullInformationAlign64,
137 KeyValuePartialInformationAlign64
138 } KEY_VALUE_INFORMATION_CLASS;
140 NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(
141 PUNICODE_STRING KeyPath);
143 /* thread information */
145 typedef enum _THREADINFOCLASS
146 { ThreadBasicInformation,
151 ThreadImpersonationToken,
152 ThreadDescriptorTableEntry,
153 ThreadEnableAlignmentFaultFixup,
154 ThreadEventPair_Reusable,
155 ThreadQuerySetWin32StartAddress,
157 ThreadPerformanceCount,
159 ThreadIdealProcessor,
161 ThreadSetTlsArrayAddress,
167 /* This is used by NtQuerySystemInformation */
168 FILETIME ftCreationTime;
170 DWORD dwStartAddress;
173 DWORD dwCurrentPriority;
174 DWORD dwBasePriority;
175 DWORD dwContextSwitches;
179 } THREADINFO, *PTHREADINFO;
181 /* file information */
183 typedef enum _FILE_INFORMATION_CLASS {
184 FileDirectoryInformation = 1,
185 FileFullDirectoryInformation,
186 FileBothDirectoryInformation,
187 FileBasicInformation,
188 FileStandardInformation,
189 FileInternalInformation,
191 FileAccessInformation,
193 FileRenameInformation,
195 FileNamesInformation,
196 FileDispositionInformation,
197 FilePositionInformation,
198 FileFullEaInformation,
200 FileAlignmentInformation,
202 FileAllocationInformation,
203 FileEndOfFileInformation,
204 FileAlternateNameInformation,
205 FileStreamInformation,
207 FilePipeLocalInformation,
208 FilePipeRemoteInformation,
209 FileMailslotQueryInformation,
210 FileMailslotSetInformation,
211 FileCompressionInformation,
212 FileObjectIdInformation,
213 FileCompletionInformation,
214 FileMoveClusterInformation,
215 FileQuotaInformation,
216 FileReparsePointInformation,
217 FileNetworkOpenInformation,
218 FileAttributeTagInformation,
219 FileTrackingInformation,
220 FileMaximumInformation
221 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
223 typedef enum _FSINFOCLASS {
224 FileFsVolumeInformation = 1,
225 FileFsLabelInformation,
226 FileFsSizeInformation,
227 FileFsDeviceInformation,
228 FileFsAttributeInformation,
229 FileFsControlInformation,
230 FileFsFullSizeInformation,
231 FileFsObjectIdInformation,
232 FileFsMaximumInformation
233 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
235 typedef enum _SECTION_INHERIT
242 /* object information */
244 typedef enum _OBJECT_INFORMATION_CLASS
248 } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
251 /* system information */
253 typedef enum SYSTEM_INFORMATION_CLASS
254 { SystemBasicInformation = 0,
256 SystemPerformanceInformation,
257 SystemTimeInformation,
259 SystemProcessInformation,
265 SystemDriverInformation,
275 SystemCacheInformation
276 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
279 /* System Information Class 0x00 */
281 ULONG uKeMaximumIncrement;
283 ULONG uMmNumberOfPhysicalPages;
284 ULONG uMmLowestPhysicalPage;
285 ULONG uMmHighestPhysicalPage;
286 ULONG uAllocationGranularity;
287 PVOID pLowestUserAddress;
288 PVOID pMmHighestUserAddress;
289 ULONG uKeActiveProcessors;
290 BYTE bKeNumberProcessors;
293 } SYSTEM_BASIC_INFORMATION;
296 /* System Information Class 0x02 */
297 LARGE_INTEGER liIdleTime;
299 } SYSTEM_PERFORMANCE_INFORMATION;
302 /* System Information Class 0x03 */
303 LARGE_INTEGER liKeBootTime;
304 LARGE_INTEGER liKeSystemTime;
305 LARGE_INTEGER liExpTimeZoneBias;
306 ULONG uCurrentTimeZoneId;
308 } SYSTEM_TIME_INFORMATION;
311 /* System Information Class 0x05 */
315 FILETIME ftCreationTime;
317 WCHAR* pszProcessName;
318 DWORD dwBasePriority;
320 DWORD dwParentProcessID;
324 DWORD dwVirtualBytesPeak;
325 DWORD dwVirtualBytes;
327 DWORD dwWorkingSetPeak;
332 DWORD dwNonPagedPool;
333 DWORD dwPageFileBytesPeak;
334 DWORD dwPrivateBytes;
335 DWORD dwPageFileBytes;
338 } SYSTEM_PROCESS_INFORMATION;
341 /* System Information Class 0x0b */
347 char szName[MAX_PATH + 1];
348 } SYSTEM_DRIVER_INFORMATION;
351 /* System Information Class 0x10 */
353 USHORT dwCreatorBackTraceIndex;
355 BYTE bHandleAttributes;
356 USHORT usHandleOffset;
358 ULONG ulGrantedAccess;
359 } HANDLEINFO, *PHANDLEINFO;
362 /* System Information Class 0x15 */
365 ULONG PageFaultCount;
366 ULONG MinimumWorkingSet;
367 ULONG MaximumWorkingSet;
369 } SYSTEM_CACHE_INFORMATION;
371 /* reading coffee grounds... */
372 typedef struct _THREAD_INFO
379 } THREAD_INFO, PTHREAD_INFO;
381 typedef struct _VM_COUNTERS_
382 { ULONG PeakVirtualSize;
384 ULONG PageFaultCount;
385 ULONG PeakWorkingSetSize;
386 ULONG WorkingSetSize;
387 ULONG QuotaPeakPagedPoolUsage;
388 ULONG QuotaPagedPoolUsage;
389 ULONG QuotaPeakNonPagedPoolUsage;
390 ULONG QuotaNonPagedPoolUsage;
392 ULONG PeakPagefileUsage;
393 } VM_COUNTERS, *PVM_COUNTERS;
395 /* process information */
397 typedef struct _PROCESS_INFO
398 { DWORD Offset; /* 00 offset to next PROCESS_INFO ok*/
399 DWORD ThreadCount; /* 04 number of ThreadInfo member ok */
401 FILETIME CreationTime; /* 20 */
403 PWCHAR ProcessName; /* 3c ok */
405 DWORD ProcessID; /* 44 ok*/
406 DWORD ParentProcessID;
408 DWORD Unknown3[2]; /* 50 */
409 ULONG PeakVirtualSize;
411 ULONG PageFaultCount;
412 ULONG PeakWorkingSetSize;
413 ULONG WorkingSetSize;
414 ULONG QuotaPeakPagedPoolUsage;
415 ULONG QuotaPagedPoolUsage;
416 ULONG QuotaPeakNonPagedPoolUsage;
417 ULONG QuotaNonPagedPoolUsage;
419 ULONG PeakPagefileUsage;
422 THREAD_INFO ati[ANYSIZE_ARRAY]; /* 94 size=0x40*/
423 } PROCESS_INFO, PPROCESS_INFO;
425 NTSTATUS WINAPI NtQuerySystemInformation(
426 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
427 OUT PVOID SystemInformation,
429 OUT PULONG ResultLength);
432 * system configuration
436 typedef struct _SYSTEM_TIME_ADJUSTMENT
438 ULONG TimeAdjustment;
439 BOOLEAN TimeAdjustmentDisabled;
441 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
443 typedef struct _SYSTEM_CONFIGURATION_INFO
448 { WORD ProcessorArchitecture;
453 PVOID MinimumApplicationAddress;
454 PVOID MaximumApplicationAddress;
455 ULONG ActiveProcessorMask;
456 ULONG NumberOfProcessors;
458 ULONG AllocationGranularity;
460 WORD ProcessorRevision;
462 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
466 * NtQueryProcessInformation
469 /* parameter ProcessInformationClass */
471 typedef enum _PROCESSINFOCLASS
472 { ProcessBasicInformation,
478 ProcessRaisePriority,
480 ProcessExceptionPort,
482 ProcessLdtInformation,
484 ProcessDefaultHardErrorMode,
485 ProcessIoPortHandlers,
486 ProcessPooledUsageAndLimits,
487 ProcessWorkingSetWatch,
489 ProcessEnableAlignmentFaultFixup,
490 ProcessPriorityClass,
491 ProcessWx86Information,
494 ProcessPriorityBoost,
496 ProcessSessionInformation,
497 ProcessForegroundInformation,
498 ProcessWow64Information,
502 /* parameter ProcessInformation (depending on ProcessInformationClass) */
504 typedef struct _PROCESS_BASIC_INFORMATION
506 DWORD PebBaseAddress;
509 ULONG UniqueProcessId;
510 ULONG InheritedFromUniqueProcessId;
511 } PROCESS_BASIC_INFORMATION;
513 NTSTATUS WINAPI NtQueryInformationProcess(
514 IN HANDLE ProcessHandle,
515 IN PROCESSINFOCLASS ProcessInformationClass,
516 OUT PVOID ProcessInformation,
517 IN ULONG ProcessInformationLength,
518 OUT PULONG ReturnLength);
520 #define NtCurrentProcess() ( (HANDLE) -1 )
526 typedef enum _TIMER_TYPE
533 /* token functions */
535 NTSTATUS WINAPI NtOpenProcessToken(
536 HANDLE ProcessHandle,
538 HANDLE *TokenHandle);
540 NTSTATUS WINAPI NtOpenThreadToken(
544 HANDLE *TokenHandle);
546 NTSTATUS WINAPI NtAdjustPrivilegesToken(
547 IN HANDLE TokenHandle,
548 IN BOOLEAN DisableAllPrivileges,
549 IN PTOKEN_PRIVILEGES NewState,
550 IN DWORD BufferLength,
551 OUT PTOKEN_PRIVILEGES PreviousState,
552 OUT PDWORD ReturnLength);
554 NTSTATUS WINAPI NtQueryInformationToken(
556 DWORD tokeninfoclass,
558 DWORD tokeninfolength,
563 BOOLEAN WINAPI RtlAllocateAndInitializeSid (
564 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
565 BYTE nSubAuthorityCount,
566 DWORD nSubAuthority0, DWORD nSubAuthority1,
567 DWORD nSubAuthority2, DWORD nSubAuthority3,
568 DWORD nSubAuthority4, DWORD nSubAuthority5,
569 DWORD nSubAuthority6, DWORD nSubAuthority7,
572 BOOL WINAPI RtlInitializeSid(
574 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
575 BYTE nSubAuthorityCount);
577 DWORD WINAPI RtlFreeSid(
580 BOOL WINAPI RtlEqualSid(
584 DWORD WINAPI RtlLengthRequiredSid(
587 DWORD WINAPI RtlLengthSid(
590 LPDWORD WINAPI RtlSubAuthoritySid(
594 LPBYTE WINAPI RtlSubAuthorityCountSid(
597 DWORD WINAPI RtlCopySid(
602 BOOL WINAPI RtlValidSid(
605 BOOL WINAPI RtlEqualPrefixSid(
609 PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(
612 /* security descriptor functions */
614 NTSTATUS WINAPI RtlCreateSecurityDescriptor(
615 PSECURITY_DESCRIPTOR lpsd,
618 NTSTATUS WINAPI RtlValidSecurityDescriptor(
619 PSECURITY_DESCRIPTOR SecurityDescriptor);
621 ULONG WINAPI RtlLengthSecurityDescriptor(
622 PSECURITY_DESCRIPTOR SecurityDescriptor);
624 NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(
625 IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
626 OUT PBOOLEAN lpbDaclPresent,
628 OUT PBOOLEAN lpbDaclDefaulted);
630 NTSTATUS WINAPI RtlSetDaclSecurityDescriptor (
631 PSECURITY_DESCRIPTOR lpsd,
634 BOOLEAN dacldefaulted );
636 NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(
637 IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
638 OUT PBOOLEAN lpbSaclPresent,
640 OUT PBOOLEAN lpbSaclDefaulted);
642 NTSTATUS WINAPI RtlSetSaclSecurityDescriptor (
643 PSECURITY_DESCRIPTOR lpsd,
646 BOOLEAN sacldefaulted);
648 NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(
649 PSECURITY_DESCRIPTOR SecurityDescriptor,
651 PBOOLEAN OwnerDefaulted);
653 NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(
654 PSECURITY_DESCRIPTOR lpsd,
656 BOOLEAN ownerdefaulted);
658 NTSTATUS WINAPI RtlSetGroupSecurityDescriptor (
659 PSECURITY_DESCRIPTOR lpsd,
661 BOOLEAN groupdefaulted);
663 NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(
664 PSECURITY_DESCRIPTOR SecurityDescriptor,
666 PBOOLEAN GroupDefaulted);
668 NTSTATUS WINAPI RtlMakeSelfRelativeSD(
669 IN PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
670 IN PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
671 IN OUT LPDWORD lpdwBufferLength);
673 NTSTATUS WINAPI RtlGetControlSecurityDescriptor(
674 PSECURITY_DESCRIPTOR pSecurityDescriptor,
675 PSECURITY_DESCRIPTOR_CONTROL pControl,
676 LPDWORD lpdwRevision);
680 NTSTATUS WINAPI RtlCreateAcl(
685 BOOLEAN WINAPI RtlFirstFreeAce(
689 NTSTATUS WINAPI RtlAddAce(
693 PACE_HEADER acestart,
696 BOOL WINAPI RtlAddAccessAllowedAce(
698 IN DWORD dwAceRevision,
702 BOOL WINAPI AddAccessAllowedAceEx(
704 IN DWORD dwAceRevision,
709 DWORD WINAPI RtlGetAce(
714 /* string functions */
716 DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING*);
717 NTSTATUS WINAPI RtlAnsiStringToUnicodeString(UNICODE_STRING*,const STRING *,BOOLEAN);
718 NTSTATUS WINAPI RtlAppendAsciizToString(STRING*,LPCSTR);
719 NTSTATUS WINAPI RtlAppendStringToString(STRING*,const STRING*);
720 NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING*,const UNICODE_STRING*);
721 NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING*,LPCWSTR);
722 LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
723 LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
724 void WINAPI RtlCopyString(STRING*,const STRING*);
725 void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
726 BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
727 BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
728 void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
729 BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
730 BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
731 void WINAPI RtlFreeAnsiString(PSTRING);
732 void WINAPI RtlFreeOemString(PSTRING);
733 void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
734 void WINAPI RtlInitAnsiString(PSTRING,LPCSTR);
735 void WINAPI RtlInitString(PSTRING,LPCSTR);
736 void WINAPI RtlInitUnicodeString(PUNICODE_STRING,LPCWSTR);
737 NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
738 NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
739 UINT WINAPI RtlOemStringToUnicodeSize(const STRING*);
740 NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
741 NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
742 BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
743 BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
744 DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
745 NTSTATUS WINAPI RtlUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
746 DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
747 NTSTATUS WINAPI RtlUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
748 NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
749 NTSTATUS WINAPI RtlUnicodeToMultiByteSize(DWORD*,LPCWSTR,UINT);
750 NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
751 NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
752 NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
753 NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
754 NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
755 NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
757 DWORD WINAPI RtlIsTextUnicode(
762 INT __cdecl wcstol(LPCWSTR,LPWSTR*,INT);
763 int __cdecl swprintf(LPWSTR,LPCWSTR,...);
765 /* resource functions */
767 typedef struct _RTL_RWLOCK {
768 CRITICAL_SECTION rtlCS;
769 HANDLE hSharedReleaseSemaphore;
771 HANDLE hExclusiveReleaseSemaphore;
772 UINT uExclusiveWaiters;
774 HANDLE hOwningThreadId;
775 DWORD dwTimeoutBoost;
777 } RTL_RWLOCK, *LPRTL_RWLOCK;
779 VOID WINAPI RtlInitializeResource(
782 VOID WINAPI RtlDeleteResource(
785 BYTE WINAPI RtlAcquireResourceExclusive(
786 LPRTL_RWLOCK, BYTE fWait);
788 BYTE WINAPI RtlAcquireResourceShared(
789 LPRTL_RWLOCK, BYTE fWait);
791 VOID WINAPI RtlReleaseResource(
794 VOID WINAPI RtlDumpResource(
799 typedef struct _TIME_FIELDS
810 typedef TIME_FIELDS *PTIME_FIELDS;
812 VOID WINAPI RtlSystemTimeToLocalTime(
813 IN PLARGE_INTEGER SystemTime,
814 OUT PLARGE_INTEGER LocalTime);
816 VOID WINAPI RtlTimeToTimeFields(
817 PLARGE_INTEGER liTime,
818 PTIME_FIELDS TimeFields);
820 BOOLEAN WINAPI RtlTimeFieldsToTime(
821 PTIME_FIELDS tfTimeFields,
822 PLARGE_INTEGER Time);
824 VOID WINAPI RtlTimeToElapsedTimeFields(
825 PLARGE_INTEGER liTime,
826 PTIME_FIELDS TimeFields);
828 void WINAPI NtQuerySystemTime( LARGE_INTEGER *time );
830 BOOLEAN WINAPI RtlTimeToSecondsSince1980( const FILETIME *time, LPDWORD res );
831 BOOLEAN WINAPI RtlTimeToSecondsSince1970( const FILETIME *time, LPDWORD res );
832 void WINAPI RtlSecondsSince1970ToTime( DWORD time, FILETIME *res );
833 void WINAPI RtlSecondsSince1980ToTime( DWORD time, FILETIME *res );
837 /* Data structure for heap definition. This includes various
838 sizing parameters and callback routines, which, if left NULL,
839 result in default behavior */
842 { ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
844 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
846 HANDLE WINAPI RtlCreateHeap(ULONG,PVOID,ULONG,ULONG,PVOID,PRTL_HEAP_DEFINITION);
847 HANDLE WINAPI RtlDestroyHeap(HANDLE);
848 PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,ULONG);
849 BOOLEAN WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
850 PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,ULONG);
851 ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
852 BOOLEAN WINAPI RtlLockHeap(HANDLE);
853 BOOLEAN WINAPI RtlUnlockHeap(HANDLE);
854 ULONG WINAPI RtlSizeHeap(HANDLE,ULONG,PVOID);
855 BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,PCVOID);
856 ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
857 NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
861 void WINAPI NtRaiseException(
862 PEXCEPTION_RECORD,PCONTEXT,BOOL);
864 void WINAPI RtlRaiseException(
867 void WINAPI RtlRaiseStatus(
870 void WINAPI RtlUnwind(
873 PEXCEPTION_RECORD,DWORD);
875 /* process environment block */
876 VOID WINAPI RtlAcquirePebLock(void);
877 VOID WINAPI RtlReleasePebLock(void);
880 LONGLONG WINAPI RtlConvertLongToLargeInteger( LONG a );
881 LONGLONG WINAPI RtlEnlargedIntegerMultiply( INT a, INT b );
882 LONGLONG WINAPI RtlExtendedMagicDivide( LONGLONG a, LONGLONG b, INT shift );
883 LONGLONG WINAPI RtlExtendedIntegerMultiply( LONGLONG a, INT b );
884 LONGLONG WINAPI RtlExtendedLargeIntegerDivide( LONGLONG a, INT b, INT *rem );
885 LONGLONG WINAPI RtlLargeIntegerAdd( LONGLONG a, LONGLONG b );
886 LONGLONG WINAPI RtlLargeIntegerArithmeticShift( LONGLONG a, INT count );
887 LONGLONG WINAPI RtlLargeIntegerNegate( LONGLONG a );
888 LONGLONG WINAPI RtlLargeIntegerShiftLeft( LONGLONG a, INT count );
889 LONGLONG WINAPI RtlLargeIntegerShiftRight( LONGLONG a, INT count );
890 LONGLONG WINAPI RtlLargeIntegerSubtract( LONGLONG a, LONGLONG b );
891 ULONGLONG WINAPI RtlEnlargedUnsignedMultiply( UINT a, UINT b );
892 UINT WINAPI RtlEnlargedUnsignedDivide( ULONGLONG a, UINT b, UINT *remptr );
893 ULONGLONG WINAPI RtlConvertUlongToLargeInteger( ULONG a );
894 ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG a, ULONGLONG b, ULONGLONG *rem );
897 DWORD WINAPI RtlCreateEnvironment(
901 DWORD WINAPI RtlDestroyEnvironment(
904 DWORD WINAPI RtlQueryEnvironmentVariable_U(
907 PUNICODE_STRING val) ;
909 DWORD WINAPI RtlSetEnvironmentVariable(
912 PUNICODE_STRING val);
914 /* object security */
916 DWORD WINAPI RtlNewSecurityObject(
924 DWORD WINAPI RtlDeleteSecurityObject(
928 NtQuerySecurityObject(
930 IN SECURITY_INFORMATION RequestedInformation,
931 OUT PSECURITY_DESCRIPTOR pSecurityDesriptor,
933 OUT PULONG ResultLength);
938 IN SECURITY_INFORMATION SecurityInformation,
939 IN PSECURITY_DESCRIPTOR SecurityDescriptor);
941 /* registry functions */
943 NTSTATUS WINAPI NtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,
944 const UNICODE_STRING*,ULONG,PULONG);
945 NTSTATUS WINAPI NtDeleteKey(HANDLE);
946 NTSTATUS WINAPI NtDeleteValueKey(HANDLE,const UNICODE_STRING*);
947 NTSTATUS WINAPI NtOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
948 NTSTATUS WINAPI NtQueryKey(HANDLE,KEY_INFORMATION_CLASS,void*,DWORD,DWORD*);
949 NTSTATUS WINAPI NtSetValueKey(HANDLE,const UNICODE_STRING*,ULONG,ULONG,const void*,ULONG);
950 NTSTATUS WINAPI NtEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void*,DWORD,DWORD*);
951 NTSTATUS WINAPI NtQueryValueKey(HANDLE,const UNICODE_STRING*,KEY_VALUE_INFORMATION_CLASS,
953 NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES*,const OBJECT_ATTRIBUTES*);
956 NTSTATUS WINAPI NtEnumerateValueKey(
959 KEY_VALUE_INFORMATION_CLASS KeyInformationClass,
960 PVOID KeyInformation,
962 PULONG ResultLength);
964 NTSTATUS WINAPI NtFlushKey(HANDLE KeyHandle);
966 NTSTATUS WINAPI NtNotifyChangeKey(
969 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
970 IN PVOID ApcContext OPTIONAL,
971 OUT PIO_STATUS_BLOCK IoStatusBlock,
972 IN ULONG CompletionFilter,
973 IN BOOLEAN Asynchroneous,
974 OUT PVOID ChangeBuffer,
976 IN BOOLEAN WatchSubtree);
978 NTSTATUS WINAPI NtQueryMultipleValueKey(
980 PVALENTW ListOfValuesToQuery,
982 PVOID MultipleValueInformation,
984 PULONG ReturnLength);
986 NTSTATUS WINAPI NtReplaceKey(
987 IN POBJECT_ATTRIBUTES ObjectAttributes,
989 IN POBJECT_ATTRIBUTES ReplacedObjectAttributes);
991 NTSTATUS WINAPI NtRestoreKey(
996 NTSTATUS WINAPI NtSaveKey(
998 IN HANDLE FileHandle);
1000 NTSTATUS WINAPI NtSetInformationKey(
1001 IN HANDLE KeyHandle,
1002 IN const int KeyInformationClass,
1003 IN PVOID KeyInformation,
1004 IN ULONG KeyInformationLength);
1006 NTSTATUS WINAPI NtUnloadKey(
1007 IN HANDLE KeyHandle);
1009 NTSTATUS WINAPI NtClose(
1012 NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code );
1013 NTSTATUS WINAPI NtTerminateThread( HANDLE handle, LONG exit_code );
1015 NTSTATUS WINAPI NtClearEvent(HANDLE);
1016 NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOOLEAN,BOOLEAN);
1017 NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,ULONG);
1018 NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *attr);
1019 NTSTATUS WINAPI NtPulseEvent(HANDLE,PULONG);
1020 NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
1021 NTSTATUS WINAPI NtResetEvent(HANDLE,PULONG);
1022 NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
1024 NTSTATUS WINAPI RtlInitializeCriticalSection( RTL_CRITICAL_SECTION *crit );
1025 NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount( RTL_CRITICAL_SECTION *crit, DWORD spincount );
1026 NTSTATUS WINAPI RtlDeleteCriticalSection( RTL_CRITICAL_SECTION *crit );
1027 NTSTATUS WINAPI RtlpWaitForCriticalSection( RTL_CRITICAL_SECTION *crit );
1028 NTSTATUS WINAPI RtlpUnWaitCriticalSection( RTL_CRITICAL_SECTION *crit );
1029 NTSTATUS WINAPI RtlEnterCriticalSection( RTL_CRITICAL_SECTION *crit );
1030 BOOL WINAPI RtlTryEnterCriticalSection( RTL_CRITICAL_SECTION *crit );
1031 NTSTATUS WINAPI RtlLeaveCriticalSection( RTL_CRITICAL_SECTION *crit );
1033 /* string functions */
1034 extern LPSTR _strlwr( LPSTR str );
1035 extern LPSTR _strupr( LPSTR str );
1039 #if defined(__i386__) && defined(__GNUC__)
1040 static inline void WINAPI DbgBreakPoint(void) { __asm__ __volatile__("int3"); }
1041 static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3"); }
1042 #else /* __i386__ && __GNUC__ */
1043 void WINAPI DbgBreakPoint(void);
1044 void WINAPI DbgUserBreakPoint(void);
1045 #endif /* __i386__ && __GNUC__ */
1046 void WINAPIV DbgPrint(LPCSTR fmt, ...);
1048 DWORD WINAPI RtlAdjustPrivilege(DWORD x1,DWORD x2,DWORD x3,DWORD x4);
1049 DWORD WINAPI RtlIntegerToChar(DWORD x1,DWORD x2,DWORD x3,DWORD x4);
1050 LPVOID WINAPI RtlNormalizeProcessParams(LPVOID x);
1051 DWORD WINAPI RtlNtStatusToDosError(DWORD error);
1052 BOOLEAN WINAPI RtlGetNtProductType(LPDWORD type);
1053 PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule);
1055 DWORD WINAPI RtlOpenCurrentUser(
1056 IN ACCESS_MASK DesiredAccess,
1057 OUT PHANDLE KeyHandle);
1059 BOOLEAN WINAPI RtlDosPathNameToNtPathName_U( LPWSTR from,PUNICODE_STRING us,DWORD x2,DWORD x3);
1060 BOOL WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel);
1064 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
1065 IN HANDLE ClientToken,
1066 IN ACCESS_MASK DesiredAccess,
1067 IN PGENERIC_MAPPING GenericMapping,
1068 OUT PPRIVILEGE_SET PrivilegeSet,
1069 OUT PULONG ReturnLength,
1070 OUT PULONG GrantedAccess,
1071 OUT PBOOLEAN AccessStatus);