Virtual adapter, change IP address through registry, enable/disable?
- From: "Benoît Bousquet" <bbousquet@xxxxxxxxxxxxxxxx>
- Date: Wed, 9 Nov 2005 15:29:57 -0500
Greetings.
I have a virtual adapter based on the NetVMini sample from the XP DDK. I
have been using it (successfully) for tunneling, using IpHlpApi calls to
add/delete IP addresses. However, this implies that the adapter has a dummy
first address (DHCP off, so it usually sits there as 0.0.0.0). I would like
to be able to change the primary address on the adapter instead of adding a
second one when needed. I have seen some virtual adapters who do this exact
thing and I'm wondering what steps are involved.
I know that the following works:
- disable virtual adapter in device manager
- make registry changes in
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{.......}
- enable virtual adapter in device manager
This is rather slow, however, and I was hoping a similar effect could be
obtained by using Windows' media sensing mechanism. I thus tried the
following:
- internally set my connection status to "disconnected" (this is what my
virtual adapter responds to an OID_GEN_MEDIA_CONNECT_STATUS query)
- indicate NDIS_STATUS_MEDIA_DISCONNECTED with NdisMIndicateStatus
- make registry changes, as above
- internally set my connection status to "connected"
- indicate NDIS_STATUS_MEDIA_CONNECTED with NdisMIndicateStatus
Sadly, although this is way faster than the first option, the new IP
information does not seem to get fetched from the registry.
I did some OID debugging and saw that the only OID_GEN_MEDIA_CONNECT_STATUS
(0x00010114) request my adapter received was when I ran IPCONFIG (which
queries the adapters directly). Furthermore, my calls to NdisMIndicateStatus
do not have much of an impact on the way Windows behaves with the adapter
(GetIfEntry's dwOperStatus goes from "Operational" to "Non Operational").
Any ideas?
-----
Benoît Bousquet
.
- Follow-Ups:
- Re: Virtual adapter, change IP address through registry, enable/disable?
- From: Ajay Agrawal
- RE: Virtual adapter, change IP address through registry, enable/disable?
- From: "Bryan S. Burgin [MSFT]"
- Re: Virtual adapter, change IP address through registry, enable/disable?
- Prev by Date: Re: DIFXAPP not uninstalling active driver
- Next by Date: Re: Help testing a dll
- Previous by thread: Re: Can a driver change the IRP major function code?
- Next by thread: RE: Virtual adapter, change IP address through registry, enable/disable?
- Index(es):
Relevant Pages
|