uia0702
驱动牛犊
驱动牛犊
  • 注册日期2007-04-08
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分90分
  • 威望10点
  • 贡献值0点
  • 好评度9点
  • 原创分0分
  • 专家分0分
阅读:1089回复:0

ds高手请进!

楼主#
更多 发布于:2007-05-13 21:03
  本人开发一个中间层加密的驱动,开发平台是vc+ddk+ds。
由于ds框架隐藏了很多东西,所以到现在为止,我还只能对发出去的包进行加密。
其分包接受函数:OnReceive(
    IN OUT KNdisPartialPacket& PacketToAccept,
    IN PVOID HeaderBuffer, IN UINT HeaderBufferSize,
    IN PVOID LookAheadBuffer, IN UINT LookaheadBufferSize,
    IN UINT PacketSize)

文档Comments:
The framework calls this version of OnReceive( ) when the underlying real NIC miniport uses partial receive packet indications (e.g., see KNdisLookahead). Non-bus mastering NIC miniports may use this form of packet indication. This method, thus, is the way for the filter adapter to inspect the packet received by the real NIC before the framework forwards it up to the bound protocol(s). The driver might override the content of the indicated packet or even drop it altogether. If the client is interested in looking into the remainder of the packet, it could assign the supplied empty PacketToAccept to a real packet descriptor allocated from a private packet pool. Then the framework would attempt to TransferData into the supplied packet and call the filter's OnTransferComplete( ) method. The default implementation returns NDIS_STATUS_SUCCESS, which passes the packet up.

这最后3句话我没理解,如OnTransferComplete( )是个如Onreceive的虚函数?哪位高手帮我解释下,它的思路是什么?(个人理解:我们可以将packtoaccept初始化,此时框架会将数据传到packtoaccept,并且框架会调用OnTransferComplete( )。默认的操作是返回NDIS_STATUS_SUCCESS,并将packtoaccept传递上去。)
希望哪位大侠能给我一个思路。
游客

返回顶部