阅读:1068回复:2
求助:passthru中的PtReceive是否多收了?
NDIS_STATUS PtReceive(..........)
{ PADAPT pAdapt =(PADAPT)ProtocolBindingContext; PNDIS_PACKET MyPacket, Packet; NDIS_STATUS Status = NDIS_STATUS_SUCCESS; if(!pAdapt->MiniportHandle) { Status = NDIS_STATUS_FAILURE; } else do { if(pAdapt->isSecondary) { DBGPRINT(\"PASSTHRU GETTING RECIEVES ON SECONDARY\\n\"); ASSERT(0); } Packet = NdisGetReceivedPacket(pAdapt->BindingHandle, MacReceiveContext); if(Packet != NULL) { NdisDprAllocatePacket(&Status, &MyPacket, pAdapt->RecvPacketPoolHandle); if(Status == NDIS_STATUS_SUCCESS) { MyPacket->Private.Head = Packet->Private.Head; MyPacket->Private.Tail = Packet->Private.Tail; NDIS_SET_ORIGINAL_PACKET(MyPacket, NDIS_GET_ORIGINAL_PACKET(Packet)); NDIS_SET_PACKET_HEADER_SIZE(MyPacket, HeaderBufferSize); NdisGetPacketFlags(MyPacket) = NdisGetPacketFlags(Packet); NDIS_SET_PACKET_STATUS(MyPacket, NDIS_STATUS_RESOURCES); NdisMIndicateReceivePacket(pAdapt->MiniportHandle, &MyPacket, 1); ASSERT(NDIS_GET_PACKET_STATUS(MyPacket) == NDIS_STATUS_RESOURCES); NdisDprFreePacket(MyPacket); break; } } pAdapt->IndicateRcvComplete = TRUE; switch(pAdapt->Medium) { case NdisMedium802_3: 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(0); break; } } while(FALSE); return Status; } 当Packet = NdisGetReceivedPacket(pAdapt->BindingHandle, MacReceiveContext); != NULL 时,该列程是否对同一的数据内容同时执行了NdisMIndicateReceivePacket(pAdapt->MiniportHandle, &MyPacket, 1);与NdisMEthIndicateReceive(pAdapt->MiniportHandle, MacReceiveContext, HeaderBuffer, HeaderBufferSize, LookAheadBuffer, LookAheadBufferSize, PacketSize); 是这样的吗? 我认为这好象不妥。 小弟不才,望大虾指点。谢谢!!! 若顺便将解其中的缘由,我将以分相许。 :D :D :D |
|
|
沙发#
发布于:2002-05-10 13:18
没有呀!Packet = GetReceivedPacket(……)之后,如果Packet != NULL,则NdisMIndicateReceivePacket(……),后面有一个break语句跳出do……while啊,你没有看见berak么?
|
|
板凳#
发布于:2002-05-10 16:34
谢谢!
见笑了。。。。。。。一点小意思 :) :D [编辑 - 5/10/02 作者: magicw] |
|
|