I’m currently working on porting a vista driver that uses Winsock Kernel
back to XP. Consequently, I’m needing to reimplement my network interface
using TDI rather than WSK. I’m using the PCAUSA examples to help with
this, and these are good, as far as they go, but they don’t cover setting
options on the connection. My driver needs to be able to set multicast
options as well as reuseaddr and the like.
After a lot of searching, I believe that what I need to do is to send
IOCTL IRPs to TDI to set the required options. I even found
IOCTL_TDI_TL_IO_CONTROL_ENDPOINT whose data structure contains a control
type that can be set to SetSockOptIoControlType.
Unfortunately, I can’t find any documentation about the IOCTL anywhere in
the WDK or on the web. And this IOCTL still gets me only half of the way.
I also need to know about the specific IoControlCode values needed to set
my required options, which I suspect will be device-specific.
One of PCAUSA’s headers (smpltcp.h) has a number of #defines relating to
multicast options, such as AO_OPTION_ADD_MCAST and AO_OPTION_MCASTIF, but
it makes no mention of the context of these macros and they are not used
anywhere in their sample code. There is also no mention of reuseaddr and
other socket options.
Finally, the PCAUSA sample code has a function KS_TCPSetInformation which
“uses the IOCTL_TCP_SET_INFORMATION_EX call mechanism to pass a
TCP_REQUEST_SET_INFORMATION request to the underlying transport.” However
they state that it apparently has no effect, and that “It appears that
Microsoft has a proprietary interface that is more useful.” Unfortunately,
they neglect to mention what that interface is (maybe they mean Winsock
Kernel?). Does anyone know if it does in fact exist and if so where it is
documented?
Regards,
Joe.