29 VOID InitializeListHead(PLIST_ENTRY ListHead) {
30 ListHead->Flink = ListHead->Blink = ListHead;
35 IsListEmpty(
const LIST_ENTRY *ListHead) {
36 return (BOOLEAN)(ListHead == NULL || ListHead->Flink == ListHead);
41 RemoveEntryList(PLIST_ENTRY Entry) {
50 return (BOOLEAN)(Flink == Blink);
58 RemoveHeadList(PLIST_ENTRY ListHead) {
62 Entry = ListHead->Flink;
64 ListHead->Flink = Flink;
65 Flink->Blink = ListHead;
71 RemoveTailList(PLIST_ENTRY ListHead) {
75 Entry = ListHead->Blink;
77 ListHead->Blink = Blink;
78 Blink->Flink = ListHead;
83 VOID InsertTailList(PLIST_ENTRY ListHead, PLIST_ENTRY Entry) {
86 Blink = ListHead->Blink;
87 Entry->Flink = ListHead;
90 ListHead->Blink = Entry;
94 VOID InsertHeadList(PLIST_ENTRY ListHead, PLIST_ENTRY Entry) {
97 Flink = ListHead->Flink;
99 Entry->Blink = ListHead;
100 Flink->Blink = Entry;
101 ListHead->Flink = Entry;
105 VOID AppendTailList(PLIST_ENTRY ListHead, PLIST_ENTRY ListToAppend) {
106 PLIST_ENTRY ListEnd = ListHead->Blink;
108 ListHead->Blink->Flink = ListToAppend;
109 ListHead->Blink = ListToAppend->Blink;
110 ListToAppend->Blink->Flink = ListHead;
111 ListToAppend->Blink = ListEnd;
116 PopEntryList(PSINGLE_LIST_ENTRY ListHead) {
117 PSINGLE_LIST_ENTRY FirstEntry;
118 FirstEntry = ListHead->Next;
119 if (FirstEntry != NULL) {
120 ListHead->Next = FirstEntry->Next;
127 VOID PushEntryList(PSINGLE_LIST_ENTRY ListHead, PSINGLE_LIST_ENTRY Entry) {
128 Entry->Next = ListHead->Next;
129 ListHead->Next = Entry;