In Windows NDIS's passthru example, how to send a NDIS_PACKET with a specific adapter?

StackOverflow https://stackoverflow.com/questions/13780472

سؤال

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