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 **************************************************************/
15 /* PROTOTYPES ****************************************************************/
18 * Error and Exception Functions
23 RtlAddVectoredExceptionHandler(
24 IN ULONG FirstHandler
,
25 IN PVECTORED_EXCEPTION_HANDLER VectoredHandler
32 PVOID FailedAssertion
,
41 RtlEncodePointer(IN PVOID Pointer
);
46 RtlDecodePointer(IN PVOID Pointer
);
51 RtlNtStatusToDosError(IN NTSTATUS Status
);
56 RtlRaiseException(IN PEXCEPTION_RECORD ExceptionRecord
);
61 RtlRaiseStatus(NTSTATUS Status
);
66 RtlUnhandledExceptionFilter(struct _EXCEPTION_POINTERS
* ExceptionInfo
);
72 PEXCEPTION_REGISTRATION RegistrationFrame
,
74 PEXCEPTION_RECORD ExceptionRecord
,
96 IN PVOID BaseAddress OPTIONAL
,
97 IN SIZE_T SizeToReserve OPTIONAL
,
98 IN SIZE_T SizeToCommit OPTIONAL
,
99 IN PVOID Lock OPTIONAL
,
100 IN PRTL_HEAP_PARAMETERS Parameters OPTIONAL
113 RtlDestroyHeap(HANDLE hheap
);
119 IN HANDLE HeapHandle
,
142 RtlLockHeap(IN HANDLE Heap
);
146 RtlUnlockHeap(IN HANDLE Heap
);
153 IN PVOID MemoryPointer
164 #define RtlGetProcessHeap() (NtCurrentPeb()->ProcessHeap)
173 RtlAbsoluteToSelfRelativeSD(
174 IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor
,
175 IN OUT PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor
,
176 IN PULONG BufferLength
182 RtlAddAccessAllowedAce(
185 ACCESS_MASK AccessMask
,
191 RtlAddAccessAllowedAceEx(
193 IN ULONG dwAceRevision
,
201 RtlAddAccessDeniedAce(
204 ACCESS_MASK AccessMask
,
210 RtlAddAccessDeniedAceEx(
214 IN ACCESS_MASK AccessMask
,
220 RtlAddAuditAccessAceEx(
224 IN ACCESS_MASK AccessMask
,
236 ULONG StartingAceIndex
,
243 RtlAddAuditAccessAce(
246 ACCESS_MASK AccessMask
,
257 IN BOOLEAN ForThread
,
258 OUT PBOOLEAN OldValue
264 RtlAllocateAndInitializeSid(
265 IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority
,
266 IN UCHAR SubAuthorityCount
,
267 IN ULONG SubAuthority0
,
268 IN ULONG SubAuthority1
,
269 IN ULONG SubAuthority2
,
270 IN ULONG SubAuthority3
,
271 IN ULONG SubAuthority4
,
272 IN ULONG SubAuthority5
,
273 IN ULONG SubAuthority6
,
274 IN ULONG SubAuthority7
,
280 RtlAreAllAccessesGranted(
281 ACCESS_MASK GrantedAccess
,
282 ACCESS_MASK DesiredAccess
287 RtlAreAnyAccessesGranted(
288 ACCESS_MASK GrantedAccess
,
289 ACCESS_MASK DesiredAccess
302 RtlCopyLuidAndAttributesArray(
304 PLUID_AND_ATTRIBUTES Src
,
305 PLUID_AND_ATTRIBUTES Dest
310 RtlCopySidAndAttributesArray(
312 PSID_AND_ATTRIBUTES Src
,
314 PSID_AND_ATTRIBUTES Dest
,
316 PVOID
* RemainingSidArea
,
317 PULONG RemainingSidAreaSize
322 RtlConvertSidToUnicodeString(
323 OUT PUNICODE_STRING DestinationString
,
325 IN BOOLEAN AllocateDestinationString
349 RtlCreateSecurityDescriptor(
350 PSECURITY_DESCRIPTOR SecurityDescriptor
,
357 RtlCreateSecurityDescriptorRelative(
358 PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor
,
411 RtlGetControlSecurityDescriptor(
412 PSECURITY_DESCRIPTOR SecurityDescriptor
,
413 PSECURITY_DESCRIPTOR_CONTROL Control
,
420 RtlGetDaclSecurityDescriptor(
421 IN PSECURITY_DESCRIPTOR SecurityDescriptor
,
422 OUT PBOOLEAN DaclPresent
,
424 OUT PBOOLEAN DaclDefaulted
430 RtlGetSaclSecurityDescriptor(
431 PSECURITY_DESCRIPTOR SecurityDescriptor
,
432 PBOOLEAN SaclPresent
,
434 PBOOLEAN SaclDefaulted
440 RtlGetGroupSecurityDescriptor(
441 IN PSECURITY_DESCRIPTOR SecurityDescriptor
,
443 OUT PBOOLEAN GroupDefaulted
449 RtlGetOwnerSecurityDescriptor(
450 IN PSECURITY_DESCRIPTOR SecurityDescriptor
,
452 OUT PBOOLEAN OwnerDefaulted
458 RtlGetSecurityDescriptorRMControl(
459 PSECURITY_DESCRIPTOR SecurityDescriptor
,
464 PSID_IDENTIFIER_AUTHORITY
466 RtlIdentifierAuthoritySid(PSID Sid
);
471 RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
);
478 IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority
,
479 IN UCHAR SubAuthorityCount
485 RtlLengthRequiredSid(IN ULONG SubAuthorityCount
);
490 RtlLengthSid(IN PSID Sid
);
496 PACCESS_MASK AccessMask
,
497 PGENERIC_MAPPING GenericMapping
503 RtlQueryInformationAcl(
506 ULONG InformationLength
,
507 ACL_INFORMATION_CLASS InformationClass
513 RtlSelfRelativeToAbsoluteSD(
514 IN PSECURITY_DESCRIPTOR SelfRelativeSD
,
515 OUT PSECURITY_DESCRIPTOR AbsoluteSD
,
516 IN PULONG AbsoluteSDSize
,
523 IN PSID PrimaryGroup
,
524 IN PULONG PrimaryGroupSize
530 RtlSetControlSecurityDescriptor(
531 IN PSECURITY_DESCRIPTOR SecurityDescriptor
,
532 IN SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest
,
533 IN SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet
539 RtlSetDaclSecurityDescriptor (
540 PSECURITY_DESCRIPTOR SecurityDescriptor
,
543 BOOLEAN DaclDefaulted
549 RtlSetGroupSecurityDescriptor(
550 IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor
,
552 IN BOOLEAN GroupDefaulted
558 RtlSetInformationAcl(
561 ULONG InformationLength
,
562 ACL_INFORMATION_CLASS InformationClass
568 RtlSetOwnerSecurityDescriptor(
569 IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor
,
571 IN BOOLEAN OwnerDefaulted
577 RtlSetSaclSecurityDescriptor(
578 IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor
,
579 IN BOOLEAN SaclPresent
,
581 IN BOOLEAN SaclDefaulted
587 RtlSetSecurityDescriptorRMControl(
588 PSECURITY_DESCRIPTOR SecurityDescriptor
,
595 RtlSubAuthorityCountSid(
604 IN ULONG SubAuthority
610 RtlValidRelativeSecurityDescriptor(
611 IN PSECURITY_DESCRIPTOR SecurityDescriptorInput
,
612 IN ULONG SecurityDescriptorLength
,
613 IN SECURITY_INFORMATION RequiredInformation
619 RtlValidSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor
);
624 RtlValidSid(IN PSID Sid
);
629 RtlValidAcl(PACL Acl
);
634 RtlDeleteSecurityObject(
635 IN PSECURITY_DESCRIPTOR
*ObjectDescriptor
641 RtlNewSecurityObject(
642 IN PSECURITY_DESCRIPTOR ParentDescriptor
,
643 IN PSECURITY_DESCRIPTOR CreatorDescriptor
,
644 OUT PSECURITY_DESCRIPTOR
*NewDescriptor
,
645 IN BOOLEAN IsDirectoryObject
,
647 IN PGENERIC_MAPPING GenericMapping
653 RtlQuerySecurityObject(
654 IN PSECURITY_DESCRIPTOR ObjectDescriptor
,
655 IN SECURITY_INFORMATION SecurityInformation
,
656 OUT PSECURITY_DESCRIPTOR ResultantDescriptor
,
657 IN ULONG DescriptorLength
,
658 OUT PULONG ReturnLength
664 RtlSetSecurityObject(
665 IN SECURITY_INFORMATION SecurityInformation
,
666 IN PSECURITY_DESCRIPTOR ModificationDescriptor
,
667 OUT PSECURITY_DESCRIPTOR
*ObjectsSecurityDescriptor
,
668 IN PGENERIC_MAPPING GenericMapping
,
673 * Single-Character Functions
678 RtlLargeIntegerToChar(
679 IN PLARGE_INTEGER Value
,
688 RtlUpperChar(CHAR Source
);
693 RtlUpcaseUnicodeChar(WCHAR Source
);
698 RtlDowncaseUnicodeChar(IN WCHAR Source
);
715 IN ULONG Base OPTIONAL
,
716 IN ULONG Length OPTIONAL
,
723 RtlIntegerToUnicodeString(
726 IN OUT PUNICODE_STRING String
738 #if (defined(_M_IX86) && (_MSC_FULL_VER > 13009037)) || ((defined(_M_AMD64) || defined(_M_IA64)) && (_MSC_FULL_VER > 13009175))
739 unsigned short __cdecl
_byteswap_ushort(unsigned short);
740 unsigned long __cdecl
_byteswap_ulong (unsigned long);
741 unsigned __int64 __cdecl
_byteswap_uint64(unsigned __int64
);
742 #pragma intrinsic(_byteswap_ushort)
743 #pragma intrinsic(_byteswap_ulong)
744 #pragma intrinsic(_byteswap_uint64)
745 #define RtlUshortByteSwap(_x) _byteswap_ushort((USHORT)(_x))
746 #define RtlUlongByteSwap(_x) _byteswap_ulong((_x))
747 #define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x))
752 RtlUshortByteSwap(IN USHORT Source
);
756 RtlUlongByteSwap(IN ULONG Source
);
760 RtlUlonglongByteSwap(IN ULONGLONG Source
);
765 * Unicode->Ansi String Functions
770 RtlxUnicodeStringToAnsiSize(IN PCUNICODE_STRING UnicodeString
);
772 #ifdef NTOS_MODE_USER
773 #define RtlUnicodeStringToAnsiSize(STRING) ( \
774 NLS_MB_CODE_PAGE_TAG ? \
775 RtlxUnicodeStringToAnsiSize(STRING) : \
776 ((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \
783 RtlUnicodeStringToAnsiString(
784 PANSI_STRING DestinationString
,
785 PCUNICODE_STRING SourceString
,
786 BOOLEAN AllocateDestinationString
790 * Unicode->OEM String Functions
795 RtlUpcaseUnicodeStringToOemString(
796 POEM_STRING DestinationString
,
797 PCUNICODE_STRING SourceString
,
798 BOOLEAN AllocateDestinationString
804 RtlUpcaseUnicodeStringToCountedOemString(
805 IN OUT POEM_STRING DestinationString
,
806 IN PCUNICODE_STRING SourceString
,
807 IN BOOLEAN AllocateDestinationString
813 RtlUnicodeStringToOemString(
814 POEM_STRING DestinationString
,
815 PCUNICODE_STRING SourceString
,
816 BOOLEAN AllocateDestinationString
822 RtlUpcaseUnicodeToOemN(
826 PWCHAR UnicodeString
,
833 RtlxUnicodeStringToOemSize(IN PCUNICODE_STRING UnicodeString
);
835 #ifdef NTOS_MODE_USER
836 #define RtlUnicodeStringToOemSize(STRING) ( \
837 NLS_MB_OEM_CODE_PAGE_TAG ? \
838 RtlxUnicodeStringToOemSize(STRING) : \
839 ((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \
841 #define RtlUnicodeStringToCountedOemSize(STRING) ( \
842 (ULONG)(RtlUnicodeStringToOemSize(STRING) - sizeof(ANSI_NULL)) \
853 PWCHAR UnicodeString
,
858 * Unicode->MultiByte String Functions
863 RtlUnicodeToMultiByteN(
867 PWCHAR UnicodeString
,
874 RtlUpcaseUnicodeToMultiByteN(
878 PWCHAR UnicodeString
,
885 RtlUnicodeToMultiByteSize(
887 PWCHAR UnicodeString
,
894 RtlxOemStringToUnicodeSize(IN PCOEM_STRING OemString
);
897 * OEM to Unicode Functions
899 #ifdef NTOS_MODE_USER
900 #define RtlOemStringToUnicodeSize(STRING) ( \
901 NLS_MB_OEM_CODE_PAGE_TAG ? \
902 RtlxOemStringToUnicodeSize(STRING) : \
903 ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \
905 #define RtlOemStringToCountedUnicodeSize(STRING) ( \
906 (ULONG)(RtlOemStringToUnicodeSize(STRING) - sizeof(UNICODE_NULL)) \
913 RtlOemStringToUnicodeString(
914 PUNICODE_STRING DestinationString
,
915 PCOEM_STRING SourceString
,
916 BOOLEAN AllocateDestinationString
924 ULONG MaxBytesInUnicodeString
,
925 PULONG BytesInUnicodeString
,
927 ULONG BytesInOemString
931 * Ansi->Unicode String Functions
936 RtlAnsiStringToUnicodeString(
937 PUNICODE_STRING DestinationString
,
938 PCANSI_STRING SourceString
,
939 BOOLEAN AllocateDestinationString
942 #ifdef NTOS_MODE_USER
943 #define RtlAnsiStringToUnicodeSize(STRING) ( \
944 NLS_MB_CODE_PAGE_TAG ? \
945 RtlxAnsiStringToUnicodeSize(STRING) : \
946 ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \
953 RtlCreateUnicodeStringFromAsciiz(
954 OUT PUNICODE_STRING Destination
,
959 * Unicode String Functions
964 RtlAppendUnicodeToString(
965 PUNICODE_STRING Destination
,
972 RtlAppendUnicodeStringToString(
973 PUNICODE_STRING Destination
,
974 PCUNICODE_STRING Source
980 RtlCompareUnicodeString(
981 PCUNICODE_STRING String1
,
982 PCUNICODE_STRING String2
,
983 BOOLEAN CaseInsensitive
989 RtlCopyUnicodeString(
990 PUNICODE_STRING DestinationString
,
991 PCUNICODE_STRING SourceString
997 RtlCreateUnicodeString(
998 PUNICODE_STRING DestinationString
,
1002 #ifdef NTOS_MODE_USER
1006 RtlDowncaseUnicodeString(
1007 IN OUT PUNICODE_STRING UniDest
,
1008 IN PCUNICODE_STRING UniSource
,
1009 IN BOOLEAN AllocateDestinationString
1016 RtlDuplicateUnicodeString(
1018 IN PCUNICODE_STRING SourceString
,
1019 OUT PUNICODE_STRING DestinationString
1025 RtlEqualUnicodeString(
1026 PCUNICODE_STRING String1
,
1027 PCUNICODE_STRING String2
,
1028 BOOLEAN CaseInsensitive
1034 RtlFreeUnicodeString(IN PUNICODE_STRING UnicodeString
);
1039 RtlHashUnicodeString(
1040 IN CONST UNICODE_STRING
*String
,
1041 IN BOOLEAN CaseInSensitive
,
1042 IN ULONG HashAlgorithm
,
1043 OUT PULONG HashValue
1049 RtlInitUnicodeString(
1050 IN OUT PUNICODE_STRING DestinationString
,
1051 IN PCWSTR SourceString
);
1065 RtlPrefixUnicodeString(
1066 PCUNICODE_STRING String1
,
1067 PCUNICODE_STRING String2
,
1068 BOOLEAN CaseInsensitive
1074 RtlUpcaseUnicodeString(
1075 PUNICODE_STRING DestinationString
,
1076 PCUNICODE_STRING SourceString
,
1077 BOOLEAN AllocateDestinationString
1083 RtlUnicodeStringToInteger(
1084 PCUNICODE_STRING String
,
1090 * Ansi String Functions
1095 RtlFreeAnsiString(IN PANSI_STRING AnsiString
);
1101 PANSI_STRING DestinationString
,
1106 * OEM String Functions
1111 RtlFreeOemString(IN POEM_STRING OemString
);
1114 * MultiByte->Unicode String Functions
1119 RtlMultiByteToUnicodeN(
1120 PWCHAR UnicodeString
,
1130 RtlMultiByteToUnicodeSize(
1142 RtlAddAtomToAtomTable(
1143 IN PRTL_ATOM_TABLE AtomTable
,
1153 IN OUT PRTL_ATOM_TABLE
*AtomTable
1159 RtlDeleteAtomFromAtomTable(
1160 IN PRTL_ATOM_TABLE AtomTable
,
1167 RtlDestroyAtomTable(IN PRTL_ATOM_TABLE AtomTable
);
1172 RtlQueryAtomInAtomTable(
1173 IN PRTL_ATOM_TABLE AtomTable
,
1175 IN OUT PULONG RefCount OPTIONAL
,
1176 IN OUT PULONG PinCount OPTIONAL
,
1177 IN OUT PWSTR AtomName OPTIONAL
,
1178 IN OUT PULONG NameLength OPTIONAL
1184 RtlLookupAtomInAtomTable(
1185 IN PRTL_ATOM_TABLE AtomTable
,
1197 IN PVOID Destination
,
1203 * Process Management Functions
1208 RtlAcquirePebLock(VOID
);
1213 RtlCreateProcessParameters (
1214 OUT PRTL_USER_PROCESS_PARAMETERS
*ProcessParameters
,
1215 IN PUNICODE_STRING ImagePathName OPTIONAL
,
1216 IN PUNICODE_STRING DllPath OPTIONAL
,
1217 IN PUNICODE_STRING CurrentDirectory OPTIONAL
,
1218 IN PUNICODE_STRING CommandLine OPTIONAL
,
1219 IN PWSTR Environment OPTIONAL
,
1220 IN PUNICODE_STRING WindowTitle OPTIONAL
,
1221 IN PUNICODE_STRING DesktopInfo OPTIONAL
,
1222 IN PUNICODE_STRING ShellInfo OPTIONAL
,
1223 IN PUNICODE_STRING RuntimeInfo OPTIONAL
1229 RtlCreateUserProcess(
1230 IN PUNICODE_STRING ImageFileName
,
1231 IN ULONG Attributes
,
1232 IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters
,
1233 IN PSECURITY_DESCRIPTOR ProcessSecutityDescriptor OPTIONAL
,
1234 IN PSECURITY_DESCRIPTOR ThreadSecurityDescriptor OPTIONAL
,
1235 IN HANDLE ParentProcess OPTIONAL
,
1236 IN BOOLEAN CurrentDirectory
,
1237 IN HANDLE DebugPort OPTIONAL
,
1238 IN HANDLE ExceptionPort OPTIONAL
,
1239 OUT PRTL_USER_PROCESS_INFORMATION ProcessInfo
1245 RtlCreateUserThread(
1246 IN HANDLE ProcessHandle
,
1247 IN PSECURITY_DESCRIPTOR SecurityDescriptor
,
1248 IN BOOLEAN CreateSuspended
,
1249 IN LONG StackZeroBits
,
1250 IN ULONG StackReserve
,
1251 IN ULONG StackCommit
,
1252 IN PTHREAD_START_ROUTINE StartAddress
,
1254 IN OUT PHANDLE ThreadHandle
,
1255 IN OUT PCLIENT_ID ClientId
1259 PRTL_USER_PROCESS_PARAMETERS
1261 RtlDeNormalizeProcessParams(IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters
);
1266 RtlDestroyProcessParameters(IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters
);
1271 RtlExitUserThread(NTSTATUS Status
);
1276 RtlInitializeContext(
1277 IN HANDLE ProcessHandle
,
1278 OUT PCONTEXT ThreadContext
,
1279 IN PVOID ThreadStartParam OPTIONAL
,
1280 IN PTHREAD_START_ROUTINE ThreadStartAddress
,
1281 IN PINITIAL_TEB InitialTeb
1285 PRTL_USER_PROCESS_PARAMETERS
1287 RtlNormalizeProcessParams(IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters
);
1292 RtlReleasePebLock(VOID
);
1295 * Environment/Path Functions
1300 RtlCreateEnvironment(
1308 RtlDestroyEnvironment(PWSTR Environment
);
1313 RtlDoesFileExists_U(PWSTR FileName
);
1318 RtlDetermineDosPathNameType_U(PCWSTR Path
);
1335 RtlDosPathNameToNtPathName_U(
1337 PUNICODE_STRING NtName
,
1339 PCURDIR CurrentDirectory
1345 RtlExpandEnvironmentStrings_U(
1347 PUNICODE_STRING Source
,
1348 PUNICODE_STRING Destination
,
1355 RtlGetCurrentDirectory_U(
1356 ULONG MaximumLength
,
1363 RtlGetFullPathName_U(
1364 const WCHAR
*dosname
,
1373 RtlIsNameLegalDOS8Dot3(
1374 IN PUNICODE_STRING UnicodeName
,
1375 IN PANSI_STRING AnsiName
,
1382 RtlQueryEnvironmentVariable_U(
1384 PUNICODE_STRING Name
,
1385 PUNICODE_STRING Value
1391 RtlSetCurrentDirectory_U(PUNICODE_STRING name
);
1396 RtlSetEnvironmentVariable(
1398 PUNICODE_STRING Name
,
1399 PUNICODE_STRING Value
1403 * Critical Section/Resource Functions
1408 RtlDeleteCriticalSection (
1409 IN PRTL_CRITICAL_SECTION CriticalSection
1415 RtlEnterCriticalSection(
1416 IN PRTL_CRITICAL_SECTION CriticalSection
1422 RtlInitializeCriticalSection(
1423 IN PRTL_CRITICAL_SECTION CriticalSection
1429 RtlInitializeCriticalSectionAndSpinCount(
1430 IN PRTL_CRITICAL_SECTION CriticalSection
,
1437 RtlLeaveCriticalSection(
1438 IN PRTL_CRITICAL_SECTION CriticalSection
1444 RtlpUnWaitCriticalSection(
1445 IN PRTL_CRITICAL_SECTION CriticalSection
1451 RtlpWaitForCriticalSection(
1452 IN PRTL_CRITICAL_SECTION CriticalSection
1458 RtlAcquireResourceExclusive(
1459 IN PRTL_RESOURCE Resource
,
1466 RtlAcquireResourceShared(
1467 IN PRTL_RESOURCE Resource
,
1474 RtlConvertExclusiveToShared(
1475 IN PRTL_RESOURCE Resource
1481 RtlConvertSharedToExclusive(
1482 IN PRTL_RESOURCE Resource
1489 IN PRTL_RESOURCE Resource
1496 IN PRTL_RESOURCE Resource
1502 RtlInitializeResource(
1503 IN PRTL_RESOURCE Resource
1510 IN PRTL_RESOURCE Resource
1514 * Compression Functions
1520 IN USHORT CompressionFormatAndEngine
,
1521 IN PUCHAR UncompressedBuffer
,
1522 IN ULONG UncompressedBufferSize
,
1523 OUT PUCHAR CompressedBuffer
,
1524 IN ULONG CompressedBufferSize
,
1525 IN ULONG UncompressedChunkSize
,
1526 OUT PULONG FinalCompressedSize
,
1533 RtlDecompressBuffer(
1534 IN USHORT CompressionFormat
,
1535 OUT PUCHAR UncompressedBuffer
,
1536 IN ULONG UncompressedBufferSize
,
1537 IN PUCHAR CompressedBuffer
,
1538 IN ULONG CompressedBufferSize
,
1539 OUT PULONG FinalUncompressedSize
1545 RtlGetCompressionWorkSpaceSize(
1546 IN USHORT CompressionFormatAndEngine
,
1547 OUT PULONG CompressBufferWorkSpaceSize
,
1548 OUT PULONG CompressFragmentWorkSpaceSize
1552 * Debug Info Functions
1557 RtlCreateQueryDebugBuffer(
1559 IN BOOLEAN EventPair
1565 RtlDestroyQueryDebugBuffer(IN PDEBUG_BUFFER DebugBuffer
);
1570 RtlQueryProcessDebugInformation(
1572 IN ULONG DebugInfoClassMask
,
1573 IN OUT PDEBUG_BUFFER DebugBuffer
1583 IN PRTL_BITMAP BitMapHeader
,
1584 IN ULONG StartingIndex
,
1592 IN PRTL_BITMAP BitMapHeader
,
1593 IN ULONG StartingIndex
,
1601 IN PRTL_BITMAP BitMapHeader
,
1602 IN ULONG StartingIndex
,
1603 IN ULONG NumberToClear
1610 IN PRTL_BITMAP BitMapHeader
,
1611 IN ULONG NumberToFind
,
1618 RtlFindClearBitsAndSet(
1619 IN PRTL_BITMAP BitMapHeader
,
1620 IN ULONG NumberToFind
,
1627 RtlInitializeBitMap(
1628 IN PRTL_BITMAP BitMapHeader
,
1629 IN PULONG BitMapBuffer
,
1630 IN ULONG SizeOfBitMap
1637 IN PRTL_BITMAP BitMapHeader
,
1638 IN ULONG StartingIndex
,
1639 IN ULONG NumberToSet
1651 WAITORTIMERCALLBACKFUNC Callback
,
1661 RtlCreateTimerQueue(PHANDLE TimerQueue
);
1669 HANDLE CompletionEvent
1685 RtlDeleteTimerQueueEx(
1687 HANDLE CompletionEvent
1693 RtlDeleteTimerQueue(HANDLE TimerQueue
);
1707 DbgBreakPoint(VOID
);
1710 * Handle Table Functions
1713 PRTL_HANDLE_TABLE_ENTRY
1716 IN PRTL_HANDLE_TABLE HandleTable
,
1723 RtlDestroyHandleTable(IN PRTL_HANDLE_TABLE HandleTable
);
1729 IN PRTL_HANDLE_TABLE HandleTable
,
1730 IN PRTL_HANDLE_TABLE_ENTRY Handle
1736 RtlInitializeHandleTable(
1738 IN ULONG HandleSize
,
1739 IN PRTL_HANDLE_TABLE HandleTable
1746 IN PRTL_HANDLE_TABLE HandleTable
,
1747 IN PRTL_HANDLE_TABLE_ENTRY Handle
1753 RtlIsValidIndexHandle(
1754 IN PRTL_HANDLE_TABLE HandleTable
,
1756 OUT PRTL_HANDLE_TABLE_ENTRY
*Handle
1766 IN PVOID BaseAddress
,
1770 OUT PRTL_MESSAGE_RESOURCE_ENTRY
*MessageResourceEntry
1776 RtlGetNtGlobalFlags(VOID
);
1781 RtlImageDirectoryEntryToData(
1792 PIMAGE_NT_HEADERS NtHeader
,
1795 PIMAGE_SECTION_HEADER
*SectionHeader
1801 RtlImageNtHeader(IN PVOID BaseAddress
);
1804 PIMAGE_SECTION_HEADER
1806 RtlImageRvaToSection(
1807 PIMAGE_NT_HEADERS NtHeader
,
1813 * Registry Functions
1818 RtlCheckRegistryKey(
1826 RtlFormatCurrentUserKeyPath(IN OUT PUNICODE_STRING KeyPath
);
1832 OUT HANDLE KeyHandle
,
1833 IN ACCESS_MASK DesiredAccess
,
1834 IN POBJECT_ATTRIBUTES ObjectAttributes
,
1842 IN ACCESS_MASK DesiredAccess
,
1843 OUT PHANDLE KeyHandle
1849 RtlQueryRegistryValues(
1850 IN ULONG RelativeTo
,
1852 IN PRTL_QUERY_REGISTRY_TABLE QueryTable
,
1854 IN PVOID Environment
1860 RtlWriteRegistryValue(
1876 IN PUSHORT AnsiTableBase
,
1877 IN PUSHORT OemTableBase
,
1878 IN PUSHORT CaseTableBase
,
1879 OUT PNLSTABLEINFO NlsTable
1885 RtlInitCodePageTable(
1886 IN PUSHORT TableBase
,
1887 OUT PCPTABLEINFO CodePageTable
1893 RtlResetRtlTranslations(IN PNLSTABLEINFO NlsTable
);
1896 * Misc conversion functions
1898 #if defined(NTOS_MODE_USER) && !defined(NO_RTL_INLINES)
1902 RtlConvertLongToLargeInteger(LONG SignedInteger
)
1904 LARGE_INTEGER Result
;
1906 Result
.QuadPart
= SignedInteger
;
1913 RtlEnlargedIntegerMultiply(
1917 LARGE_INTEGER Product
;
1919 Product
.QuadPart
= (LONGLONG
)Multiplicand
* (ULONGLONG
)Multiplier
;
1926 RtlEnlargedUnsignedDivide(
1927 IN ULARGE_INTEGER Dividend
,
1929 IN PULONG Remainder OPTIONAL
)
1933 Quotient
= (ULONG
)(Dividend
.QuadPart
/ Divisor
);
1935 *Remainder
= (ULONG
)(Dividend
.QuadPart
% Divisor
);
1944 RtlEnlargedUnsignedMultiply(
1948 LARGE_INTEGER Product
;
1950 Product
.QuadPart
= (ULONGLONG
)Multiplicand
* (ULONGLONG
)Multiplier
;
1958 RtlUniform(PULONG Seed
);
1966 RtlQueryTimeZoneInformation(LPTIME_ZONE_INFORMATION TimeZoneInformation
);
1971 RtlSecondsSince1970ToTime(
1972 IN ULONG SecondsSince1970
,
1973 OUT PLARGE_INTEGER Time
1979 RtlSetTimeZoneInformation(LPTIME_ZONE_INFORMATION TimeZoneInformation
);
1984 RtlTimeFieldsToTime(
1985 PTIME_FIELDS TimeFields
,
1992 RtlTimeToTimeFields(
1993 PLARGE_INTEGER Time
,
1994 PTIME_FIELDS TimeFields
2003 RtlVerifyVersionInfo(
2004 IN PRTL_OSVERSIONINFOEXW VersionInfo
,
2006 IN ULONGLONG ConditionMask
2012 RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation
);