#ifndef _NTRTL_H
/**
* The AppendTailListNoFence routine appends a doubly linked list to the tail of another doubly linked list using a no-fence (non-serializing) write.
*
* \param ListHead A pointer to the LIST_ENTRY that serves as the header of the destination list.
* \param ListToAppend A pointer to the LIST_ENTRY that serves as the header of the list to append.
*/
FORCEINLINE
VOID
AppendTailListNoFence(
_Inout_ PLIST_ENTRY ListHead,
_Inout_ PLIST_ENTRY ListToAppend
)
{
PLIST_ENTRY ListEnd = (PLIST_ENTRY)ReadPointerNoFence((volatile const PVOID*)&ListHead->Blink);
RtlCheckListEntry(ListHead);
RtlCheckListEntry(ListToAppend);
WritePointerNoFence((volatile PVOID*)&ListHead->Blink->Flink, ListToAppend);
WritePointerNoFence((volatile PVOID*)&ListHead->Blink, ListToAppend->Blink);
WritePointerNoFence((volatile PVOID*)&ListToAppend->Blink->Flink, ListHead);
WritePointerNoFence((volatile PVOID*)&ListToAppend->Blink, ListEnd);
return;
}
View code on GitHubNo description available.