#include        "defs.h"

PLIST
RemoveHeadList(
    IN PLIST ListHead
    )
{
    PLIST Flink;
    PLIST Entry;

    Entry = ListHead->Flink;
    Flink = Entry->Flink;
    ListHead->Flink = Flink;
    Flink->Blink = ListHead;
    if (Entry == ListHead) return NULL;
    return Entry;
}

VOID
InsertTailList(
    IN PLIST ListHead,
    IN PLIST Entry
    )
{
    PLIST Blink;

    Blink = ListHead->Blink;
    Entry->Flink = ListHead;
    Entry->Blink = Blink;
    Blink->Flink = Entry;
    ListHead->Blink = Entry;
}

VOID    RemoveList(__in PVOID list)
{       
        PLIST Entry = list;
        Entry->Blink->Flink = Entry->Flink;
        Entry->Flink->Blink = Entry->Blink;
}

