阅读:2924回复:2
在PtReceive中NdisAllocateBuffer后,在NdisChainBufferAtFront,此ndisbuffer在什么地方释放?
在PtReceive中NdisAllocateBuffer后,在进行NdisChainBufferAtFront操作,此ndisbuffer在什么地方释放?
NdisAllocateBuffer(&Status,&pPacketBuffer,pAdapt->RecvPacketPoolHandle,pPacketContent,PacketLen); if (Status!=NDIS_STATUS_SUCCESS) { NdisFreeMemory(pPacketContent,BUFFER_SIZE,0); NdisDprFreePacket(MyPacket); break; } NdisChainBufferAtFront(MyPacket,pPacketBuffer); MyPacket->Private.Head->Next=NULL; MyPacket->Private.Tail=NULL; Rsvd=(PRECV_RSVD)(MyPacket->MiniportReserved); Rsvd->OriginalPkt=(PNDIS_PACKET)1; NDIS_SET_PACKET_HEADER_SIZE(MyPacket,HeaderBufferSize); NdisMIndicateReceivePacket(pAdapt->MiniportHandle,&MyPacket,1); 请问上面操作的pPacketContent 和pPacketBuffer 等等,在什么地方释放?... 高手帮忙解答下!谢谢了! |
|
沙发#
发布于:2010-05-04 12:16
MPReturnPacket函数中释放即可
|
|
板凳#
发布于:2010-05-08 10:23
两种情况吧:
情况一:如果包状态为NDIS_STATUS_RESOURCES,则在 NdisMIndicateReceivePacket(pAdapt->MiniportHandle,&MyPacket,1); 之后就可以直接释放buffer; 情况二:如果包状态不是NDIS_STATUS_RESOURCES,就要在MPReturnPacket中释放了 |
|