2 * PROJECT: ReactOS Native Headers
3 * FILE: include/ndk/rtlfuncs.h
4 * PURPOSE: Prototypes for Runtime Library Functions not defined in DDK/IFS
5 * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
12 /* DEPENDENCIES **************************************************************/
17 /* PROTOTYPES ****************************************************************/
20 * Error and Exception Functions
25 RtlAddVectoredExceptionHandler(
26 IN ULONG FirstHandler
,
27 IN PVECTORED_EXCEPTION_HANDLER VectoredHandler
34 PVOID FailedAssertion
,
43 RtlEncodePointer(IN PVOID Pointer
);
48 RtlDecodePointer(IN PVOID Pointer
);
53 RtlNtStatusToDosError(IN NTSTATUS Status
);
58 RtlRaiseException(IN PEXCEPTION_RECORD ExceptionRecord
);
63 RtlRaiseStatus(NTSTATUS Status
);
68 RtlUnhandledExceptionFilter(struct _EXCEPTION_POINTERS
* ExceptionInfo
);
74 PEXCEPTION_REGISTRATION RegistrationFrame
,
76 PEXCEPTION_RECORD ExceptionRecord
,
98 IN PVOID BaseAddress OPTIONAL
,
99 IN SIZE_T SizeToReserve OPTIONAL
,
100 IN SIZE_T SizeToCommit OPTIONAL
,
101 IN PVOID Lock OPTIONAL
,
102 IN PRTL_HEAP_PARAMETERS Parameters OPTIONAL
115 RtlDestroyHeap(HANDLE hheap
);
121 IN HANDLE HeapHandle
,
144 RtlLockHeap(IN HANDLE Heap
);
148 RtlUnlockHeap(IN HANDLE Heap
);
155 IN PVOID MemoryPointer
166 #define RtlGetProcessHeap() (NtCurrentPeb()->ProcessHeap)
175 RtlAbsoluteToSelfRelativeSD(
176 IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor
,
177 IN OUT PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor
,
178 IN PULONG BufferLength
184 RtlAddAccessAllowedAce(
187 ACCESS_MASK AccessMask
,
193 RtlAddAccessAllowedAceEx(
195 IN ULONG dwAceRevision
,
203 RtlAddAccessDeniedAce(
206 ACCESS_MASK AccessMask
,
212 RtlAddAccessDeniedAceEx(
216 IN ACCESS_MASK AccessMask
,
222 RtlAddAuditAccessAceEx(
226 IN ACCESS_MASK AccessMask
,
238 ULONG StartingAceIndex
,
245 RtlAddAuditAccessAce(
248 ACCESS_MASK AccessMask
,
259 IN BOOLEAN ForThread
,
260 OUT PBOOLEAN OldValue
266 RtlAllocateAndInitializeSid(
267 IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority
,
268 IN UCHAR SubAuthorityCount
,
269 IN ULONG SubAuthority0
,
270 IN ULONG SubAuthority1
,
271 IN ULONG SubAuthority2
,
272 IN ULONG SubAuthority3
,
273 IN ULONG SubAuthority4
,
274 IN ULONG SubAuthority5
,
275 IN ULONG SubAuthority6
,
276 IN ULONG SubAuthority7
,
282 RtlAreAllAccessesGranted(
283 ACCESS_MASK GrantedAccess
,
284 ACCESS_MASK DesiredAccess
289 RtlAreAnyAccessesGranted(
290 ACCESS_MASK GrantedAccess
,
291 ACCESS_MASK DesiredAccess
304 RtlCopyLuidAndAttributesArray(
306 PLUID_AND_ATTRIBUTES Src
,
307 PLUID_AND_ATTRIBUTES Dest
312 RtlCopySidAndAttributesArray(
314 PSID_AND_ATTRIBUTES Src
,
316 PSID_AND_ATTRIBUTES Dest
,
318 PVOID
* RemainingSidArea
,
319 PULONG RemainingSidAreaSize
324 RtlConvertSidToUnicodeString(
325 OUT PUNICODE_STRING DestinationString
,
327 IN BOOLEAN AllocateDestinationString
351 RtlCreateSecurityDescriptor(
352 PSECURITY_DESCRIPTOR SecurityDescriptor
,
359 RtlCreateSecurityDescriptorRelative(
360 PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor
,
413 RtlGetControlSecurityDescriptor(
414 PSECURITY_DESCRIPTOR SecurityDescriptor
,
415 PSECURITY_DESCRIPTOR_CONTROL Control
,
422 RtlGetDaclSecurityDescriptor(
423 IN PSECURITY_DESCRIPTOR SecurityDescriptor
,
424 OUT PBOOLEAN DaclPresent
,
426 OUT PBOOLEAN DaclDefaulted
432 RtlGetSaclSecurityDescriptor(
433 PSECURITY_DESCRIPTOR SecurityDescriptor
,
434 PBOOLEAN SaclPresent
,
436 PBOOLEAN SaclDefaulted
442 RtlGetGroupSecurityDescriptor(
443 IN PSECURITY_DESCRIPTOR SecurityDescriptor
,
445 OUT PBOOLEAN GroupDefaulted
451 RtlGetOwnerSecurityDescriptor(
452 IN PSECURITY_DESCRIPTOR SecurityDescriptor
,
454 OUT PBOOLEAN OwnerDefaulted
460 RtlGetSecurityDescriptorRMControl(
461 PSECURITY_DESCRIPTOR SecurityDescriptor
,
466 PSID_IDENTIFIER_AUTHORITY
468 RtlIdentifierAuthoritySid(PSID Sid
);
473 RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
);
480 IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority
,
481 IN UCHAR SubAuthorityCount
487 RtlLengthRequiredSid(IN ULONG SubAuthorityCount
);
492 RtlLengthSid(IN PSID Sid
);
498 PACCESS_MASK AccessMask
,
499 PGENERIC_MAPPING GenericMapping
505 RtlQueryInformationAcl(
508 ULONG InformationLength
,
509 ACL_INFORMATION_CLASS InformationClass
515 RtlSelfRelativeToAbsoluteSD(
516 IN PSECURITY_DESCRIPTOR SelfRelativeSD
,
517 OUT PSECURITY_DESCRIPTOR AbsoluteSD
,
518 IN PULONG AbsoluteSDSize
,
525 IN PSID PrimaryGroup
,
526 IN PULONG PrimaryGroupSize
532 RtlSetControlSecurityDescriptor(
533 IN PSECURITY_DESCRIPTOR SecurityDescriptor
,
534 IN SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest
,
535 IN SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet
541 RtlSetDaclSecurityDescriptor (
542 PSECURITY_DESCRIPTOR SecurityDescriptor
,
545 BOOLEAN DaclDefaulted
551 RtlSetGroupSecurityDescriptor(
552 IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor
,
554 IN BOOLEAN GroupDefaulted
560 RtlSetInformationAcl(
563 ULONG InformationLength
,
564 ACL_INFORMATION_CLASS InformationClass
570 RtlSetOwnerSecurityDescriptor(
571 IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor
,
573 IN BOOLEAN OwnerDefaulted
579 RtlSetSaclSecurityDescriptor(
580 IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor
,
581 IN BOOLEAN SaclPresent
,
583 IN BOOLEAN SaclDefaulted
589 RtlSetSecurityDescriptorRMControl(
590 PSECURITY_DESCRIPTOR SecurityDescriptor
,
597 RtlSubAuthorityCountSid(
606 IN ULONG SubAuthority
612 RtlValidRelativeSecurityDescriptor(
613 IN PSECURITY_DESCRIPTOR SecurityDescriptorInput
,
614 IN ULONG SecurityDescriptorLength
,
615 IN SECURITY_INFORMATION RequiredInformation
621 RtlValidSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor
);
626 RtlValidSid(IN PSID Sid
);
631 RtlValidAcl(PACL Acl
);
636 RtlDeleteSecurityObject(
637 IN PSECURITY_DESCRIPTOR
*ObjectDescriptor
643 RtlNewSecurityObject(
644 IN PSECURITY_DESCRIPTOR ParentDescriptor
,
645 IN PSECURITY_DESCRIPTOR CreatorDescriptor
,
646 OUT PSECURITY_DESCRIPTOR
*NewDescriptor
,
647 IN BOOLEAN IsDirectoryObject
,
649 IN PGENERIC_MAPPING GenericMapping
655 RtlQuerySecurityObject(
656 IN PSECURITY_DESCRIPTOR ObjectDescriptor
,
657 IN SECURITY_INFORMATION SecurityInformation
,
658 OUT PSECURITY_DESCRIPTOR ResultantDescriptor
,
659 IN ULONG DescriptorLength
,
660 OUT PULONG ReturnLength
666 RtlSetSecurityObject(
667 IN SECURITY_INFORMATION SecurityInformation
,
668 IN PSECURITY_DESCRIPTOR ModificationDescriptor
,
669 OUT PSECURITY_DESCRIPTOR
*ObjectsSecurityDescriptor
,
670 IN PGENERIC_MAPPING GenericMapping
,
675 * Single-Character Functions
680 RtlLargeIntegerToChar(
681 IN PLARGE_INTEGER Value
,
690 RtlUpperChar(CHAR Source
);
695 RtlUpcaseUnicodeChar(WCHAR Source
);
700 RtlDowncaseUnicodeChar(IN WCHAR Source
);
717 IN ULONG Base OPTIONAL
,
718 IN ULONG Length OPTIONAL
,
725 RtlIntegerToUnicodeString(
728 IN OUT PUNICODE_STRING String
740 #if (defined(_M_IX86) && (_MSC_FULL_VER > 13009037)) || ((defined(_M_AMD64) || defined(_M_IA64)) && (_MSC_FULL_VER > 13009175))
741 unsigned short __cdecl
_byteswap_ushort(unsigned short);
742 unsigned long __cdecl
_byteswap_ulong (unsigned long);
743 unsigned __int64 __cdecl
_byteswap_uint64(unsigned __int64
);
744 #pragma intrinsic(_byteswap_ushort)
745 #pragma intrinsic(_byteswap_ulong)
746 #pragma intrinsic(_byteswap_uint64)
747 #define RtlUshortByteSwap(_x) _byteswap_ushort((USHORT)(_x))
748 #define RtlUlongByteSwap(_x) _byteswap_ulong((_x))
749 #define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x))
754 RtlUshortByteSwap(IN USHORT Source
);
758 RtlUlongByteSwap(IN ULONG Source
);
762 RtlUlonglongByteSwap(IN ULONGLONG Source
);
767 * Unicode->Ansi String Functions
772 RtlxUnicodeStringToAnsiSize(IN PCUNICODE_STRING UnicodeString
);
774 #ifdef NTOS_MODE_USER
775 #define RtlUnicodeStringToAnsiSize(STRING) ( \
776 NLS_MB_CODE_PAGE_TAG ? \
777 RtlxUnicodeStringToAnsiSize(STRING) : \
778 ((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \
785 RtlUnicodeStringToAnsiString(
786 PANSI_STRING DestinationString
,
787 PCUNICODE_STRING SourceString
,
788 BOOLEAN AllocateDestinationString
792 * Unicode->OEM String Functions
797 RtlUpcaseUnicodeStringToOemString(
798 POEM_STRING DestinationString
,
799 PCUNICODE_STRING SourceString
,
800 BOOLEAN AllocateDestinationString
806 RtlUpcaseUnicodeStringToCountedOemString(
807 IN OUT POEM_STRING DestinationString
,
808 IN PCUNICODE_STRING SourceString
,
809 IN BOOLEAN AllocateDestinationString
815 RtlUnicodeStringToOemString(
816 POEM_STRING DestinationString
,
817 PCUNICODE_STRING SourceString
,
818 BOOLEAN AllocateDestinationString
824 RtlUpcaseUnicodeToOemN(
828 PWCHAR UnicodeString
,
835 RtlxUnicodeStringToOemSize(IN PCUNICODE_STRING UnicodeString
);
837 #ifdef NTOS_MODE_USER
838 #define RtlUnicodeStringToOemSize(STRING) ( \
839 NLS_MB_OEM_CODE_PAGE_TAG ? \
840 RtlxUnicodeStringToOemSize(STRING) : \
841 ((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \
843 #define RtlUnicodeStringToCountedOemSize(STRING) ( \
844 (ULONG)(RtlUnicodeStringToOemSize(STRING) - sizeof(ANSI_NULL)) \
855 PWCHAR UnicodeString
,
860 * Unicode->MultiByte String Functions
865 RtlUnicodeToMultiByteN(
869 PWCHAR UnicodeString
,
876 RtlUpcaseUnicodeToMultiByteN(
880 PWCHAR UnicodeString
,
887 RtlUnicodeToMultiByteSize(
889 PWCHAR UnicodeString
,
896 RtlxOemStringToUnicodeSize(IN PCOEM_STRING OemString
);
899 * OEM to Unicode Functions
901 #ifdef NTOS_MODE_USER
902 #define RtlOemStringToUnicodeSize(STRING) ( \
903 NLS_MB_OEM_CODE_PAGE_TAG ? \
904 RtlxOemStringToUnicodeSize(STRING) : \
905 ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \
907 #define RtlOemStringToCountedUnicodeSize(STRING) ( \
908 (ULONG)(RtlOemStringToUnicodeSize(STRING) - sizeof(UNICODE_NULL)) \
915 RtlOemStringToUnicodeString(
916 PUNICODE_STRING DestinationString
,
917 PCOEM_STRING SourceString
,
918 BOOLEAN AllocateDestinationString
926 ULONG MaxBytesInUnicodeString
,
927 PULONG BytesInUnicodeString
,
929 ULONG BytesInOemString
933 * Ansi->Unicode String Functions
938 RtlAnsiStringToUnicodeString(
939 PUNICODE_STRING DestinationString
,
940 PCANSI_STRING SourceString
,
941 BOOLEAN AllocateDestinationString
944 #ifdef NTOS_MODE_USER
945 #define RtlAnsiStringToUnicodeSize(STRING) ( \
946 NLS_MB_CODE_PAGE_TAG ? \
947 RtlxAnsiStringToUnicodeSize(STRING) : \
948 ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \
955 RtlCreateUnicodeStringFromAsciiz(
956 OUT PUNICODE_STRING Destination
,
961 * Unicode String Functions
966 RtlAppendUnicodeToString(
967 PUNICODE_STRING Destination
,
974 RtlAppendUnicodeStringToString(
975 PUNICODE_STRING Destination
,
976 PCUNICODE_STRING Source
982 RtlCompareUnicodeString(
983 PCUNICODE_STRING String1
,
984 PCUNICODE_STRING String2
,
985 BOOLEAN CaseInsensitive
991 RtlCopyUnicodeString(
992 PUNICODE_STRING DestinationString
,
993 PCUNICODE_STRING SourceString
999 RtlCreateUnicodeString(
1000 PUNICODE_STRING DestinationString
,
1004 #ifdef NTOS_MODE_USER
1008 RtlDowncaseUnicodeString(
1009 IN OUT PUNICODE_STRING UniDest
,
1010 IN PCUNICODE_STRING UniSource
,
1011 IN BOOLEAN AllocateDestinationString
1018 RtlDuplicateUnicodeString(
1020 IN PCUNICODE_STRING SourceString
,
1021 OUT PUNICODE_STRING DestinationString
1027 RtlEqualUnicodeString(
1028 PCUNICODE_STRING String1
,
1029 PCUNICODE_STRING String2
,
1030 BOOLEAN CaseInsensitive
1036 RtlFreeUnicodeString(IN PUNICODE_STRING UnicodeString
);
1041 RtlHashUnicodeString(
1042 IN CONST UNICODE_STRING
*String
,
1043 IN BOOLEAN CaseInSensitive
,
1044 IN ULONG HashAlgorithm
,
1045 OUT PULONG HashValue
1051 RtlInitUnicodeString(
1052 IN OUT PUNICODE_STRING DestinationString
,
1053 IN PCWSTR SourceString
);
1067 RtlPrefixUnicodeString(
1068 PCUNICODE_STRING String1
,
1069 PCUNICODE_STRING String2
,
1070 BOOLEAN CaseInsensitive
1076 RtlUpcaseUnicodeString(
1077 PUNICODE_STRING DestinationString
,
1078 PCUNICODE_STRING SourceString
,
1079 BOOLEAN AllocateDestinationString
1085 RtlUnicodeStringToInteger(
1086 PCUNICODE_STRING String
,
1092 * Ansi String Functions
1097 RtlFreeAnsiString(IN PANSI_STRING AnsiString
);
1103 PANSI_STRING DestinationString
,
1108 * OEM String Functions
1113 RtlFreeOemString(IN POEM_STRING OemString
);
1116 * MultiByte->Unicode String Functions
1121 RtlMultiByteToUnicodeN(
1122 PWCHAR UnicodeString
,
1132 RtlMultiByteToUnicodeSize(
1144 RtlAddAtomToAtomTable(
1145 IN PRTL_ATOM_TABLE AtomTable
,
1155 IN OUT PRTL_ATOM_TABLE
*AtomTable
1161 RtlDeleteAtomFromAtomTable(
1162 IN PRTL_ATOM_TABLE AtomTable
,
1169 RtlDestroyAtomTable(IN PRTL_ATOM_TABLE AtomTable
);
1174 RtlQueryAtomInAtomTable(
1175 IN PRTL_ATOM_TABLE AtomTable
,
1177 IN OUT PULONG RefCount OPTIONAL
,
1178 IN OUT PULONG PinCount OPTIONAL
,
1179 IN OUT PWSTR AtomName OPTIONAL
,
1180 IN OUT PULONG NameLength OPTIONAL
1186 RtlLookupAtomInAtomTable(
1187 IN PRTL_ATOM_TABLE AtomTable
,
1199 IN PVOID Destination
,
1205 * Process Management Functions
1210 RtlAcquirePebLock(VOID
);
1215 RtlCreateProcessParameters (
1216 OUT PRTL_USER_PROCESS_PARAMETERS
*ProcessParameters
,
1217 IN PUNICODE_STRING ImagePathName OPTIONAL
,
1218 IN PUNICODE_STRING DllPath OPTIONAL
,
1219 IN PUNICODE_STRING CurrentDirectory OPTIONAL
,
1220 IN PUNICODE_STRING CommandLine OPTIONAL
,
1221 IN PWSTR Environment OPTIONAL
,
1222 IN PUNICODE_STRING WindowTitle OPTIONAL
,
1223 IN PUNICODE_STRING DesktopInfo OPTIONAL
,
1224 IN PUNICODE_STRING ShellInfo OPTIONAL
,
1225 IN PUNICODE_STRING RuntimeInfo OPTIONAL
1231 RtlCreateUserProcess(
1232 IN PUNICODE_STRING ImageFileName
,
1233 IN ULONG Attributes
,
1234 IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters
,
1235 IN PSECURITY_DESCRIPTOR ProcessSecutityDescriptor OPTIONAL
,
1236 IN PSECURITY_DESCRIPTOR ThreadSecurityDescriptor OPTIONAL
,
1237 IN HANDLE ParentProcess OPTIONAL
,
1238 IN BOOLEAN CurrentDirectory
,
1239 IN HANDLE DebugPort OPTIONAL
,
1240 IN HANDLE ExceptionPort OPTIONAL
,
1241 OUT PRTL_USER_PROCESS_INFORMATION ProcessInfo
1247 RtlCreateUserThread(
1248 IN HANDLE ProcessHandle
,
1249 IN PSECURITY_DESCRIPTOR SecurityDescriptor
,
1250 IN BOOLEAN CreateSuspended
,
1251 IN LONG StackZeroBits
,
1252 IN ULONG StackReserve
,
1253 IN ULONG StackCommit
,
1254 IN PTHREAD_START_ROUTINE StartAddress
,
1256 IN OUT PHANDLE ThreadHandle
,
1257 IN OUT PCLIENT_ID ClientId
1261 PRTL_USER_PROCESS_PARAMETERS
1263 RtlDeNormalizeProcessParams(IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters
);
1268 RtlDestroyProcessParameters(IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters
);
1273 RtlExitUserThread(NTSTATUS Status
);
1278 RtlInitializeContext(
1279 IN HANDLE ProcessHandle
,
1280 OUT PCONTEXT ThreadContext
,
1281 IN PVOID ThreadStartParam OPTIONAL
,
1282 IN PTHREAD_START_ROUTINE ThreadStartAddress
,
1283 IN PINITIAL_TEB InitialTeb
1287 PRTL_USER_PROCESS_PARAMETERS
1289 RtlNormalizeProcessParams(IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters
);
1294 RtlReleasePebLock(VOID
);
1297 * Environment/Path Functions
1302 RtlCreateEnvironment(
1310 RtlDestroyEnvironment(PWSTR Environment
);
1315 RtlDoesFileExists_U(PWSTR FileName
);
1320 RtlDetermineDosPathNameType_U(PCWSTR Path
);
1337 RtlDosPathNameToNtPathName_U(
1339 PUNICODE_STRING NtName
,
1341 PCURDIR CurrentDirectory
1347 RtlExpandEnvironmentStrings_U(
1349 PUNICODE_STRING Source
,
1350 PUNICODE_STRING Destination
,
1357 RtlGetCurrentDirectory_U(
1358 ULONG MaximumLength
,
1365 RtlGetFullPathName_U(
1366 const WCHAR
*dosname
,
1375 RtlIsNameLegalDOS8Dot3(
1376 IN PUNICODE_STRING UnicodeName
,
1377 IN PANSI_STRING AnsiName
,
1384 RtlQueryEnvironmentVariable_U(
1386 PUNICODE_STRING Name
,
1387 PUNICODE_STRING Value
1393 RtlSetCurrentDirectory_U(PUNICODE_STRING name
);
1398 RtlSetEnvironmentVariable(
1400 PUNICODE_STRING Name
,
1401 PUNICODE_STRING Value
1405 * Critical Section/Resource Functions
1410 RtlDeleteCriticalSection (
1411 IN PRTL_CRITICAL_SECTION CriticalSection
1417 RtlEnterCriticalSection(
1418 IN PRTL_CRITICAL_SECTION CriticalSection
1424 RtlInitializeCriticalSection(
1425 IN PRTL_CRITICAL_SECTION CriticalSection
1431 RtlInitializeCriticalSectionAndSpinCount(
1432 IN PRTL_CRITICAL_SECTION CriticalSection
,
1439 RtlLeaveCriticalSection(
1440 IN PRTL_CRITICAL_SECTION CriticalSection
1446 RtlpUnWaitCriticalSection(
1447 IN PRTL_CRITICAL_SECTION CriticalSection
1453 RtlpWaitForCriticalSection(
1454 IN PRTL_CRITICAL_SECTION CriticalSection
1460 RtlAcquireResourceExclusive(
1461 IN PRTL_RESOURCE Resource
,
1468 RtlAcquireResourceShared(
1469 IN PRTL_RESOURCE Resource
,
1476 RtlConvertExclusiveToShared(
1477 IN PRTL_RESOURCE Resource
1483 RtlConvertSharedToExclusive(
1484 IN PRTL_RESOURCE Resource
1491 IN PRTL_RESOURCE Resource
1498 IN PRTL_RESOURCE Resource
1504 RtlInitializeResource(
1505 IN PRTL_RESOURCE Resource
1512 IN PRTL_RESOURCE Resource
1516 * Compression Functions
1522 IN USHORT CompressionFormatAndEngine
,
1523 IN PUCHAR UncompressedBuffer
,
1524 IN ULONG UncompressedBufferSize
,
1525 OUT PUCHAR CompressedBuffer
,
1526 IN ULONG CompressedBufferSize
,
1527 IN ULONG UncompressedChunkSize
,
1528 OUT PULONG FinalCompressedSize
,
1535 RtlDecompressBuffer(
1536 IN USHORT CompressionFormat
,
1537 OUT PUCHAR UncompressedBuffer
,
1538 IN ULONG UncompressedBufferSize
,
1539 IN PUCHAR CompressedBuffer
,
1540 IN ULONG CompressedBufferSize
,
1541 OUT PULONG FinalUncompressedSize
1547 RtlGetCompressionWorkSpaceSize(
1548 IN USHORT CompressionFormatAndEngine
,
1549 OUT PULONG CompressBufferWorkSpaceSize
,
1550 OUT PULONG CompressFragmentWorkSpaceSize
1554 * Debug Info Functions
1559 RtlCreateQueryDebugBuffer(
1561 IN BOOLEAN EventPair
1567 RtlDestroyQueryDebugBuffer(IN PDEBUG_BUFFER DebugBuffer
);
1572 RtlQueryProcessDebugInformation(
1574 IN ULONG DebugInfoClassMask
,
1575 IN OUT PDEBUG_BUFFER DebugBuffer
1585 IN PRTL_BITMAP BitMapHeader
,
1586 IN ULONG StartingIndex
,
1594 IN PRTL_BITMAP BitMapHeader
,
1595 IN ULONG StartingIndex
,
1603 IN PRTL_BITMAP BitMapHeader
,
1604 IN ULONG StartingIndex
,
1605 IN ULONG NumberToClear
1612 IN PRTL_BITMAP BitMapHeader
,
1613 IN ULONG NumberToFind
,
1620 RtlFindClearBitsAndSet(
1621 IN PRTL_BITMAP BitMapHeader
,
1622 IN ULONG NumberToFind
,
1629 RtlInitializeBitMap(
1630 IN PRTL_BITMAP BitMapHeader
,
1631 IN PULONG BitMapBuffer
,
1632 IN ULONG SizeOfBitMap
1639 IN PRTL_BITMAP BitMapHeader
,
1640 IN ULONG StartingIndex
,
1641 IN ULONG NumberToSet
1653 WAITORTIMERCALLBACKFUNC Callback
,
1663 RtlCreateTimerQueue(PHANDLE TimerQueue
);
1671 HANDLE CompletionEvent
1687 RtlDeleteTimerQueueEx(
1689 HANDLE CompletionEvent
1695 RtlDeleteTimerQueue(HANDLE TimerQueue
);
1709 DbgBreakPoint(VOID
);
1712 * Handle Table Functions
1715 PRTL_HANDLE_TABLE_ENTRY
1718 IN PRTL_HANDLE_TABLE HandleTable
,
1725 RtlDestroyHandleTable(IN PRTL_HANDLE_TABLE HandleTable
);
1731 IN PRTL_HANDLE_TABLE HandleTable
,
1732 IN PRTL_HANDLE_TABLE_ENTRY Handle
1738 RtlInitializeHandleTable(
1740 IN ULONG HandleSize
,
1741 IN PRTL_HANDLE_TABLE HandleTable
1748 IN PRTL_HANDLE_TABLE HandleTable
,
1749 IN PRTL_HANDLE_TABLE_ENTRY Handle
1755 RtlIsValidIndexHandle(
1756 IN PRTL_HANDLE_TABLE HandleTable
,
1758 OUT PRTL_HANDLE_TABLE_ENTRY
*Handle
1768 IN PVOID BaseAddress
,
1772 OUT PRTL_MESSAGE_RESOURCE_ENTRY
*MessageResourceEntry
1778 RtlGetNtGlobalFlags(VOID
);
1783 RtlImageDirectoryEntryToData(
1794 PIMAGE_NT_HEADERS NtHeader
,
1797 PIMAGE_SECTION_HEADER
*SectionHeader
1803 RtlImageNtHeader(IN PVOID BaseAddress
);
1806 PIMAGE_SECTION_HEADER
1808 RtlImageRvaToSection(
1809 PIMAGE_NT_HEADERS NtHeader
,
1815 * Registry Functions
1820 RtlCheckRegistryKey(
1828 RtlFormatCurrentUserKeyPath(IN OUT PUNICODE_STRING KeyPath
);
1834 OUT HANDLE KeyHandle
,
1835 IN ACCESS_MASK DesiredAccess
,
1836 IN POBJECT_ATTRIBUTES ObjectAttributes
,
1844 IN ACCESS_MASK DesiredAccess
,
1845 OUT PHANDLE KeyHandle
1851 RtlQueryRegistryValues(
1852 IN ULONG RelativeTo
,
1854 IN PRTL_QUERY_REGISTRY_TABLE QueryTable
,
1856 IN PVOID Environment
1862 RtlWriteRegistryValue(
1878 IN PUSHORT AnsiTableBase
,
1879 IN PUSHORT OemTableBase
,
1880 IN PUSHORT CaseTableBase
,
1881 OUT PNLSTABLEINFO NlsTable
1887 RtlInitCodePageTable(
1888 IN PUSHORT TableBase
,
1889 OUT PCPTABLEINFO CodePageTable
1895 RtlResetRtlTranslations(IN PNLSTABLEINFO NlsTable
);
1898 * Misc conversion functions
1900 #if defined(NTOS_MODE_USER) && !defined(NO_RTL_INLINES)
1904 RtlConvertLongToLargeInteger(LONG SignedInteger
)
1906 LARGE_INTEGER Result
;
1908 Result
.QuadPart
= SignedInteger
;
1915 RtlEnlargedIntegerMultiply(
1919 LARGE_INTEGER Product
;
1921 Product
.QuadPart
= (LONGLONG
)Multiplicand
* (ULONGLONG
)Multiplier
;
1928 RtlEnlargedUnsignedDivide(
1929 IN ULARGE_INTEGER Dividend
,
1931 IN PULONG Remainder OPTIONAL
)
1935 Quotient
= (ULONG
)(Dividend
.QuadPart
/ Divisor
);
1937 *Remainder
= (ULONG
)(Dividend
.QuadPart
% Divisor
);
1946 RtlEnlargedUnsignedMultiply(
1950 LARGE_INTEGER Product
;
1952 Product
.QuadPart
= (ULONGLONG
)Multiplicand
* (ULONGLONG
)Multiplier
;
1960 RtlUniform(PULONG Seed
);
1968 RtlQueryTimeZoneInformation(LPTIME_ZONE_INFORMATION TimeZoneInformation
);
1973 RtlSecondsSince1970ToTime(
1974 IN ULONG SecondsSince1970
,
1975 OUT PLARGE_INTEGER Time
1981 RtlSetTimeZoneInformation(LPTIME_ZONE_INFORMATION TimeZoneInformation
);
1986 RtlTimeFieldsToTime(
1987 PTIME_FIELDS TimeFields
,
1994 RtlTimeToTimeFields(
1995 PLARGE_INTEGER Time
,
1996 PTIME_FIELDS TimeFields
2005 RtlVerifyVersionInfo(
2006 IN PRTL_OSVERSIONINFOEXW VersionInfo
,
2008 IN ULONGLONG ConditionMask
2014 RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation
);