ReactOS 0.4.16-dev-340-g0540c21
rtlfuncs.h File Reference

Go to the source code of this file.

Macros

#define FAST_FAIL_LEGACY_GS_VIOLATION   0
 
#define FAST_FAIL_VTGUARD_CHECK_FAILURE   1
 
#define FAST_FAIL_STACK_COOKIE_CHECK_FAILURE   2
 
#define FAST_FAIL_CORRUPT_LIST_ENTRY   3
 
#define FAST_FAIL_INCORRECT_STACK   4
 
#define FAST_FAIL_INVALID_ARG   5
 
#define FAST_FAIL_GS_COOKIE_INIT   6
 
#define FAST_FAIL_FATAL_APP_EXIT   7
 
#define FAST_FAIL_RANGE_CHECK_FAILURE   8
 
#define FAST_FAIL_UNSAFE_REGISTRY_ACCESS   9
 
#define FAST_FAIL_GUARD_ICALL_CHECK_FAILURE   10
 
#define FAST_FAIL_GUARD_WRITE_CHECK_FAILURE   11
 
#define FAST_FAIL_INVALID_FIBER_SWITCH   12
 
#define FAST_FAIL_INVALID_SET_OF_CONTEXT   13
 
#define FAST_FAIL_INVALID_REFERENCE_COUNT   14
 
#define FAST_FAIL_INVALID_JUMP_BUFFER   18
 
#define FAST_FAIL_MRDATA_MODIFIED   19
 
#define FAST_FAIL_INVALID_FAST_FAIL_CODE   0xFFFFFFFF
 
#define RTL_STATIC_LIST_HEAD(x)   LIST_ENTRY x = { &x, &x }
 
#define RtlCopyMemory(Destination, Source, Length)    memcpy(Destination, Source, Length)
 
#define RtlCopyBytes   RtlCopyMemory
 
#define RtlCopyMemoryNonTemporal   RtlCopyMemory
 
#define RtlEqualLuid(Luid1, Luid2)    (((Luid1)->LowPart == (Luid2)->LowPart) && ((Luid1)->HighPart == (Luid2)->HighPart))
 
#define RtlEqualMemory(Destination, Source, Length)    (!memcmp(Destination, Source, Length))
 
#define RtlFillMemory(Destination, Length, Fill)    memset(Destination, Fill, Length)
 
#define RtlFillBytes   RtlFillMemory
 
#define RtlMoveMemory(Destination, Source, Length)    memmove(Destination, Source, Length)
 
#define RtlZeroMemory(Destination, Length)    memset(Destination, 0, Length)
 
#define RtlZeroBytes   RtlZeroMemory
 
#define RtlAnsiStringToUnicodeSize(String)
 
#define RtlIntPtrToUnicodeString(Value, Base, String)    RtlIntegerToUnicodeString(Value, Base, String)
 
#define RtlIsZeroLuid(_L1)    ((BOOLEAN) ((!(_L1)->LowPart) && (!(_L1)->HighPart)))
 
#define SHORT_SIZE   (sizeof(USHORT))
 
#define SHORT_MASK   (SHORT_SIZE - 1)
 
#define LONG_SIZE   (sizeof(LONG))
 
#define LONGLONG_SIZE   (sizeof(LONGLONG))
 
#define LONG_MASK   (LONG_SIZE - 1)
 
#define LONGLONG_MASK   (LONGLONG_SIZE - 1)
 
#define LOWBYTE_MASK   0x00FF
 
#define FIRSTBYTE(VALUE)   ((VALUE) & LOWBYTE_MASK)
 
#define SECONDBYTE(VALUE)   (((VALUE) >> 8) & LOWBYTE_MASK)
 
#define THIRDBYTE(VALUE)   (((VALUE) >> 16) & LOWBYTE_MASK)
 
#define FOURTHBYTE(VALUE)   (((VALUE) >> 24) & LOWBYTE_MASK)
 
#define RtlStoreUlong(Address, Value)
 
#define RtlStoreUlonglong(Address, Value)
 
#define RtlStoreUshort(Address, Value)
 
#define RtlRetrieveUshort(DestAddress, SrcAddress)
 
#define RtlRetrieveUlong(DestAddress, SrcAddress)
 
#define RtlStoreUlongPtr(Address, Value)   RtlStoreUlong(Address,Value)
 
#define RtlUnicodeStringToAnsiSize(String)
 
#define RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT   8
 
#define RtlLargeIntegerAnd(Result, Source, Mask)    Result.QuadPart = Source.QuadPart & Mask.QuadPart
 
#define RtlLargeIntegerEqualTo(X, Y)    (!(((X).LowPart ^ (Y).LowPart) | ((X).HighPart ^ (Y).HighPart)))
 
#define RtlCheckBit(BMH, BP)   (((((PLONG)(BMH)->Buffer)[(BP)/32]) >> ((BP)%32)) & 0x1)
 
#define RtlLargeIntegerGreaterThan(X, Y)
 
#define RtlLargeIntegerGreaterThanOrEqualTo(X, Y)
 
#define RtlLargeIntegerNotEqualTo(X, Y)
 
#define RtlLargeIntegerLessThan(X, Y)
 
#define RtlLargeIntegerLessThanOrEqualTo(X, Y)
 
#define RtlLargeIntegerGreaterThanZero(X)
 
#define RtlLargeIntegerGreaterOrEqualToZero(X)   ( (X).HighPart >= 0 )
 
#define RtlLargeIntegerEqualToZero(X)   ( !((X).LowPart | (X).HighPart) )
 
#define RtlLargeIntegerNotEqualToZero(X)   ( ((X).LowPart | (X).HighPart) )
 
#define RtlLargeIntegerLessThanZero(X)   ( ((X).HighPart < 0) )
 
#define RtlLargeIntegerLessOrEqualToZero(X)   ( ((X).HighPart < 0) || !((X).LowPart | (X).HighPart) )
 
#define RtlUshortByteSwap(_x)   _byteswap_ushort((USHORT)(_x))
 
#define RtlUlongByteSwap(_x)   _byteswap_ulong((_x))
 
#define RtlUlonglongByteSwap(_x)   _byteswap_uint64((_x))
 
#define __assert_annotationA(msg)    DbgPrint("Assertion failed at %s(%d): %s\n", __FILE__, __LINE__, msg)
 
#define __assert_annotationW(msg)    DbgPrint("Assertion failed at %s(%d): %S\n", __FILE__, __LINE__, msg)
 
#define NT_ANALYSIS_ASSUME(_exp)   __noop(_exp)
 
#define NT_ASSERT_ACTION(exp)
 
#define NT_ASSERTMSG_ACTION(msg, exp)
 
#define NT_ASSERTMSGW_ACTION(msg, exp)
 
#define ASSERT(exp)   ((void)0)
 
#define ASSERTMSG(msg, exp)   ((void)0)
 
#define RTL_SOFT_ASSERT(exp)   ((void)0)
 
#define RTL_SOFT_ASSERTMSG(msg, exp)   ((void)0)
 
#define RTL_VERIFY(exp)   ((exp) ? TRUE : FALSE)
 
#define RTL_VERIFYMSG(msg, exp)   ((exp) ? TRUE : FALSE)
 
#define RTL_SOFT_VERIFY(exp)   ((exp) ? TRUE : FALSE)
 
#define RTL_SOFT_VERIFYMSG(msg, exp)   ((exp) ? TRUE : FALSE)
 
#define NT_VERIFY(exp)   (NT_ANALYSIS_ASSUME(exp), ((exp) ? TRUE : FALSE))
 
#define NT_VERIFYMSG(msg, exp)   (NT_ANALYSIS_ASSUME(exp), ((exp) ? TRUE : FALSE))
 
#define NT_VERIFYMSGW(msg, exp)   (NT_ANALYSIS_ASSUME(exp), ((exp) ? TRUE : FALSE))
 
#define NT_ASSERT_ASSUME(exp)   (NT_ANALYSIS_ASSUME(exp), (void)0)
 
#define NT_ASSERTMSG_ASSUME(msg, exp)   (NT_ANALYSIS_ASSUME(exp), (void)0)
 
#define NT_ASSERTMSGW_ASSUME(msg, exp)   (NT_ANALYSIS_ASSUME(exp), (void)0)
 
#define NT_ASSERT_NOASSUME(exp)   ((void)0)
 
#define NT_ASSERTMSG_NOASSUME(msg, exp)   ((void)0)
 
#define NT_ASSERTMSGW_NOASSUME(msg, exp)   ((void)0)
 
#define NT_FRE_ASSERT   (void)NT_ASSERT_ACTION
 
#define NT_FRE_ASSERTMSG   (void)NT_ASSERTMSG_ACTION
 
#define NT_FRE_ASSERTMSGW   (void)NT_ASSERTMSGW_ACTION
 
#define NT_ASSERT   NT_ASSERT_NOASSUME
 
#define NT_ASSERTMSG   NT_ASSERTMSG_NOASSUME
 
#define NT_ASSERTMSGW   NT_ASSERTMSGW_NOASSUME
 
#define InitializeListHead32(ListHead)
 
#define InterlockedPushEntrySList(SListHead, SListEntry)    ExpInterlockedPushEntrySList(SListHead, SListEntry)
 
#define InterlockedPopEntrySList(SListHead)    ExpInterlockedPopEntrySList(SListHead)
 
#define InterlockedFlushSList(SListHead)    ExpInterlockedFlushSList(SListHead)
 
#define QueryDepthSList(SListHead)    ExQueryDepthSList(SListHead)
 
#define RTL_CONTEXT_EX_OFFSET(ContextEx, Chunk)   ((ContextEx)->Chunk.Offset)
 
#define RTL_CONTEXT_EX_LENGTH(ContextEx, Chunk)   ((ContextEx)->Chunk.Length)
 
#define RTL_CONTEXT_EX_CHUNK(Base, Layout, Chunk)    ((PVOID)((PCHAR)(Base) + RTL_CONTEXT_EX_OFFSET(Layout, Chunk)))
 
#define RTL_CONTEXT_OFFSET(Context, Chunk)    RTL_CONTEXT_EX_OFFSET((PCONTEXT_EX)(Context + 1), Chunk)
 
#define RTL_CONTEXT_LENGTH(Context, Chunk)    RTL_CONTEXT_EX_LENGTH((PCONTEXT_EX)(Context + 1), Chunk)
 
#define RTL_CONTEXT_CHUNK(Context, Chunk)
 
#define RtlIsNtDdiVersionAvailable   WdmlibRtlIsNtDdiVersionAvailable
 
#define RtlIsServicePackVersionInstalled   WdmlibRtlIsServicePackVersionInstalled
 
#define RtlInterlockedSetBits(Flags, Flag)    InterlockedOr((PLONG)(Flags), Flag)
 
#define RtlInterlockedAndBits(Flags, Flag)    InterlockedAnd((PLONG)(Flags), Flag)
 
#define RtlInterlockedClearBits(Flags, Flag)    RtlInterlockedAndBits(Flags, ~(Flag))
 
#define RtlInterlockedXorBits(Flags, Flag)    InterlockedXor(Flags, Flag)
 
#define RtlInterlockedSetBitsDiscardReturn(Flags, Flag)    (VOID) RtlInterlockedSetBits(Flags, Flag)
 
#define RtlInterlockedAndBitsDiscardReturn(Flags, Flag)    (VOID) RtlInterlockedAndBits(Flags, Flag)
 
#define RtlInterlockedClearBitsDiscardReturn(Flags, Flag)    RtlInterlockedAndBitsDiscardReturn(Flags, ~(Flag))
 
#define RtlInitializeSplayLinks(Links)
 
#define RtlIsLeftChild(Links)    (RtlLeftChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))
 
#define RtlIsRightChild(Links)    (RtlRightChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))
 
#define RtlRightChild(Links)    ((PRTL_SPLAY_LINKS)(Links))->RightChild
 
#define RtlIsRoot(Links)    (RtlParent(Links) == (PRTL_SPLAY_LINKS)(Links))
 
#define RtlLeftChild(Links)    ((PRTL_SPLAY_LINKS)(Links))->LeftChild
 
#define RtlParent(Links)    ((PRTL_SPLAY_LINKS)(Links))->Parent
 
#define RtlInsertAsLeftChild(ParentLinks, ChildLinks)
 
#define RtlInsertAsRightChild(ParentLinks, ChildLinks)
 
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE   1
 
#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING   2
 
#define RtlUnicodeStringToOemSize(STRING)
 
#define RtlOemStringToUnicodeSize(STRING)
 
#define RtlOemStringToCountedUnicodeSize(STRING)
 
#define RtlOffsetToPointer(B, O)   ((PCHAR)(((PCHAR)(B)) + ((ULONG_PTR)(O))))
 
#define RtlPointerToOffset(B, P)   ((ULONG)(((PCHAR)(P)) - ((PCHAR)(B))))
 

Functions

 $if (_WDMDDK_||_WINNT_) DECLSPEC_NORETURN FORCEINLINE VOID RtlFailFast(_In_ ULONG Code)
 
 $endif (_WDMDDK_||_WINNT_) $if(_WDMDDK_) FORCEINLINE VOID InitializeListHead(_Out_ PLIST_ENTRY ListHead)
 
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty (_In_ const LIST_ENTRY *ListHead)
 
FORCEINLINE BOOLEAN RemoveEntryListUnsafe (_In_ PLIST_ENTRY Entry)
 
FORCEINLINE VOID FatalListEntryError (_In_ PVOID P1, _In_ PVOID P2, _In_ PVOID P3)
 
FORCEINLINE VOID RtlpCheckListEntry (_In_ PLIST_ENTRY Entry)
 
FORCEINLINE BOOLEAN RemoveEntryList (_In_ PLIST_ENTRY Entry)
 
FORCEINLINE PLIST_ENTRY RemoveHeadList (_Inout_ PLIST_ENTRY ListHead)
 
FORCEINLINE PLIST_ENTRY RemoveTailList (_Inout_ PLIST_ENTRY ListHead)
 
FORCEINLINE VOID InsertTailList (_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY Entry)
 
FORCEINLINE VOID InsertHeadList (_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY Entry)
 
FORCEINLINE VOID AppendTailList (_Inout_ PLIST_ENTRY ListHead, _Inout_ PLIST_ENTRY ListToAppend)
 
FORCEINLINE PSINGLE_LIST_ENTRY PopEntryList (_Inout_ PSINGLE_LIST_ENTRY ListHead)
 
FORCEINLINE VOID PushEntryList (_Inout_ PSINGLE_LIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PSINGLE_LIST_ENTRY Entry)
 
__analysis_noreturn NTSYSAPI VOID NTAPI RtlAssert (_In_ PVOID FailedAssertion, _In_ PVOID FileName, _In_ ULONG LineNumber, _In_opt_z_ PSTR Message)
 
 _IRQL_requires_max_ (PASSIVE_LEVEL) NTSYSAPI VOID NTAPI RtlFreeUnicodeString(_Inout_ _At_(UnicodeString -> Buffer, __drv_freesMem(Mem)) PUNICODE_STRING UnicodeString)
 Queries information details about a security descriptor.
 
 _IRQL_requires_max_ (DISPATCH_LEVEL) _At_(DestinationString -> Buffer, _Post_equal_to_(SourceString)) _When_(SourceString !=NULL, _At_(DestinationString->Length, _Post_equal_to_(_String_length_(SourceString) *sizeof(WCHAR))) _At_(DestinationString->MaximumLength, _Post_equal_to_(DestinationString->Length+sizeof(WCHAR)))) _When_(SourceString==NULL, _At_(DestinationString->Length, _Post_equal_to_(0)) _At_(DestinationString->MaximumLength, _Post_equal_to_(0))) NTSYSAPI VOID NTAPI RtlInitUnicodeString(_Out_ PUNICODE_STRING DestinationString, _In_opt_z_ __drv_aliasesMem PCWSTR SourceString)
 
_Out_ _At_ (GuidString->Buffer, __drv_allocatesMem(Mem)) PUNICODE_STRING GuidString)
 
 $endif (_WDMDDK_) $if(_WDMDDK_) _Must_inspect_result_ NTSYSAPI BOOLEAN NTAPI RtlAreBitsClear(_In_ PRTL_BITMAP BitMapHeader
 
_Must_inspect_result_ NTSYSAPI BOOLEAN NTAPI RtlAreBitsSet (_In_ PRTL_BITMAP BitMapHeader, _In_ ULONG StartingIndex, _In_ ULONG Length)
 
_Out_ _At_ (DestinationString->Buffer, __drv_allocatesMem(Mem))) _When_(!AllocateDestinationString
 
 _Success_ (1) _Unchanged_(Destination -> MaximumLength) _Unchanged_(Destination->Buffer) _When_(_Old_(Destination->Length)+Source->Length<=Destination->MaximumLength, _At_(Destination->Length, _Post_equal_to_(_Old_(Destination->Length)+Source->Length)) _At_(return, _Out_range_(==, 0))) _When_(_Old_(Destination->Length)+Source->Length > Destination->MaximumLength, _Unchanged_(Destination->Length) _At_(return, _Out_range_(<, 0))) NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(_Inout_ PUNICODE_STRING Destination, _In_ PCUNICODE_STRING Source)
 
NTSYSAPI VOID NTAPI RtlClearAllBits (_In_ PRTL_BITMAP BitMapHeader)
 
NTSYSAPI VOID NTAPI RtlClearBits (_In_ PRTL_BITMAP BitMapHeader, _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToClear) ULONG StartingIndex, _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToClear)
 
_Must_inspect_result_ NTSYSAPI SIZE_T NTAPI RtlCompareMemory (_In_ const VOID *Source1, _In_ const VOID *Source2, _In_ SIZE_T Length)
 
_In_ SIZE_T _In_reads_ (String2Length) PCWCH String2
 
 _Unchanged_ (DestinationString->Buffer) _Unchanged_(DestinationString -> MaximumLength) _At_(DestinationString->Length, _When_(SourceString->Length > DestinationString->MaximumLength, _Post_equal_to_(DestinationString->MaximumLength)) _When_(SourceString->Length<=DestinationString->MaximumLength, _Post_equal_to_(SourceString->Length))) NTSYSAPI VOID NTAPI RtlCopyUnicodeString(_Inout_ PUNICODE_STRING DestinationString, _In_opt_ PCUNICODE_STRING SourceString)
 
 _IRQL_requires_max_ (APC_LEVEL) NTSYSAPI NTSTATUS NTAPI RtlCreateSecurityDescriptor(_Out_ PSECURITY_DESCRIPTOR SecurityDescriptor
 Probes and locks virtual pages in memory for the specified process.
 
NTSYSAPI LARGE_INTEGER NTAPI RtlExtendedIntegerMultiply (_In_ LARGE_INTEGER Multiplicand, _In_ LONG Multiplier)
 
NTSYSAPI LARGE_INTEGER NTAPI RtlExtendedLargeIntegerDivide (_In_ LARGE_INTEGER Dividend, _In_ ULONG Divisor, _Out_opt_ PULONG Remainder)
 
 _Success_ (return !=-1) _Must_inspect_result_ NTSYSAPI ULONG NTAPI RtlFindClearBits(_In_ PRTL_BITMAP BitMapHeader
 
NTSYSAPI ULONG NTAPI RtlFindFirstRunClear (_In_ PRTL_BITMAP BitMapHeader, _Out_ PULONG StartingIndex)
 
NTSYSAPI ULONG NTAPI RtlFindClearRuns (_In_ PRTL_BITMAP BitMapHeader, _Out_writes_to_(SizeOfRunArray, return) PRTL_BITMAP_RUN RunArray, _In_range_(>, 0) ULONG SizeOfRunArray, _In_ BOOLEAN LocateLongestRuns)
 
NTSYSAPI ULONG NTAPI RtlFindLastBackwardRunClear (_In_ PRTL_BITMAP BitMapHeader, _In_ ULONG FromIndex, _Out_ PULONG StartingRunIndex)
 
NTSYSAPI ULONG NTAPI RtlFindLongestRunClear (_In_ PRTL_BITMAP BitMapHeader, _Out_ PULONG StartingIndex)
 
NTSYSAPI ULONG NTAPI RtlFindNextForwardRunClear (_In_ PRTL_BITMAP BitMapHeader, _In_ ULONG FromIndex, _Out_ PULONG StartingRunIndex)
 
NTSYSAPI ULONG NTAPI RtlFindNextForwardRunSet (_In_ PRTL_BITMAP BitMapHeader, _In_ ULONG FromIndex, _Out_ PULONG StartingRunIndex)
 
 _At_ (BitMapHeader->SizeOfBitMap, _Post_equal_to_(SizeOfBitMap)) _At_(BitMapHeader -> Buffer, _Post_equal_to_(BitMapBuffer)) NTSYSAPI VOID NTAPI RtlInitializeBitMap(_Out_ PRTL_BITMAP BitMapHeader, _In_opt_ __drv_aliasesMem PULONG BitMapBuffer, _In_opt_ ULONG SizeOfBitMap)
 
NTSYSAPI ULONG NTAPI RtlNumberOfClearBits (_In_ PRTL_BITMAP BitMapHeader)
 
NTSYSAPI ULONG NTAPI RtlNumberOfSetBits (_In_ PRTL_BITMAP BitMapHeader)
 
NTSYSAPI VOID NTAPI RtlSetAllBits (_In_ PRTL_BITMAP BitMapHeader)
 
NTSYSAPI VOID NTAPI RtlSetBits (_In_ PRTL_BITMAP BitMapHeader, _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToSet) ULONG StartingIndex, _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToSet)
 
NTSYSAPI VOID NTAPI RtlTimeToTimeFields (_In_ PLARGE_INTEGER Time, _Out_ PTIME_FIELDS TimeFields)
 
NTSYSAPI USHORT FASTCALL RtlUshortByteSwap (_In_ USHORT Source)
 
NTSYSAPI ULONG FASTCALL RtlUlongByteSwap (_In_ ULONG Source)
 
NTSYSAPI ULONGLONG FASTCALL RtlUlonglongByteSwap (_In_ ULONGLONG Source)
 
 _When_ (AllocateDestinationString, _At_(DestinationString->MaximumLength, _Out_range_(<=,(SourceString->MaximumLength/sizeof(WCHAR))))) _When_(!AllocateDestinationString
 
 _At_ (DestinationString->Buffer, _Const_) _At_(DestinationString -> MaximumLength, _Const_)) _IRQL_requires_max_(PASSIVE_LEVEL) _When_(AllocateDestinationString, _Must_inspect_result_) NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(_When_(AllocateDestinationString, _Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem))) _When_(!AllocateDestinationString, _Inout_) PANSI_STRING DestinationString, _In_ PCUNICODE_STRING SourceString, _In_ BOOLEAN AllocateDestinationString)
 
_In_ PCWSTR _In_z_ PCWSTR _In_ ULONG _In_reads_bytes_opt_ (ValueLength) PVOID ValueData
 
NTSYSAPI PVOID NTAPI RtlInsertElementGenericTable (_In_ PRTL_GENERIC_TABLE Table, _In_reads_bytes_(BufferSize) PVOID Buffer, _In_ CLONG BufferSize, _Out_opt_ PBOOLEAN NewElement)
 
NTSYSAPI PVOID NTAPI RtlInsertElementGenericTableFull (_In_ PRTL_GENERIC_TABLE Table, _In_reads_bytes_(BufferSize) PVOID Buffer, _In_ CLONG BufferSize, _Out_opt_ PBOOLEAN NewElement, _In_ PVOID NodeOrParent, _In_ TABLE_SEARCH_RESULT SearchResult)
 
NTSYSAPI BOOLEAN NTAPI RtlDeleteElementGenericTable (_In_ PRTL_GENERIC_TABLE Table, _In_ PVOID Buffer)
 
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlLookupElementGenericTable (_In_ PRTL_GENERIC_TABLE Table, _In_ PVOID Buffer)
 
NTSYSAPI PVOID NTAPI RtlLookupElementGenericTableFull (_In_ PRTL_GENERIC_TABLE Table, _In_ PVOID Buffer, _Out_ PVOID *NodeOrParent, _Out_ TABLE_SEARCH_RESULT *SearchResult)
 
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlEnumerateGenericTable (_In_ PRTL_GENERIC_TABLE Table, _In_ BOOLEAN Restart)
 
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlEnumerateGenericTableWithoutSplaying (_In_ PRTL_GENERIC_TABLE Table, _Inout_ PVOID *RestartKey)
 
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlGetElementGenericTable (_In_ PRTL_GENERIC_TABLE Table, _In_ ULONG I)
 
NTSYSAPI ULONG NTAPI RtlNumberGenericTableElements (_In_ PRTL_GENERIC_TABLE Table)
 
_Must_inspect_result_ NTSYSAPI BOOLEAN NTAPI RtlIsGenericTableEmpty (_In_ PRTL_GENERIC_TABLE Table)
 
NTSYSAPI PRTL_SPLAY_LINKS NTAPI RtlSplay (_Inout_ PRTL_SPLAY_LINKS Links)
 
NTSYSAPI PRTL_SPLAY_LINKS NTAPI RtlDelete (_In_ PRTL_SPLAY_LINKS Links)
 
NTSYSAPI VOID NTAPI RtlDeleteNoSplay (_In_ PRTL_SPLAY_LINKS Links, _Inout_ PRTL_SPLAY_LINKS *Root)
 
_Must_inspect_result_ NTSYSAPI PRTL_SPLAY_LINKS NTAPI RtlSubtreeSuccessor (_In_ PRTL_SPLAY_LINKS Links)
 
_Must_inspect_result_ NTSYSAPI PRTL_SPLAY_LINKS NTAPI RtlSubtreePredecessor (_In_ PRTL_SPLAY_LINKS Links)
 
_Must_inspect_result_ NTSYSAPI PRTL_SPLAY_LINKS NTAPI RtlRealSuccessor (_In_ PRTL_SPLAY_LINKS Links)
 
_Must_inspect_result_ NTSYSAPI PRTL_SPLAY_LINKS NTAPI RtlRealPredecessor (_In_ PRTL_SPLAY_LINKS Links)
 
_Must_inspect_result_ NTSYSAPI NTSTATUS NTAPI RtlUpcaseUnicodeString (_When_(AllocateDestinationString, _Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem))) _When_(!AllocateDestinationString, _Inout_) PUNICODE_STRING DestinationString, _In_ PCUNICODE_STRING SourceString, _In_ BOOLEAN AllocateDestinationString)
 
NTSYSAPI VOID NTAPI RtlCopyString (_Out_ PSTRING DestinationString, _In_opt_ const STRING *SourceString)
 
NTSYSAPI ULONG NTAPI RtlWalkFrameChain (_Out_writes_(Count -(Flags > > RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT)) PVOID *Callers, _In_ ULONG Count, _In_ ULONG Flags)
 
 $endif (_NTDDK_) $if(_NTIFS_) _Must_inspect_result_ _Ret_maybenull_ _Post_writable_byte_size_(Size) NTSYSAPI PVOID NTAPI RtlAllocateHeap(_In_ HANDLE HeapHandle
 
NTSYSAPI VOID NTAPI RtlCaptureContext (_Out_ PCONTEXT ContextRecord)
 
 _Ret_range_ (<, MAXLONG) NTSYSAPI ULONG NTAPI RtlRandom(_Inout_ PULONG Seed)
 
_Must_inspect_result_ NTSYSAPI NTSTATUS NTAPI RtlDowncaseUnicodeString (_When_(AllocateDestinationString, _Out_ _At_(UniDest->Buffer, __drv_allocatesMem(Mem))) _When_(!AllocateDestinationString, _Inout_) PUNICODE_STRING UniDest, _In_ PCUNICODE_STRING UniSource, _In_ BOOLEAN AllocateDestinationString)
 
*BytesInUnicodeString PWCH _In_ ULONG _Out_opt_ PULONG _In_reads_bytes_ (BytesInMultiByteString) const CHAR *MultiByteString
 
 _In_reads_bytes_ (BytesInUnicodeString) PCWCH UnicodeString
 
*BytesInUnicodeString PWSTR _In_ ULONG _Out_opt_ PULONG _In_reads_bytes_ (BytesInOemString) PCCH OemString
 
_Must_inspect_result_ NTSYSAPI SIZE_T NTAPI RtlCompareMemoryUlong (_In_reads_bytes_(Length) PVOID Source, _In_ SIZE_T Length, _In_ ULONG Pattern)
 
NTSYSAPI VOID NTAPI RtlSecondsSince1980ToTime (_In_ ULONG ElapsedSeconds, _Out_ PLARGE_INTEGER Time)
 
NTSYSAPI VOID NTAPI RtlSecondsSince1970ToTime (_In_ ULONG ElapsedSeconds, _Out_ PLARGE_INTEGER Time)
 
_Must_inspect_result_ NTSYSAPI BOOLEAN NTAPI RtlEqualSid (_In_ PSID Sid1, _In_ PSID Sid2)
 
NTSYSAPI PVOID NTAPI RtlFreeSid (_In_ _Post_invalid_ PSID Sid)
 
_Must_inspect_result_ NTSYSAPI NTSTATUS NTAPI RtlAllocateAndInitializeSid (_In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, _In_ UCHAR SubAuthorityCount, _In_ ULONG SubAuthority0, _In_ ULONG SubAuthority1, _In_ ULONG SubAuthority2, _In_ ULONG SubAuthority3, _In_ ULONG SubAuthority4, _In_ ULONG SubAuthority5, _In_ ULONG SubAuthority6, _In_ ULONG SubAuthority7, _Outptr_ PSID *Sid)
 
NTSYSAPI PULONG NTAPI RtlSubAuthoritySid (_In_ PSID Sid, _In_ ULONG SubAuthority)
 
 _Post_satisfies_ (return >=8 &&return<=SECURITY_MAX_SID_SIZE) NTSYSAPI ULONG NTAPI RtlLengthSid(_In_ PSID Sid)
 
 _Out_writes_bytes_ (DestinationSidLength) PSID DestinationSid
 
_In_ ULONG _In_ ULONG _In_reads_bytes_ (AceListLength) PVOID AceList
 
NTSYSAPI NTSTATUS NTAPI RtlGetAce (_In_ PACL Acl, _In_ ULONG AceIndex, _Outptr_ PVOID *Ace)
 
NTSYSAPI NTSTATUS NTAPI RtlGetDaclSecurityDescriptor (_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PBOOLEAN DaclPresent, _Out_ PACL *Dacl, _Out_ PBOOLEAN DaclDefaulted)
 
 _Out_range_ (>, 0)) _When_(Status >=0
 
 _Out_writes_bytes_to_ (MaxBytesInUnicodeString, *BytesInUnicodeString) PWCH UnicodeString
 
_In_ ULONG _Out_opt_ PULONG _In_reads_bytes_ (BytesInCustomCPString) PCH CustomCPString
 
 _Out_writes_bytes_to_ (MaxBytesInCustomCPString, *BytesInCustomCPString) PCH CustomCPString
 
 $endif (_NTIFS_) $if(_WDMDDK_) NTSYSAPI VOID FASTCALL RtlPrefetchMemoryNonTemporal(_In_ PVOID Source
 
 _In_range_ (<, BitMapHeader->SizeOfBitMap) ULONG BitNumber)
 
NTSYSAPI VOID NTAPI RtlSetBit (_In_ PRTL_BITMAP BitMapHeader, _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber)
 
_Must_inspect_result_ NTSYSAPI BOOLEAN NTAPI RtlTestBit (_In_ PRTL_BITMAP BitMapHeader, _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber)
 
NTSYSAPI PVOID NTAPI RtlInsertElementGenericTableAvl (_In_ PRTL_AVL_TABLE Table, _In_reads_bytes_(BufferSize) PVOID Buffer, _In_ CLONG BufferSize, _Out_opt_ PBOOLEAN NewElement)
 
NTSYSAPI PVOID NTAPI RtlInsertElementGenericTableFullAvl (_In_ PRTL_AVL_TABLE Table, _In_reads_bytes_(BufferSize) PVOID Buffer, _In_ CLONG BufferSize, _Out_opt_ PBOOLEAN NewElement, _In_ PVOID NodeOrParent, _In_ TABLE_SEARCH_RESULT SearchResult)
 
NTSYSAPI BOOLEAN NTAPI RtlDeleteElementGenericTableAvl (_In_ PRTL_AVL_TABLE Table, _In_ PVOID Buffer)
 
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlLookupElementGenericTableAvl (_In_ PRTL_AVL_TABLE Table, _In_ PVOID Buffer)
 
NTSYSAPI PVOID NTAPI RtlLookupElementGenericTableFullAvl (_In_ PRTL_AVL_TABLE Table, _In_ PVOID Buffer, _Out_ PVOID *NodeOrParent, _Out_ TABLE_SEARCH_RESULT *SearchResult)
 
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlEnumerateGenericTableAvl (_In_ PRTL_AVL_TABLE Table, _In_ BOOLEAN Restart)
 
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlEnumerateGenericTableWithoutSplayingAvl (_In_ PRTL_AVL_TABLE Table, _Inout_ PVOID *RestartKey)
 
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlLookupFirstMatchingElementGenericTableAvl (_In_ PRTL_AVL_TABLE Table, _In_ PVOID Buffer, _Out_ PVOID *RestartKey)
 
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlEnumerateGenericTableLikeADirectory (_In_ PRTL_AVL_TABLE Table, _In_opt_ PRTL_AVL_MATCH_FUNCTION MatchFunction, _In_opt_ PVOID MatchData, _In_ ULONG NextFlag, _Inout_ PVOID *RestartKey, _Inout_ PULONG DeleteCount, _In_ PVOID Buffer)
 
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlGetElementGenericTableAvl (_In_ PRTL_AVL_TABLE Table, _In_ ULONG I)
 
NTSYSAPI ULONG NTAPI RtlNumberGenericTableElementsAvl (_In_ PRTL_AVL_TABLE Table)
 
_Must_inspect_result_ NTSYSAPI BOOLEAN NTAPI RtlIsGenericTableEmptyAvl (_In_ PRTL_AVL_TABLE Table)
 
NTSYSAPI PVOID NTAPI RtlDestroyHeap (_In_ _Post_invalid_ PVOID HeapHandle)
 
NTSYSAPI USHORT NTAPI RtlCaptureStackBackTrace (_In_ ULONG FramesToSkip, _In_ ULONG FramesToCapture, _Out_writes_to_(FramesToCapture, return) PVOID *BackTrace, _Out_opt_ PULONG BackTraceHash)
 
_Must_inspect_result_ NTSYSAPI NTSTATUS NTAPI RtlValidateUnicodeString (_In_ ULONG Flags, _In_ PCUNICODE_STRING String)
 
NTSYSAPI NTSTATUS NTAPI RtlGetCompressionWorkSpaceSize (_In_ USHORT CompressionFormatAndEngine, _Out_ PULONG CompressBufferWorkSpaceSize, _Out_ PULONG CompressFragmentWorkSpaceSize)
 
NTSYSAPI NTSTATUS NTAPI RtlCompressBuffer (_In_ USHORT CompressionFormatAndEngine, _In_reads_bytes_(UncompressedBufferSize) PUCHAR UncompressedBuffer, _In_ ULONG UncompressedBufferSize, _Out_writes_bytes_to_(CompressedBufferSize, *FinalCompressedSize) PUCHAR CompressedBuffer, _In_ ULONG CompressedBufferSize, _In_ ULONG UncompressedChunkSize, _Out_ PULONG FinalCompressedSize, _In_ PVOID WorkSpace)
 
 _Out_writes_bytes_to_ (UncompressedBufferSize, *FinalUncompressedSize) PUCHAR UncompressedBuffer
 
_In_ ULONG _In_reads_bytes_ (CompressedBufferSize) PUCHAR CompressedBuffer
 
 _Out_writes_bytes_to_ (UncompressedFragmentSize, *FinalUncompressedSize) PUCHAR UncompressedFragment
 
_In_ ULONG _In_ ULONG _In_range_ (<, CompressedBufferSize) ULONG FragmentOffset
 
_In_ ULONG _In_ ULONG _In_reads_bytes_ (CompressedTailSize) PUCHAR CompressedTail
 
_In_ ULONG _Out_writes_bytes_ (CompressedBufferSize) PUCHAR CompressedBuffer
 
_In_ ULONG _In_range_ (>=,(UncompressedBufferSize -(UncompressedBufferSize/16))) ULONG CompressedBufferSize
 
_In_ ULONG _Inout_updates_bytes_ (CompressedDataInfoLength) PCOMPRESSED_DATA_INFO CompressedDataInfo
 
_In_ ULONG _In_range_ (>, sizeof(COMPRESSED_DATA_INFO)) ULONG CompressedDataInfoLength
 
NTSYSAPI PUCHAR NTAPI RtlSubAuthorityCountSid (_In_ PSID Sid)
 
 _When_ (Status< 0, _Out_range_(>, 0)) _When_(Status >=0
 
NTSYSAPI VOID NTAPI RtlFillMemoryUlong (_Out_writes_bytes_all_(Length) PVOID Destination, _In_ SIZE_T Length, _In_ ULONG Pattern)
 
NTSYSAPI VOID NTAPI RtlFillMemoryUlonglong (_Out_writes_bytes_all_(Length) PVOID Destination, _In_ SIZE_T Length, _In_ ULONGLONG Pattern)
 
NTSYSAPI ULONGLONG NTAPI RtlIoDecodeMemIoResource (_In_ struct _IO_RESOURCE_DESCRIPTOR *Descriptor, _Out_opt_ PULONGLONG Alignment, _Out_opt_ PULONGLONG MinimumAddress, _Out_opt_ PULONGLONG MaximumAddress)
 
NTSYSAPI NTSTATUS NTAPI RtlIoEncodeMemIoResource (_In_ struct _IO_RESOURCE_DESCRIPTOR *Descriptor, _In_ UCHAR Type, _In_ ULONGLONG Length, _In_ ULONGLONG Alignment, _In_ ULONGLONG MinimumAddress, _In_ ULONGLONG MaximumAddress)
 
NTSYSAPI ULONGLONG NTAPI RtlCmDecodeMemIoResource (_In_ struct _CM_PARTIAL_RESOURCE_DESCRIPTOR *Descriptor, _Out_opt_ PULONGLONG Start)
 
NTSYSAPI NTSTATUS NTAPI RtlFindClosestEncodableLength (_In_ ULONGLONG SourceLength, _Out_ PULONGLONG TargetLength)
 
NTSYSAPI NTSTATUS NTAPI RtlCmEncodeMemIoResource (_In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor, _In_ UCHAR Type, _In_ ULONGLONG Length, _In_ ULONGLONG Start)
 
NTSYSAPI BOOLEAN NTAPI RtlGetProductInfo (_In_ ULONG OSMajorVersion, _In_ ULONG OSMinorVersion, _In_ ULONG SpMajorVersion, _In_ ULONG SpMinorVersion, _Out_ PULONG ReturnedProductType)
 
NTSYSAPI NTSTATUS NTAPI RtlIsNormalizedString (_In_ ULONG NormForm, _In_ PCWSTR SourceString, _In_ LONG SourceStringLength, _Out_ PBOOLEAN Normalized)
 
NTSYSAPI NTSTATUS NTAPI RtlIdnToAscii (_In_ ULONG Flags, _In_ PCWSTR SourceString, _In_ LONG SourceStringLength, _Out_writes_to_(*DestinationStringLength, *DestinationStringLength) PWSTR DestinationString, _Inout_ PLONG DestinationStringLength)
 
NTSYSAPI NTSTATUS NTAPI RtlIdnToUnicode (IN ULONG Flags, IN PCWSTR SourceString, IN LONG SourceStringLength, OUT PWSTR DestinationString, IN OUT PLONG DestinationStringLength)
 
NTSYSAPI NTSTATUS NTAPI RtlIdnToNameprepUnicode (_In_ ULONG Flags, _In_ PCWSTR SourceString, _In_ LONG SourceStringLength, _Out_writes_to_(*DestinationStringLength, *DestinationStringLength) PWSTR DestinationString, _Inout_ PLONG DestinationStringLength)
 
NTSYSAPI NTSTATUS NTAPI RtlCreateServiceSid (_In_ PUNICODE_STRING ServiceName, _Out_writes_bytes_opt_(*ServiceSidLength) PSID ServiceSid, _Inout_ PULONG ServiceSidLength)
 
NTSYSAPI LONG NTAPI RtlCompareAltitudes (_In_ PCUNICODE_STRING Altitude1, _In_ PCUNICODE_STRING Altitude2)
 
*UTF8StringActualByteCount PCHAR _In_ ULONG _Out_ PULONG _In_reads_bytes_ (UnicodeStringByteCount) PCWCH UnicodeStringSource
 
*UnicodeStringActualByteCount PWSTR _In_ ULONG _Out_ PULONG _In_reads_bytes_ (UTF8StringByteCount) PCCH UTF8StringSource
 
NTSYSAPI ULONG64 NTAPI RtlGetEnabledExtendedFeatures (IN ULONG64 FeatureMask)
 
 __drv_allocatesMem (Mem)) PRTL_DYNAMIC_HASH_TABLE *HashTable
 
NTSYSAPI VOID NTAPI RtlDeleteHashTable (_In_ _When_((HashTable->Flags &RTL_HASH_ALLOCATED_HEADER), __drv_freesMem(Mem) _Post_invalid_) PRTL_DYNAMIC_HASH_TABLE HashTable)
 
NTSYSAPI BOOLEAN NTAPI RtlInsertEntryHashTable (_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _In_ __drv_aliasesMem PRTL_DYNAMIC_HASH_TABLE_ENTRY Entry, _In_ ULONG_PTR Signature, _Inout_opt_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context)
 
NTSYSAPI BOOLEAN NTAPI RtlRemoveEntryHashTable (_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _In_ PRTL_DYNAMIC_HASH_TABLE_ENTRY Entry, _Inout_opt_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context)
 
_Must_inspect_result_ NTSYSAPI PRTL_DYNAMIC_HASH_TABLE_ENTRY NTAPI RtlLookupEntryHashTable (_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _In_ ULONG_PTR Signature, _Out_opt_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context)
 
_Must_inspect_result_ NTSYSAPI PRTL_DYNAMIC_HASH_TABLE_ENTRY NTAPI RtlGetNextEntryHashTable (_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _In_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context)
 
NTSYSAPI BOOLEAN NTAPI RtlInitEnumerationHashTable (_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _Out_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator)
 
_Must_inspect_result_ NTSYSAPI PRTL_DYNAMIC_HASH_TABLE_ENTRY NTAPI RtlEnumerateEntryHashTable (_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _Inout_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator)
 
NTSYSAPI VOID NTAPI RtlEndEnumerationHashTable (_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _Inout_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator)
 
NTSYSAPI BOOLEAN NTAPI RtlInitWeakEnumerationHashTable (_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _Out_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator)
 
_Must_inspect_result_ NTSYSAPI PRTL_DYNAMIC_HASH_TABLE_ENTRY NTAPI RtlWeaklyEnumerateEntryHashTable (_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _Inout_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator)
 
NTSYSAPI VOID NTAPI RtlEndWeakEnumerationHashTable (_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _Inout_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator)
 
NTSYSAPI BOOLEAN NTAPI RtlExpandHashTable (_In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
 
NTSYSAPI BOOLEAN NTAPI RtlContractHashTable (_In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
 
NTSYSAPI NTSTATUS NTAPI RtlCreateVirtualAccountSid (_In_ PCUNICODE_STRING Name, _In_ ULONG BaseSubAuthority, _Out_writes_bytes_(*SidLength) PSID Sid, _Inout_ PULONG SidLength)
 
static __inline LARGE_INTEGER NTAPI_INLINE RtlConvertUlongToLargeInteger (_In_ ULONG UnsignedInteger)
 
static __inline LARGE_INTEGER NTAPI_INLINE RtlLargeIntegerShiftLeft (_In_ LARGE_INTEGER LargeInteger, _In_ CCHAR ShiftCount)
 
static __inline LARGE_INTEGER NTAPI_INLINE RtlLargeIntegerShiftRight (_In_ LARGE_INTEGER LargeInteger, _In_ CCHAR ShiftCount)
 
static __inline ULONG NTAPI_INLINE RtlEnlargedUnsignedDivide (_In_ ULARGE_INTEGER Dividend, _In_ ULONG Divisor, _Out_opt_ PULONG Remainder)
 
static __inline LARGE_INTEGER NTAPI_INLINE RtlLargeIntegerNegate (_In_ LARGE_INTEGER Subtrahend)
 
static __inline LARGE_INTEGER NTAPI_INLINE RtlLargeIntegerSubtract (_In_ LARGE_INTEGER Minuend, _In_ LARGE_INTEGER Subtrahend)
 
static __inline LARGE_INTEGER NTAPI_INLINE RtlEnlargedUnsignedMultiply (_In_ ULONG Multiplicand, _In_ ULONG Multiplier)
 
static __inline LARGE_INTEGER NTAPI_INLINE RtlEnlargedIntegerMultiply (_In_ LONG Multiplicand, _In_ LONG Multiplier)
 
 _At_ (AnsiString->Buffer, _Post_equal_to_(Buffer)) _At_(AnsiString -> Length, _Post_equal_to_(0)) _At_(AnsiString->MaximumLength, _Post_equal_to_(BufferSize)) FORCEINLINE VOID RtlInitEmptyAnsiString(_Out_ PANSI_STRING AnsiString, _Pre_maybenull_ _Pre_readable_size_(BufferSize) __drv_aliasesMem PCHAR Buffer, _In_ USHORT BufferSize)
 
 _At_ (UnicodeString->Buffer, _Post_equal_to_(Buffer)) _At_(UnicodeString -> Length, _Post_equal_to_(0)) _At_(UnicodeString->MaximumLength, _Post_equal_to_(BufferSize)) FORCEINLINE VOID RtlInitEmptyUnicodeString(_Out_ PUNICODE_STRING UnicodeString, _Writable_bytes_(BufferSize) _When_(BufferSize !=0
 
static __inline LARGE_INTEGER NTAPI_INLINE RtlLargeIntegerArithmeticShift (_In_ LARGE_INTEGER LargeInteger, _In_ CCHAR ShiftCount)
 
FORCEINLINE PVOID RtlSecureZeroMemory (_Out_writes_bytes_all_(Size) PVOID Pointer, _In_ SIZE_T Size)
 
FORCEINLINE VOID InitializeSListHead (_Out_ PSLIST_HEADER SListHead)
 
BOOLEAN RTLVERLIB_DDI() RtlIsNtDdiVersionAvailable (_In_ ULONG Version)
 
BOOLEAN RTLVERLIB_DDI() RtlIsServicePackVersionInstalled (_In_ ULONG Version)
 
FORCEINLINE LUID NTAPI_INLINE RtlConvertUlongToLuid (_In_ ULONG Val)
 
NTSYSAPI VOID NTAPI RtlGetCallersAddress (_Out_ PVOID *CallersAddress, _Out_ PVOID *CallersCaller)
 
FORCEINLINE VOID NTAPI RtlInitHashTableContext (_Inout_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context)
 
FORCEINLINE VOID NTAPI RtlInitHashTableContextFromEnumerator (_Inout_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context, _In_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator)
 
FORCEINLINE VOID NTAPI RtlReleaseHashTableContext (_Inout_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context)
 
FORCEINLINE ULONG NTAPI RtlTotalBucketsHashTable (_In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
 
FORCEINLINE ULONG NTAPI RtlNonEmptyBucketsHashTable (_In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
 
FORCEINLINE ULONG NTAPI RtlEmptyBucketsHashTable (_In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
 
FORCEINLINE ULONG NTAPI RtlTotalEntriesHashTable (_In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
 
FORCEINLINE ULONG NTAPI RtlActiveEnumeratorsHashTable (_In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
 

Variables

_Out_ GUIDGuid
 
_In_ ULONG StartingIndex
 
_In_ ULONG _In_ ULONG Length
 
_Out_ _Inout_ PUNICODE_STRING DestinationString
 
_Out_ _Inout_ PUNICODE_STRING _In_ PANSI_STRING SourceString
 
_Out_ _Inout_ PUNICODE_STRING _In_ PANSI_STRING _In_ BOOLEAN AllocateDestinationString
 
_In_ PWSTR Path
 
_In_ PCUNICODE_STRING String2
 
_In_ PCUNICODE_STRING _In_ BOOLEAN CaseInSensitive
 
_In_ SIZE_T String1Length
 
_In_ SIZE_T _In_ SIZE_T String2Length
 
_In_ ULONG Revision
 
_In_ PCWSTR _In_z_ PCWSTR ValueName
 
_In_ ULONG NumberToFind
 
_In_ ULONG _In_ ULONG HintIndex
 
_In_ PCWSTR _Inout_ _At_ QueryTable EntryContext
 
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE QueryTable
 
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE _In_opt_ PVOID Context
 
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE _In_opt_ PVOID _In_opt_ PVOID Environment
 
_In_ BOOLEAN DaclPresent
 
_In_ BOOLEAN _In_opt_ PACL Dacl
 
_In_ BOOLEAN _In_opt_ PACL _In_opt_ BOOLEAN DaclDefaulted
 
_Out_ PLARGE_INTEGER Time
 
_In_opt_ ULONG Base
 
_In_opt_ ULONG _Out_ PULONG Value
 
_In_ ULONG SecurityDescriptorLength
 
_In_ ULONG _In_ SECURITY_INFORMATION RequiredInformation
 
_In_ ULONG TypeMask
 
_In_ ULONG _In_ ULONGLONG ConditionMask
 
_In_ PCWSTR _In_z_ PCWSTR _In_ ULONG ValueType
 
_In_ PCWSTR _In_z_ PCWSTR _In_ ULONG _In_ ULONG ValueLength
 
_In_ PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine
 
_In_ PRTL_GENERIC_COMPARE_ROUTINE _In_ PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine
 
_In_ PRTL_GENERIC_COMPARE_ROUTINE _In_ PRTL_GENERIC_ALLOCATE_ROUTINE _In_ PRTL_GENERIC_FREE_ROUTINE FreeRoutine
 
_In_ PRTL_GENERIC_COMPARE_ROUTINE _In_ PRTL_GENERIC_ALLOCATE_ROUTINE _In_ PRTL_GENERIC_FREE_ROUTINE _In_opt_ PVOID TableContext
 
_In_ PGENERIC_MAPPING GenericMapping
 
_Out_ PUNICODE_STRING DosName
 
_In_opt_ ULONG Flags
 
_In_opt_ ULONG _In_ SIZE_T Size
 
_In_opt_ ULONG _In_ _Post_invalid_ PVOID BaseAddress
 
_In_ const STRING _In_ BOOLEAN CaseInsensitive
 
_In_ const STRINGSource
 
*BytesInUnicodeString PWCH UnicodeString
 
*BytesInUnicodeString PWCH _In_ ULONG MaxBytesInUnicodeString
 
*BytesInUnicodeString PWCH _In_ ULONG _Out_opt_ PULONG BytesInUnicodeString
 
*BytesInUnicodeString PWCH _In_ ULONG _Out_opt_ PULONG _In_ ULONG BytesInMultiByteString
 
*BytesInMultiByteString PCHAR MultiByteString
 
*BytesInMultiByteString PCHAR _In_ ULONG MaxBytesInMultiByteString
 
*BytesInUnicodeString PWSTR _In_ ULONG _Out_opt_ PULONG _In_ ULONG BytesInOemString
 
*BytesInOemString PCHAR OemString
 
*BytesInOemString PCHAR _In_ ULONG MaxBytesInOemString
 
_In_ BOOLEAN AllowExtendedCharacters
 
_In_ BOOLEAN _Inout_ PGENERATE_NAME_CONTEXT _Inout_ PUNICODE_STRING Name8dot3
 
_Inout_opt_ POEM_STRING OemName
 
_Inout_opt_ POEM_STRING _Out_opt_ PBOOLEAN NameContainsSpaces
 
_In_ __drv_aliasesMem PSTRING Prefix
 
_In_ __drv_aliasesMem PSTRING _Out_ PPREFIX_TABLE_ENTRY PrefixTableEntry
 
_In_ PSTRING FullName
 
_In_ PUNICODE_STRING _In_ ULONG CaseInsensitiveIndex
 
_In_ BOOLEAN Restart
 
_Out_ PULONG ElapsedSeconds
 
_In_ PSID Sid2
 
_In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority
 
_In_ PSID_IDENTIFIER_AUTHORITY _In_ UCHAR SubAuthorityCount
 
_In_ PSID SourceSid
 
_In_ PSID Sid
 
_In_ PLUID SourceLuid
 
_In_ ULONG AclLength
 
_In_ ULONG _In_ ULONG AclRevision
 
_In_ ULONG AceRevision
 
_In_ ULONG _In_ ULONG StartingAceIndex
 
_In_ ULONG _In_ ULONG _In_ ULONG AceListLength
 
_In_ ULONG AceIndex
 
_In_ ULONG _In_ ACCESS_MASK AccessMask
 
_In_ ULONG _In_ ULONG AceFlags
 
_In_opt_ PSID Owner
 
_In_opt_ PSID _In_opt_ BOOLEAN OwnerDefaulted
 
_In_ ULONG _Out_opt_ PULONG _In_ ULONG BytesInCustomCPString
 
_In_ ULONG MaxBytesInCustomCPString
 
_Out_ PCPTABLEINFO CodePageTable
 
_In_ BOOLEAN _In_ ULONG HashAlgorithm
 
_In_ BOOLEAN _In_ ULONG _Out_ PULONG HashValue
 
_In_opt_ PVOID HeapBase
 
_In_opt_ PVOID _In_opt_ SIZE_T ReserveSize
 
_In_opt_ PVOID _In_opt_ SIZE_T _In_opt_ SIZE_T CommitSize
 
_In_opt_ PVOID _In_opt_ SIZE_T _In_opt_ SIZE_T _In_opt_ PVOID Lock
 
_In_opt_ PVOID _In_opt_ SIZE_T _In_opt_ SIZE_T _In_opt_ PVOID _In_opt_ PRTL_HEAP_PARAMETERS Parameters
 
_In_ ULONG UncompressedBufferSize
 
_In_ ULONG _In_ ULONG CompressedBufferSize
 
_In_ ULONG _In_ ULONG _Out_ PULONG FinalUncompressedSize
 
_In_ ULONG UncompressedFragmentSize
 
_In_ ULONG _In_ ULONG _Out_ PULONG _In_ PVOID WorkSpace
 
_Inout_ PUCHARCompressedBuffer
 
_Inout_ PUCHAR _In_ PUCHAR EndOfCompressedBufferPlus1
 
_Inout_ PUCHAR _In_ PUCHAR _Out_ PUCHARChunkBuffer
 
_Inout_ PUCHAR _In_ PUCHAR _Out_ PUCHAR _Out_ PULONG ChunkSize
 
_In_ ULONG _In_ ULONG _In_ ULONG CompressedTailSize
 
_In_ ULONG _In_ ULONG _In_ ULONG _In_ PCOMPRESSED_DATA_INFO CompressedDataInfo
 
_Out_ PBOOLEAN SaclPresent
 
_Out_ PBOOLEAN _Out_ PACLSacl
 
_Out_ PBOOLEAN _Out_ PACL _Out_ PBOOLEAN SaclDefaulted
 
_In_opt_ PSID Group
 
_In_opt_ PSID _In_opt_ BOOLEAN GroupDefaulted
 
_Out_writes_bytes_to_opt_ BufferLength PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor
 
_Out_writes_bytes_to_opt_ BufferLength PSECURITY_DESCRIPTOR _Inout_ PULONG BufferLength
 
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor
 
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG AbsoluteSecurityDescriptorSize
 
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG DaclSize
 
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG SaclSize
 
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ OwnerSize PSID _Inout_ PULONG OwnerSize
 
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ OwnerSize PSID _Inout_ PULONG _Out_writes_bytes_to_opt_ PrimaryGroupSize PSID PrimaryGroup
 
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ OwnerSize PSID _Inout_ PULONG _Out_writes_bytes_to_opt_ PrimaryGroupSize PSID _Inout_ PULONG PrimaryGroupSize
 
_In_ __inner_callback PRTL_RUN_ONCE_INIT_FN InitFn
 
_In_ __inner_callback PRTL_RUN_ONCE_INIT_FN _Inout_opt_ PVOID Parameter
 
_In_ PCWSTR _In_ LONG SourceStringLength
 
_In_ PCWSTR _In_ LONG _Out_writes_to_ DestinationStringLength PWSTR _Inout_ PLONG DestinationStringLength
 
*UTF8StringActualByteCount PCHAR UTF8StringDestination
 
*UTF8StringActualByteCount PCHAR _In_ ULONG UTF8StringMaxByteCount
 
*UTF8StringActualByteCount PCHAR _In_ ULONG _Out_ PULONG UTF8StringActualByteCount
 
*UTF8StringActualByteCount PCHAR _In_ ULONG _Out_ PULONG _In_ ULONG UnicodeStringByteCount
 
*UnicodeStringActualByteCount PWSTR UnicodeStringDestination
 
*UnicodeStringActualByteCount PWSTR _In_ ULONG UnicodeStringMaxByteCount
 
*UnicodeStringActualByteCount PWSTR _In_ ULONG _Out_ PULONG UnicodeStringActualByteCount
 
*UnicodeStringActualByteCount PWSTR _In_ ULONG _Out_ PULONG _In_ ULONG UTF8StringByteCount
 
_In_ ULONG Shift
 
_In_ PSID OldSid
 
_In_ PSID _In_ PSID NewSid
 
_In_ PSID _In_ PSID _Out_ ULONGNumChanges
 
_Notnull_ __drv_aliasesMem PWSTR Buffer = Buffer
 
_Notnull_ __drv_aliasesMem PWSTR _In_ USHORT BufferSize
 
UnicodeString MaximumLength = BufferSize
 
_In_ LARGE_INTEGER Divisor
 
_In_ LARGE_INTEGER _Out_opt_ PLARGE_INTEGER Remainder
 
_In_ LARGE_INTEGER Addend2
 
ret QuadPart = Addend1.QuadPart + Addend2.QuadPart
 
return ret
 

Macro Definition Documentation

◆ __assert_annotationA

#define __assert_annotationA (   msg)     DbgPrint("Assertion failed at %s(%d): %s\n", __FILE__, __LINE__, msg)

Definition at line 3222 of file rtlfuncs.h.

◆ __assert_annotationW

#define __assert_annotationW (   msg)     DbgPrint("Assertion failed at %s(%d): %S\n", __FILE__, __LINE__, msg)

Definition at line 3224 of file rtlfuncs.h.

◆ ASSERT

#define ASSERT (   exp)    ((void)0)

Definition at line 3292 of file rtlfuncs.h.

◆ ASSERTMSG

#define ASSERTMSG (   msg,
  exp 
)    ((void)0)

Definition at line 3293 of file rtlfuncs.h.

◆ FAST_FAIL_CORRUPT_LIST_ENTRY

#define FAST_FAIL_CORRUPT_LIST_ENTRY   3

◆ FAST_FAIL_FATAL_APP_EXIT

#define FAST_FAIL_FATAL_APP_EXIT   7

◆ FAST_FAIL_GS_COOKIE_INIT

#define FAST_FAIL_GS_COOKIE_INIT   6

◆ FAST_FAIL_GUARD_ICALL_CHECK_FAILURE

#define FAST_FAIL_GUARD_ICALL_CHECK_FAILURE   10

◆ FAST_FAIL_GUARD_WRITE_CHECK_FAILURE

#define FAST_FAIL_GUARD_WRITE_CHECK_FAILURE   11

◆ FAST_FAIL_INCORRECT_STACK

#define FAST_FAIL_INCORRECT_STACK   4

◆ FAST_FAIL_INVALID_ARG

#define FAST_FAIL_INVALID_ARG   5

◆ FAST_FAIL_INVALID_FAST_FAIL_CODE

#define FAST_FAIL_INVALID_FAST_FAIL_CODE   0xFFFFFFFF

◆ FAST_FAIL_INVALID_FIBER_SWITCH

#define FAST_FAIL_INVALID_FIBER_SWITCH   12

◆ FAST_FAIL_INVALID_JUMP_BUFFER

#define FAST_FAIL_INVALID_JUMP_BUFFER   18

◆ FAST_FAIL_INVALID_REFERENCE_COUNT

#define FAST_FAIL_INVALID_REFERENCE_COUNT   14

◆ FAST_FAIL_INVALID_SET_OF_CONTEXT

#define FAST_FAIL_INVALID_SET_OF_CONTEXT   13

◆ FAST_FAIL_LEGACY_GS_VIOLATION

#define FAST_FAIL_LEGACY_GS_VIOLATION   0

◆ FAST_FAIL_MRDATA_MODIFIED

#define FAST_FAIL_MRDATA_MODIFIED   19

◆ FAST_FAIL_RANGE_CHECK_FAILURE

#define FAST_FAIL_RANGE_CHECK_FAILURE   8

◆ FAST_FAIL_STACK_COOKIE_CHECK_FAILURE

#define FAST_FAIL_STACK_COOKIE_CHECK_FAILURE   2

◆ FAST_FAIL_UNSAFE_REGISTRY_ACCESS

#define FAST_FAIL_UNSAFE_REGISTRY_ACCESS   9

◆ FAST_FAIL_VTGUARD_CHECK_FAILURE

#define FAST_FAIL_VTGUARD_CHECK_FAILURE   1

◆ FIRSTBYTE

#define FIRSTBYTE (   VALUE)    ((VALUE) & LOWBYTE_MASK)

Definition at line 806 of file rtlfuncs.h.

◆ FOURTHBYTE

#define FOURTHBYTE (   VALUE)    (((VALUE) >> 24) & LOWBYTE_MASK)

Definition at line 809 of file rtlfuncs.h.

◆ InitializeListHead32

#define InitializeListHead32 (   ListHead)
Value:
(\
(ListHead)->Flink = (ListHead)->Blink = PtrToUlong((ListHead)))
#define PtrToUlong(u)
Definition: config.h:107

Definition at line 3343 of file rtlfuncs.h.

◆ InterlockedFlushSList

#define InterlockedFlushSList (   SListHead)     ExpInterlockedFlushSList(SListHead)

Definition at line 3412 of file rtlfuncs.h.

◆ InterlockedPopEntrySList

#define InterlockedPopEntrySList (   SListHead)     ExpInterlockedPopEntrySList(SListHead)

Definition at line 3409 of file rtlfuncs.h.

◆ InterlockedPushEntrySList

#define InterlockedPushEntrySList (   SListHead,
  SListEntry 
)     ExpInterlockedPushEntrySList(SListHead, SListEntry)

Definition at line 3406 of file rtlfuncs.h.

◆ LONG_MASK

#define LONG_MASK   (LONG_SIZE - 1)

Definition at line 802 of file rtlfuncs.h.

◆ LONG_SIZE

#define LONG_SIZE   (sizeof(LONG))

Definition at line 800 of file rtlfuncs.h.

◆ LONGLONG_MASK

#define LONGLONG_MASK   (LONGLONG_SIZE - 1)

Definition at line 803 of file rtlfuncs.h.

◆ LONGLONG_SIZE

#define LONGLONG_SIZE   (sizeof(LONGLONG))

Definition at line 801 of file rtlfuncs.h.

◆ LOWBYTE_MASK

#define LOWBYTE_MASK   0x00FF

Definition at line 804 of file rtlfuncs.h.

◆ NT_ANALYSIS_ASSUME

#define NT_ANALYSIS_ASSUME (   _exp)    __noop(_exp)

Definition at line 3233 of file rtlfuncs.h.

◆ NT_ASSERT

#define NT_ASSERT   NT_ASSERT_NOASSUME

Definition at line 3327 of file rtlfuncs.h.

◆ NT_ASSERT_ACTION

#define NT_ASSERT_ACTION (   exp)
Value:
((!(exp)) ? \
DbgRaiseAssertionFailure(), FALSE) : TRUE))
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
DWORD exp
Definition: msg.c:16058
#define __assert_annotationA(msg)
Definition: rtlfuncs.h:3222
#define NT_ANALYSIS_ASSUME(_exp)
Definition: rtlfuncs.h:3233

Definition at line 3236 of file rtlfuncs.h.

◆ NT_ASSERT_ASSUME

#define NT_ASSERT_ASSUME (   exp)    (NT_ANALYSIS_ASSUME(exp), (void)0)

Definition at line 3308 of file rtlfuncs.h.

◆ NT_ASSERT_NOASSUME

#define NT_ASSERT_NOASSUME (   exp)    ((void)0)

Definition at line 3312 of file rtlfuncs.h.

◆ NT_ASSERTMSG

#define NT_ASSERTMSG   NT_ASSERTMSG_NOASSUME

Definition at line 3328 of file rtlfuncs.h.

◆ NT_ASSERTMSG_ACTION

#define NT_ASSERTMSG_ACTION (   msg,
  exp 
)
Value:
((!(exp)) ? \
DbgRaiseAssertionFailure(), FALSE) : TRUE))
#define msg(x)
Definition: auth_time.c:54

Definition at line 3242 of file rtlfuncs.h.

◆ NT_ASSERTMSG_ASSUME

#define NT_ASSERTMSG_ASSUME (   msg,
  exp 
)    (NT_ANALYSIS_ASSUME(exp), (void)0)

Definition at line 3309 of file rtlfuncs.h.

◆ NT_ASSERTMSG_NOASSUME

#define NT_ASSERTMSG_NOASSUME (   msg,
  exp 
)    ((void)0)

Definition at line 3313 of file rtlfuncs.h.

◆ NT_ASSERTMSGW

#define NT_ASSERTMSGW   NT_ASSERTMSGW_NOASSUME

Definition at line 3329 of file rtlfuncs.h.

◆ NT_ASSERTMSGW_ACTION

#define NT_ASSERTMSGW_ACTION (   msg,
  exp 
)
Value:
((!(exp)) ? \
DbgRaiseAssertionFailure(), FALSE) : TRUE))
#define __assert_annotationW(msg)
Definition: rtlfuncs.h:3224

Definition at line 3248 of file rtlfuncs.h.

◆ NT_ASSERTMSGW_ASSUME

#define NT_ASSERTMSGW_ASSUME (   msg,
  exp 
)    (NT_ANALYSIS_ASSUME(exp), (void)0)

Definition at line 3310 of file rtlfuncs.h.

◆ NT_ASSERTMSGW_NOASSUME

#define NT_ASSERTMSGW_NOASSUME (   msg,
  exp 
)    ((void)0)

Definition at line 3314 of file rtlfuncs.h.

◆ NT_FRE_ASSERT

#define NT_FRE_ASSERT   (void)NT_ASSERT_ACTION

Definition at line 3318 of file rtlfuncs.h.

◆ NT_FRE_ASSERTMSG

#define NT_FRE_ASSERTMSG   (void)NT_ASSERTMSG_ACTION

Definition at line 3319 of file rtlfuncs.h.

◆ NT_FRE_ASSERTMSGW

#define NT_FRE_ASSERTMSGW   (void)NT_ASSERTMSGW_ACTION

Definition at line 3320 of file rtlfuncs.h.

◆ NT_VERIFY

#define NT_VERIFY (   exp)    (NT_ANALYSIS_ASSUME(exp), ((exp) ? TRUE : FALSE))

Definition at line 3304 of file rtlfuncs.h.

◆ NT_VERIFYMSG

#define NT_VERIFYMSG (   msg,
  exp 
)    (NT_ANALYSIS_ASSUME(exp), ((exp) ? TRUE : FALSE))

Definition at line 3305 of file rtlfuncs.h.

◆ NT_VERIFYMSGW

#define NT_VERIFYMSGW (   msg,
  exp 
)    (NT_ANALYSIS_ASSUME(exp), ((exp) ? TRUE : FALSE))

Definition at line 3306 of file rtlfuncs.h.

◆ QueryDepthSList

#define QueryDepthSList (   SListHead)     ExQueryDepthSList(SListHead)

Definition at line 3417 of file rtlfuncs.h.

◆ RTL_CONTEXT_CHUNK

#define RTL_CONTEXT_CHUNK (   Context,
  Chunk 
)
Value:
(PCONTEXT_EX)(Context + 1), \
Chunk)
#define RTL_CONTEXT_EX_CHUNK(Base, Layout, Chunk)
Definition: rtlfuncs.h:3424

Definition at line 3430 of file rtlfuncs.h.

◆ RTL_CONTEXT_EX_CHUNK

#define RTL_CONTEXT_EX_CHUNK (   Base,
  Layout,
  Chunk 
)     ((PVOID)((PCHAR)(Base) + RTL_CONTEXT_EX_OFFSET(Layout, Chunk)))

Definition at line 3424 of file rtlfuncs.h.

◆ RTL_CONTEXT_EX_LENGTH

#define RTL_CONTEXT_EX_LENGTH (   ContextEx,
  Chunk 
)    ((ContextEx)->Chunk.Length)

Definition at line 3423 of file rtlfuncs.h.

◆ RTL_CONTEXT_EX_OFFSET

#define RTL_CONTEXT_EX_OFFSET (   ContextEx,
  Chunk 
)    ((ContextEx)->Chunk.Offset)

Definition at line 3422 of file rtlfuncs.h.

◆ RTL_CONTEXT_LENGTH

#define RTL_CONTEXT_LENGTH (   Context,
  Chunk 
)     RTL_CONTEXT_EX_LENGTH((PCONTEXT_EX)(Context + 1), Chunk)

Definition at line 3428 of file rtlfuncs.h.

◆ RTL_CONTEXT_OFFSET

#define RTL_CONTEXT_OFFSET (   Context,
  Chunk 
)     RTL_CONTEXT_EX_OFFSET((PCONTEXT_EX)(Context + 1), Chunk)

Definition at line 3426 of file rtlfuncs.h.

◆ RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING

#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING   2

◆ RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE

#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE   1

◆ RTL_SOFT_ASSERT

#define RTL_SOFT_ASSERT (   exp)    ((void)0)

Definition at line 3295 of file rtlfuncs.h.

◆ RTL_SOFT_ASSERTMSG

#define RTL_SOFT_ASSERTMSG (   msg,
  exp 
)    ((void)0)

Definition at line 3296 of file rtlfuncs.h.

◆ RTL_SOFT_VERIFY

#define RTL_SOFT_VERIFY (   exp)    ((exp) ? TRUE : FALSE)

Definition at line 3301 of file rtlfuncs.h.

◆ RTL_SOFT_VERIFYMSG

#define RTL_SOFT_VERIFYMSG (   msg,
  exp 
)    ((exp) ? TRUE : FALSE)

Definition at line 3302 of file rtlfuncs.h.

◆ RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT

#define RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT   8

Definition at line 1193 of file rtlfuncs.h.

◆ RTL_STATIC_LIST_HEAD

#define RTL_STATIC_LIST_HEAD (   x)    LIST_ENTRY x = { &x, &x }

◆ RTL_VERIFY

#define RTL_VERIFY (   exp)    ((exp) ? TRUE : FALSE)

Definition at line 3298 of file rtlfuncs.h.

◆ RTL_VERIFYMSG

#define RTL_VERIFYMSG (   msg,
  exp 
)    ((exp) ? TRUE : FALSE)

Definition at line 3299 of file rtlfuncs.h.

◆ RtlAnsiStringToUnicodeSize

#define RtlAnsiStringToUnicodeSize (   String)
Value:
( \
RtlxAnsiStringToUnicodeSize(String) : \
)
#define NLS_MB_CODE_PAGE_TAG
Definition: nt_native.h:212
#define ANSI_NULL
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
__wchar_t WCHAR
Definition: xmlstorage.h:180

Definition at line 429 of file rtlfuncs.h.

◆ RtlCheckBit

#define RtlCheckBit (   BMH,
  BP 
)    (((((PLONG)(BMH)->Buffer)[(BP)/32]) >> ((BP)%32)) & 0x1)

Definition at line 3169 of file rtlfuncs.h.

◆ RtlCopyBytes

#define RtlCopyBytes   RtlCopyMemory

Definition at line 285 of file rtlfuncs.h.

◆ RtlCopyMemory

#define RtlCopyMemory (   Destination,
  Source,
  Length 
)     memcpy(Destination, Source, Length)

Definition at line 282 of file rtlfuncs.h.

◆ RtlCopyMemoryNonTemporal

#define RtlCopyMemoryNonTemporal   RtlCopyMemory

Definition at line 296 of file rtlfuncs.h.

◆ RtlEqualLuid

#define RtlEqualLuid (   Luid1,
  Luid2 
)     (((Luid1)->LowPart == (Luid2)->LowPart) && ((Luid1)->HighPart == (Luid2)->HighPart))

Definition at line 304 of file rtlfuncs.h.

◆ RtlEqualMemory

#define RtlEqualMemory (   Destination,
  Source,
  Length 
)     (!memcmp(Destination, Source, Length))

Definition at line 313 of file rtlfuncs.h.

◆ RtlFillBytes

#define RtlFillBytes   RtlFillMemory

Definition at line 325 of file rtlfuncs.h.

◆ RtlFillMemory

#define RtlFillMemory (   Destination,
  Length,
  Fill 
)     memset(Destination, Fill, Length)

Definition at line 322 of file rtlfuncs.h.

◆ RtlInitializeSplayLinks

#define RtlInitializeSplayLinks (   Links)
Value:
{ \
PRTL_SPLAY_LINKS _SplayLinks; \
_SplayLinks = (PRTL_SPLAY_LINKS)(Links); \
_SplayLinks->Parent = _SplayLinks; \
_SplayLinks->LeftChild = NULL; \
_SplayLinks->RightChild = NULL; \
}
#define NULL
Definition: types.h:112
struct _RTL_SPLAY_LINKS * PRTL_SPLAY_LINKS

◆ RtlInsertAsLeftChild

#define RtlInsertAsLeftChild (   ParentLinks,
  ChildLinks 
)
Value:
{ \
PRTL_SPLAY_LINKS _SplayParent; \
PRTL_SPLAY_LINKS _SplayChild; \
_SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
_SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
_SplayParent->LeftChild = _SplayChild; \
_SplayChild->Parent = _SplayParent; \
}

◆ RtlInsertAsRightChild

#define RtlInsertAsRightChild (   ParentLinks,
  ChildLinks 
)
Value:
{ \
PRTL_SPLAY_LINKS _SplayParent; \
PRTL_SPLAY_LINKS _SplayChild; \
_SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
_SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
_SplayParent->RightChild = _SplayChild; \
_SplayChild->Parent = _SplayParent; \
}

◆ RtlInterlockedAndBits

#define RtlInterlockedAndBits (   Flags,
  Flag 
)     InterlockedAnd((PLONG)(Flags), Flag)

Definition at line 3454 of file rtlfuncs.h.

◆ RtlInterlockedAndBitsDiscardReturn

#define RtlInterlockedAndBitsDiscardReturn (   Flags,
  Flag 
)     (VOID) RtlInterlockedAndBits(Flags, Flag)

Definition at line 3466 of file rtlfuncs.h.

◆ RtlInterlockedClearBits

#define RtlInterlockedClearBits (   Flags,
  Flag 
)     RtlInterlockedAndBits(Flags, ~(Flag))

Definition at line 3457 of file rtlfuncs.h.

◆ RtlInterlockedClearBitsDiscardReturn

#define RtlInterlockedClearBitsDiscardReturn (   Flags,
  Flag 
)     RtlInterlockedAndBitsDiscardReturn(Flags, ~(Flag))

Definition at line 3469 of file rtlfuncs.h.

◆ RtlInterlockedSetBits

#define RtlInterlockedSetBits (   Flags,
  Flag 
)     InterlockedOr((PLONG)(Flags), Flag)

Definition at line 3451 of file rtlfuncs.h.

◆ RtlInterlockedSetBitsDiscardReturn

#define RtlInterlockedSetBitsDiscardReturn (   Flags,
  Flag 
)     (VOID) RtlInterlockedSetBits(Flags, Flag)

Definition at line 3463 of file rtlfuncs.h.

◆ RtlInterlockedXorBits

#define RtlInterlockedXorBits (   Flags,
  Flag 
)     InterlockedXor(Flags, Flag)

Definition at line 3460 of file rtlfuncs.h.

◆ RtlIntPtrToUnicodeString

#define RtlIntPtrToUnicodeString (   Value,
  Base,
  String 
)     RtlIntegerToUnicodeString(Value, Base, String)

Definition at line 756 of file rtlfuncs.h.

◆ RtlIsLeftChild

#define RtlIsLeftChild (   Links)     (RtlLeftChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))

◆ RtlIsNtDdiVersionAvailable

#define RtlIsNtDdiVersionAvailable   WdmlibRtlIsNtDdiVersionAvailable

Definition at line 3444 of file rtlfuncs.h.

◆ RtlIsRightChild

#define RtlIsRightChild (   Links)     (RtlRightChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))

◆ RtlIsRoot

#define RtlIsRoot (   Links)     (RtlParent(Links) == (PRTL_SPLAY_LINKS)(Links))

◆ RtlIsServicePackVersionInstalled

#define RtlIsServicePackVersionInstalled   WdmlibRtlIsServicePackVersionInstalled

Definition at line 3448 of file rtlfuncs.h.

◆ RtlIsZeroLuid

#define RtlIsZeroLuid (   _L1)     ((BOOLEAN) ((!(_L1)->LowPart) && (!(_L1)->HighPart)))

Definition at line 764 of file rtlfuncs.h.

◆ RtlLargeIntegerAnd

#define RtlLargeIntegerAnd (   Result,
  Source,
  Mask 
)     Result.QuadPart = Source.QuadPart & Mask.QuadPart

Definition at line 3116 of file rtlfuncs.h.

◆ RtlLargeIntegerEqualTo

#define RtlLargeIntegerEqualTo (   X,
  Y 
)     (!(((X).LowPart ^ (Y).LowPart) | ((X).HighPart ^ (Y).HighPart)))

Definition at line 3137 of file rtlfuncs.h.

◆ RtlLargeIntegerEqualToZero

#define RtlLargeIntegerEqualToZero (   X)    ( !((X).LowPart | (X).HighPart) )

Definition at line 3203 of file rtlfuncs.h.

◆ RtlLargeIntegerGreaterOrEqualToZero

#define RtlLargeIntegerGreaterOrEqualToZero (   X)    ( (X).HighPart >= 0 )

Definition at line 3201 of file rtlfuncs.h.

◆ RtlLargeIntegerGreaterThan

#define RtlLargeIntegerGreaterThan (   X,
  Y 
)
Value:
( \
(((X).HighPart == (Y).HighPart) && ((X).LowPart > (Y).LowPart)) || \
((X).HighPart > (Y).HighPart) \
)
#define Y(I)
#define X(b, s)

Definition at line 3172 of file rtlfuncs.h.

◆ RtlLargeIntegerGreaterThanOrEqualTo

#define RtlLargeIntegerGreaterThanOrEqualTo (   X,
  Y 
)
Value:
( \
(((X).HighPart == (Y).HighPart) && ((X).LowPart >= (Y).LowPart)) || \
((X).HighPart > (Y).HighPart) \
)

Definition at line 3177 of file rtlfuncs.h.

◆ RtlLargeIntegerGreaterThanZero

#define RtlLargeIntegerGreaterThanZero (   X)
Value:
( \
(((X).HighPart == 0) && ((X).LowPart > 0)) || \
((X).HighPart > 0 ) \
)

Definition at line 3196 of file rtlfuncs.h.

◆ RtlLargeIntegerLessOrEqualToZero

#define RtlLargeIntegerLessOrEqualToZero (   X)    ( ((X).HighPart < 0) || !((X).LowPart | (X).HighPart) )

Definition at line 3209 of file rtlfuncs.h.

◆ RtlLargeIntegerLessThan

#define RtlLargeIntegerLessThan (   X,
  Y 
)
Value:
( \
(((X).HighPart == (Y).HighPart) && ((X).LowPart < (Y).LowPart)) || \
((X).HighPart < (Y).HighPart) \
)

Definition at line 3186 of file rtlfuncs.h.

◆ RtlLargeIntegerLessThanOrEqualTo

#define RtlLargeIntegerLessThanOrEqualTo (   X,
  Y 
)
Value:
( \
(((X).HighPart == (Y).HighPart) && ((X).LowPart <= (Y).LowPart)) || \
((X).HighPart < (Y).HighPart) \
)

Definition at line 3191 of file rtlfuncs.h.

◆ RtlLargeIntegerLessThanZero

#define RtlLargeIntegerLessThanZero (   X)    ( ((X).HighPart < 0) )

Definition at line 3207 of file rtlfuncs.h.

◆ RtlLargeIntegerNotEqualTo

#define RtlLargeIntegerNotEqualTo (   X,
  Y 
)
Value:
( \
(((X).LowPart ^ (Y).LowPart) | ((X).HighPart ^ (Y).HighPart)) \
)

Definition at line 3182 of file rtlfuncs.h.

◆ RtlLargeIntegerNotEqualToZero

#define RtlLargeIntegerNotEqualToZero (   X)    ( ((X).LowPart | (X).HighPart) )

Definition at line 3205 of file rtlfuncs.h.

◆ RtlLeftChild

#define RtlLeftChild (   Links)     ((PRTL_SPLAY_LINKS)(Links))->LeftChild

◆ RtlMoveMemory

#define RtlMoveMemory (   Destination,
  Source,
  Length 
)     memmove(Destination, Source, Length)

Definition at line 365 of file rtlfuncs.h.

◆ RtlOemStringToCountedUnicodeSize

#define RtlOemStringToCountedUnicodeSize (   STRING)
Value:
( \
)
std::wstring STRING
Definition: fontsub.cpp:33
#define UNICODE_NULL
uint32_t ULONG
Definition: typedefs.h:59
#define RtlOemStringToUnicodeSize(STRING)

◆ RtlOemStringToUnicodeSize

#define RtlOemStringToUnicodeSize (   STRING)
Value:
( \
RtlxOemStringToUnicodeSize(STRING) : \
)
#define NLS_MB_OEM_CODE_PAGE_TAG
Definition: nt_native.h:213

◆ RtlOffsetToPointer

#define RtlOffsetToPointer (   B,
  O 
)    ((PCHAR)(((PCHAR)(B)) + ((ULONG_PTR)(O))))

◆ RtlParent

#define RtlParent (   Links)     ((PRTL_SPLAY_LINKS)(Links))->Parent

◆ RtlPointerToOffset

#define RtlPointerToOffset (   B,
  P 
)    ((ULONG)(((PCHAR)(P)) - ((PCHAR)(B))))

◆ RtlRetrieveUlong

#define RtlRetrieveUlong (   DestAddress,
  SrcAddress 
)
Value:
if ((ULONG_PTR)(SrcAddress) & LONG_MASK) \
{ \
((PUCHAR)(DestAddress))[0]=((PUCHAR)(SrcAddress))[0]; \
((PUCHAR)(DestAddress))[1]=((PUCHAR)(SrcAddress))[1]; \
((PUCHAR)(DestAddress))[2]=((PUCHAR)(SrcAddress))[2]; \
((PUCHAR)(DestAddress))[3]=((PUCHAR)(SrcAddress))[3]; \
} \
else \
{ \
*((PULONG)(DestAddress))=*((PULONG)(SrcAddress)); \
}
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t ULONG_PTR
Definition: typedefs.h:65
unsigned char * PUCHAR
Definition: typedefs.h:53
#define LONG_MASK
Definition: rtlfuncs.h:802

Definition at line 926 of file rtlfuncs.h.

◆ RtlRetrieveUshort

#define RtlRetrieveUshort (   DestAddress,
  SrcAddress 
)
Value:
if ((ULONG_PTR)(SrcAddress) & LONG_MASK) \
{ \
((PUCHAR)(DestAddress))[0]=((PUCHAR)(SrcAddress))[0]; \
((PUCHAR)(DestAddress))[1]=((PUCHAR)(SrcAddress))[1]; \
} \
else \
{ \
*((PUSHORT)(DestAddress))=*((PUSHORT)(SrcAddress)); \
}
uint16_t * PUSHORT
Definition: typedefs.h:56

Definition at line 915 of file rtlfuncs.h.

◆ RtlRightChild

#define RtlRightChild (   Links)     ((PRTL_SPLAY_LINKS)(Links))->RightChild

◆ RtlStoreUlong

#define RtlStoreUlong (   Address,
  Value 
)
Value:
if ((ULONG_PTR)(Address) & LONG_MASK) { \
} \
else { \
*((PULONG)(Address)) = (ULONG) (Value); \
}
static WCHAR Address[46]
Definition: ping.c:68
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:1035
#define THIRDBYTE(VALUE)
Definition: rtlfuncs.h:808
#define FOURTHBYTE(VALUE)
Definition: rtlfuncs.h:809
#define SECONDBYTE(VALUE)
Definition: rtlfuncs.h:807
#define FIRSTBYTE(VALUE)
Definition: rtlfuncs.h:806
#define LONG_3RD_MOST_SIGNIFICANT_BIT
Definition: rtltypes.h:222
#define LONG_LEAST_SIGNIFICANT_BIT
Definition: rtltypes.h:221
#define LONG_2ND_MOST_SIGNIFICANT_BIT
Definition: rtltypes.h:223
#define LONG_MOST_SIGNIFICANT_BIT
Definition: rtltypes.h:224
unsigned char UCHAR
Definition: xmlstorage.h:181

Definition at line 885 of file rtlfuncs.h.

◆ RtlStoreUlonglong

#define RtlStoreUlonglong (   Address,
  Value 
)
Value:
RtlStoreUlong((ULONG_PTR)(Address), \
(ULONGLONG)(Value) & 0xFFFFFFFF); \
RtlStoreUlong((ULONG_PTR)(Address)+sizeof(ULONG), \
(ULONGLONG)(Value) >> 32); \
} else { \
}
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
Definition: ntbasedef.h:391
uint64_t ULONGLONG
Definition: typedefs.h:67
#define LONGLONG_MASK
Definition: rtlfuncs.h:803

Definition at line 896 of file rtlfuncs.h.

◆ RtlStoreUlongPtr

#define RtlStoreUlongPtr (   Address,
  Value 
)    RtlStoreUlong(Address,Value)

Definition at line 949 of file rtlfuncs.h.

◆ RtlStoreUshort

#define RtlStoreUshort (   Address,
  Value 
)
Value:
} \
else { \
*((PUSHORT) (Address)) = (USHORT)Value; \
}
unsigned short USHORT
Definition: pedump.c:61
#define SHORT_MASK
Definition: rtlfuncs.h:799
#define SHORT_LEAST_SIGNIFICANT_BIT
Definition: rtltypes.h:218
#define SHORT_MOST_SIGNIFICANT_BIT
Definition: rtltypes.h:219

Definition at line 906 of file rtlfuncs.h.

◆ RtlUlongByteSwap

#define RtlUlongByteSwap (   _x)    _byteswap_ulong((_x))

Definition at line 3215 of file rtlfuncs.h.

◆ RtlUlonglongByteSwap

#define RtlUlonglongByteSwap (   _x)    _byteswap_uint64((_x))

Definition at line 3216 of file rtlfuncs.h.

◆ RtlUnicodeStringToAnsiSize

#define RtlUnicodeStringToAnsiSize (   String)
Value:
( \
RtlxUnicodeStringToAnsiSize(String) : \
)

Definition at line 1022 of file rtlfuncs.h.

◆ RtlUnicodeStringToOemSize

#define RtlUnicodeStringToOemSize (   STRING)
Value:
RtlxUnicodeStringToOemSize(STRING) : \
)

◆ RtlUshortByteSwap

#define RtlUshortByteSwap (   _x)    _byteswap_ushort((USHORT)(_x))

Definition at line 3214 of file rtlfuncs.h.

◆ RtlZeroBytes

#define RtlZeroBytes   RtlZeroMemory

Definition at line 386 of file rtlfuncs.h.

◆ RtlZeroMemory

#define RtlZeroMemory (   Destination,
  Length 
)     memset(Destination, 0, Length)

Definition at line 383 of file rtlfuncs.h.

◆ SECONDBYTE

#define SECONDBYTE (   VALUE)    (((VALUE) >> 8) & LOWBYTE_MASK)

Definition at line 807 of file rtlfuncs.h.

◆ SHORT_MASK

#define SHORT_MASK   (SHORT_SIZE - 1)

Definition at line 799 of file rtlfuncs.h.

◆ SHORT_SIZE

#define SHORT_SIZE   (sizeof(USHORT))

Definition at line 798 of file rtlfuncs.h.

◆ THIRDBYTE

#define THIRDBYTE (   VALUE)    (((VALUE) >> 16) & LOWBYTE_MASK)

Definition at line 808 of file rtlfuncs.h.

Function Documentation

◆ $endif() [1/4]

$endif ( _NTDDK_  )

Definition at line 559 of file iofuncs.h.

2502{
2503 PriorityInfo->Size = sizeof(IO_PRIORITY_INFO);
2504 PriorityInfo->ThreadPriority = 0xffff;
2505 PriorityInfo->IoPriority = IoPriorityNormal;
2506 PriorityInfo->PagePriority = 0;
2507}
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD _Inout_ PIO_PRIORITY_INFO PriorityInfo
Definition: fltkernel.h:2654
struct _IO_PRIORITY_INFO IO_PRIORITY_INFO
@ IoPriorityNormal
Definition: iotypes.h:1233

◆ $endif() [2/4]

$endif ( _NTIFS_  )

Definition at line 2842 of file rtlfuncs.h.

2856{
2858 ret.QuadPart = SignedInteger;
2859 return ret;
2860}
return ret
Definition: rtlfuncs.h:3107

◆ $endif() [3/4]

$endif ( _WDMDDK_  )

Definition at line 3472 of file rtlfuncs.h.

3492 { \
3493 PRTL_SPLAY_LINKS _SplayLinks; \
3494 _SplayLinks = (PRTL_SPLAY_LINKS)(Links); \
3495 _SplayLinks->Parent = _SplayLinks; \
3496 _SplayLinks->LeftChild = NULL; \
3497 _SplayLinks->RightChild = NULL; \
3498}
3499
3500#define RtlIsLeftChild(Links) \
3501 (RtlLeftChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))
3502
3503#define RtlIsRightChild(Links) \
3504 (RtlRightChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))
3505
3506#define RtlRightChild(Links) \
3507 ((PRTL_SPLAY_LINKS)(Links))->RightChild
3508
3509#define RtlIsRoot(Links) \
3510 (RtlParent(Links) == (PRTL_SPLAY_LINKS)(Links))
3511
3512#define RtlLeftChild(Links) \
3513 ((PRTL_SPLAY_LINKS)(Links))->LeftChild
3514
3515#define RtlParent(Links) \
3516 ((PRTL_SPLAY_LINKS)(Links))->Parent
3517
3518#define RtlInsertAsLeftChild(ParentLinks,ChildLinks) \
3519 { \
3520 PRTL_SPLAY_LINKS _SplayParent; \
3521 PRTL_SPLAY_LINKS _SplayChild; \
3522 _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
3523 _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
3524 _SplayParent->LeftChild = _SplayChild; \
3525 _SplayChild->Parent = _SplayParent; \
3526 }
3527
3528#define RtlInsertAsRightChild(ParentLinks,ChildLinks) \
3529 { \
3530 PRTL_SPLAY_LINKS _SplayParent; \
3531 PRTL_SPLAY_LINKS _SplayChild; \
3532 _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
3533 _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
3534 _SplayParent->RightChild = _SplayChild; \
3535 _SplayChild->Parent = _SplayParent; \
3536 }
3537
3538#if !defined(MIDL_PASS)
3539
3541LUID
3543RtlConvertLongToLuid(
3544 _In_ LONG Val)
3545{
3546 LUID Luid;
3547 LARGE_INTEGER Temp;
3548
3549 Temp.QuadPart = Val;
3550 Luid.LowPart = Temp.u.LowPart;
3551 Luid.HighPart = Temp.u.HighPart;
3552 return Luid;
3553}
#define _In_
Definition: no_sal2.h:158
long LONG
Definition: pedump.c:60
LONG HighPart
DWORD LowPart
#define NTAPI_INLINE
Definition: umtypes.h:68
LONGLONG QuadPart
Definition: typedefs.h:114
struct _LARGE_INTEGER::@2304 u
#define FORCEINLINE
Definition: wdftypes.h:67

◆ $endif() [4/4]

$endif ( _WDMDDK_||  _WINNT_)

Definition at line 34 of file rtlfuncs.h.

47 { &x, &x }
48
50VOID
52 _Out_ PLIST_ENTRY ListHead)
53{
54 ListHead->Flink = ListHead->Blink = ListHead;
55}
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define _Out_
Definition: no_sal2.h:160
Definition: typedefs.h:120

◆ $if()

$if ( _WDMDDK_||  _WINNT_)

Definition at line 5 of file rtlfuncs.h.

30{
31 __fastfail(Code);
32}
_In_ UCHAR _In_ UCHAR _In_ ULONG Code
Definition: wdfdevice.h:1701

◆ __drv_allocatesMem()

__drv_allocatesMem ( Mem  )

Definition at line 37 of file exfuncs.h.

1484{
1485 PVOID Entry;
1486
1487 Lookaside->L.TotalAllocates++;
1488#ifdef NONAMELESSUNION
1489#if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_)
1491 &Lookaside->Lock__ObsoleteButDoNotDelete);
1492#else
1493 Entry = InterlockedPopEntrySList(&Lookaside->L.u.ListHead);
1494#endif
1495 if (Entry == NULL) {
1496 Lookaside->L.u2.AllocateMisses++;
1497 Entry = (Lookaside->L.u4.Allocate)(Lookaside->L.Type,
1498 Lookaside->L.Size,
1499 Lookaside->L.Tag);
1500 }
1501#else /* NONAMELESSUNION */
1502#if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_)
1504 &Lookaside->Lock__ObsoleteButDoNotDelete);
1505#else
1507#endif
1508 if (Entry == NULL) {
1509 Lookaside->L.AllocateMisses++;
1510 Entry = (Lookaside->L.Allocate)(Lookaside->L.Type,
1511 Lookaside->L.Size,
1512 Lookaside->L.Tag);
1513 }
1514#endif /* NONAMELESSUNION */
1515 return Entry;
1516}
base of all file and directory entries
Definition: entries.h:83
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_opt_ ULONG _Out_ WDFLOOKASIDE * Lookaside
Definition: wdfmemory.h:414
_In_ PVOID Entry
Definition: exfuncs.h:229
#define ExInterlockedPopEntrySList(SListHead, Lock)
Definition: exfuncs.h:166
#define InterlockedPopEntrySList(SListHead)
Definition: rtlfuncs.h:3409

◆ _At_() [1/6]

Definition at line 2969 of file rtlfuncs.h.

2978{
2979 AnsiString->Length = 0;
2980 AnsiString->MaximumLength = BufferSize;
2981 AnsiString->Buffer = Buffer;
2982}
@ AnsiString
Definition: dnslib.h:19
_Notnull_ __drv_aliasesMem PWSTR _In_ USHORT BufferSize
Definition: rtlfuncs.h:2995
_Notnull_ __drv_aliasesMem PWSTR Buffer
Definition: rtlfuncs.h:2993

◆ _At_() [2/6]

_At_ ( BitMapHeader->  SizeOfBitMap,
_Post_equal_to_(SizeOfBitMap)   
) -> Buffer, _Post_equal_to_(BitMapBuffer)) NTSYSAPI VOID NTAPI RtlInitializeBitMap(_Out_ PRTL_BITMAP BitMapHeader, _In_opt_ __drv_aliasesMem PULONG BitMapBuffer, _In_opt_ ULONG SizeOfBitMap)

Definition at line 59 of file dbgbitmap.h.

67{
68 RtlInitializeBitMap(&BitMapHeader->BitMap, BitMapBuffer, SizeOfBitMap);
69 BitMapHeader->NumberOfSetBits = RtlNumberOfSetBits(&BitMapHeader->BitMap);
70 BitMapHeader->BitmapHash = RtlComputeBitmapHashDbg(BitMapHeader);
71}
#define RtlInitializeBitMap
Definition: dbgbitmap.h:326
#define RtlNumberOfSetBits
Definition: dbgbitmap.h:343
static ULONG RtlComputeBitmapHashDbg(_In_ PRTL_BITMAP_DBG BitMapHeader)
Definition: dbgbitmap.h:41

◆ _At_() [3/6]

_Out_ _At_ ( DestinationString->  Buffer,
__drv_allocatesMem(Mem)   
)

◆ _At_() [4/6]

◆ _At_() [5/6]

_Out_ _At_ ( GuidString->  Buffer,
__drv_allocatesMem(Mem)   
)

◆ _At_() [6/6]

◆ _In_range_() [1/4]

_In_range_ ( <, BitMapHeader->  SizeOfBitMap)

◆ _In_range_() [2/4]

_In_ ULONG _In_ ULONG _In_range_ ( )

◆ _In_range_() [3/4]

◆ _In_range_() [4/4]

_In_ ULONG _In_range_ ( >=  ,
(UncompressedBufferSize -(UncompressedBufferSize/16))   
)

◆ _In_reads_()

_In_ SIZE_T _In_reads_ ( String2Length  )

◆ _In_reads_bytes_() [1/9]

_In_ ULONG _In_ ULONG _In_reads_bytes_ ( AceListLength  )

◆ _In_reads_bytes_() [2/9]

◆ _In_reads_bytes_() [3/9]

◆ _In_reads_bytes_() [4/9]

◆ _In_reads_bytes_() [5/9]

_In_reads_bytes_ ( BytesInUnicodeString  )

◆ _In_reads_bytes_() [6/9]

_In_ ULONG _In_reads_bytes_ ( CompressedBufferSize  )

◆ _In_reads_bytes_() [7/9]

_In_ ULONG _In_ ULONG _In_reads_bytes_ ( CompressedTailSize  )

◆ _In_reads_bytes_() [8/9]

◆ _In_reads_bytes_() [9/9]

◆ _In_reads_bytes_opt_()

_In_ PCWSTR _In_z_ PCWSTR _In_ ULONG _In_reads_bytes_opt_ ( ValueLength  )

◆ _Inout_updates_bytes_()

_In_ ULONG _Inout_updates_bytes_ ( CompressedDataInfoLength  )

◆ _IRQL_requires_max_() [1/3]

_IRQL_requires_max_ ( APC_LEVEL  )

Probes and locks virtual pages in memory for the specified process.

Parameters
[in,out]MemoryDescriptorListMemory Descriptor List (MDL) containing the buffer to be probed and locked.
[in]ProcessThe process for which the buffer should be probed and locked.
[in]AccessModeAccess mode for probing the pages. Can be KernelMode or UserMode.
[in]LockOperationThe type of the probing and locking operation. Can be IoReadAccess, IoWriteAccess or IoModifyAccess.
Returns
Nothing.
See also
MmProbeAndLockPages
Remarks
Must be called at IRQL <= APC_LEVEL

Probes and locks virtual pages in memory for the specified process.

Frees previously reserved amount of memory in system virtual address space.

Parameters
[in]NumberOfBytesSize, in bytes, of memory to reserve.
[in]PoolTagPool Tag identifying the buffer. Usually consists from 4 characters in reversed order.
Returns
A pointer to the 1st memory block of the reserved buffer in case of success, NULL otherwise.
Remarks
Must be called at IRQL <= APC_LEVEL
Parameters
[in]BaseAddressA pointer to the 1st memory block of the reserved buffer.
[in]PoolTagPool Tag identifying the buffer. Usually consists from 4 characters in reversed order.
Returns
Nothing.
See also
MmAllocateMappingAddress
Remarks
Must be called at IRQL <= APC_LEVEL

Definition at line 37 of file cddata.c.

254{
255 THREAD_CONTEXT ThreadContext = {0};
256 PIRP_CONTEXT IrpContext = NULL;
258
259#ifdef CD_SANITY
260 PVOID PreviousTopLevel;
261#endif
262
264
265#if DBG
266
267 KIRQL SaveIrql = KeGetCurrentIrql();
268
269#endif
270
272
274
276
277#ifdef CD_SANITY
278 PreviousTopLevel = IoGetTopLevelIrp();
279#endif
280
281 //
282 // Loop until this request has been completed or posted.
283 //
284
285 do {
286
287 //
288 // Use a try-except to handle the exception cases.
289 //
290
291 _SEH2_TRY {
292
293 //
294 // If the IrpContext is NULL then this is the first pass through
295 // this loop.
296 //
297
298 if (IrpContext == NULL) {
299
300 //
301 // Decide if this request is waitable an allocate the IrpContext.
302 // If the file object in the stack location is NULL then this
303 // is a mount which is always waitable. Otherwise we look at
304 // the file object flags.
305 //
306
308
309 Wait = TRUE;
310
311 } else {
312
313 Wait = CanFsdWait( Irp );
314 }
315
316 IrpContext = CdCreateIrpContext( Irp, Wait );
317
318 //
319 // Update the thread context information.
320 //
321
322 CdSetThreadContext( IrpContext, &ThreadContext );
323
324#ifdef CD_SANITY
325 NT_ASSERT( !CdTestTopLevel ||
326 SafeNodeType( IrpContext->TopLevel ) == CDFS_NTC_IRP_CONTEXT );
327#endif
328
329 //
330 // Otherwise cleanup the IrpContext for the retry.
331 //
332
333 } else {
334
335 //
336 // Set the MORE_PROCESSING flag to make sure the IrpContext
337 // isn't inadvertently deleted here. Then cleanup the
338 // IrpContext to perform the retry.
339 //
340
341 SetFlag( IrpContext->Flags, IRP_CONTEXT_FLAG_MORE_PROCESSING );
342 CdCleanupIrpContext( IrpContext, FALSE );
343 }
344
345 //
346 // Case on the major irp code.
347 //
348
349 switch (IrpContext->MajorFunction) {
350
351 case IRP_MJ_CREATE :
352
353 Status = CdCommonCreate( IrpContext, Irp );
354 break;
355
356 case IRP_MJ_CLOSE :
357
358 Status = CdCommonClose( IrpContext, Irp );
359 break;
360
361 case IRP_MJ_READ :
362
363 //
364 // If this is an Mdl complete request, don't go through
365 // common read.
366 //
367
368 if (FlagOn( IrpContext->MinorFunction, IRP_MN_COMPLETE )) {
369
370 Status = CdCompleteMdl( IrpContext, Irp );
371
372 } else {
373
374 Status = CdCommonRead( IrpContext, Irp );
375 }
376
377 break;
378
379 case IRP_MJ_WRITE :
380
381 Status = CdCommonWrite( IrpContext, Irp );
382 break;
383
385
386 Status = CdCommonQueryInfo( IrpContext, Irp );
387 break;
388
390
391 Status = CdCommonSetInfo( IrpContext, Irp );
392 break;
393
395
396 Status = CdCommonQueryVolInfo( IrpContext, Irp );
397 break;
398
400
401 Status = CdCommonDirControl( IrpContext, Irp );
402 break;
403
405
406 Status = CdCommonFsControl( IrpContext, Irp );
407 break;
408
410
411 Status = CdCommonDevControl( IrpContext, Irp );
412 break;
413
415
416 Status = CdCommonLockControl( IrpContext, Irp );
417 break;
418
419 case IRP_MJ_CLEANUP :
420
421 Status = CdCommonCleanup( IrpContext, Irp );
422 break;
423
424 case IRP_MJ_PNP :
425
426 Status = CdCommonPnp( IrpContext, Irp );
427 break;
428
429 case IRP_MJ_SHUTDOWN :
430
431 Status = CdCommonShutdown( IrpContext, Irp );
432 break;
433
434 default :
435
437 CdCompleteRequest( IrpContext, Irp, Status );
438 }
439
441
442 Status = CdProcessException( IrpContext, Irp, _SEH2_GetExceptionCode() );
443 } _SEH2_END;
444
445 } while (Status == STATUS_CANT_WAIT);
446
447#ifdef CD_SANITY
448 NT_ASSERT( !CdTestTopLevel ||
449 (PreviousTopLevel == IoGetTopLevelIrp()) );
450#endif
451
453
454 NT_ASSERT( SaveIrql == KeGetCurrentIrql( ));
455
456 return Status;
457}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
VOID CdCompleteRequest(_Inout_opt_ PIRP_CONTEXT IrpContext, _Inout_opt_ PIRP Irp, _In_ NTSTATUS Status)
Definition: cddata.c:914
LONG CdExceptionFilter(_Inout_ PIRP_CONTEXT IrpContext, _In_ PEXCEPTION_POINTERS ExceptionPointer)
Definition: cddata.c:525
VOID CdSetThreadContext(_Inout_ PIRP_CONTEXT IrpContext, _In_ PTHREAD_CONTEXT ThreadContext)
Definition: cddata.c:981
#define ASSERT_OPTIONAL_IRP(I)
Definition: cddata.h:251
NTSTATUS CdCompleteMdl(_In_ PIRP_CONTEXT IrpContext, _Inout_ PIRP Irp)
Definition: cachesup.c:411
VOID CdCleanupIrpContext(_In_ PIRP_CONTEXT IrpContext, _In_ BOOLEAN Post)
Definition: strucsup.c:1733
#define CanFsdWait(I)
Definition: cdprocs.h:2001
NTSTATUS CdCommonLockControl(_Inout_ PIRP_CONTEXT IrpContext, _Inout_ PIRP Irp)
Definition: lockctrl.c:35
NTSTATUS CdCommonDevControl(_Inout_ PIRP_CONTEXT IrpContext, _Inout_ PIRP Irp)
Definition: devctrl.c:46
_Ret_valid_ PIRP_CONTEXT CdCreateIrpContext(_In_ PIRP Irp, _In_ BOOLEAN Wait)
Definition: strucsup.c:1573
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
#define IRP_CONTEXT_FLAG_MORE_PROCESSING
Definition: cdstruc.h:1214
_In_ PIRP Irp
Definition: csq.h:116
#define CDFS_NTC_IRP_CONTEXT
Definition: nodetype.h:34
#define SafeNodeType(Ptr)
Definition: nodetype.h:54
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
Status
Definition: gdiplustypes.h:25
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
PIRP NTAPI IoGetTopLevelIrp(VOID)
Definition: irp.c:1843
#define STATUS_CANT_WAIT
Definition: ntstatus.h:452
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
#define _SEH2_GetExceptionInformation()
Definition: pseh2_64.h:164
#define _SEH2_END
Definition: pseh2_64.h:155
#define _SEH2_TRY
Definition: pseh2_64.h:55
#define IRP_MJ_DIRECTORY_CONTROL
Definition: rdpdr.c:51
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define IRP_MJ_QUERY_VOLUME_INFORMATION
Definition: rdpdr.c:50
#define IRP_MJ_LOCK_CONTROL
Definition: rdpdr.c:53
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define IRP_MJ_SET_INFORMATION
Definition: rdpdr.c:49
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define IRP_MJ_QUERY_INFORMATION
Definition: rdpdr.c:48
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
#define IRP_MN_COMPLETE
Definition: iotypes.h:4420
#define IRP_MJ_FILE_SYSTEM_CONTROL
#define IRP_MJ_SHUTDOWN
#define IRP_MJ_CLEANUP
#define NT_ASSERT
Definition: rtlfuncs.h:3327

◆ _IRQL_requires_max_() [2/3]

Definition at line 347 of file common.c.

3587{
3589 BOOLEAN requestSent = FALSE;
3590
3591 BOOLEAN shouldRetry = TRUE;
3592 PCDB cdb = (PCDB)DeviceExtension->PowerContext.Srb.Cdb;
3593 ULONG timeoutValue = DeviceExtension->TimeOutValue;
3594 ULONG retryCount = 1;
3595
3596 // reset some fields.
3597 DeviceExtension->PowerContext.RetryIntervalIn100ns = 0;
3598 status = PowerContextReuseRequest(DeviceExtension);
3599 RequestClearSendTime(DeviceExtension->PowerContext.PowerRequest);
3600
3601 if (!NT_SUCCESS(status))
3602 {
3603 return status;
3604 }
3605
3606 // set proper timeout value and max retry count.
3607 switch(DeviceExtension->PowerContext.PowerChangeState.PowerDown)
3608 {
3612 break;
3613
3615 // Case of issuing SYNC CACHE command. Do not use power irp timeout remaining time in this case
3616 // as we want to give best try on SYNC CACHE command.
3617 retryCount = MAXIMUM_RETRIES;
3618 timeoutValue = DeviceExtension->TimeOutValue;
3619 break;
3620
3622 {
3623 // Case of issuing STOP UNIT command
3624 // As "Imme" bit is set to '1', this command should be completed in short time.
3625 // This command is at low importance, failure of this command has very small impact.
3626 ULONG secondsRemaining = 0;
3627
3628#if (WINVER >= 0x0601)
3629 // this API is introduced in Windows7
3630 PoQueryWatchdogTime(DeviceExtension->LowerPdo, &secondsRemaining);
3631#endif
3632
3633 if (secondsRemaining == 0)
3634 {
3635 // not able to retrieve remaining time from PoQueryWatchdogTime API, use default values.
3636 retryCount = MAXIMUM_RETRIES;
3637 timeoutValue = SCSI_CDROM_TIMEOUT;
3638 }
3639 else
3640 {
3641 // plan to leave about 30 seconds to lower level drivers if possible.
3642 if (secondsRemaining >= 32)
3643 {
3644 retryCount = (secondsRemaining - 30)/SCSI_CDROM_TIMEOUT + 1;
3645 timeoutValue = SCSI_CDROM_TIMEOUT;
3646
3647 if (retryCount > MAXIMUM_RETRIES)
3648 {
3649 retryCount = MAXIMUM_RETRIES;
3650 }
3651
3652 if (retryCount == 1)
3653 {
3654 timeoutValue = secondsRemaining - 30;
3655 }
3656 }
3657 else
3658 {
3659 // issue the command with minimal timeout value and do not retry on it.
3660 retryCount = 1;
3661 timeoutValue = 2;
3662 }
3663 }
3664 }
3665 break;
3666 default:
3667 NT_ASSERT( FALSE );
3669 return status;
3670 }
3671
3672 DeviceExtension->PowerContext.RetryCount = retryCount;
3673
3674 // issue command.
3675 while (shouldRetry)
3676 {
3677
3678 // set SRB fields.
3679 DeviceExtension->PowerContext.Srb.SrbFlags = SRB_FLAGS_NO_DATA_TRANSFER |
3684
3685 DeviceExtension->PowerContext.Srb.Function = SRB_FUNCTION_EXECUTE_SCSI;
3686 DeviceExtension->PowerContext.Srb.TimeOutValue = timeoutValue;
3687
3688 if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceInitial)
3689 {
3690 DeviceExtension->PowerContext.Srb.Function = SRB_FUNCTION_LOCK_QUEUE;
3691 }
3692 else if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceLocked)
3693 {
3694 DeviceExtension->PowerContext.Srb.Function = SRB_FUNCTION_QUIESCE_DEVICE;
3695 }
3696 else if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceQuiesced)
3697 {
3698 // Case of issuing SYNC CACHE command.
3699 DeviceExtension->PowerContext.Srb.CdbLength = 10;
3700 cdb->SYNCHRONIZE_CACHE10.OperationCode = SCSIOP_SYNCHRONIZE_CACHE;
3701 }
3702 else if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceFlushed)
3703 {
3704 // Case of issuing STOP UNIT command.
3705 DeviceExtension->PowerContext.Srb.CdbLength = 6;
3706 cdb->START_STOP.OperationCode = SCSIOP_START_STOP_UNIT;
3707 cdb->START_STOP.Start = 0;
3708 cdb->START_STOP.Immediate = 1;
3709 }
3710 else if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceStopped)
3711 {
3712 DeviceExtension->PowerContext.Srb.Function = SRB_FUNCTION_UNLOCK_QUEUE;
3713 }
3714
3715 // Set up completion routine and context if requested
3717 {
3718 WdfRequestSetCompletionRoutine(DeviceExtension->PowerContext.PowerRequest,
3720 Context);
3721 }
3722
3723 status = RequestSend(DeviceExtension,
3724 DeviceExtension->PowerContext.PowerRequest,
3725 DeviceExtension->IoTarget,
3727 &requestSent);
3728
3729 if (requestSent)
3730 {
3731 if ((CompletionRoutine == NULL) &&
3732 (SRB_STATUS(DeviceExtension->PowerContext.Srb.SrbStatus) != SRB_STATUS_SUCCESS))
3733 {
3734 TracePrint((TRACE_LEVEL_ERROR,
3735 TRACE_FLAG_POWER,
3736 "%p\tError occured when issuing %s command to device. Srb %p, Status %x\n",
3737 DeviceExtension->PowerContext.PowerRequest,
3738 (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceQuiesced) ? "SYNC CACHE" : "STOP UNIT",
3739 &DeviceExtension->PowerContext.Srb,
3740 DeviceExtension->PowerContext.Srb.SrbStatus));
3741
3742 NT_ASSERT(!(TEST_FLAG(DeviceExtension->PowerContext.Srb.SrbStatus, SRB_STATUS_QUEUE_FROZEN)));
3743
3744 shouldRetry = RequestSenseInfoInterpret(DeviceExtension,
3745 DeviceExtension->PowerContext.PowerRequest,
3746 &(DeviceExtension->PowerContext.Srb),
3747 retryCount - DeviceExtension->PowerContext.RetryCount,
3748 &status,
3749 &(DeviceExtension->PowerContext.RetryIntervalIn100ns));
3750
3751 if (shouldRetry && (DeviceExtension->PowerContext.RetryCount-- == 0))
3752 {
3753 shouldRetry = FALSE;
3754 }
3755 }
3756 else
3757 {
3758 // succeeded, do not need to retry.
3759 shouldRetry = FALSE;
3760 }
3761
3762 }
3763 else
3764 {
3765 // request failed to be sent
3766 shouldRetry = FALSE;
3767 }
3768
3769 if (shouldRetry)
3770 {
3772 t.QuadPart = -DeviceExtension->PowerContext.RetryIntervalIn100ns;
3774
3775 status = PowerContextReuseRequest(DeviceExtension);
3776 if (!NT_SUCCESS(status))
3777 {
3778 shouldRetry = FALSE;
3779 }
3780 }
3781 }
3782
3783 if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceQuiesced)
3784 {
3785 // record SYNC CACHE command completion time stamp.
3786 KeQueryTickCount(&DeviceExtension->PowerContext.Step1CompleteTime);
3787 }
3788
3789 return status;
3790}
#define MAXIMUM_RETRIES
Definition: cdrom.h:124
#define SCSI_CDROM_TIMEOUT
Definition: cdrom.h:680
BOOLEAN RequestSenseInfoInterpret(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ WDFREQUEST Request, _In_ PSCSI_REQUEST_BLOCK Srb, _In_ ULONG RetriedCount, _Out_ NTSTATUS *Status, _Out_opt_ _Deref_out_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) LONGLONG *RetryIntervalIn100ns)
Definition: sense.c:2467
#define TEST_FLAG(Flags, Bit)
Definition: cdrom.h:1495
@ PowerDownDeviceStopped
Definition: cdrom.h:412
@ PowerDownDeviceQuiesced
Definition: cdrom.h:410
@ PowerDownDeviceInitial
Definition: cdrom.h:408
@ PowerDownDeviceLocked
Definition: cdrom.h:409
@ PowerDownDeviceFlushed
Definition: cdrom.h:411
union _CDB * PCDB
#define SCSIOP_START_STOP_UNIT
Definition: cdrw_hw.h:897
#define SCSIOP_SYNCHRONIZE_CACHE
Definition: cdrw_hw.h:918
#define STATUS_NOT_IMPLEMENTED
Definition: d3dkmdt.h:42
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
NTSTATUS RequestSend(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ WDFREQUEST Request, _In_ WDFIOTARGET IoTarget, _In_ ULONG Flags, _Out_opt_ PBOOLEAN RequestSent)
Definition: common.c:3793
VOID RequestClearSendTime(_In_ WDFREQUEST Request)
Definition: common.c:111
#define SRB_FUNCTION_EXECUTE_SCSI
Definition: srb.h:315
#define SRB_FLAGS_NO_DATA_TRANSFER
Definition: srb.h:402
#define SRB_FUNCTION_LOCK_QUEUE
Definition: srb.h:332
#define SRB_FUNCTION_UNLOCK_QUEUE
Definition: srb.h:333
#define SRB_FLAGS_BYPASS_LOCKED_QUEUE
Definition: srb.h:410
#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER
Definition: srb.h:397
#define SRB_STATUS(Status)
Definition: srb.h:389
#define SRB_STATUS_QUEUE_FROZEN
Definition: srb.h:386
#define SRB_FLAGS_NO_QUEUE_FREEZE
Definition: srb.h:404
#define SRB_STATUS_SUCCESS
Definition: srb.h:341
#define KeDelayExecutionThread(mode, foo, t)
Definition: env_spec_w32.h:484
GLdouble GLdouble t
Definition: gl.h:2047
#define KernelMode
Definition: asm.h:34
#define SRB_FLAGS_D3_PROCESSING
Definition: srb.h:165
#define SRB_FUNCTION_QUIESCE_DEVICE
Definition: srb.h:99
#define KeQueryTickCount(CurrentCount)
Definition: ke.h:43
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
Definition: ps.c:97
Definition: cdrw_hw.h:28
struct _CDB::_START_STOP START_STOP
struct _CDB::_SYNCHRONIZE_CACHE10 SYNCHRONIZE_CACHE10
@ WDF_REQUEST_SEND_OPTION_SYNCHRONOUS
Definition: wdfrequest.h:109
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine
Definition: wdfrequest.h:895

◆ _IRQL_requires_max_() [3/3]

_IRQL_requires_max_ ( PASSIVE_LEVEL  ) -> Buffer, __drv_freesMem(Mem)) PUNICODE_STRING UnicodeString)

Queries information details about a security descriptor.

Computes the quota size of a security descriptor.

Assigns a security descriptor for a new object.

An extended function that assigns a security descriptor for a new object.

Frees a security descriptor.

An extended function that sets new information data to a security descriptor.

Modifies some information data about a security descriptor.

Parameters
[in]SecurityInformationSecurity information details to be queried from a security descriptor.
[out]SecurityDescriptorThe returned security descriptor with security information data.
[in,out]LengthThe returned length of a security descriptor.
[in,out]ObjectsSecurityDescriptorThe returned object security descriptor.
Returns
Returns STATUS_SUCCESS if the operations have been completed successfully and that the specific information about the security descriptor has been queried. STATUS_BUFFER_TOO_SMALL is returned if the buffer size is too small to contain the queried info about the security descriptor.
Parameters
[in]ObjectIf specified, the function will use this arbitrary object that points to an object security descriptor.
[in]SecurityInformationSecurity information details to be set.
[in]SecurityDescriptorA security descriptor where its info is to be changed.
[in,out]ObjectsSecurityDescriptorThe returned pointer to security descriptor objects.
[in]PoolTypePool type for the new security descriptor to allocate.
[in]GenericMappingThe generic mapping of access rights masks.
Returns
See SeSetSecurityDescriptorInfoEx.
Parameters
[in]ObjectIf specified, the function will use this arbitrary object that points to an object security descriptor.
[in]SecurityInformationSecurity information details to be set.
[in]SecurityDescriptorA security descriptor where its info is to be changed.
[in,out]ObjectsSecurityDescriptorThe returned pointer to security descriptor objects.
[in]AutoInheritFlagsFlags bitmask inheritation, influencing how the security descriptor can be inherited and if it can be in the first place.
[in]PoolTypePool type for the new security descriptor to allocate.
[in]GenericMappingThe generic mapping of access rights masks.
Returns
Returns STATUS_SUCCESS if the operations have been completed without problems and that new info has been set to the security descriptor. STATUS_NO_SECURITY_ON_OBJECT is returned if the object does not have a security descriptor. STATUS_INSUFFICIENT_RESOURCES is returned if memory pool allocation for the new security descriptor with new info set has failed.
Parameters
[in]SecurityDescriptorA security descriptor to be freed from memory.
Returns
Returns STATUS_SUCCESS.
Parameters
[in]_ParentDescriptorA security descriptor of the parent object that is being created.
[in]_ExplicitDescriptorAn explicit security descriptor that is applied to a new object.
[out]NewDescriptorThe new allocated security descriptor.
[in]ObjectTypeThe type of the new object.
[in]IsDirectoryObjectSet this to TRUE if the newly created object is a directory object, otherwise set this to FALSE.
[in]AutoInheritFlagsAutomatic inheritance flags that influence how access control entries within ACLs from security descriptors are inherited.
[in]SubjectContextSecurity subject context of the new object.
[in]GenericMappingGeneric mapping of access mask rights.
[in]PoolTypeThis parameter is unused.
Returns
Returns STATUS_SUCCESS if the operations have been completed successfully and that the security descriptor has been assigned to the new object. STATUS_NO_TOKEN is returned if the caller hasn't supplied a valid argument to a security subject context. STATUS_INVALID_OWNER is returned if the caller hasn't supplied a parent descriptor that belongs to the main user (owner). STATUS_INVALID_PRIMARY_GROUP is returned by the same reason as with the previous NTSTATUS code. The two NTSTATUS codes are returned if the calling thread stated that the owner and/or group is defaulted to the parent descriptor (SEF_DEFAULT_OWNER_FROM_PARENT and/or SEF_DEFAULT_GROUP_FROM_PARENT respectively). STATUS_INSUFFICIENT_RESOURCES is returned if memory pool allocation for the descriptor buffer has failed. A failure NTSTATUS is returned otherwise.
Parameters
[in]ParentDescriptorA security descriptor of the parent object that is being created.
[in]ExplicitDescriptorAn explicit security descriptor that is applied to a new object.
[out]NewDescriptorThe new allocated security descriptor.
[in]IsDirectoryObjectSet this to TRUE if the newly created object is a directory object, otherwise set this to FALSE.
[in]SubjectContextSecurity subject context of the new object.
[in]GenericMappingGeneric mapping of access mask rights.
[in]PoolTypeThis parameter is unused.
Returns
See SeAssignSecurityEx.
Parameters
[in]SecurityDescriptorA security descriptor.
[out]QuotaInfoSizeThe returned quota size of the given security descriptor to the caller. The function may return 0 to this parameter if the descriptor doesn't have a group or a discretionary access control list (DACL) even.
Returns
Returns STATUS_SUCCESS if the quota size of a security descriptor has been computed successfully. STATUS_UNKNOWN_REVISION is returned if the security descriptor has an invalid revision.

Definition at line 923 of file Messaging.c.

75{
76 PFLT_SERVER_PORT_OBJECT PortObject;
78
79 /* The caller must allow at least one connection */
80 if (MaxConnections == 0)
81 {
83 }
84
85 /* The request must be for a kernel handle */
86 if (!(ObjectAttributes->Attributes & OBJ_KERNEL_HANDLE))
87 {
89 }
90
91 /*
92 * Get rundown protection on the target to stop the owner
93 * from unloading whilst this port object is open. It gets
94 * removed in the FltpServerPortClose callback
95 */
97 if (!NT_SUCCESS(Status))
98 {
99 return Status;
100 }
101
102 /* Create the server port object for this filter */
107 NULL,
109 0,
110 0,
111 (PVOID *)&PortObject);
112 if (NT_SUCCESS(Status))
113 {
114 /* Zero out the struct */
115 RtlZeroMemory(PortObject, sizeof(FLT_SERVER_PORT_OBJECT));
116
117 /* Increment the ref count on the target filter */
119
120 /* Setup the filter port object */
121 PortObject->Filter = Filter;
125 PortObject->Cookie = ServerPortCookie;
126 PortObject->MaxConnections = MaxConnections;
127
128 /* Insert the object */
129 Status = ObInsertObject(PortObject,
130 NULL,
132 0,
133 NULL,
135 if (NT_SUCCESS(Status))
136 {
137 /* Lock the connection list */
139
140 /* Add the new port object to the connection list and increment the count */
143
144 /* Unlock the connection list*/
146 }
147 }
148
149 if (!NT_SUCCESS(Status))
150 {
151 /* Allow the filter to be cleaned up */
153 }
154
155 return Status;
156}
static const INTERNET_PORT ServerPort
Definition: CWebService.cpp:11
POBJECT_TYPE ServerPortObjectType
Definition: Messaging.c:24
VOID FLTAPI FltObjectDereference(_Inout_ PVOID Object)
Definition: Object.c:53
NTSTATUS FLTAPI FltObjectReference(_Inout_ PVOID Object)
Definition: Object.c:41
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define InsertTailList(ListHead, Entry)
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1801
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY _In_opt_ PFLT_MESSAGE_NOTIFY MessageNotifyCallback
Definition: fltkernel.h:1877
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY ConnectNotifyCallback
Definition: fltkernel.h:1875
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID ServerPortCookie
Definition: fltkernel.h:1874
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY DisconnectNotifyCallback
Definition: fltkernel.h:1876
ULONG FltpObjectPointerReference(_In_ PFLT_OBJECT Object)
Definition: Object.c:322
VOID FASTCALL ExAcquireFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:23
VOID FASTCALL ExReleaseFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:31
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
static LONG MaxConnections
#define FILE_READ_DATA
Definition: nt_native.h:628
#define STANDARD_RIGHTS_ALL
Definition: nt_native.h:69
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
NTSTATUS NTAPI ObInsertObject(IN PVOID Object, IN PACCESS_STATE AccessState OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG ObjectPointerBias, OUT PVOID *NewObject OPTIONAL, OUT PHANDLE Handle)
Definition: obhandle.c:2935
NTSTATUS NTAPI ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL, IN POBJECT_TYPE Type, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN KPROCESSOR_MODE AccessMode, IN OUT PVOID ParseContext OPTIONAL, IN ULONG ObjectSize, IN ULONG PagedPoolCharge OPTIONAL, IN ULONG NonPagedPoolCharge OPTIONAL, OUT PVOID *Object)
Definition: oblife.c:1039
FLT_MUTEX_LIST_HEAD ConnectionList
Definition: fltmgrint.h:121
LIST_ENTRY mList
Definition: fltmgrint.h:56
FAST_MUTEX mLock
Definition: fltmgrint.h:55
PFLT_DISCONNECT_NOTIFY DisconnectNotify
Definition: fltmgrint.h:192
PFLT_MESSAGE_NOTIFY MessageNotify
Definition: fltmgrint.h:193
PFLT_CONNECT_NOTIFY ConnectNotify
Definition: fltmgrint.h:191
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135

◆ _Out_range_()

_Out_range_ ( )
pure virtual

◆ _Out_writes_bytes_() [1/2]

_In_ ULONG _Out_writes_bytes_ ( CompressedBufferSize  )

◆ _Out_writes_bytes_() [2/2]

_Out_writes_bytes_ ( DestinationSidLength  )

◆ _Out_writes_bytes_to_() [1/4]

_Out_writes_bytes_to_ ( MaxBytesInCustomCPString  ,
BytesInCustomCPString 
)

◆ _Out_writes_bytes_to_() [2/4]

_Out_writes_bytes_to_ ( MaxBytesInUnicodeString  ,
BytesInUnicodeString 
)

◆ _Out_writes_bytes_to_() [3/4]

_Out_writes_bytes_to_ ( UncompressedBufferSize  ,
FinalUncompressedSize 
)

◆ _Out_writes_bytes_to_() [4/4]

_Out_writes_bytes_to_ ( UncompressedFragmentSize  ,
FinalUncompressedSize 
)

◆ _Post_satisfies_()

_Post_satisfies_ ( return >=8 &&return<=  SECURITY_MAX_SID_SIZE)

◆ _Ret_range_()

_Ret_range_ ( )

◆ _Success_() [1/2]

◆ _Success_() [2/2]

_Success_ ( return = -1)

Definition at line 1028 of file fsctrl.c.

3189{
3191
3192 PVPB Vpb = Vcb->Vpb;
3193 PVPB OldVpb;
3194
3195 BOOLEAN Remount = FALSE;
3196
3197 PAGED_CODE();
3198
3199 UNREFERENCED_PARAMETER( IrpContext );
3200
3201 //
3202 // Check whether we are looking for a device only Mvcb.
3203 //
3204
3205 for (Link = CdData.VcbQueue.Flink;
3206 Link != &CdData.VcbQueue;
3207 Link = Link->Flink) {
3208
3209 *OldVcb = CONTAINING_RECORD( Link, VCB, VcbLinks );
3210
3211 //
3212 // Skip ourselves.
3213 //
3214
3215 if (Vcb == *OldVcb) { continue; }
3216
3217 //
3218 // Look at the Vpb and state of the previous Vcb.
3219 //
3220
3221 OldVpb = (*OldVcb)->Vpb;
3222
3223 if ((OldVpb != Vpb) &&
3224 (OldVpb->RealDevice == Vpb->RealDevice) &&
3225 ((*OldVcb)->VcbCondition == VcbNotMounted)) {
3226
3227 //
3228 // If the current disk is a raw disk then it can match a previous music or
3229 // raw disk.
3230 //
3231
3232 if (FlagOn( Vcb->VcbState, VCB_STATE_AUDIO_DISK)) {
3233
3234 if (FlagOn( (*OldVcb)->VcbState, VCB_STATE_AUDIO_DISK )) {
3235
3236 //
3237 // If we have both TOC then fail the remount if the lengths
3238 // are different or they don't match.
3239 //
3240
3241 if ((Vcb->TocLength != (*OldVcb)->TocLength) ||
3242 ((Vcb->TocLength != 0) &&
3243 !RtlEqualMemory( Vcb->CdromToc,
3244 (*OldVcb)->CdromToc,
3245 Vcb->TocLength ))) {
3246
3247 continue;
3248 }
3249
3250 Remount = TRUE;
3251 break;
3252 }
3253
3254 //
3255 // The current disk is not a raw disk. Go ahead and compare
3256 // serial numbers, volume label and TOC.
3257 //
3258
3259 }
3260 else if ((OldVpb->SerialNumber == Vpb->SerialNumber) &&
3261 (Vcb->TocLength == (*OldVcb)->TocLength) &&
3262 ((Vcb->TocLength == 0) || RtlEqualMemory( Vcb->CdromToc,
3263 (*OldVcb)->CdromToc,
3264 Vcb->TocLength )) &&
3265 (Vpb->VolumeLabelLength == OldVpb->VolumeLabelLength) &&
3266 (RtlEqualMemory( OldVpb->VolumeLabel,
3267 Vpb->VolumeLabel,
3268 Vpb->VolumeLabelLength ))) {
3269 //
3270 // Remember the old Vcb. Then set the return value to
3271 // TRUE and break.
3272 //
3273
3274 Remount = TRUE;
3275 break;
3276 }
3277 }
3278 }
3279
3280 return Remount;
3281}
#define PAGED_CODE()
CD_DATA CdData
Definition: cddata.c:42
#define VCB_STATE_AUDIO_DISK
Definition: cdstruc.h:712
@ VcbNotMounted
Definition: cdstruc.h:490
IN OUT PVCB IN PDEVICE_OBJECT IN PVPB Vpb
Definition: fatprocs.h:1676
#define RtlEqualMemory(dst, src, len)
Definition: kdvm.h:18
#define Vcb
Definition: cdprocs.h:1415
LIST_ENTRY VcbQueue
Definition: cdstruc.h:334
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
Definition: cdstruc.h:498
Definition: iotypes.h:189
WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH/sizeof(WCHAR)]
Definition: iotypes.h:198
USHORT VolumeLabelLength
Definition: iotypes.h:193
ULONG SerialNumber
Definition: iotypes.h:196
struct _DEVICE_OBJECT * RealDevice
Definition: iotypes.h:195
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
static int Link(const char **args)
Definition: vfdcmd.c:2414

◆ _Unchanged_()

◆ _When_() [1/2]

◆ _When_() [2/2]

_When_ ( )
pure virtual

◆ AppendTailList()

FORCEINLINE VOID AppendTailList ( _Inout_ PLIST_ENTRY  ListHead,
_Inout_ PLIST_ENTRY  ListToAppend 
)

Definition at line 225 of file rtlfuncs.h.

228{
229 PLIST_ENTRY ListEnd = ListHead->Blink;
230
231#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS)
232 RtlpCheckListEntry(ListHead);
233 RtlpCheckListEntry(ListToAppend);
234#endif
235 ListHead->Blink->Flink = ListToAppend;
236 ListHead->Blink = ListToAppend->Blink;
237 ListToAppend->Blink->Flink = ListHead;
238 ListToAppend->Blink = ListEnd;
239}
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY ListEnd
Definition: exfuncs.h:1224
FORCEINLINE VOID RtlpCheckListEntry(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:98

◆ FatalListEntryError()

FORCEINLINE VOID FatalListEntryError ( _In_ PVOID  P1,
_In_ PVOID  P2,
_In_ PVOID  P3 
)

◆ InitializeSListHead()

FORCEINLINE VOID InitializeSListHead ( _Out_ PSLIST_HEADER  SListHead)

Definition at line 3368 of file rtlfuncs.h.

3370{
3371#if defined(_WIN64)
3372 if (((ULONG_PTR)SListHead & 0xf) != 0) {
3374 }
3375#if defined(_IA64_)
3376 SListHead->Region = (ULONG_PTR)SListHead & VRN_MASK;
3377#else
3378 SListHead->Region = 0;
3379#endif /* _IA64_ */
3380#endif /* _WIN64 */
3381 SListHead->Alignment = 0;
3382}
#define ULONG_PTR
Definition: config.h:101
#define ExRaiseStatus
Definition: ntoskrnl.h:114
#define STATUS_DATATYPE_MISALIGNMENT
Definition: ntstatus.h:183

Referenced by ExInitializeSystemLookasideList(), ExInitPoolLookasidePointers(), InitializeTransferPackets(), MiInitializeNonPagedPool(), MmArmInitSystem(), START_TEST(), and test_slist().

◆ InsertHeadList()

FORCEINLINE VOID InsertHeadList ( _Inout_ PLIST_ENTRY  ListHead,
_Inout_ __drv_aliasesMem PLIST_ENTRY  Entry 
)

Definition at line 204 of file rtlfuncs.h.

207{
208 PLIST_ENTRY OldFlink;
209#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS) && DBG
210 RtlpCheckListEntry(ListHead);
211#endif
212 OldFlink = ListHead->Flink;
213 Entry->Flink = OldFlink;
214 Entry->Blink = ListHead;
215#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS)
216 if (OldFlink->Blink != ListHead)
217 FatalListEntryError(ListHead, OldFlink, OldFlink->Flink);
218#endif
219 OldFlink->Blink = Entry;
220 ListHead->Flink = Entry;
221}
struct _LIST_ENTRY * Blink
Definition: typedefs.h:122
FORCEINLINE VOID FatalListEntryError(_In_ PVOID P1, _In_ PVOID P2, _In_ PVOID P3)
Definition: rtlfuncs.h:84

◆ InsertTailList()

FORCEINLINE VOID InsertTailList ( _Inout_ PLIST_ENTRY  ListHead,
_Inout_ __drv_aliasesMem PLIST_ENTRY  Entry 
)

Definition at line 183 of file rtlfuncs.h.

186{
187 PLIST_ENTRY OldBlink;
188#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS) && DBG
189 RtlpCheckListEntry(ListHead);
190#endif
191 OldBlink = ListHead->Blink;
192 Entry->Flink = ListHead;
193 Entry->Blink = OldBlink;
194#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS)
195 if (OldBlink->Flink != ListHead)
196 FatalListEntryError(OldBlink->Blink, OldBlink, ListHead);
197#endif
198 OldBlink->Flink = Entry;
199 ListHead->Blink = Entry;
200}

◆ IsListEmpty()

Definition at line 60 of file rtlfuncs.h.

62{
63 return (BOOLEAN)(ListHead->Flink == ListHead);
64}

◆ PopEntryList()

Definition at line 243 of file rtlfuncs.h.

245{
246 PSINGLE_LIST_ENTRY FirstEntry;
247 FirstEntry = ListHead->Next;
248 if (FirstEntry != NULL) {
249 ListHead->Next = FirstEntry->Next;
250 }
251 return FirstEntry;
252}
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
Definition: ntbasedef.h:636
struct _SINGLE_LIST_ENTRY * Next
Definition: ntbasedef.h:637

Referenced by FxIoTarget::_CancelSentRequests(), CdCreateIrpContext(), CdUnload(), ClearTTFontCache(), DcFreeAdapter(), DcSendPacket(), ExInterlockedPopEntryList(), ExitThreadCallback(), NvNetSendPacket(), FxPkgIo::ResetStateForRestart(), FxPkgIo::ResumeProcessingForPower(), FxPkgIo::StopProcessingForPower(), and UserDerefObjectCo().

◆ PushEntryList()

◆ RemoveEntryList()

FORCEINLINE BOOLEAN RemoveEntryList ( _In_ PLIST_ENTRY  Entry)

Definition at line 108 of file rtlfuncs.h.

110{
111 PLIST_ENTRY OldFlink;
112 PLIST_ENTRY OldBlink;
113
114 OldFlink = Entry->Flink;
115 OldBlink = Entry->Blink;
116#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS)
117#ifdef EXTRA_KERNEL_LIST_ENTRY_CHECKS
118 if (OldFlink == Entry || OldBlink == Entry)
119 FatalListEntryError(OldBlink, Entry, OldFlink);
120#endif
121 if (OldFlink->Blink != Entry || OldBlink->Flink != Entry)
122 FatalListEntryError(OldBlink, Entry, OldFlink);
123#endif
124 OldFlink->Blink = OldBlink;
125 OldBlink->Flink = OldFlink;
126 return (BOOLEAN)(OldFlink == OldBlink);
127}

◆ RemoveEntryListUnsafe()

FORCEINLINE BOOLEAN RemoveEntryListUnsafe ( _In_ PLIST_ENTRY  Entry)

Definition at line 68 of file rtlfuncs.h.

70{
71 PLIST_ENTRY OldFlink;
72 PLIST_ENTRY OldBlink;
73
74 OldFlink = Entry->Flink;
75 OldBlink = Entry->Blink;
76 OldFlink->Blink = OldBlink;
77 OldBlink->Flink = OldFlink;
78 return (BOOLEAN)(OldFlink == OldBlink);
79}

◆ RemoveHeadList()

FORCEINLINE PLIST_ENTRY RemoveHeadList ( _Inout_ PLIST_ENTRY  ListHead)

Definition at line 131 of file rtlfuncs.h.

133{
134 PLIST_ENTRY Flink;
136
137#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS) && DBG
138 RtlpCheckListEntry(ListHead);
139#ifdef EXTRA_KERNEL_LIST_ENTRY_CHECKS
140 if (ListHead->Flink == ListHead || ListHead->Blink == ListHead)
141 FatalListEntryError(ListHead->Blink, ListHead, ListHead->Flink);
142#endif
143#endif
144 Entry = ListHead->Flink;
145 Flink = Entry->Flink;
146#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS)
147 if (Entry->Blink != ListHead || Flink->Blink != Entry)
148 FatalListEntryError(ListHead, Entry, Flink);
149#endif
150 ListHead->Flink = Flink;
151 Flink->Blink = ListHead;
152 return Entry;
153}

◆ RemoveTailList()

FORCEINLINE PLIST_ENTRY RemoveTailList ( _Inout_ PLIST_ENTRY  ListHead)

Definition at line 157 of file rtlfuncs.h.

159{
160 PLIST_ENTRY Blink;
162
163#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS) && DBG
164 RtlpCheckListEntry(ListHead);
165#ifdef EXTRA_KERNEL_LIST_ENTRY_CHECKS
166 if (ListHead->Flink == ListHead || ListHead->Blink == ListHead)
167 FatalListEntryError(ListHead->Blink, ListHead, ListHead->Flink);
168#endif
169#endif
170 Entry = ListHead->Blink;
171 Blink = Entry->Blink;
172#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS)
173 if (Blink->Flink != Entry || Entry->Flink != ListHead)
174 FatalListEntryError(Blink, Entry, ListHead);
175#endif
176 ListHead->Blink = Blink;
177 Blink->Flink = ListHead;
178 return Entry;
179}

◆ RtlActiveEnumeratorsHashTable()

FORCEINLINE ULONG NTAPI RtlActiveEnumeratorsHashTable ( _In_ PRTL_DYNAMIC_HASH_TABLE  HashTable)

Definition at line 3659 of file rtlfuncs.h.

3661{
3662 return HashTable->NumEnumerators;
3663}
Definition: hash.c:67

◆ RtlAllocateAndInitializeSid()

_Must_inspect_result_ NTSYSAPI NTSTATUS NTAPI RtlAllocateAndInitializeSid ( _In_ PSID_IDENTIFIER_AUTHORITY  IdentifierAuthority,
_In_ UCHAR  SubAuthorityCount,
_In_ ULONG  SubAuthority0,
_In_ ULONG  SubAuthority1,
_In_ ULONG  SubAuthority2,
_In_ ULONG  SubAuthority3,
_In_ ULONG  SubAuthority4,
_In_ ULONG  SubAuthority5,
_In_ ULONG  SubAuthority6,
_In_ ULONG  SubAuthority7,
_Outptr_ PSID Sid 
)

◆ RtlAreBitsSet()

_Must_inspect_result_ NTSYSAPI BOOLEAN NTAPI RtlAreBitsSet ( _In_ PRTL_BITMAP  BitMapHeader,
_In_ ULONG  StartingIndex,
_In_ ULONG  Length 
)

Definition at line 459 of file bitmap.c.

463{
464 /* Verify parameters */
465 if ((StartingIndex + Length > BitMapHeader->SizeOfBitMap) ||
467 return FALSE;
468
469 return RtlpGetLengthOfRunSet(BitMapHeader, StartingIndex, Length) >= Length;
470}
static __inline BITMAP_INDEX RtlpGetLengthOfRunSet(_In_ PRTL_BITMAP BitMapHeader, _In_ BITMAP_INDEX StartingIndex, _In_ BITMAP_INDEX MaxLength)
Definition: bitmap.c:153
_In_ ULONG StartingIndex
Definition: rtlfuncs.h:398

◆ RtlAssert()

__analysis_noreturn NTSYSAPI VOID NTAPI RtlAssert ( _In_ PVOID  FailedAssertion,
_In_ PVOID  FileName,
_In_ ULONG  LineNumber,
_In_opt_z_ PSTR  Message 
)

◆ RtlCaptureContext()

NTSYSAPI VOID NTAPI RtlCaptureContext ( _Out_ PCONTEXT  ContextRecord)

◆ RtlCaptureStackBackTrace()

NTSYSAPI USHORT NTAPI RtlCaptureStackBackTrace ( _In_ ULONG  FramesToSkip,
_In_ ULONG  FramesToCapture,
_Out_writes_to_(FramesToCapture, return) PVOID BackTrace,
_Out_opt_ PULONG  BackTraceHash 
)

◆ RtlClearAllBits()

NTSYSAPI VOID NTAPI RtlClearAllBits ( _In_ PRTL_BITMAP  BitMapHeader)

Definition at line 272 of file bitmap.c.

274{
275 BITMAP_INDEX LengthInUlongs;
276
277 LengthInUlongs = (BitMapHeader->SizeOfBitMap + _BITCOUNT - 1) / _BITCOUNT;
278 RtlFillMemoryUlong(BitMapHeader->Buffer, LengthInUlongs * sizeof(BITMAP_INDEX), 0);
279}
#define RtlFillMemoryUlong(dst, len, val)
Definition: mkhive.h:55
#define _BITCOUNT
Definition: bitmap.c:62
ULONG BITMAP_INDEX
Definition: bitmap.c:64

◆ RtlClearBits()

NTSYSAPI VOID NTAPI RtlClearBits ( _In_ PRTL_BITMAP  BitMapHeader,
_In_range_(0, BitMapHeader->SizeOfBitMap - NumberToClear) ULONG  StartingIndex,
_In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG  NumberToClear 
)

Definition at line 314 of file bitmap.c.

318{
319 BITMAP_INDEX Bits, Mask;
321
322 ASSERT(StartingIndex + NumberToClear <= BitMapHeader->SizeOfBitMap);
323
324 /* Calculate buffer start and first bit index */
325 Buffer = &BitMapHeader->Buffer[StartingIndex / _BITCOUNT];
326 Bits = StartingIndex & (_BITCOUNT - 1);
327
328 /* Are we unaligned? */
329 if (Bits)
330 {
331 /* Create an inverse mask by shifting MAXINDEX */
332 Mask = MAXINDEX << Bits;
333
334 /* This is what's left in the first ULONG */
335 Bits = _BITCOUNT - Bits;
336
337 /* Even less bits to clear? */
338 if (NumberToClear < Bits)
339 {
340 /* Calculate how many bits are left */
341 Bits -= NumberToClear;
342
343 /* Fixup the mask on the high side */
344 Mask = Mask << Bits >> Bits;
345
346 /* Clear bits and return */
347 *Buffer &= ~Mask;
348 return;
349 }
350
351 /* Clear bits */
352 *Buffer &= ~Mask;
353
354 /* Update buffer and left bits */
355 Buffer++;
356 NumberToClear -= Bits;
357 }
358
359 /* Clear all full ULONGs */
360 RtlFillMemoryUlong(Buffer, NumberToClear >> 3, 0);
361 Buffer += NumberToClear / _BITCOUNT;
362
363 /* Clear what's left */
364 NumberToClear &= (_BITCOUNT - 1);
365 if (NumberToClear != 0)
366 {
367 Mask = MAXINDEX << NumberToClear;
368 *Buffer &= Mask;
369 }
370}
Definition: bufpool.h:45
unsigned int Mask
Definition: fpcontrol.c:82
ULONG * PBITMAP_BUFFER
Definition: bitmap.c:65
#define ASSERT(...)
Definition: bitmap.c:19
#define MAXINDEX
Definition: bitmap.c:63

◆ RtlCmDecodeMemIoResource()

NTSYSAPI ULONGLONG NTAPI RtlCmDecodeMemIoResource ( _In_ struct _CM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor,
_Out_opt_ PULONGLONG  Start 
)

◆ RtlCmEncodeMemIoResource()

NTSYSAPI NTSTATUS NTAPI RtlCmEncodeMemIoResource ( _In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR  Descriptor,
_In_ UCHAR  Type,
_In_ ULONGLONG  Length,
_In_ ULONGLONG  Start 
)

◆ RtlCompareAltitudes()

NTSYSAPI LONG NTAPI RtlCompareAltitudes ( _In_ PCUNICODE_STRING  Altitude1,
_In_ PCUNICODE_STRING  Altitude2 
)

◆ RtlCompareMemory()

_Must_inspect_result_ NTSYSAPI SIZE_T NTAPI RtlCompareMemory ( _In_ const VOID Source1,
_In_ const VOID Source2,
_In_ SIZE_T  Length 
)

◆ RtlCompareMemoryUlong()

◆ RtlCompressBuffer()

NTSYSAPI NTSTATUS NTAPI RtlCompressBuffer ( _In_ USHORT  CompressionFormatAndEngine,
_In_reads_bytes_(UncompressedBufferSize) PUCHAR  UncompressedBuffer,
_In_ ULONG  UncompressedBufferSize,
_Out_writes_bytes_to_(CompressedBufferSize, *FinalCompressedSize) PUCHAR  CompressedBuffer,
_In_ ULONG  CompressedBufferSize,
_In_ ULONG  UncompressedChunkSize,
_Out_ PULONG  FinalCompressedSize,
_In_ PVOID  WorkSpace 
)

◆ RtlContractHashTable()

NTSYSAPI BOOLEAN NTAPI RtlContractHashTable ( _In_ PRTL_DYNAMIC_HASH_TABLE  HashTable)

◆ RtlConvertUlongToLargeInteger()

static __inline LARGE_INTEGER NTAPI_INLINE RtlConvertUlongToLargeInteger ( _In_ ULONG  UnsignedInteger)
static

Definition at line 2866 of file rtlfuncs.h.

2868{
2870 ret.QuadPart = UnsignedInteger;
2871 return ret;
2872}

◆ RtlConvertUlongToLuid()

FORCEINLINE LUID NTAPI_INLINE RtlConvertUlongToLuid ( _In_ ULONG  Val)

Definition at line 3558 of file rtlfuncs.h.

3560{
3561 LUID Luid;
3562
3563 Luid.LowPart = Val;
3564 Luid.HighPart = 0;
3565 return Luid;
3566}

Referenced by IsPrivilegeEnabled(), KsInstallBusEnumInterface(), KsRemoveBusEnumInterface(), SmpAcquirePrivilege(), and START_TEST().

◆ RtlCopyString()

NTSYSAPI VOID NTAPI RtlCopyString ( _Out_ PSTRING  DestinationString,
_In_opt_ const STRING SourceString 
)

◆ RtlCreateServiceSid()

NTSYSAPI NTSTATUS NTAPI RtlCreateServiceSid ( _In_ PUNICODE_STRING  ServiceName,
_Out_writes_bytes_opt_ *ServiceSidLength PSID  ServiceSid,
_Inout_ PULONG  ServiceSidLength 
)

Definition at line 412 of file sid.c.

416{
419}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15

◆ RtlCreateVirtualAccountSid()

NTSYSAPI NTSTATUS NTAPI RtlCreateVirtualAccountSid ( _In_ PCUNICODE_STRING  Name,
_In_ ULONG  BaseSubAuthority,
_Out_writes_bytes_ *SidLength PSID  Sid,
_Inout_ PULONG  SidLength 
)

◆ RtlDelete()

◆ RtlDeleteElementGenericTable()

◆ RtlDeleteElementGenericTableAvl()

NTSYSAPI BOOLEAN NTAPI RtlDeleteElementGenericTableAvl ( _In_ PRTL_AVL_TABLE  Table,
_In_ PVOID  Buffer 
)

◆ RtlDeleteHashTable()

◆ RtlDeleteNoSplay()

NTSYSAPI VOID NTAPI RtlDeleteNoSplay ( _In_ PRTL_SPLAY_LINKS  Links,
_Inout_ PRTL_SPLAY_LINKS Root 
)

◆ RtlDestroyHeap()

NTSYSAPI PVOID NTAPI RtlDestroyHeap ( _In_ _Post_invalid_ PVOID  HeapHandle)

◆ RtlDowncaseUnicodeString()

◆ RtlEmptyBucketsHashTable()