阅读:2378回复:1
NDIS6.0 发送包数据部分内容如何取得?void ReadSendNetBuffer( PNET_BUFFER_LIST NetBufferLists) { PUCHAR data,info; ULONG len,i,offset=0; PNET_BUFFER_LIST CurrNbl; PNET_BUFFER Currbuff; PMDL mdl; int DataLen; CurrNbl = NetBufferLists; while (CurrNbl) { Currbuff = NET_BUFFER_LIST_FIRST_NB(CurrNbl); while(Currbuff) { offset = NET_BUFFER_DATA_OFFSET(Currbuff); mdl = NET_BUFFER_FIRST_MDL(Currbuff); DataLen = NET_BUFFER_DATA_LENGTH(Currbuff); if ( mdl && DataLen ) { data = (UCHAR*)MmGetSystemAddressForMdlSafe( mdl,NormalPagePriority ); if(data) { info = data + offset; ParseProtocol(data+offset,DataLen, FALSE); } } Currbuff = NET_BUFFER_NEXT_NB(Currbuff); } CurrNbl = NET_BUFFER_LIST_NEXT_NBL(CurrNbl); } } 在解析函数ParseProtocol()中可以得到telnet的端口为23, 但我发送一个回车后, 数据部分应该为0x0d, 0x0a(抓包工具看), 但结果是0,0 why? 发送包数据部分内容取得错误. 接收包正常. NDIS6.0 发送包数据部分内容如何取得? |
|
沙发#
发布于:2012-09-18 22:26
NET_BUFFER_LIST_FIRST_NB 修改为 NET_BUFFER_LIST_CURRENT_NB
|
|