diesnak
驱动牛犊
驱动牛犊
  • 注册日期2002-03-04
  • 最后登录2002-12-09
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1431回复:0

有关NdisSend的问题.

楼主#
更多 发布于:2002-11-27 15:36
小弟在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);
}
}
I believv i can fly I believe i can touch sky
游客

返回顶部