Packet = PacketArray;
NdisQueryPacket(Packet,NULL,&BufLength,&pBuffer,&PacketSize);
if(!BufLength)
DBGPRINT(("==Packet Query Failed"));
// 分配缓冲区pPacketContent
Status = NdisAllocateMemoryWithTag((PVOID *)&pPacketContent, PacketSize, 'maDN');
if (Status!=NDIS_STATUS_SUCCESS )
DBGPRINT(("==Memory Allocate Failed"));
// 读取所有数据到pPacketContent
NdisZeroMemory (pPacketContent, PacketSize);
NdisAllocateBuffer(&Status,
&pBuffer,
pAdapt->SendPacketPoolHandle,
pPacketContent,
BufLength );
NdisQueryBuffer(pBuffer, &CurrentBufferVA, &CurrentBufferLength);
while(pBuffer != NULL)
{
NdisMoveMemory(pPacketContent+tempBuL, CurrentBufferVA, CurrentBufferLength);
tempBuL += CurrentBufferLength;
NdisGetNextBuffer(pBuffer, &pBuffer);
if(pBuffer == NULL)
break;
NdisQueryBuffer(pBuffer, &CurrentBufferVA, &CurrentBufferLength);
}
DBGPRINT(("==>pPacketContent:%x\n",pPacketContent[23]));
这段代码在MPSendPackets函数里,pPacketContent[23]用来得到协议类型,为什么值总为0?
用DEBUG模式看过吗?是否真的得到了正确的数据包?