質問

I'm working on a NAT-like software in Windows platform by modifying the original passthru example in Windows WDK.

Here're several network adapters in my machine, and I wanna analyze every packet I received then decide which adapter to forward the packet to. There comes the problem: I don't know how to specify the adapter for sending when calling the NdisSend function.

As follows, there's a BindingHandle arg in NdisSend, but in my understanding it should stand for all the adapters in passthru(may not right:)

NdisSend(&Status, pAdapt->BindingHandle, MyPacket);

So how to specify a adapter like this form :{62E9DB05-88D3-479D-A194-22D6A591DB96} when calling NdisSend?

Very thx..

役に立ちましたか?

解決

I think the clue is pAdapt->BindingHandle, so pAdapt is a pointer to a structure that contains all adapter-specific information, including a BindingHandle. So each adapter has a different BindingHandle, and that's how you control which adapter gets the packet.

Also you might want to investigate if you can use WFP instead of NDIS for you driver.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top