3 Copyright (c) Alex Ionescu. All rights reserved.
11 Function definitions for the Run-Time Library
15 Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
45 _Out_ PLIST_ENTRY ListHead
48 ListHead
->Flink
= ListHead
->Blink
= ListHead
;
54 _Inout_ PLIST_ENTRY ListHead
,
55 _Inout_ PLIST_ENTRY Entry
59 OldFlink
= ListHead
->Flink
;
60 Entry
->Flink
= OldFlink
;
61 Entry
->Blink
= ListHead
;
62 OldFlink
->Blink
= Entry
;
63 ListHead
->Flink
= Entry
;
69 _Inout_ PLIST_ENTRY ListHead
,
70 _Inout_ PLIST_ENTRY Entry
74 OldBlink
= ListHead
->Blink
;
75 Entry
->Flink
= ListHead
;
76 Entry
->Blink
= OldBlink
;
77 OldBlink
->Flink
= Entry
;
78 ListHead
->Blink
= Entry
;
85 _In_
const LIST_ENTRY
* ListHead
88 return (BOOLEAN
)(ListHead
->Flink
== ListHead
);
94 _Inout_ PSINGLE_LIST_ENTRY ListHead
97 PSINGLE_LIST_ENTRY FirstEntry
;
98 FirstEntry
= ListHead
->Next
;
99 if (FirstEntry
!= NULL
) {
100 ListHead
->Next
= FirstEntry
->Next
;
109 _Inout_ PSINGLE_LIST_ENTRY ListHead
,
110 _Inout_ PSINGLE_LIST_ENTRY Entry
113 Entry
->Next
= ListHead
->Next
;
114 ListHead
->Next
= Entry
;
120 _In_ PLIST_ENTRY Entry
)
122 PLIST_ENTRY OldFlink
;
123 PLIST_ENTRY OldBlink
;
125 OldFlink
= Entry
->Flink
;
126 OldBlink
= Entry
->Blink
;
127 OldFlink
->Blink
= OldBlink
;
128 OldBlink
->Flink
= OldFlink
;
129 return (BOOLEAN
)(OldFlink
== OldBlink
);
135 _Inout_ PLIST_ENTRY ListHead
)
140 Entry
= ListHead
->Flink
;
141 Flink
= Entry
->Flink
;
142 ListHead
->Flink
= Flink
;
143 Flink
->Blink
= ListHead
;
150 _Inout_ PLIST_ENTRY ListHead
)
155 Entry
= ListHead
->Blink
;
156 Blink
= Entry
->Blink
;
157 ListHead
->Blink
= Blink
;
158 Blink
->Flink
= ListHead
;
163 // Unicode string macros
165 _At_(UnicodeString
->Buffer
, _Post_equal_to_(Buffer
))
166 _At_(UnicodeString
->Length
, _Post_equal_to_(0))
167 _At_(UnicodeString
->MaximumLength
, _Post_equal_to_(BufferSize
))
170 RtlInitEmptyUnicodeString(
171 _Out_ PUNICODE_STRING UnicodeString
,
172 _When_(BufferSize
!= 0, _Notnull_
) _Writable_bytes_(BufferSize
) __drv_aliasesMem PWCHAR Buffer
,
173 _In_ USHORT BufferSize
)
175 UnicodeString
->Length
= 0;
176 UnicodeString
->MaximumLength
= BufferSize
;
177 UnicodeString
->Buffer
= Buffer
;
180 _At_(AnsiString
->Buffer
, _Post_equal_to_(Buffer
))
181 _At_(AnsiString
->Length
, _Post_equal_to_(0))
182 _At_(AnsiString
->MaximumLength
, _Post_equal_to_(BufferSize
))
185 RtlInitEmptyAnsiString(
186 _Out_ PANSI_STRING AnsiString
,
187 _When_(BufferSize
!= 0, _Notnull_
) _Writable_bytes_(BufferSize
) __drv_aliasesMem PCHAR Buffer
,
188 _In_ USHORT BufferSize
)
190 AnsiString
->Length
= 0;
191 AnsiString
->MaximumLength
= BufferSize
;
192 AnsiString
->Buffer
= Buffer
;
198 #define RtlEqualLuid(L1, L2) (((L1)->HighPart == (L2)->HighPart) && \
199 ((L1)->LowPart == (L2)->LowPart))
203 RtlConvertUlongToLuid(
208 TempLuid
.LowPart
= Ulong
;
209 TempLuid
.HighPart
= 0;
219 #define ASSERT( exp ) \
221 (RtlAssert( (PVOID)#exp, (PVOID)__FILE__, __LINE__, NULL ),FALSE) : \
224 #define ASSERTMSG( msg, exp ) \
226 (RtlAssert( (PVOID)#exp, (PVOID)__FILE__, __LINE__, (PCHAR)msg ),FALSE) : \
231 #define ASSERT( exp ) ((void) 0)
232 #define ASSERTMSG( msg, exp ) ((void) 0)
237 #ifdef NTOS_KERNEL_RUNTIME
240 // Executing RTL functions at DISPATCH_LEVEL or higher will result in a
243 #define RTL_PAGED_CODE PAGED_CODE
248 // This macro does nothing in user mode
250 #define RTL_PAGED_CODE NOP_FUNCTION
255 // RTL Splay Tree Functions
257 #ifndef RTL_USE_AVL_TABLES
262 RtlInitializeGenericTable(
263 _Out_ PRTL_GENERIC_TABLE Table
,
264 _In_ PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine
,
265 _In_opt_ PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine
,
266 _In_opt_ PRTL_GENERIC_FREE_ROUTINE FreeRoutine
,
267 _In_opt_ PVOID TableContext
273 RtlInsertElementGenericTable(
274 _In_ PRTL_GENERIC_TABLE Table
,
275 _In_reads_bytes_(BufferSize
) PVOID Buffer
,
276 _In_ CLONG BufferSize
,
277 _Out_opt_ PBOOLEAN NewElement
283 RtlInsertElementGenericTableFull(
284 _In_ PRTL_GENERIC_TABLE Table
,
285 _In_reads_bytes_(BufferSize
) PVOID Buffer
,
286 _In_ CLONG BufferSize
,
287 _Out_opt_ PBOOLEAN NewElement
,
288 _In_ PVOID NodeOrParent
,
289 _In_ TABLE_SEARCH_RESULT SearchResult
295 RtlDeleteElementGenericTable(
296 _In_ PRTL_GENERIC_TABLE Table
,
300 _Must_inspect_result_
304 RtlLookupElementGenericTable(
305 _In_ PRTL_GENERIC_TABLE Table
,
312 RtlLookupElementGenericTableFull(
313 _In_ PRTL_GENERIC_TABLE Table
,
315 _Out_ PVOID
*NodeOrParent
,
316 _Out_ TABLE_SEARCH_RESULT
*SearchResult
319 _Must_inspect_result_
323 RtlEnumerateGenericTable(
324 _In_ PRTL_GENERIC_TABLE Table
,
328 _Must_inspect_result_
332 RtlEnumerateGenericTableWithoutSplaying(
333 _In_ PRTL_GENERIC_TABLE Table
,
334 _Inout_ PVOID
*RestartKey
337 _Must_inspect_result_
341 RtlGetElementGenericTable(
342 _In_ PRTL_GENERIC_TABLE Table
,
349 RtlNumberGenericTableElements(
350 _In_ PRTL_GENERIC_TABLE Table
353 _Must_inspect_result_
357 RtlIsGenericTableEmpty(
358 _In_ PRTL_GENERIC_TABLE Table
361 #endif /* !RTL_USE_AVL_TABLES */
367 _Inout_ PRTL_SPLAY_LINKS Links
374 _In_ PRTL_SPLAY_LINKS Links
381 _In_ PRTL_SPLAY_LINKS Links
,
382 _Inout_ PRTL_SPLAY_LINKS
*Root
385 _Must_inspect_result_
390 _In_ PRTL_SPLAY_LINKS Links
393 _Must_inspect_result_
397 RtlSubtreePredecessor(
398 _In_ PRTL_SPLAY_LINKS Links
401 _Must_inspect_result_
406 _In_ PRTL_SPLAY_LINKS Links
409 _Must_inspect_result_
414 _In_ PRTL_SPLAY_LINKS Links
417 #define RtlIsLeftChild(Links) \
418 (RtlLeftChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))
420 #define RtlIsRightChild(Links) \
421 (RtlRightChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))
423 #define RtlRightChild(Links) \
424 ((PRTL_SPLAY_LINKS)(Links))->RightChild
426 #define RtlIsRoot(Links) \
427 (RtlParent(Links) == (PRTL_SPLAY_LINKS)(Links))
429 #define RtlLeftChild(Links) \
430 ((PRTL_SPLAY_LINKS)(Links))->LeftChild
432 #define RtlParent(Links) \
433 ((PRTL_SPLAY_LINKS)(Links))->Parent
435 // FIXME: use inline function
437 #define RtlInitializeSplayLinks(Links) \
439 PRTL_SPLAY_LINKS _SplayLinks; \
440 _SplayLinks = (PRTL_SPLAY_LINKS)(Links); \
441 _SplayLinks->Parent = _SplayLinks; \
442 _SplayLinks->LeftChild = NULL; \
443 _SplayLinks->RightChild = NULL; \
446 #define RtlInsertAsLeftChild(ParentLinks,ChildLinks) \
448 PRTL_SPLAY_LINKS _SplayParent; \
449 PRTL_SPLAY_LINKS _SplayChild; \
450 _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
451 _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
452 _SplayParent->LeftChild = _SplayChild; \
453 _SplayChild->Parent = _SplayParent; \
456 #define RtlInsertAsRightChild(ParentLinks,ChildLinks) \
458 PRTL_SPLAY_LINKS _SplayParent; \
459 PRTL_SPLAY_LINKS _SplayChild; \
460 _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
461 _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
462 _SplayParent->RightChild = _SplayChild; \
463 _SplayChild->Parent = _SplayParent; \
467 // RTL AVL Tree Functions
472 RtlInitializeGenericTableAvl(
473 _Out_ PRTL_AVL_TABLE Table
,
474 _In_ PRTL_AVL_COMPARE_ROUTINE CompareRoutine
,
475 _In_opt_ PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine
,
476 _In_opt_ PRTL_AVL_FREE_ROUTINE FreeRoutine
,
477 _In_opt_ PVOID TableContext
483 RtlInsertElementGenericTableAvl(
484 _In_ PRTL_AVL_TABLE Table
,
485 _In_reads_bytes_(BufferSize
) PVOID Buffer
,
486 _In_ CLONG BufferSize
,
487 _Out_opt_ PBOOLEAN NewElement
493 RtlInsertElementGenericTableFullAvl(
494 _In_ PRTL_AVL_TABLE Table
,
495 _In_reads_bytes_(BufferSize
) PVOID Buffer
,
496 _In_ CLONG BufferSize
,
497 _Out_opt_ PBOOLEAN NewElement
,
498 _In_ PVOID NodeOrParent
,
499 _In_ TABLE_SEARCH_RESULT SearchResult
505 RtlDeleteElementGenericTableAvl(
506 _In_ PRTL_AVL_TABLE Table
,
510 _Must_inspect_result_
514 RtlLookupElementGenericTableAvl(
515 _In_ PRTL_AVL_TABLE Table
,
522 RtlLookupElementGenericTableFullAvl(
523 _In_ PRTL_AVL_TABLE Table
,
525 _Out_ PVOID
*NodeOrParent
,
526 _Out_ TABLE_SEARCH_RESULT
*SearchResult
529 _Must_inspect_result_
533 RtlEnumerateGenericTableAvl(
534 _In_ PRTL_AVL_TABLE Table
,
538 _Must_inspect_result_
542 RtlEnumerateGenericTableWithoutSplayingAvl(
543 _In_ PRTL_AVL_TABLE Table
,
544 _Inout_ PVOID
*RestartKey
547 _Must_inspect_result_
551 RtlLookupFirstMatchingElementGenericTableAvl(
552 _In_ PRTL_AVL_TABLE Table
,
554 _Out_ PVOID
*RestartKey
557 _Must_inspect_result_
561 RtlEnumerateGenericTableLikeADirectory(
562 _In_ PRTL_AVL_TABLE Table
,
563 _In_opt_ PRTL_AVL_MATCH_FUNCTION MatchFunction
,
564 _In_opt_ PVOID MatchData
,
566 _Inout_ PVOID
*RestartKey
,
567 _Inout_ PULONG DeleteCount
,
571 _Must_inspect_result_
575 RtlGetElementGenericTableAvl(
576 _In_ PRTL_AVL_TABLE Table
,
583 RtlNumberGenericTableElementsAvl(
584 _In_ PRTL_AVL_TABLE Table
587 _Must_inspect_result_
591 RtlIsGenericTableEmptyAvl(
592 _In_ PRTL_AVL_TABLE Table
595 #ifdef RTL_USE_AVL_TABLES
597 #define RtlInitializeGenericTable RtlInitializeGenericTableAvl
598 #define RtlInsertElementGenericTable RtlInsertElementGenericTableAvl
599 #define RtlInsertElementGenericTableFull RtlInsertElementGenericTableFullAvl
600 #define RtlDeleteElementGenericTable RtlDeleteElementGenericTableAvl
601 #define RtlLookupElementGenericTable RtlLookupElementGenericTableAvl
602 #define RtlLookupElementGenericTableFull RtlLookupElementGenericTableFullAvl
603 #define RtlEnumerateGenericTable RtlEnumerateGenericTableAvl
604 #define RtlEnumerateGenericTableWithoutSplaying RtlEnumerateGenericTableWithoutSplayingAvl
605 #define RtlGetElementGenericTable RtlGetElementGenericTableAvl
606 #define RtlNumberGenericTableElements RtlNumberGenericTableElementsAvl
607 #define RtlIsGenericTableEmpty RtlIsGenericTableEmptyAvl
609 #endif /* RTL_USE_AVL_TABLES */
612 // Exception and Error Functions
617 RtlAddVectoredExceptionHandler(
618 _In_ ULONG FirstHandler
,
619 _In_ PVECTORED_EXCEPTION_HANDLER VectoredHandler
625 RtlRemoveVectoredExceptionHandler(
626 _In_ PVOID VectoredHandlerHandle
632 RtlAddVectoredContinueHandler(
633 _In_ ULONG FirstHandler
,
634 _In_ PVECTORED_EXCEPTION_HANDLER VectoredHandler
640 RtlRemoveVectoredContinueHandler(
641 _In_ PVOID VectoredHandlerHandle
647 RtlSetUnhandledExceptionFilter(
648 _In_ PRTLP_UNHANDLED_EXCEPTION_FILTER TopLevelExceptionFilter
654 RtlUnhandledExceptionFilter(
655 _In_
struct _EXCEPTION_POINTERS
* ExceptionInfo
663 _In_ PVOID FailedAssertion
,
665 _In_ ULONG LineNumber
,
666 _In_opt_z_ PCHAR Message
686 RtlEncodeSystemPointer(
693 RtlDecodeSystemPointer(
707 RtlGetLastWin32Error(
714 RtlSetLastWin32Error(
721 RtlSetLastWin32ErrorAndNtStatusFromNtStatus(
728 RtlSetThreadErrorMode(
730 _Out_opt_ PULONG OldMode
736 RtlGetThreadErrorMode(
740 #endif /* NTOS_MODE_USER */
746 _Out_ PCONTEXT ContextRecord
752 RtlDispatchException(
753 _In_ PEXCEPTION_RECORD ExceptionRecord
,
754 _In_ PCONTEXT Context
757 _IRQL_requires_max_(APC_LEVEL
)
758 _When_(Status
< 0, _Out_range_(>, 0))
759 _When_(Status
>= 0, _Out_range_(==, 0))
763 RtlNtStatusToDosError(
767 _When_(Status
< 0, _Out_range_(>, 0))
768 _When_(Status
>= 0, _Out_range_(==, 0))
772 RtlNtStatusToDosErrorNoTeb(
779 RtlMapSecurityErrorToNtStatus(
780 _In_ ULONG SecurityError
787 _In_ PEXCEPTION_RECORD ExceptionRecord
802 _In_opt_ PVOID TargetFrame
,
803 _In_opt_ PVOID TargetIp
,
804 _In_opt_ PEXCEPTION_RECORD ExceptionRecord
,
805 _In_ PVOID ReturnValue
808 #define RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT 8
817 _Out_writes_(Count
- (Flags
>> RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT
)) PVOID
*Callers
,
825 RtlLogStackBackTrace(
829 #ifdef NTOS_MODE_USER
833 _Must_inspect_result_
835 _Post_writable_byte_size_(Size
)
840 _In_ PVOID HeapHandle
,
841 _In_opt_ ULONG Flags
,
845 _Must_inspect_result_
851 _In_opt_ PVOID BaseAddress
,
852 _In_opt_ SIZE_T SizeToReserve
,
853 _In_opt_ SIZE_T SizeToCommit
,
855 _In_opt_ PRTL_HEAP_PARAMETERS Parameters
862 _In_ HANDLE HeapHandle
,
865 _In_ PWSTR TagSubName
875 _Must_inspect_result_
881 _In_opt_ PVOID BaseAddress
,
882 _In_opt_ SIZE_T SizeToReserve
,
883 _In_opt_ SIZE_T SizeToCommit
,
885 _In_opt_ PRTL_HEAP_PARAMETERS Parameters
892 _In_ _Post_invalid_ HANDLE Heap
905 _Success_(return != 0)
910 _In_ HANDLE HeapHandle
,
911 _In_opt_ ULONG Flags
,
912 _In_ _Post_invalid_ PVOID P
918 _In_ ULONG HeapCount
,
919 _Out_cap_(HeapCount
) HANDLE
*HeapArray
922 _Success_(return != 0)
926 _In_ PVOID HeapHandle
,
928 _In_ PVOID BaseAddress
,
929 _Inout_opt_ PVOID
*UserValue
,
930 _Out_opt_ PULONG UserFlags
937 _In_ PVOID HeapHandle
,
944 RtlQueryHeapInformation(
945 _In_ PVOID HeapHandle
,
946 _In_ HEAP_INFORMATION_CLASS HeapInformationClass
,
947 _Out_ PVOID HeapInformation
,
948 _In_ SIZE_T HeapInformationLength
,
949 _When_(HeapInformationClass
==HeapCompatibilityInformation
, _On_failure_(_Out_opt_
))
950 _Out_opt_ PSIZE_T ReturnLength
958 _In_ PVOID HeapHandle
,
960 _In_ USHORT TagIndex
,
961 _In_ BOOLEAN ResetCounters
,
962 _Out_ PRTL_HEAP_TAG_INFO HeapTagInfo
965 _Must_inspect_result_
967 _Post_writable_byte_size_(Size
)
973 _In_opt_ ULONG Flags
,
974 _In_ _Post_invalid_ PVOID Ptr
,
981 RtlSetHeapInformation(
982 _In_ PVOID HeapHandle
,
983 _In_ HEAP_INFORMATION_CLASS HeapInformationClass
,
984 _When_(HeapInformationClass
==HeapCompatibilityInformation
,_In_
) PVOID HeapInformation
,
985 _In_ SIZE_T HeapInformationLength
995 _Must_inspect_result_
999 RtlMultipleAllocateHeap (
1000 _In_ HANDLE HeapHandle
,
1004 _Out_cap_(Count
) _Deref_post_bytecap_(Size
) PVOID
* Array
1010 RtlMultipleFreeHeap (
1011 _In_ HANDLE HeapHandle
,
1014 _In_count_(Count
) /* _Deref_ _Post_invalid_ */ PVOID
* Array
1023 _Out_ PRTL_HEAP_USAGE Usage
1035 RtlSetUserValueHeap(
1036 _In_ PVOID HeapHandle
,
1038 _In_ PVOID BaseAddress
,
1039 _In_ PVOID UserValue
1044 RtlSetUserFlagsHeap(
1045 _In_ PVOID HeapHandle
,
1047 _In_ PVOID BaseAddress
,
1048 _In_ ULONG UserFlagsReset
,
1049 _In_ ULONG UserFlagsSet
1065 _In_ HANDLE HeapHandle
,
1066 _In_ PVOID HeapEntry
1069 #define RtlGetProcessHeap() (NtCurrentPeb()->ProcessHeap)
1071 #endif // NTOS_MODE_USER
1073 #define NtCurrentPeb() (NtCurrentTeb()->ProcessEnvironmentBlock)
1079 _In_ PVOID HeapHandle
,
1081 _In_ PVOID MemoryPointer
1086 // Security Functions
1088 _IRQL_requires_max_(APC_LEVEL
)
1092 RtlAbsoluteToSelfRelativeSD(
1093 _In_ PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor
,
1094 _Out_writes_bytes_to_opt_(*BufferLength
, *BufferLength
) PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor
,
1095 _Inout_ PULONG BufferLength
1098 _IRQL_requires_max_(APC_LEVEL
)
1102 RtlAddAccessAllowedAce(
1104 _In_ ULONG Revision
,
1105 _In_ ACCESS_MASK AccessMask
,
1109 _IRQL_requires_max_(APC_LEVEL
)
1113 RtlAddAccessAllowedAceEx(
1115 _In_ ULONG dwAceRevision
,
1116 _In_ ULONG AceFlags
,
1117 _In_ ACCESS_MASK AccessMask
,
1124 RtlAddAccessAllowedObjectAce(
1126 _In_ ULONG dwAceRevision
,
1127 _In_ ULONG AceFlags
,
1128 _In_ ACCESS_MASK AccessMask
,
1129 _In_opt_ GUID
*ObjectTypeGuid
,
1130 _In_opt_ GUID
*InheritedObjectTypeGuid
,
1137 RtlAddAccessDeniedAce(
1139 _In_ ULONG Revision
,
1140 _In_ ACCESS_MASK AccessMask
,
1147 RtlAddAccessDeniedAceEx(
1149 _In_ ULONG Revision
,
1151 _In_ ACCESS_MASK AccessMask
,
1158 RtlAddAccessDeniedObjectAce(
1160 _In_ ULONG dwAceRevision
,
1161 _In_ ULONG AceFlags
,
1162 _In_ ACCESS_MASK AccessMask
,
1163 _In_opt_ GUID
*ObjectTypeGuid
,
1164 _In_opt_ GUID
*InheritedObjectTypeGuid
,
1173 _In_ ULONG AceRevision
,
1174 _In_ ULONG StartingAceIndex
,
1175 _In_reads_bytes_(AceListLength
) PVOID AceList
,
1176 _In_ ULONG AceListLength
1182 RtlAddAuditAccessAce(
1184 _In_ ULONG Revision
,
1185 _In_ ACCESS_MASK AccessMask
,
1187 _In_ BOOLEAN Success
,
1188 _In_ BOOLEAN Failure
1194 RtlAcquirePrivilege(
1195 _In_ PULONG Privilege
,
1198 _Out_ PVOID
*ReturnedState
1204 RtlAddAuditAccessAceEx(
1206 _In_ ULONG Revision
,
1208 _In_ ACCESS_MASK AccessMask
,
1210 _In_ BOOLEAN Success
,
1211 _In_ BOOLEAN Failure
1217 RtlAddAuditAccessObjectAce(
1219 _In_ ULONG Revision
,
1221 _In_ ACCESS_MASK AccessMask
,
1222 _In_opt_ GUID
*ObjectTypeGuid
,
1223 _In_opt_ GUID
*InheritedObjectTypeGuid
,
1225 _In_ BOOLEAN Success
,
1226 _In_ BOOLEAN Failure
1234 _In_ ULONG Revision
,
1236 _In_ ULONG MandatoryFlags
,
1238 _In_ PSID LabelSid
);
1244 _In_ ULONG Privilege
,
1245 _In_ BOOLEAN NewValue
,
1246 _In_ BOOLEAN ForThread
,
1247 _Out_ PBOOLEAN OldValue
1250 _Must_inspect_result_
1254 RtlAllocateAndInitializeSid(
1255 _In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority
,
1256 _In_ UCHAR SubAuthorityCount
,
1257 _In_ ULONG SubAuthority0
,
1258 _In_ ULONG SubAuthority1
,
1259 _In_ ULONG SubAuthority2
,
1260 _In_ ULONG SubAuthority3
,
1261 _In_ ULONG SubAuthority4
,
1262 _In_ ULONG SubAuthority5
,
1263 _In_ ULONG SubAuthority6
,
1264 _In_ ULONG SubAuthority7
,
1271 RtlAreAllAccessesGranted(
1272 ACCESS_MASK GrantedAccess
,
1273 ACCESS_MASK DesiredAccess
1279 RtlAreAnyAccessesGranted(
1280 ACCESS_MASK GrantedAccess
,
1281 ACCESS_MASK DesiredAccess
1284 _IRQL_requires_max_(APC_LEVEL
)
1289 _Out_ PLUID DestinationLuid
,
1290 _In_ PLUID SourceLuid
1296 RtlCopyLuidAndAttributesArray(
1298 PLUID_AND_ATTRIBUTES Src
,
1299 PLUID_AND_ATTRIBUTES Dest
1305 RtlCopySidAndAttributesArray(
1307 _In_ PSID_AND_ATTRIBUTES Src
,
1308 _In_ ULONG SidAreaSize
,
1309 _In_ PSID_AND_ATTRIBUTES Dest
,
1311 _Out_ PSID
* RemainingSidArea
,
1312 _Out_ PULONG RemainingSidAreaSize
1315 _IRQL_requires_max_(APC_LEVEL
)
1319 RtlConvertSidToUnicodeString(
1320 _Inout_ PUNICODE_STRING UnicodeString
,
1322 _In_ BOOLEAN AllocateDestinationString
1325 _IRQL_requires_max_(APC_LEVEL
)
1330 _In_ ULONG DestinationSidLength
,
1331 _Out_writes_bytes_(DestinationSidLength
) PSID DestinationSid
,
1347 RtlCreateSecurityDescriptor(
1348 _Out_ PSECURITY_DESCRIPTOR SecurityDescriptor
,
1355 RtlCreateSecurityDescriptorRelative(
1356 _Out_ PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor
,
1363 RtlCopySecurityDescriptor(
1364 _In_ PSECURITY_DESCRIPTOR pSourceSecurityDescriptor
,
1365 _Out_ PSECURITY_DESCRIPTOR
*pDestinationSecurityDescriptor
1404 _In_ _Post_invalid_ PSID Sid
1419 RtlGetControlSecurityDescriptor(
1420 _In_ PSECURITY_DESCRIPTOR SecurityDescriptor
,
1421 _Out_ PSECURITY_DESCRIPTOR_CONTROL Control
,
1422 _Out_ PULONG Revision
1428 RtlGetDaclSecurityDescriptor(
1429 _In_ PSECURITY_DESCRIPTOR SecurityDescriptor
,
1430 _Out_ PBOOLEAN DaclPresent
,
1432 _Out_ PBOOLEAN DaclDefaulted
1438 RtlGetSaclSecurityDescriptor(
1439 _In_ PSECURITY_DESCRIPTOR SecurityDescriptor
,
1440 _Out_ PBOOLEAN SaclPresent
,
1442 _Out_ PBOOLEAN SaclDefaulted
1448 RtlGetGroupSecurityDescriptor(
1449 _In_ PSECURITY_DESCRIPTOR SecurityDescriptor
,
1451 _Out_ PBOOLEAN GroupDefaulted
1457 RtlGetOwnerSecurityDescriptor(
1458 _In_ PSECURITY_DESCRIPTOR SecurityDescriptor
,
1460 _Out_ PBOOLEAN OwnerDefaulted
1466 RtlGetSecurityDescriptorRMControl(
1467 _In_ PSECURITY_DESCRIPTOR SecurityDescriptor
,
1468 _Out_ PUCHAR RMControl
1472 PSID_IDENTIFIER_AUTHORITY
1474 RtlIdentifierAuthoritySid(PSID Sid
);
1479 RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
);
1481 _IRQL_requires_max_(APC_LEVEL
)
1487 _In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority
,
1488 _In_ UCHAR SubAuthorityCount
1494 RtlLengthRequiredSid(IN ULONG SubAuthorityCount
);
1496 _IRQL_requires_max_(APC_LEVEL
)
1500 RtlLengthSecurityDescriptor(
1501 _In_ PSECURITY_DESCRIPTOR SecurityDescriptor
);
1506 RtlLengthSid(IN PSID Sid
);
1511 RtlMakeSelfRelativeSD(
1512 _In_ PSECURITY_DESCRIPTOR AbsoluteSD
,
1513 _Out_ PSECURITY_DESCRIPTOR SelfRelativeSD
,
1514 _Inout_ PULONG BufferLength
);
1520 PACCESS_MASK AccessMask
,
1521 PGENERIC_MAPPING GenericMapping
1524 #ifdef NTOS_MODE_USER
1529 RtlQueryInformationAcl(
1532 ULONG InformationLength
,
1533 ACL_INFORMATION_CLASS InformationClass
1541 RtlReleasePrivilege(
1542 _In_ PVOID ReturnedState
1545 _IRQL_requires_max_(APC_LEVEL
)
1549 RtlSelfRelativeToAbsoluteSD(
1550 _In_ PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor
,
1551 _Out_writes_bytes_to_opt_(*AbsoluteSecurityDescriptorSize
, *AbsoluteSecurityDescriptorSize
) PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor
,
1552 _Inout_ PULONG AbsoluteSecurityDescriptorSize
,
1553 _Out_writes_bytes_to_opt_(*DaclSize
, *DaclSize
) PACL Dacl
,
1554 _Inout_ PULONG DaclSize
,
1555 _Out_writes_bytes_to_opt_(*SaclSize
, *SaclSize
) PACL Sacl
,
1556 _Inout_ PULONG SaclSize
,
1557 _Out_writes_bytes_to_opt_(*OwnerSize
, *OwnerSize
) PSID Owner
,
1558 _Inout_ PULONG OwnerSize
,
1559 _Out_writes_bytes_to_opt_(*PrimaryGroupSize
, *PrimaryGroupSize
) PSID PrimaryGroup
,
1560 _Inout_ PULONG PrimaryGroupSize
1566 RtlSelfRelativeToAbsoluteSD2(
1567 _Inout_ PSECURITY_DESCRIPTOR SelfRelativeSD
,
1568 _Out_ PULONG BufferSize
1574 RtlSetAttributesSecurityDescriptor(
1575 _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor
,
1576 _In_ SECURITY_DESCRIPTOR_CONTROL Control
,
1577 _Out_ PULONG Revision
1583 RtlSetControlSecurityDescriptor(
1584 _In_ PSECURITY_DESCRIPTOR SecurityDescriptor
,
1585 _In_ SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest
,
1586 _In_ SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet
1589 _IRQL_requires_max_(APC_LEVEL
)
1593 RtlSetDaclSecurityDescriptor(
1594 _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor
,
1595 _In_ BOOLEAN DaclPresent
,
1597 _In_opt_ BOOLEAN DaclDefaulted
1600 _IRQL_requires_max_(APC_LEVEL
)
1604 RtlSetGroupSecurityDescriptor(
1605 _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor
,
1606 _In_opt_ PSID Group
,
1607 _In_opt_ BOOLEAN GroupDefaulted
1610 #ifdef NTOS_MODE_USER
1615 RtlSetInformationAcl(
1618 ULONG InformationLength
,
1619 ACL_INFORMATION_CLASS InformationClass
1624 _IRQL_requires_max_(APC_LEVEL
)
1628 RtlSetOwnerSecurityDescriptor(
1629 _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor
,
1630 _In_opt_ PSID Owner
,
1631 _In_opt_ BOOLEAN OwnerDefaulted
1637 RtlSetSaclSecurityDescriptor(
1638 _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor
,
1639 _In_ BOOLEAN SaclPresent
,
1641 _In_ BOOLEAN SaclDefaulted
1647 RtlSetSecurityDescriptorRMControl(
1648 _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor
,
1649 _In_ PUCHAR RMControl
1655 RtlSubAuthorityCountSid(
1664 _In_ ULONG SubAuthority
1667 _IRQL_requires_max_(APC_LEVEL
)
1668 _Must_inspect_result_
1672 RtlValidRelativeSecurityDescriptor(
1673 _In_reads_bytes_(SecurityDescriptorLength
) PSECURITY_DESCRIPTOR SecurityDescriptorInput
,
1674 _In_ ULONG SecurityDescriptorLength
,
1675 _In_ SECURITY_INFORMATION RequiredInformation
1681 RtlValidSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor
);
1686 RtlValidSid(IN PSID Sid
);
1691 RtlValidAcl(PACL Acl
);
1696 RtlDeleteSecurityObject(
1697 _In_ PSECURITY_DESCRIPTOR
*ObjectDescriptor
1703 RtlNewSecurityObject(
1704 _In_ PSECURITY_DESCRIPTOR ParentDescriptor
,
1705 _In_ PSECURITY_DESCRIPTOR CreatorDescriptor
,
1706 _Out_ PSECURITY_DESCRIPTOR
*NewDescriptor
,
1707 _In_ BOOLEAN IsDirectoryObject
,
1709 _In_ PGENERIC_MAPPING GenericMapping
1715 RtlQuerySecurityObject(
1716 _In_ PSECURITY_DESCRIPTOR ObjectDescriptor
,
1717 _In_ SECURITY_INFORMATION SecurityInformation
,
1718 _Out_ PSECURITY_DESCRIPTOR ResultantDescriptor
,
1719 _In_ ULONG DescriptorLength
,
1720 _Out_ PULONG ReturnLength
1726 RtlSetSecurityObject(
1727 _In_ SECURITY_INFORMATION SecurityInformation
,
1728 _In_ PSECURITY_DESCRIPTOR ModificationDescriptor
,
1729 _Out_ PSECURITY_DESCRIPTOR
*ObjectsSecurityDescriptor
,
1730 _In_ PGENERIC_MAPPING GenericMapping
,
1735 // Single-Character Functions
1740 RtlLargeIntegerToChar(
1741 _In_ PLARGE_INTEGER Value
,
1750 RtlUpperChar(CHAR Source
);
1755 RtlUpcaseUnicodeChar(WCHAR Source
);
1760 RtlDowncaseUnicodeChar(IN WCHAR Source
);
1775 RtlIntegerToUnicode(
1777 _In_opt_ ULONG Base
,
1778 _In_opt_ ULONG Length
,
1779 _Inout_ LPWSTR String
1782 _IRQL_requires_max_(PASSIVE_LEVEL
)
1783 _At_(String
->MaximumLength
, _Const_
)
1787 RtlIntegerToUnicodeString(
1789 _In_opt_ ULONG Base
,
1790 _Inout_ PUNICODE_STRING String
1803 // Byte Swap Functions
1805 #ifdef NTOS_MODE_USER
1807 unsigned short __cdecl
_byteswap_ushort(unsigned short);
1808 unsigned long __cdecl
_byteswap_ulong (unsigned long);
1809 unsigned __int64 __cdecl
_byteswap_uint64(unsigned __int64
);
1811 #pragma intrinsic(_byteswap_ushort)
1812 #pragma intrinsic(_byteswap_ulong)
1813 #pragma intrinsic(_byteswap_uint64)
1815 #define RtlUshortByteSwap(_x) _byteswap_ushort((USHORT)(_x))
1816 #define RtlUlongByteSwap(_x) _byteswap_ulong((_x))
1817 #define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x))
1819 #endif // NTOS_MODE_USER
1822 // Unicode->Ansi String Functions
1827 RtlxUnicodeStringToAnsiSize(IN PCUNICODE_STRING UnicodeString
);
1829 #ifdef NTOS_MODE_USER
1831 #define RtlUnicodeStringToAnsiSize(STRING) ( \
1832 NLS_MB_CODE_PAGE_TAG ? \
1833 RtlxUnicodeStringToAnsiSize(STRING) : \
1834 ((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \
1842 RtlUnicodeStringToAnsiString(
1843 PANSI_STRING DestinationString
,
1844 PCUNICODE_STRING SourceString
,
1845 BOOLEAN AllocateDestinationString
1849 // Unicode->OEM String Functions
1854 RtlUpcaseUnicodeStringToOemString(
1855 POEM_STRING DestinationString
,
1856 PCUNICODE_STRING SourceString
,
1857 BOOLEAN AllocateDestinationString
1860 _IRQL_requires_max_(PASSIVE_LEVEL
)
1861 _Must_inspect_result_
1862 //_At_(DestinationString->Buffer, _Post_bytecount_(DestinationString->Length))
1866 RtlUpcaseUnicodeStringToCountedOemString(
1867 _When_(AllocateDestinationString
, _Out_
_At_(DestinationString
->Buffer
, __drv_allocatesMem(Mem
)))
1868 _When_(!AllocateDestinationString
, _Inout_
)
1869 POEM_STRING DestinationString
,
1870 _In_ PCUNICODE_STRING SourceString
,
1871 _In_ BOOLEAN AllocateDestinationString
1877 RtlUnicodeStringToOemString(
1878 POEM_STRING DestinationString
,
1879 PCUNICODE_STRING SourceString
,
1880 BOOLEAN AllocateDestinationString
1886 RtlUpcaseUnicodeToOemN(
1890 PCWCH UnicodeString
,
1897 RtlxUnicodeStringToOemSize(IN PCUNICODE_STRING UnicodeString
);
1899 #ifdef NTOS_MODE_USER
1901 #define RtlUnicodeStringToOemSize(STRING) ( \
1902 NLS_MB_OEM_CODE_PAGE_TAG ? \
1903 RtlxUnicodeStringToOemSize(STRING) : \
1904 ((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \
1907 #define RtlUnicodeStringToCountedOemSize(STRING) ( \
1908 (ULONG)(RtlUnicodeStringToOemSize(STRING) - sizeof(ANSI_NULL)) \
1920 PCWCH UnicodeString
,
1925 // Unicode->MultiByte String Functions
1930 RtlUnicodeToMultiByteN(
1934 PCWCH UnicodeString
,
1941 RtlUpcaseUnicodeToMultiByteN(
1945 PCWCH UnicodeString
,
1952 RtlUnicodeToMultiByteSize(
1954 PCWCH UnicodeString
,
1961 RtlxOemStringToUnicodeSize(IN PCOEM_STRING OemString
);
1964 // OEM to Unicode Functions
1969 RtlOemStringToUnicodeString(
1970 PUNICODE_STRING DestinationString
,
1971 PCOEM_STRING SourceString
,
1972 BOOLEAN AllocateDestinationString
1975 _IRQL_requires_max_(PASSIVE_LEVEL
)
1980 _Out_writes_bytes_to_(MaxBytesInUnicodeString
, *BytesInUnicodeString
) PWCH UnicodeString
,
1981 _In_ ULONG MaxBytesInUnicodeString
,
1982 _Out_opt_ PULONG BytesInUnicodeString
,
1983 _In_reads_bytes_(BytesInOemString
) PCCH OemString
,
1984 _In_ ULONG BytesInOemString
1987 #ifdef NTOS_MODE_USER
1989 #define RtlOemStringToUnicodeSize(STRING) ( \
1990 NLS_MB_OEM_CODE_PAGE_TAG ? \
1991 RtlxOemStringToUnicodeSize(STRING) : \
1992 ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \
1995 #define RtlOemStringToCountedUnicodeSize(STRING) ( \
1996 (ULONG)(RtlOemStringToUnicodeSize(STRING) - sizeof(UNICODE_NULL)) \
2002 // Ansi->Unicode String Functions
2004 _IRQL_requires_max_(APC_LEVEL
)
2008 RtlAnsiCharToUnicodeChar(
2009 _Inout_ PUCHAR
*SourceCharacter
);
2014 RtlAnsiStringToUnicodeString(
2015 PUNICODE_STRING DestinationString
,
2016 PCANSI_STRING SourceString
,
2017 BOOLEAN AllocateDestinationString
2023 RtlxAnsiStringToUnicodeSize(
2024 PCANSI_STRING AnsiString
2027 #ifdef NTOS_MODE_USER
2029 #define RtlAnsiStringToUnicodeSize(STRING) ( \
2030 NLS_MB_CODE_PAGE_TAG ? \
2031 RtlxAnsiStringToUnicodeSize(STRING) : \
2032 ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \
2040 RtlCreateUnicodeStringFromAsciiz(
2041 _Out_ PUNICODE_STRING Destination
,
2046 // Unicode String Functions
2051 RtlAppendUnicodeToString(
2052 PUNICODE_STRING Destination
,
2059 RtlAppendUnicodeStringToString(
2060 PUNICODE_STRING Destination
,
2061 PCUNICODE_STRING Source
2067 RtlCompareUnicodeString(
2068 PCUNICODE_STRING String1
,
2069 PCUNICODE_STRING String2
,
2070 BOOLEAN CaseInsensitive
2076 RtlCopyUnicodeString(
2077 PUNICODE_STRING DestinationString
,
2078 PCUNICODE_STRING SourceString
2084 RtlCreateUnicodeString(
2085 PUNICODE_STRING DestinationString
,
2089 #ifdef NTOS_MODE_USER
2094 RtlDowncaseUnicodeString(
2095 _Inout_ PUNICODE_STRING UniDest
,
2096 _In_ PCUNICODE_STRING UniSource
,
2097 _In_ BOOLEAN AllocateDestinationString
2103 RtlDuplicateUnicodeString(
2105 _In_ PCUNICODE_STRING SourceString
,
2106 _Out_ PUNICODE_STRING DestinationString
2116 _In_ PVOID Destination
,
2124 RtlFillMemoryUlonglong(
2125 _Out_ PVOID Destination
,
2127 _In_ ULONGLONG Pattern
2133 RtlCopyMappedMemory(
2134 _Out_writes_bytes_all_(Size
) PVOID Destination
,
2135 _In_reads_bytes_(Size
) const VOID
*Source
,
2142 RtlCompareMemoryUlong(
2148 #ifndef RtlEqualMemory
2149 #define RtlEqualMemory(Destination, Source, Length) \
2150 (!memcmp(Destination, Source, Length))
2153 #define RtlCopyBytes RtlCopyMemory
2154 #define RtlFillBytes RtlFillMemory
2155 #define RtlZeroBytes RtlZeroMemory
2162 RtlEqualUnicodeString(
2163 PCUNICODE_STRING String1
,
2164 PCUNICODE_STRING String2
,
2165 BOOLEAN CaseInsensitive
2171 RtlFindCharInUnicodeString(
2173 _In_ PCUNICODE_STRING SearchString
,
2174 _In_ PCUNICODE_STRING MatchString
,
2175 _Out_ PUSHORT Position
2178 _IRQL_requires_max_(PASSIVE_LEVEL
)
2182 RtlFreeUnicodeString(
2183 _Inout_
_At_(UnicodeString
->Buffer
, __drv_freesMem(Mem
))
2184 PUNICODE_STRING UnicodeString
2190 RtlEraseUnicodeString(
2191 _Inout_ PUNICODE_STRING String
2197 RtlHashUnicodeString(
2198 _In_ CONST UNICODE_STRING
*String
,
2199 _In_ BOOLEAN CaseInSensitive
,
2200 _In_ ULONG HashAlgorithm
,
2201 _Out_ PULONG HashValue
2204 _IRQL_requires_max_(DISPATCH_LEVEL
)
2205 _At_(DestinationString
->Buffer
, _Post_equal_to_(SourceString
))
2206 _When_(SourceString
!= NULL
,
2207 _At_(DestinationString
->Length
, _Post_equal_to_(_String_length_(SourceString
)))
2208 _At_(DestinationString
->MaximumLength
, _Post_equal_to_(DestinationString
->Length
+ sizeof(CHAR
))))
2209 _When_(SourceString
== NULL
,
2210 _At_(DestinationString
->Length
, _Post_equal_to_(0))
2211 _At_(DestinationString
->MaximumLength
, _Post_equal_to_(0)))
2216 _Out_ PSTRING DestinationString
,
2217 _In_opt_z_ __drv_aliasesMem PCSTR SourceString
2220 _IRQL_requires_max_(DISPATCH_LEVEL
)
2221 _At_(DestinationString
->Buffer
, _Post_equal_to_(SourceString
))
2222 _When_(SourceString
!= NULL
,
2223 _At_(DestinationString
->Length
, _Post_equal_to_(_String_length_(SourceString
) * sizeof(WCHAR
)))
2224 _At_(DestinationString
->MaximumLength
, _Post_equal_to_(DestinationString
->Length
+ sizeof(WCHAR
))))
2225 _When_(SourceString
== NULL
,
2226 _At_(DestinationString
->Length
, _Post_equal_to_(0))
2227 _At_(DestinationString
->MaximumLength
, _Post_equal_to_(0)))
2231 RtlInitUnicodeString(
2232 _Out_ PUNICODE_STRING DestinationString
,
2233 _In_opt_z_ __drv_aliasesMem PCWSTR SourceString
2236 _IRQL_requires_max_(DISPATCH_LEVEL
)
2240 RtlInitUnicodeStringEx(
2241 _Out_ PUNICODE_STRING DestinationString
,
2242 _In_opt_z_ __drv_aliasesMem PCWSTR SourceString
2249 _In_ CONST VOID
* Buffer
,
2251 _Inout_opt_ INT
* Flags
2254 _IRQL_requires_max_(PASSIVE_LEVEL
)
2255 _Must_inspect_result_
2260 _In_
const STRING
*String1
,
2261 _In_
const STRING
*String2
,
2262 _In_ BOOLEAN CaseInsensitive
2265 _IRQL_requires_max_(PASSIVE_LEVEL
)
2266 _Must_inspect_result_
2270 RtlPrefixUnicodeString(
2271 _In_ PCUNICODE_STRING String1
,
2272 _In_ PCUNICODE_STRING String2
,
2273 _In_ BOOLEAN CaseInsensitive
2276 _IRQL_requires_max_(PASSIVE_LEVEL
)
2281 _Inout_ PSTRING DestinationString
,
2282 _In_
const STRING
*SourceString
2285 _IRQL_requires_max_(PASSIVE_LEVEL
)
2286 _Must_inspect_result_
2291 _In_
const STRING
*String1
,
2292 _In_
const STRING
*String2
,
2293 _In_ BOOLEAN CaseInSensitive
2300 _Out_ PSTRING DestinationString
,
2301 _In_opt_
const STRING
*SourceString
2304 _IRQL_requires_max_(PASSIVE_LEVEL
)
2305 _Must_inspect_result_
2310 _In_
const STRING
*String1
,
2311 _In_
const STRING
*String2
,
2312 _In_ BOOLEAN CaseInSensitive
2315 _IRQL_requires_max_(APC_LEVEL
)
2319 RtlAppendStringToString(
2320 _Inout_ PSTRING Destination
,
2321 _In_
const STRING
*Source
2324 _IRQL_requires_max_(PASSIVE_LEVEL
)
2325 _When_(AllocateDestinationString
, _Must_inspect_result_
)
2329 RtlUpcaseUnicodeString(
2330 _When_(AllocateDestinationString
, _Out_
_At_(DestinationString
->Buffer
, __drv_allocatesMem(Mem
)))
2331 _When_(!AllocateDestinationString
, _Inout_
)
2332 PUNICODE_STRING DestinationString
,
2333 _In_ PCUNICODE_STRING SourceString
,
2334 _In_ BOOLEAN AllocateDestinationString
2337 _IRQL_requires_max_(PASSIVE_LEVEL
)
2341 RtlUnicodeStringToInteger(
2342 _In_ PCUNICODE_STRING String
,
2343 _In_opt_ ULONG Base
,
2350 RtlValidateUnicodeString(
2352 _In_ PCUNICODE_STRING String
2355 #define RTL_SKIP_BUFFER_COPY 0x00000001
2360 RtlpEnsureBufferSize(
2362 _Inout_ PRTL_BUFFER Buffer
,
2363 _In_ SIZE_T RequiredSize
2366 #ifdef NTOS_MODE_USER
2371 _Inout_ PRTL_BUFFER Buffer
,
2376 Buffer
->Buffer
= Buffer
->StaticBuffer
= Data
;
2377 Buffer
->Size
= Buffer
->StaticSize
= DataSize
;
2378 Buffer
->ReservedForAllocatedSize
= 0;
2379 Buffer
->ReservedForIMalloc
= NULL
;
2384 RtlEnsureBufferSize(
2386 _Inout_ PRTL_BUFFER Buffer
,
2387 _In_ ULONG RequiredSize
2390 if (Buffer
&& RequiredSize
<= Buffer
->Size
)
2391 return STATUS_SUCCESS
;
2392 return RtlpEnsureBufferSize(Flags
, Buffer
, RequiredSize
);
2398 _Inout_ PRTL_BUFFER Buffer
2401 if (Buffer
->Buffer
!= Buffer
->StaticBuffer
&& Buffer
->Buffer
)
2402 RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer
->Buffer
);
2403 Buffer
->Buffer
= Buffer
->StaticBuffer
;
2404 Buffer
->Size
= Buffer
->StaticSize
;
2407 #endif /* NTOS_MODE_USER */
2410 // Ansi String Functions
2412 _IRQL_requires_max_(PASSIVE_LEVEL
)
2417 _Inout_
_At_(AnsiString
->Buffer
, __drv_freesMem(Mem
))
2418 PANSI_STRING AnsiString
2421 _IRQL_requires_max_(DISPATCH_LEVEL
)
2426 _Out_ PANSI_STRING DestinationString
,
2427 _In_opt_z_ __drv_aliasesMem PCSZ SourceString
2430 _IRQL_requires_max_(DISPATCH_LEVEL
)
2434 RtlInitAnsiStringEx(
2435 _Out_ PANSI_STRING DestinationString
,
2436 _In_opt_z_ __drv_aliasesMem PCSZ SourceString
2440 // OEM String Functions
2442 _IRQL_requires_max_(PASSIVE_LEVEL
)
2447 _Inout_
_At_(OemString
->Buffer
, __drv_freesMem(Mem
))
2448 POEM_STRING OemString
2452 // MultiByte->Unicode String Functions
2454 _IRQL_requires_max_(PASSIVE_LEVEL
)
2458 RtlMultiByteToUnicodeN(
2459 _Out_writes_bytes_to_(MaxBytesInUnicodeString
, *BytesInUnicodeString
) PWCH UnicodeString
,
2460 _In_ ULONG MaxBytesInUnicodeString
,
2461 _Out_opt_ PULONG BytesInUnicodeString
,
2462 _In_reads_bytes_(BytesInMultiByteString
) const CHAR
*MultiByteString
,
2463 _In_ ULONG BytesInMultiByteString
2466 _IRQL_requires_max_(PASSIVE_LEVEL
)
2470 RtlMultiByteToUnicodeSize(
2471 _Out_ PULONG BytesInUnicodeString
,
2472 _In_reads_bytes_(BytesInMultiByteString
) const CHAR
*MultiByteString
,
2473 _In_ ULONG BytesInMultiByteString
2482 RtlAddAtomToAtomTable(
2483 _In_ PRTL_ATOM_TABLE AtomTable
,
2484 _In_ PWSTR AtomName
,
2485 _Out_ PRTL_ATOM Atom
2492 _In_ ULONG TableSize
,
2493 _Inout_ PRTL_ATOM_TABLE
*AtomTable
2499 RtlDeleteAtomFromAtomTable(
2500 _In_ PRTL_ATOM_TABLE AtomTable
,
2507 RtlDestroyAtomTable(IN PRTL_ATOM_TABLE AtomTable
);
2512 RtlQueryAtomInAtomTable(
2513 _In_ PRTL_ATOM_TABLE AtomTable
,
2515 _Out_opt_ PULONG RefCount
,
2516 _Out_opt_ PULONG PinCount
,
2517 _Out_opt_z_bytecap_(*NameLength
) PWSTR AtomName
,
2518 _Inout_opt_ PULONG NameLength
2524 RtlPinAtomInAtomTable(
2525 _In_ PRTL_ATOM_TABLE AtomTable
,
2532 RtlLookupAtomInAtomTable(
2533 _In_ PRTL_ATOM_TABLE AtomTable
,
2534 _In_ PWSTR AtomName
,
2535 _Out_ PRTL_ATOM Atom
2539 // Process Management Functions
2551 RtlAcquirePebLock(VOID
);
2556 RtlCreateProcessParameters (
2557 _Out_ PRTL_USER_PROCESS_PARAMETERS
*ProcessParameters
,
2558 _In_ PUNICODE_STRING ImagePathName
,
2559 _In_opt_ PUNICODE_STRING DllPath
,
2560 _In_opt_ PUNICODE_STRING CurrentDirectory
,
2561 _In_opt_ PUNICODE_STRING CommandLine
,
2562 _In_opt_ PWSTR Environment
,
2563 _In_opt_ PUNICODE_STRING WindowTitle
,
2564 _In_opt_ PUNICODE_STRING DesktopInfo
,
2565 _In_opt_ PUNICODE_STRING ShellInfo
,
2566 _In_opt_ PUNICODE_STRING RuntimeInfo
2572 RtlCreateUserProcess(
2573 _In_ PUNICODE_STRING ImageFileName
,
2574 _In_ ULONG Attributes
,
2575 _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters
,
2576 _In_opt_ PSECURITY_DESCRIPTOR ProcessSecutityDescriptor
,
2577 _In_opt_ PSECURITY_DESCRIPTOR ThreadSecurityDescriptor
,
2578 _In_opt_ HANDLE ParentProcess
,
2579 _In_ BOOLEAN CurrentDirectory
,
2580 _In_opt_ HANDLE DebugPort
,
2581 _In_opt_ HANDLE ExceptionPort
,
2582 _Out_ PRTL_USER_PROCESS_INFORMATION ProcessInfo
2585 #if (NTDDI_VERSION >= NTDDI_WIN7)
2589 RtlCreateUserThread(
2590 _In_ PVOID ThreadContext
,
2591 _Out_ HANDLE
*OutThreadHandle
,
2592 _Reserved_ PVOID Reserved1
,
2593 _Reserved_ PVOID Reserved2
,
2594 _Reserved_ PVOID Reserved3
,
2595 _Reserved_ PVOID Reserved4
,
2596 _Reserved_ PVOID Reserved5
,
2597 _Reserved_ PVOID Reserved6
,
2598 _Reserved_ PVOID Reserved7
,
2599 _Reserved_ PVOID Reserved8
2605 RtlCreateUserThread(
2606 _In_ HANDLE ProcessHandle
,
2607 _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
,
2608 _In_ BOOLEAN CreateSuspended
,
2609 _In_ ULONG StackZeroBits
,
2610 _In_ SIZE_T StackReserve
,
2611 _In_ SIZE_T StackCommit
,
2612 _In_ PTHREAD_START_ROUTINE StartAddress
,
2613 _In_ PVOID Parameter
,
2614 _Out_opt_ PHANDLE ThreadHandle
,
2615 _Out_opt_ PCLIENT_ID ClientId
2620 PRTL_USER_PROCESS_PARAMETERS
2622 RtlDeNormalizeProcessParams(
2623 _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters
);
2628 RtlDestroyProcessParameters(
2629 _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters
);
2635 _In_ NTSTATUS Status
);
2640 RtlInitializeContext(
2641 _In_ HANDLE ProcessHandle
,
2642 _Out_ PCONTEXT ThreadContext
,
2643 _In_opt_ PVOID ThreadStartParam
,
2644 _In_ PTHREAD_START_ROUTINE ThreadStartAddress
,
2645 _In_ PINITIAL_TEB InitialTeb
2649 typedef struct _WOW64_CONTEXT
*PWOW64_CONTEXT
;
2654 RtlWow64GetThreadContext(
2655 _In_ HANDLE ThreadHandle
,
2656 _Inout_ PWOW64_CONTEXT ThreadContext
2663 RtlWow64SetThreadContext(
2664 _In_ HANDLE ThreadHandle
,
2665 _In_ PWOW64_CONTEXT ThreadContext
2672 RtlIsThreadWithinLoaderCallout(VOID
);
2675 PRTL_USER_PROCESS_PARAMETERS
2677 RtlNormalizeProcessParams(
2678 _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters
);
2683 RtlReleasePebLock(VOID
);
2689 _In_ HANDLE Process
,
2691 _In_ PVOID CallSite
,
2692 _In_ ULONG ArgumentCount
,
2693 _In_ PULONG Arguments
,
2694 _In_ BOOLEAN PassContext
,
2695 _In_ BOOLEAN AlreadySuspended
2701 RtlSetProcessIsCritical(
2702 _In_ BOOLEAN NewValue
,
2703 _Out_opt_ PBOOLEAN OldValue
,
2704 _In_ BOOLEAN NeedBreaks
2710 RtlSetThreadIsCritical(
2711 _In_ BOOLEAN NewValue
,
2712 _Out_opt_ PBOOLEAN OldValue
,
2713 _In_ BOOLEAN NeedBreaks
2719 RtlGetCurrentProcessorNumber(
2725 // Thread Pool Functions
2730 RtlSetThreadPoolStartFunc(
2731 _In_ PRTL_START_POOL_THREAD StartPoolThread
,
2732 _In_ PRTL_EXIT_POOL_THREAD ExitPoolThread
2738 RtlDeregisterWaitEx(
2739 _In_ HANDLE hWaitHandle
,
2740 _In_opt_ HANDLE hCompletionEvent
2747 _In_ HANDLE hWaitHandle
2754 _In_ WORKERCALLBACKFUNC Function
,
2755 _In_opt_ PVOID Context
,
2762 RtlSetIoCompletionCallback(
2763 _In_ HANDLE FileHandle
,
2764 _In_ PIO_APC_ROUTINE Callback
,
2772 _In_ PHANDLE phNewWaitObject
,
2773 _In_ HANDLE hObject
,
2774 _In_ WAITORTIMERCALLBACKFUNC Callback
,
2775 _In_ PVOID pvContext
,
2776 _In_ ULONG ulMilliseconds
,
2781 // Environment/Path Functions
2786 RtlCreateEnvironment(
2787 _In_ BOOLEAN Inherit
,
2788 _Out_ PWSTR
*Environment
2794 RtlComputePrivatizedDllName_U(
2795 _In_ PUNICODE_STRING DllName
,
2796 _Inout_ PUNICODE_STRING RealName
,
2797 _Inout_ PUNICODE_STRING LocalName
2803 RtlDestroyEnvironment(
2804 _In_ PWSTR Environment
2810 RtlDoesFileExists_U(
2811 _In_ PCWSTR FileName
2817 RtlDetermineDosPathNameType_U(
2826 _In_ PCWSTR FileName
,
2827 _In_ PCWSTR Extension
,
2828 _In_ ULONG BufferSize
,
2830 _Out_ PWSTR
*PartName
2836 RtlDosSearchPath_Ustr(
2838 _In_ PUNICODE_STRING PathString
,
2839 _In_ PUNICODE_STRING FileNameString
,
2840 _In_ PUNICODE_STRING ExtensionString
,
2841 _In_ PUNICODE_STRING CallerBuffer
,
2842 _Inout_opt_ PUNICODE_STRING DynamicString
,
2843 _Out_opt_ PUNICODE_STRING
* FullNameOut
,
2844 _Out_opt_ PSIZE_T FilePartSize
,
2845 _Out_opt_ PSIZE_T LengthNeeded
2851 RtlDosPathNameToNtPathName_U(
2852 _In_opt_z_ PCWSTR DosPathName
,
2853 _Out_ PUNICODE_STRING NtPathName
,
2854 _Out_opt_ PCWSTR
*NtFileNamePart
,
2855 _Out_opt_ PRTL_RELATIVE_NAME_U DirectoryInfo
2859 #define RTL_UNCHANGED_UNK_PATH 1
2860 #define RTL_CONVERTED_UNC_PATH 2
2861 #define RTL_CONVERTED_NT_PATH 3
2862 #define RTL_UNCHANGED_DOS_PATH 4
2867 RtlNtPathNameToDosPathName(
2869 _Inout_ PRTL_UNICODE_STRING_BUFFER Path
,
2870 _Out_opt_ PULONG PathType
,
2871 _Out_opt_ PULONG Unknown
2878 RtlDosPathNameToRelativeNtPathName_U(
2879 _In_ PCWSTR DosName
,
2880 _Out_ PUNICODE_STRING NtName
,
2881 _Out_ PCWSTR
*PartName
,
2882 _Out_ PRTL_RELATIVE_NAME_U RelativeName
2885 _At_(Destination
->Buffer
, _Out_bytecap_(Destination
->MaximumLength
))
2889 RtlExpandEnvironmentStrings_U(
2890 _In_z_ PWSTR Environment
,
2891 _In_ PUNICODE_STRING Source
,
2892 _Inout_ PUNICODE_STRING Destination
,
2899 RtlGetCurrentDirectory_U(
2900 _In_ ULONG MaximumLength
,
2901 _Out_bytecap_(MaximumLength
) PWSTR Buffer
2907 RtlGetFullPathName_U(
2908 _In_ PCWSTR FileName
,
2910 _Out_z_bytecap_(Size
) PWSTR Buffer
,
2911 _Out_opt_ PWSTR
*ShortName
2914 #if (NTDDI_VERSION >= NTDDI_WIN7)
2918 RtlGetFullPathName_UEx(
2919 _In_ PWSTR FileName
,
2920 _In_ ULONG BufferLength
,
2922 _Out_opt_ PWSTR
*FilePart
,
2923 _Out_opt_ RTL_PATH_TYPE
*InputPathType
2929 RtlGetFullPathName_UstrEx(
2930 _In_ PUNICODE_STRING FileName
,
2931 _In_opt_ PUNICODE_STRING StaticString
,
2932 _In_opt_ PUNICODE_STRING DynamicString
,
2933 _Out_opt_ PUNICODE_STRING
*StringUsed
,
2934 _Out_opt_ PSIZE_T FilePartSize
,
2935 _Out_opt_ PBOOLEAN NameInvalid
,
2936 _Out_ RTL_PATH_TYPE
* PathType
,
2937 _Out_opt_ PSIZE_T LengthNeeded
2943 RtlGetLengthWithoutTrailingPathSeperators(
2944 _Reserved_ ULONG Flags
,
2945 _In_ PCUNICODE_STRING PathString
,
2952 RtlGetLongestNtPathLength(
2959 RtlIsDosDeviceName_U(
2966 RtlIsDosDeviceName_Ustr(
2967 _In_ PCUNICODE_STRING Name
2970 _IRQL_requires_max_(PASSIVE_LEVEL
)
2971 _Must_inspect_result_
2975 RtlIsNameLegalDOS8Dot3(
2976 _In_ PCUNICODE_STRING Name
,
2977 _Inout_opt_ POEM_STRING OemName
,
2978 _Out_opt_ PBOOLEAN NameContainsSpaces
2984 RtlQueryEnvironmentVariable_U(
2985 _In_opt_ PWSTR Environment
,
2986 _In_ PCUNICODE_STRING Name
,
2987 _Out_ PUNICODE_STRING Value
2992 RtlReleaseRelativeName(
2993 _In_ PRTL_RELATIVE_NAME_U RelativeName
2999 RtlSetCurrentDirectory_U(
3000 _In_ PUNICODE_STRING name
3006 RtlSetEnvironmentVariable(
3007 _In_z_ PWSTR
*Environment
,
3008 _In_ PUNICODE_STRING Name
,
3009 _In_ PUNICODE_STRING Value
3013 // Critical Section/Resource Functions
3018 RtlDeleteCriticalSection (
3019 _In_ PRTL_CRITICAL_SECTION CriticalSection
3025 RtlEnterCriticalSection(
3026 _In_ PRTL_CRITICAL_SECTION CriticalSection
3032 RtlInitializeCriticalSection(
3033 _In_ PRTL_CRITICAL_SECTION CriticalSection
3039 RtlInitializeCriticalSectionAndSpinCount(
3040 _In_ PRTL_CRITICAL_SECTION CriticalSection
,
3041 _In_ ULONG SpinCount
3047 RtlIsCriticalSectionLocked(
3048 _In_ PRTL_CRITICAL_SECTION CriticalSection
3054 RtlIsCriticalSectionLockedByThread(
3055 _In_ PRTL_CRITICAL_SECTION CriticalSection
3061 RtlLeaveCriticalSection(
3062 _In_ PRTL_CRITICAL_SECTION CriticalSection
3068 RtlTryEnterCriticalSection(
3069 _In_ PRTL_CRITICAL_SECTION CriticalSection
3075 RtlpUnWaitCriticalSection(
3076 _In_ PRTL_CRITICAL_SECTION CriticalSection
3082 RtlpWaitForCriticalSection(
3083 _In_ PRTL_CRITICAL_SECTION CriticalSection
3089 RtlAcquireResourceExclusive(
3090 _In_ PRTL_RESOURCE Resource
,
3097 RtlAcquireResourceShared(
3098 _In_ PRTL_RESOURCE Resource
,
3105 RtlConvertExclusiveToShared(
3106 _In_ PRTL_RESOURCE Resource
3112 RtlConvertSharedToExclusive(
3113 _In_ PRTL_RESOURCE Resource
3120 _In_ PRTL_RESOURCE Resource
3127 _In_ PRTL_RESOURCE Resource
3133 RtlInitializeResource(
3134 _In_ PRTL_RESOURCE Resource
3141 _In_ PRTL_RESOURCE Resource
3145 // Compression Functions
3147 NTSYSAPI
//NT_RTL_COMPRESS_API
3151 _In_ USHORT CompressionFormatAndEngine
,
3152 _In_reads_bytes_(UncompressedBufferSize
) PUCHAR UncompressedBuffer
,
3153 _In_ ULONG UncompressedBufferSize
,
3154 _Out_writes_bytes_to_(CompressedBufferSize
, *FinalCompressedSize
) PUCHAR CompressedBuffer
,
3155 _In_ ULONG CompressedBufferSize
,
3156 _In_ ULONG UncompressedChunkSize
,
3157 _Out_ PULONG FinalCompressedSize
,
3158 _In_ PVOID WorkSpace
3161 _IRQL_requires_max_(APC_LEVEL
)
3162 NTSYSAPI
//NT_RTL_COMPRESS_API
3165 RtlDecompressBuffer(
3166 _In_ USHORT CompressionFormat
,
3167 _Out_writes_bytes_to_(UncompressedBufferSize
, *FinalUncompressedSize
) PUCHAR UncompressedBuffer
,
3168 _In_ ULONG UncompressedBufferSize
,
3169 _In_reads_bytes_(CompressedBufferSize
) PUCHAR CompressedBuffer
,
3170 _In_ ULONG CompressedBufferSize
,
3171 _Out_ PULONG FinalUncompressedSize
3177 RtlGetCompressionWorkSpaceSize(
3178 _In_ USHORT CompressionFormatAndEngine
,
3179 _Out_ PULONG CompressBufferWorkSpaceSize
,
3180 _Out_ PULONG CompressFragmentWorkSpaceSize
3190 _In_ PTEB_ACTIVE_FRAME Frame
3197 _In_ PTEB_ACTIVE_FRAME Frame
3208 // Debug Info Functions
3211 PRTL_DEBUG_INFORMATION
3213 RtlCreateQueryDebugBuffer(
3215 _In_ BOOLEAN EventPair
3221 RtlDestroyQueryDebugBuffer(IN PRTL_DEBUG_INFORMATION DebugBuffer
);
3226 RtlQueryProcessDebugInformation(
3227 _In_ ULONG ProcessId
,
3228 _In_ ULONG DebugInfoClassMask
,
3229 _Inout_ PRTL_DEBUG_INFORMATION DebugBuffer
3235 #ifdef NTOS_MODE_USER
3241 _In_ PRTL_BITMAP BitMapHeader
,
3242 _In_ ULONG StartingIndex
,
3250 _In_ PRTL_BITMAP BitMapHeader
,
3251 _In_ ULONG StartingIndex
,
3259 _In_ PRTL_BITMAP BitMapHeader
3266 _In_ PRTL_BITMAP BitMapHeader
,
3267 _In_range_(<, BitMapHeader
->SizeOfBitMap
) ULONG BitNumber
3274 _In_ PRTL_BITMAP BitMapHeader
,
3275 _In_range_(0, BitMapHeader
->SizeOfBitMap
- NumberToClear
) ULONG StartingIndex
,
3276 _In_range_(0, BitMapHeader
->SizeOfBitMap
- StartingIndex
) ULONG NumberToClear
3283 _In_ PRTL_BITMAP BitMapHeader
,
3284 _In_ ULONG NumberToFind
,
3285 _In_ ULONG HintIndex
3291 RtlFindClearBitsAndSet(
3292 _In_ PRTL_BITMAP BitMapHeader
,
3293 _In_ ULONG NumberToFind
,
3294 _In_ ULONG HintIndex
3300 RtlFindFirstRunClear(
3301 _In_ PRTL_BITMAP BitMapHeader
,
3302 _Out_ PULONG StartingIndex
3309 _In_ PRTL_BITMAP BitMapHeader
,
3310 _Out_writes_to_(SizeOfRunArray
, return) PRTL_BITMAP_RUN RunArray
,
3311 _In_range_(>, 0) ULONG SizeOfRunArray
,
3312 _In_ BOOLEAN LocateLongestRuns
3318 RtlFindLastBackwardRunClear(
3319 _In_ PRTL_BITMAP BitMapHeader
,
3320 _In_ ULONG FromIndex
,
3321 _Out_ PULONG StartingRunIndex
3327 RtlFindLeastSignificantBit(
3328 _In_ ULONGLONG Value
3334 RtlFindLongestRunClear(
3335 _In_ PRTL_BITMAP BitMapHeader
,
3336 _Out_ PULONG StartingIndex
3342 RtlFindMostSignificantBit(
3343 _In_ ULONGLONG Value
3349 RtlFindNextForwardRunClear(
3350 _In_ PRTL_BITMAP BitMapHeader
,
3351 _In_ ULONG FromIndex
,
3352 _Out_ PULONG StartingRunIndex
3358 RtlFindNextForwardRunSet(
3359 _In_ PRTL_BITMAP BitMapHeader
,
3360 _In_ ULONG FromIndex
,
3361 _Out_ PULONG StartingRunIndex
3368 _In_ PRTL_BITMAP BitMapHeader
,
3369 _In_ ULONG NumberToFind
,
3370 _In_ ULONG HintIndex
3376 RtlFindSetBitsAndClear(
3377 _In_ PRTL_BITMAP BitMapHeader
,
3378 _In_ ULONG NumberToFind
,
3379 _In_ ULONG HintIndex
3382 #ifdef _REACTOS_ // ReactOS improvement
3383 _At_(BitMapHeader
->SizeOfBitMap
, _Post_equal_to_(SizeOfBitMap
))
3384 _At_(BitMapHeader
->Buffer
, _Post_equal_to_(BitMapBuffer
))
3389 RtlInitializeBitMap(
3390 _Out_ PRTL_BITMAP BitMapHeader
,
3391 _In_opt_ __drv_aliasesMem PULONG BitMapBuffer
,
3392 _In_opt_ ULONG SizeOfBitMap
3398 RtlNumberOfClearBits(
3399 _In_ PRTL_BITMAP BitMapHeader
3406 _In_ PRTL_BITMAP BitMapHeader
3413 _In_ PRTL_BITMAP BitMapHeader
,
3414 _In_range_(<, BitMapHeader
->SizeOfBitMap
) ULONG BitNumber
3421 _In_ PRTL_BITMAP BitMapHeader
,
3422 _In_range_(0, BitMapHeader
->SizeOfBitMap
- NumberToSet
) ULONG StartingIndex
,
3423 _In_range_(0, BitMapHeader
->SizeOfBitMap
- StartingIndex
) ULONG NumberToSet
3430 _In_ PRTL_BITMAP BitMapHeader
3433 _Must_inspect_result_
3438 _In_ PRTL_BITMAP BitMapHeader
,
3439 _In_range_(<, BitMapHeader
->SizeOfBitMap
) ULONG BitNumber
3442 #if defined(_M_AMD64)
3443 _Must_inspect_result_
3447 _In_ PRTL_BITMAP BitMapHeader
,
3448 _In_range_(<, BitMapHeader
->SizeOfBitMap
) ULONG BitPosition
)
3450 return BitTest64((LONG64 CONST
*)BitMapHeader
->Buffer
, (LONG64
)BitPosition
);
3453 #define RtlCheckBit(BMH,BP) (((((PLONG)(BMH)->Buffer)[(BP)/32]) >> ((BP)%32)) & 0x1)
3454 #endif /* defined(_M_AMD64) */
3456 #endif // NTOS_MODE_USER
3466 _In_ HANDLE TimerQueue
,
3467 _In_ PHANDLE phNewTimer
,
3468 _In_ WAITORTIMERCALLBACKFUNC Callback
,
3469 _In_ PVOID Parameter
,
3478 RtlCreateTimerQueue(PHANDLE TimerQueue
);
3484 _In_ HANDLE TimerQueue
,
3486 _In_ HANDLE CompletionEvent
3493 _In_ HANDLE TimerQueue
,
3502 RtlDeleteTimerQueueEx(
3503 _In_ HANDLE TimerQueue
,
3504 _In_opt_ HANDLE CompletionEvent
3510 RtlDeleteTimerQueue(HANDLE TimerQueue
);
3517 InterlockedPushListSList(
3518 _Inout_ PSLIST_HEADER ListHead
,
3519 _Inout_ __drv_aliasesMem PSLIST_ENTRY List
,
3520 _Inout_ PSLIST_ENTRY ListEnd
,
3525 // Range List functions
3530 RtlInitializeRangeList(
3531 _Inout_ PRTL_RANGE_LIST RangeList
3538 _In_ PRTL_RANGE_LIST RangeList
3545 _Inout_ PRTL_RANGE_LIST RangeList
,
3546 _In_ ULONGLONG Start
,
3548 _In_ UCHAR Attributes
,
3550 _In_opt_ PVOID UserData
,
3551 _In_opt_ PVOID Owner
3560 _In_z_ _Printf_format_string_ PCSTR Format
,
3568 _In_ ULONG ComponentId
,
3570 _In_z_ _Printf_format_string_ PCSTR Format
,
3579 _Out_writes_bytes_(MaximumResponseLength
) PCH Response
,
3580 _In_ ULONG MaximumResponseLength
3583 #undef DbgBreakPoint
3592 DbgLoadImageSymbols(
3595 _In_ ULONG_PTR ProcessId
3600 DbgUnLoadImageSymbols(
3603 _In_ ULONG_PTR ProcessId
3614 // Generic Table Functions
3616 #if defined(NTOS_MODE_USER) || defined(_NTIFS_)
3620 RtlInsertElementGenericTable(
3621 _In_ PRTL_GENERIC_TABLE Table
,
3622 _In_reads_bytes_(BufferSize
) PVOID Buffer
,
3623 _In_ CLONG BufferSize
,
3624 _Out_opt_ PBOOLEAN NewElement
3630 RtlInsertElementGenericTableFull(
3631 _In_ PRTL_GENERIC_TABLE Table
,
3632 _In_reads_bytes_(BufferSize
) PVOID Buffer
,
3633 _In_ CLONG BufferSize
,
3634 _Out_opt_ PBOOLEAN NewElement
,
3635 _In_ PVOID NodeOrParent
,
3636 _In_ TABLE_SEARCH_RESULT SearchResult
3642 RtlIsGenericTableEmpty(
3643 _In_ PRTL_GENERIC_TABLE Table
3649 RtlLookupElementGenericTableFull(
3650 _In_ PRTL_GENERIC_TABLE Table
,
3652 _Out_ PVOID
*NodeOrParent
,
3653 _Out_ TABLE_SEARCH_RESULT
*SearchResult
3658 // Handle Table Functions
3661 PRTL_HANDLE_TABLE_ENTRY
3664 _In_ PRTL_HANDLE_TABLE HandleTable
,
3665 _Inout_ PULONG Index
3671 RtlDestroyHandleTable(
3672 _Inout_ PRTL_HANDLE_TABLE HandleTable
);
3678 _In_ PRTL_HANDLE_TABLE HandleTable
,
3679 _In_ PRTL_HANDLE_TABLE_ENTRY Handle
3685 RtlInitializeHandleTable(
3686 _In_ ULONG TableSize
,
3687 _In_ ULONG HandleSize
,
3688 _In_ PRTL_HANDLE_TABLE HandleTable
3695 _In_ PRTL_HANDLE_TABLE HandleTable
,
3696 _In_ PRTL_HANDLE_TABLE_ENTRY Handle
3699 _Success_(return!=FALSE
)
3703 RtlIsValidIndexHandle(
3704 _In_ PRTL_HANDLE_TABLE HandleTable
,
3706 _Out_ PRTL_HANDLE_TABLE_ENTRY
*Handle
3716 _In_ PVOID BaseAddress
,
3718 _In_ ULONG Language
,
3719 _In_ ULONG MessageId
,
3720 _Out_ PMESSAGE_RESOURCE_ENTRY
*MessageResourceEntry
3726 RtlGetNtGlobalFlags(VOID
);
3728 _Success_(return!=NULL
)
3732 RtlImageDirectoryEntryToData(
3733 _In_ PVOID BaseAddress
,
3734 _In_ BOOLEAN MappedAsImage
,
3735 _In_ USHORT Directory
,
3743 _In_ PIMAGE_NT_HEADERS NtHeader
,
3744 _In_ PVOID BaseAddress
,
3746 _Inout_opt_ PIMAGE_SECTION_HEADER
*SectionHeader
3753 _In_ PVOID BaseAddress
);
3760 _In_ PVOID BaseAddress
,
3761 _In_ ULONGLONG Size
,
3762 _Out_ PIMAGE_NT_HEADERS
*NtHeader
3766 PIMAGE_SECTION_HEADER
3768 RtlImageRvaToSection(
3769 _In_ PIMAGE_NT_HEADERS NtHeader
,
3770 _In_ PVOID BaseAddress
,
3777 LdrRelocateImageWithBias(
3778 _In_ PVOID NewAddress
,
3779 _In_ LONGLONG AdditionalBias
,
3780 _In_ PCCH LoaderName
,
3782 _In_ ULONG Conflict
,
3787 // Activation Context Functions
3789 #ifdef NTOS_MODE_USER
3793 RtlActivateActivationContextEx(
3797 _Out_ PULONG_PTR Cookie
3803 RtlActivateActivationContext(
3806 _Out_ PULONG_PTR Cookie
3812 RtlAddRefActivationContext(
3817 PRTL_ACTIVATION_CONTEXT_STACK_FRAME
3819 RtlActivateActivationContextUnsafeFast(
3820 _In_ PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame
,
3827 RtlAllocateActivationContextStack(
3828 _In_ PACTIVATION_CONTEXT_STACK
*Stack
3834 RtlCreateActivationContext(
3836 _In_ PACTIVATION_CONTEXT_DATA ActivationContextData
,
3837 _In_ ULONG ExtraBytes
,
3838 _In_ PVOID NotificationRoutine
,
3839 _In_ PVOID NotificationContext
,
3840 _Out_ PACTIVATION_CONTEXT
*ActCtx
3846 RtlGetActiveActivationContext(
3853 RtlReleaseActivationContext(
3860 RtlDeactivateActivationContext(
3862 _In_ ULONG_PTR ulCookie
3868 RtlFreeActivationContextStack(
3869 _In_ PACTIVATION_CONTEXT_STACK Stack
3875 RtlFreeThreadActivationContextStack(VOID
);
3878 PRTL_ACTIVATION_CONTEXT_STACK_FRAME
3880 RtlDeactivateActivationContextUnsafeFast(
3881 _In_ PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame
3887 RtlDosApplyFileIsolationRedirection_Ustr(
3889 _In_ PUNICODE_STRING OriginalName
,
3890 _In_ PUNICODE_STRING Extension
,
3891 _Inout_ PUNICODE_STRING StaticString
,
3892 _Inout_ PUNICODE_STRING DynamicString
,
3893 _Inout_ PUNICODE_STRING
*NewName
,
3894 _In_ PULONG NewFlags
,
3895 _In_ PSIZE_T FileNameSize
,
3896 _In_ PSIZE_T RequiredLength
3902 RtlFindActivationContextSectionString(
3904 _In_
const GUID
*ExtensionGuid
,
3905 _In_ ULONG SectionType
,
3906 _In_
const UNICODE_STRING
*SectionName
,
3907 _Inout_ PVOID ReturnedData
3913 RtlQueryInformationActivationContext(
3915 _In_opt_ PVOID Context
,
3916 _In_opt_ PVOID pvSubInstance
,
3917 _In_ ULONG ulInfoClass
,
3918 _Out_bytecap_(cbBuffer
) PVOID pvBuffer
,
3919 _In_opt_ SIZE_T cbBuffer
,
3920 _Out_opt_ SIZE_T
*pcbWrittenOrRequired
3926 RtlQueryInformationActiveActivationContext(
3927 _In_ ULONG ulInfoClass
,
3928 _Out_bytecap_(cbBuffer
) PVOID pvBuffer
,
3929 _In_opt_ SIZE_T cbBuffer
,
3930 _Out_opt_ SIZE_T
*pcbWrittenOrRequired
3936 RtlZombifyActivationContext(
3946 RtlWow64EnableFsRedirection(
3947 _In_ BOOLEAN Wow64FsEnableRedirection
3953 RtlWow64EnableFsRedirectionEx(
3954 _In_ PVOID Wow64FsEnableRedirection
,
3955 _Out_ PVOID
*OldFsRedirectionLevel
3961 // Registry Functions
3963 _IRQL_requires_max_(PASSIVE_LEVEL
)
3964 _Must_inspect_result_
3968 RtlCheckRegistryKey(
3969 _In_ ULONG RelativeTo
,
3976 RtlCreateRegistryKey(
3977 _In_ ULONG RelativeTo
,
3984 RtlFormatCurrentUserKeyPath(
3985 _Out_
_At_(KeyPath
->Buffer
, __drv_allocatesMem(Mem
) _Post_bytecap_(KeyPath
->MaximumLength
) _Post_bytecount_(KeyPath
->Length
))
3986 PUNICODE_STRING KeyPath
3993 _In_ ACCESS_MASK DesiredAccess
,
3994 _Out_ PHANDLE KeyHandle
3997 _IRQL_requires_max_(PASSIVE_LEVEL
)
4001 RtlQueryRegistryValues(
4002 _In_ ULONG RelativeTo
,
4004 _Inout_
_At_(*(*QueryTable
).EntryContext
, _Pre_unknown_
)
4005 PRTL_QUERY_REGISTRY_TABLE QueryTable
,
4006 _In_opt_ PVOID Context
,
4007 _In_opt_ PVOID Environment
4010 _IRQL_requires_max_(PASSIVE_LEVEL
)
4014 RtlWriteRegistryValue(
4015 _In_ ULONG RelativeTo
,
4017 _In_z_ PCWSTR ValueName
,
4018 _In_ ULONG ValueType
,
4019 _In_reads_bytes_opt_(ValueLength
) PVOID ValueData
,
4020 _In_ ULONG ValueLength
4023 #ifdef NTOS_MODE_USER
4028 _Out_ HANDLE KeyHandle
,
4029 _In_ ACCESS_MASK DesiredAccess
,
4030 _In_ POBJECT_ATTRIBUTES ObjectAttributes
,
4031 _In_ ULONG TitleIndex
,
4032 _In_ PUNICODE_STRING Class
,
4033 _Out_ PULONG Disposition
4039 RtlpNtEnumerateSubKey(
4040 _In_ HANDLE KeyHandle
,
4041 _Inout_ PUNICODE_STRING SubKeyName
,
4049 RtlpNtMakeTemporaryKey(
4050 _In_ HANDLE KeyHandle
4057 _Out_ HANDLE KeyHandle
,
4058 _In_ ACCESS_MASK DesiredAccess
,
4059 _In_ POBJECT_ATTRIBUTES ObjectAttributes
,
4066 RtlpNtQueryValueKey(
4067 _In_ HANDLE KeyHandle
,
4068 _Out_opt_ PULONG Type
,
4069 _Out_opt_ PVOID Data
,
4070 _Inout_opt_ PULONG DataLength
,
4078 _In_ HANDLE KeyHandle
,
4081 _In_ ULONG DataLength
4091 RtlGetDefaultCodePage(
4092 _Out_ PUSHORT AnsiCodePage
,
4093 _Out_ PUSHORT OemCodePage
4100 _In_ PUSHORT AnsiTableBase
,
4101 _In_ PUSHORT OemTableBase
,
4102 _In_ PUSHORT CaseTableBase
,
4103 _Out_ PNLSTABLEINFO NlsTable
4106 _IRQL_requires_max_(PASSIVE_LEVEL
)
4110 RtlInitCodePageTable(
4111 _In_ PUSHORT TableBase
,
4112 _Out_ PCPTABLEINFO CodePageTable
4118 RtlResetRtlTranslations(
4119 _In_ PNLSTABLEINFO NlsTable
);
4121 #if defined(NTOS_MODE_USER) && !defined(NO_RTL_INLINES)
4124 // Misc conversion functions
4129 RtlConvertLongToLargeInteger(
4130 _In_ LONG SignedInteger
4133 LARGE_INTEGER Result
;
4135 Result
.QuadPart
= SignedInteger
;
4142 RtlEnlargedIntegerMultiply(
4143 _In_ LONG Multiplicand
,
4144 _In_ LONG Multiplier
4147 LARGE_INTEGER Product
;
4149 Product
.QuadPart
= (LONGLONG
)Multiplicand
* (ULONGLONG
)Multiplier
;
4156 RtlEnlargedUnsignedDivide(
4157 _In_ ULARGE_INTEGER Dividend
,
4159 _In_opt_ PULONG Remainder
4164 Quotient
= (ULONG
)(Dividend
.QuadPart
/ Divisor
);
4166 *Remainder
= (ULONG
)(Dividend
.QuadPart
% Divisor
);
4175 RtlEnlargedUnsignedMultiply(
4176 _In_ ULONG Multiplicand
,
4177 _In_ ULONG Multiplier
4180 LARGE_INTEGER Product
;
4182 Product
.QuadPart
= (ULONGLONG
)Multiplicand
* (ULONGLONG
)Multiplier
;
4186 #if defined(_AMD64_) || defined(_IA64_)
4190 RtlExtendedLargeIntegerDivide(
4191 _In_ LARGE_INTEGER Dividend
,
4193 _Out_opt_ PULONG Remainder
)
4196 ret
.QuadPart
= (ULONG64
)Dividend
.QuadPart
/ Divisor
;
4198 *Remainder
= (ULONG
)(Dividend
.QuadPart
% Divisor
);
4206 RtlExtendedLargeIntegerDivide(
4207 _In_ LARGE_INTEGER Dividend
,
4209 _Out_opt_ PULONG Remainder
4212 #endif /* defined(_AMD64_) || defined(_IA64_) */
4235 _In_ ULONG InitialCrc
,
4241 // Network Functions
4246 RtlIpv4AddressToStringA(
4247 _In_
const struct in_addr
*Addr
,
4248 _Out_writes_(16) PCHAR S
4254 RtlIpv4AddressToStringW(
4255 _In_
const struct in_addr
*Addr
,
4256 _Out_writes_(16) PWCHAR S
4262 RtlIpv4AddressToStringExA(
4263 _In_
const struct in_addr
*Address
,
4265 _Out_writes_to_(*AddressStringLength
, *AddressStringLength
) PCHAR AddressString
,
4266 _Inout_ PULONG AddressStringLength
4271 RtlIpv4AddressToStringExW(
4272 _In_
const struct in_addr
*Address
,
4274 _Out_writes_to_(*AddressStringLength
, *AddressStringLength
) PWCHAR AddressString
,
4275 _Inout_ PULONG AddressStringLength
4281 RtlIpv4StringToAddressA(
4283 _In_ BOOLEAN Strict
,
4284 _Out_ PCSTR
*Terminator
,
4285 _Out_
struct in_addr
*Addr
4291 RtlIpv4StringToAddressW(
4293 _In_ BOOLEAN Strict
,
4294 _Out_ PCWSTR
*Terminator
,
4295 _Out_
struct in_addr
*Addr
4301 RtlIpv4StringToAddressExA(
4302 _In_ PCSTR AddressString
,
4303 _In_ BOOLEAN Strict
,
4304 _Out_
struct in_addr
*Address
,
4311 RtlIpv4StringToAddressExW(
4312 _In_ PCWSTR AddressString
,
4313 _In_ BOOLEAN Strict
,
4314 _Out_
struct in_addr
*Address
,
4321 RtlIpv6AddressToStringA(
4322 _In_
const struct in6_addr
*Addr
,
4323 _Out_writes_(46) PSTR S
4329 RtlIpv6AddressToStringW(
4330 _In_
const struct in6_addr
*Addr
,
4331 _Out_writes_(46) PWSTR S
4337 RtlIpv6AddressToStringExA(
4338 _In_
const struct in6_addr
*Address
,
4341 _Out_writes_to_(*AddressStringLength
, *AddressStringLength
) PSTR AddressString
,
4342 _Inout_ PULONG AddressStringLength
4348 RtlIpv6AddressToStringExW(
4349 _In_
const struct in6_addr
*Address
,
4352 _Out_writes_to_(*AddressStringLength
, *AddressStringLength
) PWCHAR AddressString
,
4353 _Inout_ PULONG AddressStringLength
4359 RtlIpv6StringToAddressA(
4361 _Out_ PCSTR
*Terminator
,
4362 _Out_
struct in6_addr
*Addr
4368 RtlIpv6StringToAddressW(
4370 _Out_ PCWSTR
*Terminator
,
4371 _Out_
struct in6_addr
*Addr
4377 RtlIpv6StringToAddressExA(
4378 _In_ PCSTR AddressString
,
4379 _Out_
struct in6_addr
*Address
,
4380 _Out_ PULONG ScopeId
,
4387 RtlIpv6StringToAddressExW(
4388 _In_ PCWSTR AddressString
,
4389 _Out_
struct in6_addr
*Address
,
4390 _Out_ PULONG ScopeId
,
4401 RtlQueryTimeZoneInformation(
4402 _Out_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation
);
4407 RtlSecondsSince1970ToTime(
4408 _In_ ULONG SecondsSince1970
,
4409 _Out_ PLARGE_INTEGER Time
4415 RtlSetTimeZoneInformation(
4416 _In_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation
);
4418 _Success_(return!=FALSE
)
4419 _Must_inspect_result_
4423 RtlTimeFieldsToTime(
4424 _In_ PTIME_FIELDS TimeFields
,
4425 _Out_ PLARGE_INTEGER Time
4428 _Success_(return != 0)
4429 _Must_inspect_result_
4433 RtlTimeToSecondsSince1970(
4434 _In_ PLARGE_INTEGER Time
,
4435 _Out_ PULONG ElapsedSeconds
4441 RtlTimeToTimeFields(
4442 PLARGE_INTEGER Time
,
4443 PTIME_FIELDS TimeFields
4449 RtlSystemTimeToLocalTime(
4450 _In_ PLARGE_INTEGER SystemTime
,
4451 _Out_ PLARGE_INTEGER LocalTime
4455 // Version Functions
4457 _IRQL_requires_max_(PASSIVE_LEVEL
)
4458 _Must_inspect_result_
4462 RtlVerifyVersionInfo(
4463 _In_ PRTL_OSVERSIONINFOEXW VersionInfo
,
4464 _In_ ULONG TypeMask
,
4465 _In_ ULONGLONG ConditionMask
4468 _IRQL_requires_max_(PASSIVE_LEVEL
)
4474 _At_(lpVersionInformation
->dwOSVersionInfoSize
, _Pre_ _Valid_
)
4475 _When_(lpVersionInformation
->dwOSVersionInfoSize
== sizeof(RTL_OSVERSIONINFOEXW
),
4476 _At_((PRTL_OSVERSIONINFOEXW
)lpVersionInformation
, _Out_
))
4477 PRTL_OSVERSIONINFOW lpVersionInformation
4483 RtlGetNtProductType(OUT PNT_PRODUCT_TYPE ProductType
);
4486 // Secure Memory Functions
4488 #ifdef NTOS_MODE_USER
4492 RtlRegisterSecureMemoryCacheCallback(
4493 _In_ PRTL_SECURE_MEMORY_CACHE_CALLBACK Callback
);
4498 RtlFlushSecureMemoryCache(
4499 _In_ PVOID MemoryCache
,
4500 _In_opt_ SIZE_T MemoryLength
4505 // Boot Status Data Functions
4507 #ifdef NTOS_MODE_USER
4511 RtlCreateBootStatusDataFile(
4518 RtlGetSetBootStatusData(
4519 _In_ HANDLE FileHandle
,
4520 _In_ BOOLEAN WriteMode
,
4521 _In_ RTL_BSD_ITEM_TYPE DataClass
,
4523 _In_ ULONG BufferSize
,
4524 _Out_opt_ PULONG ReturnLength
4530 RtlLockBootStatusData(
4531 _Out_ PHANDLE FileHandle
4537 RtlUnlockBootStatusData(
4538 _In_ HANDLE FileHandle
4542 #ifdef NTOS_MODE_USER
4543 _Must_inspect_result_
4548 _In_ PUNICODE_STRING GuidString
,
4551 _Must_inspect_result_
4557 _Out_
_At_(GuidString
->Buffer
, __drv_allocatesMem(Mem
))
4558 PUNICODE_STRING GuidString
);
4563 RtlComputeImportTableHash(
4566 _In_ ULONG ImportTableHashRevision
4571 // MemoryStream functions
4573 #ifdef NTOS_MODE_USER
4578 RtlInitMemoryStream(
4579 _Out_ PRTL_MEMORY_STREAM Stream
4585 RtlInitOutOfProcessMemoryStream(
4586 _Out_ PRTL_MEMORY_STREAM Stream
4592 RtlFinalReleaseOutOfProcessMemoryStream(
4593 _In_ PRTL_MEMORY_STREAM Stream
4599 RtlQueryInterfaceMemoryStream(
4600 _In_
struct IStream
*This
,
4601 _In_ REFIID RequestedIid
,
4602 _Outptr_ PVOID
*ResultObject
4608 RtlAddRefMemoryStream(
4609 _In_
struct IStream
*This
4615 RtlReleaseMemoryStream(
4616 _In_
struct IStream
*This
4622 RtlReadMemoryStream(
4623 _In_
struct IStream
*This
,
4624 _Out_writes_bytes_(Length
) PVOID Buffer
,
4626 _Out_opt_ PULONG BytesRead
4632 RtlReadOutOfProcessMemoryStream(
4633 _In_
struct IStream
*This
,
4634 _Out_writes_bytes_(Length
) PVOID Buffer
,
4636 _Out_opt_ PULONG BytesRead
4642 RtlSeekMemoryStream(
4643 _In_
struct IStream
*This
,
4644 _In_ LARGE_INTEGER RelativeOffset
,
4646 _Out_opt_ PULARGE_INTEGER ResultOffset
4652 RtlCopyMemoryStreamTo(
4653 _In_
struct IStream
*This
,
4654 _In_
struct IStream
*Target
,
4655 _In_ ULARGE_INTEGER Length
,
4656 _Out_opt_ PULARGE_INTEGER BytesRead
,
4657 _Out_opt_ PULARGE_INTEGER BytesWritten
4663 RtlCopyOutOfProcessMemoryStreamTo(
4664 _In_
struct IStream
*This
,
4665 _In_
struct IStream
*Target
,
4666 _In_ ULARGE_INTEGER Length
,
4667 _Out_opt_ PULARGE_INTEGER BytesRead
,
4668 _Out_opt_ PULARGE_INTEGER BytesWritten
4674 RtlStatMemoryStream(
4675 _In_
struct IStream
*This
,
4676 _Out_
struct tagSTATSTG
*Stats
,
4684 RtlWriteMemoryStream(
4685 _In_
struct IStream
*This
,
4686 _In_reads_bytes_(Length
) CONST VOID
*Buffer
,
4688 _Out_opt_ PULONG BytesWritten
4694 RtlSetMemoryStreamSize(
4695 _In_
struct IStream
*This
,
4696 _In_ ULARGE_INTEGER NewSize
4702 RtlCommitMemoryStream(
4703 _In_
struct IStream
*This
,
4704 _In_ ULONG CommitFlags
4710 RtlRevertMemoryStream(
4711 _In_
struct IStream
*This
4717 RtlLockMemoryStreamRegion(
4718 _In_
struct IStream
*This
,
4719 _In_ ULARGE_INTEGER Offset
,
4720 _In_ ULARGE_INTEGER Length
,
4727 RtlUnlockMemoryStreamRegion(
4728 _In_
struct IStream
*This
,
4729 _In_ ULARGE_INTEGER Offset
,
4730 _In_ ULARGE_INTEGER Length
,
4737 RtlCloneMemoryStream(
4738 _In_
struct IStream
*This
,
4739 _Outptr_
struct IStream
**ResultStream
4742 #endif // NTOS_MODE_USER
4747 RtlFindActivationContextSectionGuid(
4749 const GUID
*extguid
,