阅读:1549回复:4
为什么xpassthru里面接收的包总是空的?
我用安装了《Windows防火墙与网络封包截获技术》里面的xpassthru,但是我用DBGVIEW这个软件进行测试,老是看不到函数PtReceive(…)里\"==> Passthru Protocol PtReceive
RePacket...\"提示。这应该说明Packet是NULL的吧?但是,如果总是NULL,那就不存在数据包的过滤功能了,请帮我分析一下问题发生在什么地方?谢谢!! NDIS_STATUS PtReceive( IN NDIS_HANDLE ProtocolBindingContext, IN NDIS_HANDLE MacReceiveContext, IN PVOID HeaderBuffer, IN UINT HeaderBufferSize, IN PVOID LookAheadBuffer, IN UINT LookAheadBufferSize, IN UINT PacketSize ) { PADAPT pAdapt =(PADAPT)ProtocolBindingContext; PNDIS_PACKET MyPacket, Packet; NDIS_STATUS Status = NDIS_STATUS_SUCCESS; DBGPRINT(\"==> Passthru Protocol PtReceive\\n\"); DbgPrint(\" CurrentAdapterHandle: %u\\n\", ProtocolBindingContext); DbgPrint(\" MacReceiveHandle: %u\\n\", MacReceiveContext); DbgPrint(\" HeaderBufferPointer: %u\\n\", HeaderBuffer); DbgPrint(\" HeaderBufferSize: %u\\n\", HeaderBufferSize); DbgPrint(\" LookAheadBufferPointer: %u\\n\", LookAheadBuffer); DbgPrint(\" LookAheadBufferSize: %u\\n\", LookAheadBufferSize); DbgPrint(\" PacketSize: %u\\n\", PacketSize); if(!pAdapt->MiniportHandle) { Status = NDIS_STATUS_FAILURE; } else do { if(pAdapt->isSecondary) { DBGPRINT(\"PASSTHRU GETTING RECIEVES ON SECONDARY\\n\"); ASSERT(0); } Packet = NdisGetReceivedPacket(pAdapt->BindingHandle, MacReceiveContext); if(Packet != NULL) { DBGPRINT(\"==> Passthru Protocol PtReceive RePacket...\\n\"); NdisDprAllocatePacket(&Status , &MyPacket, pAdapt->RecvPacketPoolHandle); if(Status == NDIS_STATUS_SUCCESS) { MyPacket->Private.Head = Packet->Private.Head; MyPacket->Private.Tail = Packet->Private.Tail; NDIS_SET_ORIGINAL_PACKET( MyPacket, NDIS_GET_ORIGINAL_PACKET(Packet)); NDIS_SET_PACKET_HEADER_SIZE(MyPacket, HeaderBufferSize); NdisGetPacketFlags(MyPacket) = NdisGetPacketFlags(Packet); NDIS_SET_PACKET_STATUS(MyPacket, NDIS_STATUS_RESOURCES); NdisMIndicateReceivePacket(pAdapt->MiniportHandle, &MyPacket, 1); ASSERT(NDIS_GET_PACKET_STATUS(MyPacket) == NDIS_STATUS_RESOURCES); PrintPacket(MyPacket); NdisDprFreePacket(MyPacket); DBGPRINT(\"<== Passthru Protocol PtReceive RePacket Success...\\n\"); break; } } pAdapt->IndicateRcvComplete = TRUE; switch(pAdapt->Medium) { case NdisMedium802_3: NdisMEthIndicateReceive(pAdapt->MiniportHandle, MacReceiveContext, HeaderBuffer, HeaderBufferSize, LookAheadBuffer, LookAheadBufferSize, PacketSize); break; case NdisMedium802_5: NdisMTrIndicateReceive(pAdapt->MiniportHandle, MacReceiveContext, HeaderBuffer, HeaderBufferSize, LookAheadBuffer, LookAheadBufferSize, PacketSize); break; case NdisMediumFddi: NdisMFddiIndicateReceive(pAdapt->MiniportHandle, MacReceiveContext, HeaderBuffer, HeaderBufferSize, LookAheadBuffer, LookAheadBufferSize, PacketSize); break; default: ASSERT(0); break; } } while(FALSE); DBGPRINT(\"<== Passthru Protocol PtReceive\\n\"); return Status; } DBGVIEW的结果是: 00000295 1.00406560 *** XPASSHTRU.SYS *** 00000296 1.00410499 ==> Passthru Protocol PtReceive 00000297 1.00413013 CurrentAdapterHandle: 2164558312 00000298 1.00415276 MacReceiveHandle: 2166947848 00000299 1.00417539 HeaderBufferPointer: 2166948256 00000300 1.00419299 HeaderBufferSize: 14 00000301 1.00421478 LookAheadBufferPointer: 2166948270 00000302 1.00423238 LookAheadBufferSize: 46 00000303 1.00424747 PacketSize: 46 00000304 1.00430613 *** XPASSHTRU.SYS *** 00000305 1.00432289 <== Passthru Protocol PtReceive 00000306 1.00434888 *** XPASSHTRU.SYS *** 00000307 1.00436648 <== Passthru Protocol PtReceiveComplete |
|
最新喜欢:xiaoji... |
沙发#
发布于:2003-10-05 19:07
8029、8139、3com的芯片不会对收到的数据进行封包,所以packet始终是空
via的芯片,intel的芯片会封包,packet不是空 再贴个以前的帖子给你 |
|
板凳#
发布于:2003-10-05 22:37
我的是VIA VT86926,能不能支持?
能不能给我简单介绍一下“芯片怎样对收到的数据进行封包”,谢谢! 你给的那个地址我总是连不上,麻烦你寄到我的信箱,好不好? EMAIL:longzhh1979@sina.com |
|
地板#
发布于:2003-10-05 22:57
那就搜索huyuguang的帖子吧
|
|
地下室#
发布于:2003-10-13 13:58
我的是VIA VT86926,能不能支持? 简单的说就是老的芯片不封包,直接调用PtReceive给你包的内容 好一点的芯片就封包调用PtReceivePacket 另,下载用Flashget就可以了 |
|