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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? miniport.c

?? <Visual C++ 網絡程序設計實例詳解>配套源碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
                        NdisMSendComplete(ADAPT_MINIPORT_HANDLE(pAdapt),
                                            Packet,
                                            Status);
                   
                        ADAPT_DECR_PENDING_SENDS(pAdapt);
                    }
                }
                continue;
            }
        }
#endif
        do 
        {
            NdisAcquireSpinLock(&pAdapt->Lock);
            //
            // If the below miniport is going to low power state, stop sending down any packet.
            //
            if (pAdapt->PTDeviceState > NdisDeviceStateD0)
            {
                NdisReleaseSpinLock(&pAdapt->Lock);
                Status = NDIS_STATUS_FAILURE;
                break;
            }
            pAdapt->OutstandingSends++;
            NdisReleaseSpinLock(&pAdapt->Lock);
            
            NdisAllocatePacket(&Status,
                               &MyPacket,
                               pAdapt->SendPacketPoolHandle);

            if (Status == NDIS_STATUS_SUCCESS)
            {
                PSEND_RSVD        SendRsvd;

                SendRsvd = (PSEND_RSVD)(MyPacket->ProtocolReserved);
                SendRsvd->OriginalPkt = Packet;

                MyPacket->Private.Flags = NdisGetPacketFlags(Packet);

                MyPacket->Private.Head = Packet->Private.Head;
                MyPacket->Private.Tail = Packet->Private.Tail;
#ifdef WIN9X
                //
                // Work around the fact that NDIS does not initialize this
                // to FALSE on Win9x.
                //
                MyPacket->Private.ValidCounts = FALSE;
#endif // WIN9X

                //
                // Copy the OOB data from the original packet to the new
                // packet.
                //
                NdisMoveMemory(NDIS_OOB_DATA_FROM_PACKET(MyPacket),
                            NDIS_OOB_DATA_FROM_PACKET(Packet),
                            sizeof(NDIS_PACKET_OOB_DATA));
                //
                // Copy relevant parts of the per packet info into the new packet
                //
#ifndef WIN9X
                NdisIMCopySendPerPacketInfo(MyPacket, Packet);
#endif

                //
                // Copy the Media specific information
                //
                NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO(Packet,
                                                    &MediaSpecificInfo,
                                                    &MediaSpecificInfoSize);

                if (MediaSpecificInfo || MediaSpecificInfoSize)
                {
                    NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO(MyPacket,
                                                        MediaSpecificInfo,
                                                        MediaSpecificInfoSize);
                }

                NdisSend(&Status,
                         pAdapt->BindingHandle,
                         MyPacket);

                if (Status != NDIS_STATUS_PENDING)
                {
#ifndef WIN9X
                    NdisIMCopySendCompletePerPacketInfo (Packet, MyPacket);
#endif
                    NdisFreePacket(MyPacket);
                    ADAPT_DECR_PENDING_SENDS(pAdapt);
                }
            }
            else
            {
                //
                // The driver cannot allocate a packet.
                // 
                ADAPT_DECR_PENDING_SENDS(pAdapt);
            }
        }
        while (FALSE);

        if (Status != NDIS_STATUS_PENDING)
        {
            NdisMSendComplete(ADAPT_MINIPORT_HANDLE(pAdapt),
                              Packet,
                              Status);
        }
    }
}


NDIS_STATUS
MPQueryInformation(
    IN NDIS_HANDLE                MiniportAdapterContext,
    IN NDIS_OID                   Oid,
    IN PVOID                      InformationBuffer,
    IN ULONG                      InformationBufferLength,
    OUT PULONG                    BytesWritten,
    OUT PULONG                    BytesNeeded
    )
/*++

Routine Description:

    Entry point called by NDIS to query for the value of the specified OID.
    Typical processing is to forward the query down to the underlying miniport.

    The following OIDs are filtered here:

    OID_PNP_QUERY_POWER - return success right here

    OID_GEN_SUPPORTED_GUIDS - do not forward, otherwise we will show up
    multiple instances of private GUIDs supported by the underlying miniport.

    OID_PNP_CAPABILITIES - we do send this down to the lower miniport, but
    the values returned are postprocessed before we complete this request;
    see PtRequestComplete.

    NOTE on OID_TCP_TASK_OFFLOAD - if this IM driver modifies the contents
    of data it passes through such that a lower miniport may not be able
    to perform TCP task offload, then it should not forward this OID down,
    but fail it here with the status NDIS_STATUS_NOT_SUPPORTED. This is to
    avoid performing incorrect transformations on data.

    If our miniport edge (upper edge) is at a low-power state, fail the request.

    If our protocol edge (lower edge) has been notified of a low-power state,
    we pend this request until the miniport below has been set to D0. Since
    requests to miniports are serialized always, at most a single request will
    be pended.

Arguments:

    MiniportAdapterContext    Pointer to the adapter structure
    Oid                       Oid for this query
    InformationBuffer         Buffer for information
    InformationBufferLength   Size of this buffer
    BytesWritten              Specifies how much info is written
    BytesNeeded               In case the buffer is smaller than what we need, tell them how much is needed


Return Value:

    Return code from the NdisRequest below.

--*/
{
    PADAPT        pAdapt = (PADAPT)MiniportAdapterContext;
    NDIS_STATUS   Status = NDIS_STATUS_FAILURE;

    do
    {
        if (Oid == OID_PNP_QUERY_POWER)
        {
            //
            //  Do not forward this.
            //
            Status = NDIS_STATUS_SUCCESS;
            break;
        }

        if (Oid == OID_GEN_SUPPORTED_GUIDS)
        {
            //
            //  Do not forward this, otherwise we will end up with multiple
            //  instances of private GUIDs that the underlying miniport
            //  supports.
            //
            Status = NDIS_STATUS_NOT_SUPPORTED;
            break;
        }

        if (Oid == OID_TCP_TASK_OFFLOAD)
        {
            //
            // Fail this -if- this driver performs data transformations
            // that can interfere with a lower driver's ability to offload
            // TCP tasks.
            //
            // Status = NDIS_STATUS_NOT_SUPPORTED;
            // break;
            //
        }
        //
        // If the miniport below is unbinding, just fail any request
        //
        NdisAcquireSpinLock(&pAdapt->Lock);
        if (pAdapt->UnbindingInProcess == TRUE)
        {
            NdisReleaseSpinLock(&pAdapt->Lock);
            Status = NDIS_STATUS_FAILURE;
            break;
        }
        NdisReleaseSpinLock(&pAdapt->Lock);
        //
        // All other queries are failed, if the miniport is not at D0,
        //
        if (pAdapt->MPDeviceState > NdisDeviceStateD0) 
        {
            Status = NDIS_STATUS_FAILURE;
            break;
        }

        pAdapt->Request.RequestType = NdisRequestQueryInformation;
        pAdapt->Request.DATA.QUERY_INFORMATION.Oid = Oid;
        pAdapt->Request.DATA.QUERY_INFORMATION.InformationBuffer = InformationBuffer;
        pAdapt->Request.DATA.QUERY_INFORMATION.InformationBufferLength = InformationBufferLength;
        pAdapt->BytesNeeded = BytesNeeded;
        pAdapt->BytesReadOrWritten = BytesWritten;

        //
        // If the miniport below is binding, fail the request
        //
        NdisAcquireSpinLock(&pAdapt->Lock);
            
        if (pAdapt->UnbindingInProcess == TRUE)
        {
            NdisReleaseSpinLock(&pAdapt->Lock);
            Status = NDIS_STATUS_FAILURE;
            break;
        }
        //
        // If the Protocol device state is OFF, mark this request as being 
        // pended. We queue this until the device state is back to D0. 
        //
        if ((pAdapt->PTDeviceState > NdisDeviceStateD0) 
                && (pAdapt->StandingBy == FALSE))
        {
            pAdapt->QueuedRequest = TRUE;
            NdisReleaseSpinLock(&pAdapt->Lock);
            Status = NDIS_STATUS_PENDING;
            break;
        }
        //
        // This is in the process of powering down the system, always fail the request
        // 
        if (pAdapt->StandingBy == TRUE)
        {
            NdisReleaseSpinLock(&pAdapt->Lock);
            Status = NDIS_STATUS_FAILURE;
            break;
        }
        pAdapt->OutstandingRequests = TRUE;
        
        NdisReleaseSpinLock(&pAdapt->Lock);

        //
        // default case, most requests will be passed to the miniport below
        //
        NdisRequest(&Status,
                    pAdapt->BindingHandle,
                    &pAdapt->Request);


        if (Status != NDIS_STATUS_PENDING)
        {
            PtRequestComplete(pAdapt, &pAdapt->Request, Status);
            Status = NDIS_STATUS_PENDING;
        }

    } while (FALSE);

    return(Status);

}


VOID
MPQueryPNPCapabilities(
    IN OUT PADAPT            pAdapt,
    OUT PNDIS_STATUS         pStatus
    )
/*++

Routine Description:

    Postprocess a request for OID_PNP_CAPABILITIES that was forwarded
    down to the underlying miniport, and has been completed by it.

Arguments:

    pAdapt - Pointer to the adapter structure
    pStatus - Place to return final status

Return Value:

    None.

--*/

{
    PNDIS_PNP_CAPABILITIES           pPNPCapabilities;
    PNDIS_PM_WAKE_UP_CAPABILITIES    pPMstruct;

    if (pAdapt->Request.DATA.QUERY_INFORMATION.InformationBufferLength >= sizeof(NDIS_PNP_CAPABILITIES))
    {
        pPNPCapabilities = (PNDIS_PNP_CAPABILITIES)(pAdapt->Request.DATA.QUERY_INFORMATION.InformationBuffer);

        //
        // The following fields must be overwritten by an IM driver.
        //
        pPMstruct= & pPNPCapabilities->WakeUpCapabilities;
        pPMstruct->MinMagicPacketWakeUp = NdisDeviceStateUnspecified;
        pPMstruct->MinPatternWakeUp = NdisDeviceStateUnspecified;
        pPMstruct->MinLinkChangeWakeUp = NdisDeviceStateUnspecified;
        *pAdapt->BytesReadOrWritten = sizeof(NDIS_PNP_CAPABILITIES);
        *pAdapt->BytesNeeded = 0;


        //
        // Setting our internal flags
        // Default, device is ON
        //
        pAdapt->MPDeviceState = NdisDeviceStateD0;
        pAdapt->PTDeviceState = NdisDeviceStateD0;

        *pStatus = NDIS_STATUS_SUCCESS;
    }
    else
    {
        *pAdapt->BytesNeeded= sizeof(NDIS_PNP_CAPABILITIES);
        *pStatus = NDIS_STATUS_RESOURCES;
    }
}


NDIS_STATUS
MPSetInformation(
    IN NDIS_HANDLE             MiniportAdapterContext,
    IN NDIS_OID                Oid,
    IN PVOID                   InformationBuffer,
    IN ULONG                   InformationBufferLength,
    OUT PULONG                 BytesRead,
    OUT PULONG                 BytesNeeded
    )
/*++

Routine Description:

    Miniport SetInfo handler.

    In the case of OID_PNP_SET_POWER, record the power state and return the OID.    
    Do not pass below
    If the device is suspended, do not block the SET_POWER_OID 
    as it is used to reactivate the Passthru miniport

    
    PM- If the MP is not ON (DeviceState > D0) return immediately  (except for 'query power' and 'set power')
         If MP is ON, but the PT is not at D0, then queue the queue the request for later processing

    Requests to miniports are always serialized


Arguments:

    MiniportAdapterContext    Pointer to the adapter structure
    Oid                       Oid for this query
    InformationBuffer         Buffer for information
    InformationBufferLength   Size of this buffer
    BytesRead                 Specifies how much info is read
    BytesNeeded               In case the buffer is smaller than what we need, tell them how much is needed

Return Value:

    Return code from the NdisRequest below.

--*/
{
    PADAPT        pAdapt = (PADAPT)MiniportAdapterContext;
    NDIS_STATUS   Status;

    Status = NDIS_STATUS_FAILURE;

    do
    {
        //
        // The Set Power should not be sent to the miniport below the Passthru, but is handled internally
        //
        if (Oid == OID_PNP_SET_POWER)
        {
            MPProcessSetPowerOid(&Status, 
                                 pAdapt, 
                                 InformationBuffer, 
                                 InformationBufferLength, 
                                 BytesRead, 
                                 BytesNeeded);
            break;

        }

        //
        // If the miniport below is unbinding, fail the request
        //
        NdisAcquireSpinLock(&pAdapt->Lock);     
        if (pAdapt->UnbindingInProcess == TRUE)
        {
            NdisReleaseSpinLock(&pAdapt->Lock);
            Status = NDIS_STATUS_FAILURE;
            break;
        }
        NdisReleaseSpinLock(&pAdapt->Lock);
        //
        // All other Set Information requests are failed, if the miniport is
        // not at D0 or is transitioning to a device state greater than D0.
        //
        if (pAdapt->MPDeviceState > NdisDeviceStateD0)
        {
            Status = NDIS_STATUS_FAILURE;
            break;
        }

        // Set up the Request and return the result
        pAdapt->Request.RequestType = NdisRequestSetInformation;
        pAdapt->Request.DATA.SET_INFORMATION.Oid = Oid;
        pAdapt->Request.DATA.SET_INFORMATION.InformationBuffer = InformationBuffer;
        pAdapt->Request.DATA.SET_INFORMATION.InformationBufferLength = InformationBufferLength;
        pAdapt->BytesNeeded = BytesNeeded;
        pAdapt->BytesReadOrWritten = BytesRead;

        //
        // If the miniport below is unbinding, fail the request
        //
        NdisAcquireSpinLock(&pAdapt->Lock);     
        if (pAdapt->UnbindingInProcess == TRUE)
        {
            NdisReleaseSpinLock(&pAdapt->Lock);
            Status = NDIS_STATUS_FAILURE;
            break;
        }
            
        //
        // If the device below is at a low power state, we cannot send it the
        // request now, and must pend it.
        //
        if ((pAdapt->PTDeviceState > NdisDeviceStateD0) 
                && (pAdapt->StandingBy == FALSE))
        {
            pAdapt->QueuedRequest = TRUE;
            NdisReleaseSpinLock(&pAdapt->Lock);
            Status = NDIS_STATUS_PENDING;
            break;
        }
        //
        // This is in the process of powering down the system, always fail the request
        // 
        if (pAdapt->StandingBy == TRUE)
        {
            NdisReleaseSpinLock(&pAdapt->Lock);
            Status = NDIS_STATUS_FAILURE;
            break;
        }
        pAdapt->OutstandingRequests = TRUE;
        
        NdisReleaseSpinLock(&pAdapt->Lock);
        //
        // Forward the request to the device below.
        //
        NdisRequest(&Status,
                    pAdapt->BindingHandle,
                    &pAdapt->Request);

        if (Status != NDIS_STATUS_PENDING)
        {
            *BytesRead = pAdapt->Request.DATA.SET_INFORMATION.BytesRead;
            *BytesNeeded = pAdapt->Request.DATA.SET_INFORMATION.BytesNeeded;
            pAdapt->OutstandingRequests = FALSE;
        }

    } while (FALSE);

    return(Status);
}


VOID

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日日夜夜一区二区| 久久疯狂做爰流白浆xx| 欧美人与禽zozo性伦| 日韩精品一级二级 | 成人精品小蝌蚪| 国产精品天美传媒| 欧美性大战xxxxx久久久| 欧美96一区二区免费视频| 26uuu成人网一区二区三区| 成人av影院在线| 日韩不卡免费视频| 国产精品不卡一区二区三区| 99久久精品久久久久久清纯| 人人精品人人爱| 综合婷婷亚洲小说| 精品久久久久久久久久久久久久久久久| 国产毛片精品视频| 一区二区欧美视频| www国产精品av| 欧美久久一区二区| 国产一区二区免费在线| 亚洲一二三四区| 欧美一区三区四区| 色哟哟一区二区在线观看| 亚洲福利电影网| 亚洲视频一区二区免费在线观看| 91玉足脚交白嫩脚丫在线播放| 美国欧美日韩国产在线播放 | 日韩精品一区二区三区中文精品| 国产成人鲁色资源国产91色综 | 日韩精品成人一区二区三区| 国产精品毛片大码女人| 日韩欧美成人激情| 欧美在线播放高清精品| 久久福利资源站| 五月天亚洲婷婷| 一区二区三区在线观看欧美| 国产亚洲制服色| 日韩精品专区在线| 欧美精品国产精品| 在线免费精品视频| 国产一区二区三区黄视频 | 天天综合日日夜夜精品| 国产精品国产成人国产三级 | 亚洲成人资源在线| 亚洲精品国产精品乱码不99| 国产三级欧美三级日产三级99| 欧美一区中文字幕| 欧美色爱综合网| 91免费在线视频观看| 成人黄色软件下载| 蓝色福利精品导航| 日本特黄久久久高潮| 亚洲在线一区二区三区| 亚洲福利一区二区三区| 午夜国产不卡在线观看视频| 日本视频一区二区三区| 精品一区在线看| 国产传媒欧美日韩成人| 成人av免费网站| 在线观看亚洲精品| 制服丝袜亚洲网站| 日韩精品最新网址| 国产日韩欧美高清| 亚洲精品国产一区二区三区四区在线| 一区二区三区在线观看动漫| 亚洲第一搞黄网站| 极品美女销魂一区二区三区| 国产一区二区精品久久99| 成人蜜臀av电影| 色婷婷久久一区二区三区麻豆| 欧美日韩www| 久久日韩粉嫩一区二区三区 | 国产女人aaa级久久久级| 国产精品美女久久久久久久久久久 | 久久久.com| 中文字幕在线不卡视频| 亚洲国产成人精品视频| 国内外精品视频| 91丝袜国产在线播放| 4438x亚洲最大成人网| 久久精品亚洲国产奇米99| 亚洲精品中文字幕在线观看| 免费欧美日韩国产三级电影| 丁香天五香天堂综合| 欧美日产在线观看| 国产免费久久精品| 午夜精品视频在线观看| 国产精品99久久久久久久女警| 色哟哟日韩精品| 2020日本不卡一区二区视频| 亚洲精品视频一区二区| 男女性色大片免费观看一区二区| 福利电影一区二区三区| 91精品国产综合久久精品麻豆| 日本一区二区免费在线观看视频| 午夜欧美电影在线观看| av一本久道久久综合久久鬼色| 91精品国产综合久久香蕉麻豆| 国产精品第13页| 国产一区二区在线影院| 欧美熟乱第一页| 国产精品嫩草99a| 国产麻豆成人传媒免费观看| 欧美剧在线免费观看网站| 亚洲欧洲国产日韩| 国产成人综合精品三级| 日韩一区二区视频在线观看| 一区二区三区精品视频在线| 成人精品小蝌蚪| 日韩免费福利电影在线观看| 一区二区三区美女| www.欧美亚洲| 日本一区二区高清| 国产精品一线二线三线精华| 日韩三级.com| 亚洲成av人片一区二区三区| 色哟哟国产精品免费观看| 国产精品免费视频观看| 国产激情视频一区二区三区欧美 | 久久国产日韩欧美精品| 欧美日韩在线播| 亚洲一区在线视频| 99久久久久免费精品国产| 中文字幕精品综合| 豆国产96在线|亚洲| 国产校园另类小说区| 国产乱一区二区| 精品国产凹凸成av人导航| 美日韩黄色大片| 欧美一级一级性生活免费录像| 亚洲国产日韩a在线播放性色| 色综合视频一区二区三区高清| 国产精品国产三级国产专播品爱网| 国产酒店精品激情| 久久久久久毛片| 国产在线一区二区综合免费视频| 91麻豆精品国产91久久久久久久久| 亚洲最新视频在线观看| 欧洲av一区二区嗯嗯嗯啊| 夜夜嗨av一区二区三区四季av| 色欧美日韩亚洲| 国产精品久久久久久妇女6080| 成人黄色av电影| 国产精品对白交换视频 | 日本国产一区二区| 亚洲一区二区三区四区五区黄| 色哟哟精品一区| 亚洲成a人v欧美综合天堂| 欧美一区二区福利在线| 国产精品自产自拍| 一区二区中文字幕在线| 色综合中文字幕| 亚洲成av人片| 精品粉嫩aⅴ一区二区三区四区| 国产在线精品一区二区夜色| 久久综合久久综合九色| 成人aa视频在线观看| 亚洲一区二区三区在线看| 91精品婷婷国产综合久久| 久久99久久99精品免视看婷婷| 久久久久久久综合日本| 色综合久久久久| 免费看日韩精品| 国产精品麻豆网站| 欧美老肥妇做.爰bbww| 国产一区二区三区四区在线观看 | 日本不卡免费在线视频| 久久久久久久久久久久久女国产乱| 成人激情黄色小说| 视频一区二区三区在线| 久久精品在线免费观看| 欧美这里有精品| 韩国女主播一区二区三区| 日韩伦理免费电影| 日韩精品最新网址| 97久久精品人人爽人人爽蜜臀| 婷婷亚洲久悠悠色悠在线播放| www久久精品| 欧美性猛交xxxxxxxx| 国产一区二区三区视频在线播放 | 久热成人在线视频| 亚洲手机成人高清视频| 欧美成人aa大片| 在线观看免费一区| 国产91在线观看丝袜| 无吗不卡中文字幕| 一色屋精品亚洲香蕉网站| 制服.丝袜.亚洲.另类.中文| 成人黄色电影在线| 久久精品999| 夜夜精品视频一区二区| 国产日韩精品一区二区三区| 欧美丰满一区二区免费视频| 成人午夜激情在线| 麻豆91免费看| 亚洲国产精品久久久男人的天堂 | 亚洲1区2区3区4区| 中文字幕免费一区| 精品日韩成人av|