阅读:1431回复:0
有关NdisSend的问题.
小弟在Passthru框架上面做修改,我设置了一个PNDIS_PACKET的全局变量,然后在PtReceive里面根据条件拷贝了一个包的内容到这个全局变量里面,然后在MPSend里面想要把它发送出去.在MPSend里面检查包的内容,都是正确的,但一调用NdisSend,就会蓝屏,那位兄弟能帮帮我阿......
拷贝数据包的代码如下: NdisAllocatePacket(&Status, &ReSendPacket, pAdaptList->SendPacketPoolHandle); if (Status == NDIS_STATUS_SUCCESS) { PNDIS_PACKET_EXTENSION Old, New; Rsvd = (PRSVD)(ReSendPacket->ProtocolReserved); Rsvd->OriginalPkt = Packet; ReSendPacket->Private.Flags = NdisGetPacketFlags(Packet); ReSendPacket->Private.Head = Packet->Private.Head; ReSendPacket->Private.Tail = Packet->Private.Tail; NdisSetPacketFlags(ReSendPacket, NDIS_FLAGS_DONT_LOOPBACK); // // Copy the OOB Offset from the original packet to the new // packet. // NdisMoveMemory(NDIS_OOB_DATA_FROM_PACKET(ReSendPacket), NDIS_OOB_DATA_FROM_PACKET(Packet), sizeof(NDIS_PACKET_OOB_DATA)); // // Copy the per packet info into the new packet // This includes ClassificationHandle, etc. // Make sure other stuff is not copied !!! // NdisIMCopySendPerPacketInfo(ReSendPacket, Packet); // // Copy the Media specific information // NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO(Packet, &MediaSpecificInfo, &MediaSpecificInfoSize); if (MediaSpecificInfo || MediaSpecificInfoSize) { NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO(ReSendPacket, MediaSpecificInfo, MediaSpecificInfoSize); } } |
|
|