Gig*_*tti 3 windows ndis driver wdk windows-kernel
我目前正在尝试使用Windows 驱动程序示例中的 NDIS 筛选器驱动程序发送我自己的数据包。
我认为我必须使用该功能发送数据包FilterSendNetBufferLists。但我不知道如何创建这些数据包,也不知道是否应该将它们添加到现有的 NetBufferList 中或创建自己的数据包。
我还需要修改功能吗FilterSendNetBufferListsComplete?
NdisAllocateNetBufferListPool. 对于典型用法,您需要为每个 NBL 自动获取一个 NET_BUFFER (NB),因此设置fAllocateNetBuffer=TRUE。如果您希望 NDIS 为您分配数据有效负载缓冲区,请同时指定一个非零的 DataSize。如果您已经在其他缓冲区中拥有数据包有效负载,则可以通过将 NB 指向现有的 MDL 来更快地传输,但这也使编码更加复杂。NdisAllocateNetBufferAndNetBufferList。将 FilterModuleHandle 放入 NBL->SourceHandle 中。分配 NB->DataLength 并复制数据。在新 NBL 上调用 NdisFSendNetBufferLists。在将 NBL 返还给您之前,请勿触摸它。FilterSendNetBufferListsComplete. Note that all NBLs come through there in one jumbled linked list -- both your own NBLs, as well as any NBLs you just passed through from above. So you have to slice the linked list based on NBL->SourceHandle: if the SourceHandle is yours, take the NBL out of the stream and free it via NdisFreeNetBufferList. Otherwise, if the NBL is not yours, continue propagating it along by calling NdisFSendNetBufferListsComplete.When you're creating NBLs, you can use !ndiskd.nbl to double-check your work. It can detect a variety of errors. There's a likely problem with the NBL if ndiskd reports any field in red text.
| 归档时间: |
|
| 查看次数: |
821 次 |
| 最近记录: |