⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sync.c

📁 WinCE 3.0 BSP, 包含Inter SA1110, Intel_815E, Advantech_PCM9574 等
💻 C
字号:
/*

  Copyright(c) 1998,1999 SIC/Hitachi,Ltd.

	Module Name:

		sync.c

	Revision History:

		26th May   1999		Released

*/

#include <ndis.h>
#include <ntddndis.h>
#include <linklist.h>
#include "sync.h"

void CheckForEntryOnList(PLIST_ENTRY Head, PLIST_ENTRY Entry)
{
    PLIST_ENTRY ListEntry;

    for (ListEntry = Head->Flink;
         ListEntry != Head->Flink;
         ListEntry = ListEntry->Flink
        )
    {
        if (Entry==ListEntry)
        {
            DbgPrint("About to insert entry that is already on list!\n");
            DbgPrint("Head:%08X Entry:%08X\n", Head, Entry);
            DbgBreakPoint();
            break;
        }
    }
}
                     
BOOLEAN SynchronizedListFunc(IN PVOID Context)
{
    SynchronizeList *ListData = Context;

    switch (ListData->Command)
    {
        case SyncInsertHead:
//            CheckForEntryOnList(ListData->Head, ListData->Entry);
            InsertHeadList(ListData->Head, ListData->Entry);
            break;
        case SyncInsertTail:
//            CheckForEntryOnList(ListData->Head, ListData->Entry);
            InsertTailList(ListData->Head, ListData->Entry);
            break;
        case SyncRemoveHead:
            if (IsListEmpty(ListData->Head))
            {
                ListData->Entry = NULL;
            }
            else
            {
                ListData->Entry = RemoveHeadList(ListData->Head);
            }
            break;
        case SyncRemoveTail:
            if (IsListEmpty(ListData->Head))
            {
                ListData->Entry = NULL;
            }
            else
            {
                ListData->Entry = RemoveTailList(ListData->Head);
            }
            break;
        case SyncRemove:
            RemoveEntryList(ListData->Entry);
            break;
        default:
            ASSERT(0);
            break;
    }

    return TRUE;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -