亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? protocol.c

?? NDIS Intermediate Driver
?? C
?? 第 1 頁 / 共 4 頁
字號:


NDIS_STATUS
PtReceive(
    IN  NDIS_HANDLE         ProtocolBindingContext,
    IN  NDIS_HANDLE         MacReceiveContext,
    IN  PVOID               HeaderBuffer,
    IN  UINT                HeaderBufferSize,
    IN  PVOID               LookAheadBuffer,
    IN  UINT                LookAheadBufferSize,
    IN  UINT                PacketSize
    )
/*++

Routine Description:

    Handle receive data indicated up by the miniport below. We pass
    it along to the protocol above us.

    If the miniport below indicates packets, NDIS would more
    likely call us at our ReceivePacket handler. However we
    might be called here in certain situations even though
    the miniport below has indicated a receive packet, e.g.
    if the miniport had set packet status to NDIS_STATUS_RESOURCES.
        
Arguments:

    <see DDK ref page for ProtocolReceive>

Return Value:

    NDIS_STATUS_SUCCESS if we processed the receive successfully,
    NDIS_STATUS_XXX error code if we discarded it.

--*/
{
    PADAPT            pAdapt = (PADAPT)ProtocolBindingContext;
    PNDIS_PACKET      MyPacket, Packet = NULL;
    NDIS_STATUS       Status = NDIS_STATUS_SUCCESS;

    if ((!pAdapt->MiniportHandle) || (pAdapt->MPDeviceState > NdisDeviceStateD0))
    {
        Status = NDIS_STATUS_FAILURE;
    }
    else do
    {
        //
        // Get at the packet, if any, indicated up by the miniport below.
        //
        Packet = NdisGetReceivedPacket(pAdapt->BindingHandle, MacReceiveContext);
        if (Packet != NULL)
        {
            //
            // The miniport below did indicate up a packet. Use information
            // from that packet to construct a new packet to indicate up.
            //

#ifdef NDIS51
            //
            // NDIS 5.1 NOTE: Do not reuse the original packet in indicating
            // up a receive, even if there is sufficient packet stack space.
            // If we had to do so, we would have had to overwrite the
            // status field in the original packet to NDIS_STATUS_RESOURCES,
            // and it is not allowed for protocols to overwrite this field
            // in received packets.
            //
#endif // NDIS51

            //
            // Get a packet off the pool and indicate that up
            //
            NdisDprAllocatePacket(&Status,
                                &MyPacket,
                                pAdapt->RecvPacketPoolHandle);

            if (Status == NDIS_STATUS_SUCCESS)
            {
                //
                // Make our packet point to data from the original
                // packet. NOTE: this works only because we are
                // indicating a receive directly from the context of
                // our receive indication. If we need to queue this
                // packet and indicate it from another thread context,
                // we will also have to allocate a new buffer and copy
                // over the packet contents, OOB data and per-packet
                // information. This is because the packet data
                // is available only for the duration of this
                // receive indication call.
                //
                NDIS_PACKET_FIRST_NDIS_BUFFER(MyPacket) = NDIS_PACKET_FIRST_NDIS_BUFFER(Packet);
                NDIS_PACKET_LAST_NDIS_BUFFER(MyPacket) = NDIS_PACKET_LAST_NDIS_BUFFER(Packet);

                //
                // Get the original packet (it could be the same packet as the
                // one received or a different one based on the number of layered
                // miniports below) and set it on the indicated packet so the OOB
                // data is visible correctly at protocols above.
                //
                NDIS_SET_ORIGINAL_PACKET(MyPacket, NDIS_GET_ORIGINAL_PACKET(Packet));
                NDIS_SET_PACKET_HEADER_SIZE(MyPacket, HeaderBufferSize);

                //
                // Copy packet flags.
                //
                NdisGetPacketFlags(MyPacket) = NdisGetPacketFlags(Packet);

                //
                // Force protocols above to make a copy if they want to hang
                // on to data in this packet. This is because we are in our
                // Receive handler (not ReceivePacket) and we can't return a
                // ref count from here.
                //
                NDIS_SET_PACKET_STATUS(MyPacket, NDIS_STATUS_RESOURCES);

                //
                // By setting NDIS_STATUS_RESOURCES, we also know that we can reclaim
                // this packet as soon as the call to NdisMIndicateReceivePacket
                // returns.
                //
                // NOTE: we queue the packet and indicate this packet immediately with
                // the already queued packets together. We have to the queue the packet 
                // first because some versions of NDIS might call protocols' 
                // ReceiveHandler(not ReceivePacketHandler) if the packet indicate status 
                // is NDIS_STATUS_RESOURCES. If the miniport below indicates an array of 
                // packets, some of them with status NDIS_STATUS_SUCCESS, some of them 
                // with status NDIS_STATUS_RESOURCES, PtReceive might be called, by 
                // doing this way, we preserve the receive order of packets.
                // 
                PtQueueReceivedPacket(pAdapt, MyPacket, TRUE);
                //
                // Reclaim the indicated packet. Since we had set its status
                // to NDIS_STATUS_RESOURCES, we are guaranteed that protocols
                // above are done with it.
                //
                NdisDprFreePacket(MyPacket);

                break;
            }
        }
        else
        {
            //
            // The miniport below us uses the old-style (not packet)
            // receive indication. Fall through.
            //
        }

        //
        // Fall through if the miniport below us has either not
        // indicated a packet or we could not allocate one
        //
        if (Packet != NULL)
        {
            //
            // We are here because we failed to allocate packet
            //
            PtFlushReceiveQueue(pAdapt);
        }
        //
        // Here the driver checks if the miniport adapter is in lower power state, do not indicate the 
        // packets, but the check does not close the window, it only minimizes the window. To close
        // the window completely, we need to add synchronization in the receive code path; because 
        // NDIS can handle the case that miniport drivers indicate packets in lower power state,
        // we don't add the synchronization in the hot code path.
        //    
        if ((pAdapt->MiniportHandle == NULL)
                || (pAdapt->MPDeviceState > NdisDeviceStateD0))
        {
            break;
        }
        
        pAdapt->IndicateRcvComplete = TRUE;
        switch (pAdapt->Medium)
        {
            case NdisMedium802_3:
            case NdisMediumWan:
                NdisMEthIndicateReceive(pAdapt->MiniportHandle,
                                             MacReceiveContext,
                                             HeaderBuffer,
                                             HeaderBufferSize,
                                             LookAheadBuffer,
                                             LookAheadBufferSize,
                                             PacketSize);
                break;

            case NdisMedium802_5:
                NdisMTrIndicateReceive(pAdapt->MiniportHandle,
                                            MacReceiveContext,
                                            HeaderBuffer,
                                            HeaderBufferSize,
                                            LookAheadBuffer,
                                            LookAheadBufferSize,
                                            PacketSize);
                break;

            case NdisMediumFddi:
                NdisMFddiIndicateReceive(pAdapt->MiniportHandle,
                                              MacReceiveContext,
                                              HeaderBuffer,
                                              HeaderBufferSize,
                                              LookAheadBuffer,
                                              LookAheadBufferSize,
                                              PacketSize);
                break;

            default:
                ASSERT(FALSE);
                break;
        }

    } while(FALSE);

    return Status;
}


VOID
PtReceiveComplete(
    IN NDIS_HANDLE        ProtocolBindingContext
    )
/*++

Routine Description:

    Called by the adapter below us when it is done indicating a batch of
    received packets.

Arguments:

    ProtocolBindingContext    Pointer to our adapter structure.

Return Value:

    None

--*/
{
    PADAPT        pAdapt =(PADAPT)ProtocolBindingContext;
    PNDIS_PACKET  PacketArray[MAX_RECEIVE_PACKET_ARRAY_SIZE];
    ULONG         NumberOfPackets = 0, i;

    PtFlushReceiveQueue(pAdapt);
        
    if ((pAdapt->MiniportHandle != NULL)
                && (pAdapt->MPDeviceState == NdisDeviceStateD0)
                && (pAdapt->IndicateRcvComplete == TRUE))
    {
        switch (pAdapt->Medium)
        {
            case NdisMedium802_3:
            case NdisMediumWan:
                NdisMEthIndicateReceiveComplete(pAdapt->MiniportHandle);
                break;

            case NdisMedium802_5:
                NdisMTrIndicateReceiveComplete(pAdapt->MiniportHandle);
                break;

            case NdisMediumFddi:
                NdisMFddiIndicateReceiveComplete(pAdapt->MiniportHandle);
                break;

            default:
                ASSERT(FALSE);
                break;
        }
    }

    pAdapt->IndicateRcvComplete = FALSE;
}


INT
PtReceivePacket(
    IN NDIS_HANDLE            ProtocolBindingContext,
    IN PNDIS_PACKET           Packet
    )
/*++

Routine Description:

    ReceivePacket handler. Called by NDIS if the miniport below supports
    NDIS 4.0 style receives. Re-package the buffer chain in a new packet
    and indicate the new packet to protocols above us. Any context for
    packets indicated up must be kept in the MiniportReserved field.

    NDIS 5.1 - packet stacking - if there is sufficient "stack space" in
    the packet passed to us, we can use the same packet in a receive
    indication.

Arguments:

    ProtocolBindingContext - Pointer to our adapter structure.
    Packet - Pointer to the packet

Return Value:

    == 0 -> We are done with the packet
    != 0 -> We will keep the packet and call NdisReturnPackets() this
            many times when done.
--*/
{
    PADAPT              pAdapt =(PADAPT)ProtocolBindingContext;
    NDIS_STATUS         Status;
    PNDIS_PACKET        MyPacket;
    BOOLEAN             Remaining;

    //
    // Drop the packet silently if the upper miniport edge isn't initialized or
    // the miniport edge is in low power state
    //
    if ((!pAdapt->MiniportHandle) || (pAdapt->MPDeviceState > NdisDeviceStateD0))
    {
          return 0;
    }

#ifdef NDIS51
    //
    // Check if we can reuse the same packet for indicating up.
    // See also: PtReceive(). 
    //
    (VOID)NdisIMGetCurrentPacketStack(Packet, &Remaining);
    if (Remaining)
    {
        //
        // We can reuse "Packet". Indicate it up and be done with it.
        //
        Status = NDIS_GET_PACKET_STATUS(Packet);
        if (Status == NDIS_STATUS_RESOURCES)
        {
            PtQueueReceivedPacket(pAdapt, Packet, TRUE);
        }
        else
        {   
             PtQueueReceivedPacket(pAdapt, Packet, FALSE);
        }
        return((Status != NDIS_STATUS_RESOURCES) ? 1 : 0);
    }
#endif // NDIS51

    //
    // Get a packet off the pool and indicate that up
    //
    NdisDprAllocatePacket(&Status,
                           &MyPacket,
                           pAdapt->RecvPacketPoolHandle);

    if (Status == NDIS_STATUS_SUCCESS)
    {
        PRECV_RSVD            RecvRsvd;

        RecvRsvd = (PRECV_RSVD)(MyPacket->MiniportReserved);
        RecvRsvd->OriginalPkt = Packet;

        NDIS_PACKET_FIRST_NDIS_BUFFER(MyPacket) = NDIS_PACKET_FIRST_NDIS_BUFFER(Packet);
        NDIS_PACKET_LAST_NDIS_BUFFER(MyPacket) = NDIS_PACKET_LAST_NDIS_BUFFER(Packet);

        //
        // Get the original packet (it could be the same packet as the one
        // received or a different one based on the number of layered miniports
        // below) and set it on the indicated packet so the OOB data is visible
        // correctly to protocols above us.
        //
        NDIS_SET_ORIGINAL_PACKET(MyPacket, NDIS_GET_ORIGINAL_PACKET(Packet));

        //
        // Set Packet Flags
        //
        NdisGetPacketFlags(MyPacket) = NdisGetPacketFlags(Packet);

        Status = NDIS_GET_PACKET_STATUS(Packet);

        NDIS_SET_PACKET_STATUS(MyPacket, Status);
        NDIS_SET_PACKET_HEADER_SIZE(MyPacket, NDIS_GET_PACKET_HEADER_SIZE(Packet));

        if (Status == NDIS_STATUS_RESOURCES)
        {
            PtQueueReceivedPacket(pAdapt, MyPacket, TRUE);
        }
        else
        {
            PtQueueReceivedPacket(pAdapt, MyPacket, FALSE);
        }

        //
        // Check if we had indicated up the packet with NDIS_STATUS_RESOURCES
        // NOTE -- do not use NDIS_GET_PACKET_STATUS(MyPacket) for this since
        // it might have changed! Use the value saved in the local variable.
        //
        if (Status == NDIS_STATUS_RESOURCES)
        {
            //
            // Our ReturnPackets handler will not be called for this packet.
            // We should reclaim it right here.
            //
            NdisDprFreePacket(MyPacket);
        }

        return((Status != NDIS_STATUS_RESOURCES) ? 1 : 0);
    }
    else
    {
        //
        // We are out of packets. Silently drop it.
        //
        return(0);
    }
}




NDIS_STATUS
PtPNPHandler(
    IN NDIS_HANDLE        ProtocolBindingContext,
    IN PNET_PNP_EVENT     pNetPnPEvent
    )

/*++
Routine Description:

    This is called by NDIS to notify us of a PNP event related to a lower
    binding. Based on the event, this dispatches to other helper routines.

    NDIS 5.1: forward this event to the upper protocol(s) by calling
    NdisIMNotifyPnPEvent.

Arguments:

    ProtocolBindingContext - Pointer to our adapter structure. Can be NULL
                for "global" notifications

    pNetPnPEvent - Pointer to the PNP event to be processed.

Return Value:

    NDIS_STATUS code indicating status of event processing.

--*/
{

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲三级在线免费观看| 亚洲一区二区三区四区在线 | 成人免费观看视频| 亚洲成人一区二区| 国产午夜亚洲精品午夜鲁丝片| 欧美熟乱第一页| 国产99久久久国产精品潘金 | 成人国产一区二区三区精品| 人人狠狠综合久久亚洲| 亚洲美腿欧美偷拍| 国产婷婷色一区二区三区在线| 欧美人牲a欧美精品| 高清成人免费视频| 激情综合色播激情啊| 亚洲超碰精品一区二区| 《视频一区视频二区| 久久视频一区二区| 欧美一区二区福利在线| 在线视频中文字幕一区二区| 不卡一卡二卡三乱码免费网站| 久久精品国产精品亚洲综合| 丝袜美腿成人在线| 亚洲成人动漫在线观看| 亚洲免费观看在线观看| 国产精品国产精品国产专区不片| 欧美一区二区三区四区五区| 91成人在线精品| 91网站在线播放| 成人av在线资源| 国产成a人无v码亚洲福利| 另类人妖一区二区av| 天天色综合天天| 亚洲妇熟xx妇色黄| 中文子幕无线码一区tr | 最好看的中文字幕久久| 国产欧美精品一区二区三区四区| 欧美精品一区二区三区一线天视频| 91精品午夜视频| 在线综合视频播放| 欧美人与禽zozo性伦| 欧美精品自拍偷拍| 欧美日韩不卡一区| 欧美视频自拍偷拍| 欧美猛男gaygay网站| 欧美精品日日鲁夜夜添| 欧美精品亚洲二区| 日韩亚洲欧美一区二区三区| 日韩欧美国产综合| 久久综合色鬼综合色| 国产人伦精品一区二区| 国产日韩欧美亚洲| 中文字幕在线不卡一区二区三区| 中文字幕亚洲欧美在线不卡| 亚洲精品视频自拍| 亚洲gay无套男同| 日产欧产美韩系列久久99| 丝袜诱惑制服诱惑色一区在线观看 | 欧美mv和日韩mv的网站| 日韩免费在线观看| 久久亚洲精华国产精华液| 国产欧美视频一区二区三区| 亚洲欧洲国产日韩| 一区二区三区在线观看国产| 婷婷国产在线综合| 激情另类小说区图片区视频区| 国产成人精品亚洲日本在线桃色| 成人福利电影精品一区二区在线观看| voyeur盗摄精品| 欧美性大战xxxxx久久久| 欧美成人r级一区二区三区| 久久精品在这里| 一区二区三区免费| 男女男精品视频| 成人美女视频在线观看| 欧美在线短视频| 久久综合色播五月| 一区二区三区在线视频免费| 日韩av高清在线观看| 风流少妇一区二区| 欧美日韩在线精品一区二区三区激情 | 欧美丰满美乳xxx高潮www| 日韩精品一区二区三区四区视频| 国产精品久久综合| 丝袜国产日韩另类美女| 国产91综合网| 欧美一区二区三区视频在线| 国产精品系列在线| 日本vs亚洲vs韩国一区三区| 成人动漫中文字幕| 欧美一区二区三区免费观看视频| 欧美激情一区二区三区四区| 91国在线观看| 久久综合网色—综合色88| 国产在线视频精品一区| 2021国产精品久久精品| 成熟亚洲日本毛茸茸凸凹| 亚洲国产激情av| 日韩欧美国产综合在线一区二区三区| 日韩国产高清影视| 成人av午夜电影| 国产精品国产三级国产aⅴ原创 | 国产精品乱人伦| 亚洲永久精品国产| 国产黄色成人av| 8v天堂国产在线一区二区| 亚洲柠檬福利资源导航| 欧美日韩中文字幕精品| 日韩中文字幕1| 亚洲成人av福利| 轻轻草成人在线| 亚洲成人7777| 亚洲欧美在线视频| 欧美本精品男人aⅴ天堂| 91理论电影在线观看| 成人高清免费观看| 丁香六月久久综合狠狠色| 琪琪一区二区三区| 日本不卡一区二区三区| 视频一区二区不卡| 免费成人在线观看| 亚洲高清久久久| 久久综合给合久久狠狠狠97色69| 国产精品一卡二卡| 中文字幕亚洲区| 欧美大黄免费观看| 欧美性生活久久| 国产一区中文字幕| 一区二区三区日韩精品| 精品国产凹凸成av人导航| a级精品国产片在线观看| 紧缚捆绑精品一区二区| 亚洲国产中文字幕| 欧美成人精品高清在线播放| 粉嫩蜜臀av国产精品网站| 亚洲国产精品久久人人爱蜜臀| 久久嫩草精品久久久精品| 在线播放国产精品二区一二区四区 | 午夜私人影院久久久久| 国产精品视频麻豆| 日韩欧美一区二区久久婷婷| 北岛玲一区二区三区四区| 亚洲国产一区二区a毛片| 欧美一区二区在线免费观看| 国产成人午夜99999| 亚洲一区在线观看视频| 日本一区二区三区国色天香| 久久奇米777| 久久综合九色综合久久久精品综合| 精品少妇一区二区三区免费观看| 欧美高清视频一二三区 | 国产成人午夜精品影院观看视频| 国产麻豆精品theporn| 欧美午夜片在线看| 中文字幕va一区二区三区| 日本三级亚洲精品| 久久草av在线| 国产毛片精品国产一区二区三区| 亚洲精品乱码久久久久久黑人| 国产丝袜欧美中文另类| 久久一夜天堂av一区二区三区| 国产片一区二区| 国产精品女同互慰在线看| 国产精品色一区二区三区| |精品福利一区二区三区| 亚洲人成网站色在线观看 | 国产一区在线精品| 美女诱惑一区二区| 精品一区二区av| 成人黄色在线看| 欧美专区在线观看一区| 欧美一区二区三区视频免费| 一区二区三区在线观看国产 | 一区二区欧美在线观看| 一区二区三区四区蜜桃| 国产欧美日韩精品a在线观看| 26uuu另类欧美| 欧美精品一区二区在线播放| 久久精品视频在线免费观看| 亚洲男人电影天堂| 毛片av中文字幕一区二区| 972aa.com艺术欧美| 久久综合色之久久综合| 国产精品久久久久久亚洲毛片| 亚洲主播在线播放| 欧美高清视频不卡网| 日日摸夜夜添夜夜添亚洲女人| 日韩色在线观看| 粉嫩欧美一区二区三区高清影视 | 激情五月播播久久久精品| 91精品国产综合久久国产大片| 日本女人一区二区三区| 国产三级一区二区| 丁香婷婷综合激情五月色| 精品欧美一区二区久久| 午夜欧美电影在线观看| 91免费国产在线| 国产精品色眯眯| 91在线一区二区三区| 一区二区三区在线播| 欧美三级视频在线|