Maintain sequence counter
This commit is contained in:
@@ -75,10 +75,11 @@ RTL::SinglyList::InsertHeadList(IN OUT PSINGLE_LIST_HEADER ListHead,
|
|||||||
/* Store the original first entry */
|
/* Store the original first entry */
|
||||||
OriginalEntry = ListHead->Next.Next;
|
OriginalEntry = ListHead->Next.Next;
|
||||||
|
|
||||||
/* Insert entry at the head of the list and increment depth */
|
/* Insert entry at the head of the list and increment depth and sequence */
|
||||||
Entry->Next = ListHead->Next.Next;
|
Entry->Next = ListHead->Next.Next;
|
||||||
ListHead->Next.Next = Entry;
|
ListHead->Next.Next = Entry;
|
||||||
ListHead->Depth++;
|
ListHead->Depth++;
|
||||||
|
ListHead->Sequence++;
|
||||||
|
|
||||||
/* Return original first entry */
|
/* Return original first entry */
|
||||||
return OriginalEntry;
|
return OriginalEntry;
|
||||||
@@ -133,8 +134,9 @@ RTL::SinglyList::InsertTailList(IN OUT PSINGLE_LIST_HEADER ListHead,
|
|||||||
CurrentEntry->Next = Entry;
|
CurrentEntry->Next = Entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Increment list depth */
|
/* Increment list depth and sequence */
|
||||||
ListHead->Depth++;
|
ListHead->Depth++;
|
||||||
|
ListHead->Sequence++;
|
||||||
|
|
||||||
/* Return original last entry */
|
/* Return original last entry */
|
||||||
return OriginalEntry;
|
return OriginalEntry;
|
||||||
@@ -283,8 +285,9 @@ RTL::SinglyList::SpliceHeadList(IN OUT PSINGLE_LIST_HEADER ListHead,
|
|||||||
LastEntry->Next = ListHead->Next.Next;
|
LastEntry->Next = ListHead->Next.Next;
|
||||||
ListHead->Next.Next = SpliceList->Next.Next;
|
ListHead->Next.Next = SpliceList->Next.Next;
|
||||||
|
|
||||||
/* Update depth of the destination list */
|
/* Update depth and sequence of the destination list */
|
||||||
ListHead->Depth += SpliceList->Depth;
|
ListHead->Depth += SpliceList->Depth;
|
||||||
|
ListHead->Sequence++;
|
||||||
|
|
||||||
/* Reinitialize the source list to empty */
|
/* Reinitialize the source list to empty */
|
||||||
SpliceList->Next.Next = NULLPTR;
|
SpliceList->Next.Next = NULLPTR;
|
||||||
@@ -340,8 +343,9 @@ RTL::SinglyList::SpliceTailList(IN OUT PSINGLE_LIST_HEADER ListHead,
|
|||||||
LastEntry->Next = SpliceList->Next.Next;
|
LastEntry->Next = SpliceList->Next.Next;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update depth of the destination list */
|
/* Update depth and sequence of the destination list */
|
||||||
ListHead->Depth += SpliceList->Depth;
|
ListHead->Depth += SpliceList->Depth;
|
||||||
|
ListHead->Sequence++;
|
||||||
|
|
||||||
/* Reinitialize the source list to empty */
|
/* Reinitialize the source list to empty */
|
||||||
SpliceList->Next.Next = NULLPTR;
|
SpliceList->Next.Next = NULLPTR;
|
||||||
|
|||||||
Reference in New Issue
Block a user