I'am developing an application which requires to dynamically update
the TCP/IP protocol settings for a WLAN card, such as DHCP
enabled/disabled, APIPA enabled/disabled, setting IP address, setting
Subnetmask, etc. The program shall run under XP SP1.
I came to the conclusion that I need to provide my own
IntermediateDriver, such as NDISUIO and extend it by my private IOCTL
to rebind an adapter. I've been using the NDISPROT DDK example as a
starting point. (NDISPROT and NDISUIO are basically the same, there is
only very little difference. NDISPROT comes with Server2003 DDK,
whereas NDISUIO comes with XP DDK). Anyway, the NDISPROT IM driver is
running on my XP/SP1 system already.
In nuiouser.h I have defined:
#define IOCTL_NDISPROT_REBIND_ADAPTER \
_NDISPROT_CTL_CODE(0x206,METHOD_BUFFERED,FILE_READ_ACCESS |
FILE_WRITE_ACCESS)
The plan is to call this IOCTL from the application, which also works
already. Now, I stuck a bit, as I dont know much enough about the
inner working of NDIS. My initial idea was, to invoke:
1) ProtocolUnbindAdapter, and
2) ProtocolBindAdapter
from within the 'NdisProtIoControl' function (equals
'NdisuioIoControl' in NDISUIO sample) in ntdisp.c file.
Unfortunatly, I dont know what paramters to use when calling them.
VOID ProtocolBindAdapter(
OUT PNDIS_STATUS Status,
IN NDIS_HANDLE BindContext, //what shall I use here???
IN PNDIS_STRING DeviceName, //what shall I use here???
IN PVOID SystemSpecific1, //what shall I use here???
IN PVOID SystemSpecific2
);
VOID ProtocolUnbindAdapter(
OUT PNDIS_STATUS Status,
IN NDIS_HANDLE ProtocolBindingContext, //what shall I use
here???
IN NDIS_HANDLE UnbindContext //what shall I use here???
);
Can anyone help me on my problem? Does anyone has some example, on how
they have done a similar solution? (PS: WINCE already does have a
REBIND IOCTL, but I doubt that it helps for XP system...)
I'm a still on the right track for dynamically re-initailising the IP,
DHCP stuff?