All,
I have a written a VPN client for win32 that uses virtual network devices for communications. One thing I have noticed is that creating and destroying these devices can take a long time using the setupapi and admire how a dialup adapter can remain persistent but quickly change invisible and then re-appear when activated. I’m just not sure how to accomplish this.
So, does anyone know how to perform this nifty trick?
Thanks in advance,
-Matthew
Matthew,
Do you mean ‘invisible’ in the Network Connections UI? The Dial-Up (RAS)
connections shown in the Shell Network Connections UI are not adapters but
RAS connections. However, to make a device ‘disappear’ from the Network
Connections (window) is as simple as de-enumerating the device.
Since your VPN client is most likely creating a virtual (ethernet) adapter,
look closely at NDIS Layered Miniport adapters and the two calls
NdisIMInitializeDeviceInstanceEx() / NdisIMDeInitializeDeviceInstance().
These ask NDIS to ask PnP to ‘enumerate’ or ‘deenumerate’ your miniport
which will cause it to alternately ‘appear’ and ‘disappear’ from Network
Connections.
IIRC the DDK sample src\network\ndis\ndiswdm demonstrates a bit of this.
If you have created a virtual miniport that is root enumerated, you can
achieve this result by enabling or disabling the device with ConfigMgr
(setupapi). The point is to avoid ‘create/destroy’ in favor of
‘enable/disable’ since ‘create/destroy’ do a whole lot more work (running
the binding engine, for instance).
Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@shrew.net
Sent: Monday, August 21, 2006 10:55 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Making a NDIS device Invisible …
All,
I have a written a VPN client for win32 that uses virtual network devices
for communications. One thing I have noticed is that creating and destroying
these devices can take a long time using the setupapi and admire how a
dialup adapter can remain persistent but quickly change invisible and then
re-appear when activated. I’m just not sure how to accomplish this.
So, does anyone know how to perform this nifty trick?
Thanks in advance,
-Matthew
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
David, thanks for your respons. After I thought about it some more I think I am asking the wrong question. When I said invisible I meant in ipconfig which I should have stated. I think what I really needed to ask was how can I prevent TCPIP from binding to my miniport driver. I will repost the question with a more accurate title.