Jacques,
The reboot requirement is only a ‘requirement’ if the NetCfg returns that
you must reboot. In general I would have to say that no, a reboot should
not generally be required.
A common mistake in an IM driver that exposes an Auxilary Device Object is
to destroy the Auxilary Device Object in the XxxUnload() handler. The
existence of the Auxilary Device Object will cause the reference count of
the driver to be such that XxxUnload will not be called.
Because PnP and NDIS are managing the lifetime of the driver, it is
important to have a way that NDIS or NetCfg can ‘signal’ the driver to
destroy the Auxilary Device Object so that PnP can unload the driver.
One technique is to create the Aux DO when the first virtual miniport is
created and to destroy it after the last virtual miniport is destroyed. I
believe later samples of VMINI and PASSTHRU might have demonstrated this
technique. When NetCfg removes an IM driver (bindings) the virtual
miniports are removed. As with any miniport driver, when the last miniport
is removed, NDIS allows PnP to ‘attempt’ to remove the driver. If any
references to the driver remain, the driver is not unloaded. By removing
the Aux DO while when the last Virtual Miniport is destroyed, the reference
count will be in a state that will allow NDIS and PnP to unload the driver.
FYI: The ProtocolUnload() (or UnloadProtocol()) handler is another
possibility but suffers from a few bugs and other oddities. To get NetCfg
to even cause it to be called when uninstalling the NCF_NDIS_PROTOCOL
characteristic needs to be set. You might find the following thread
interesting as well.
http://groups.google.com/group/microsoft.public.development.device.drivers/b
rowse_thread/thread/4d837556167faa16/50069215885e7cda?lnk=st&q=NDIS++UnloadP
rotocol&rnum=1&hl=en#50069215885e7cda
Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development
-----Original Message-----
From: Jacques Fourie [mailto:xxxxx@trispen.com]
Sent: Monday, September 19, 2005 8:17 AM
To: Windows System Software Devs Interest List
Cc: xxxxx@msn.com
Subject: Re: [ntdev] Dynamically loading an NDIS intermediate filter driver
Hi Dave,
Our current solution (a VPN client) uses the INF install process and works
quite well if the user owns the PC on which the software is being installed.
In cases where the user only wants to run the software once a solution that
did not require the INF install path would be more desirable. In theory the
user should only run an executable which then loads the NDIS IM driver and
manages all the bindings. This would obviously require administrative
privileges but still seems a whole lot easier than the current process,
which entails running an install application and rebooting the PC.
Maybe I should ask another question and that is if the reboot step is an
absolute hard requirement when installing NDIS IM drivers the INF way? I may
be doing something wrong in the NDIS IM driver but without rebooting the
install-uninstall cycle is not always working as it should.
regards,
jacques
Obviously there are security implications but requiring administrative
privileges and running an executable still
Jacques,
You can dynamically manipulate the bindings of network components with
code
similar to the BindView sample in the DDK.
I think you will find, however, that the Net class installer (NetCfg) will
essentially require that an IM driver be installed via a pair of INF
files.
The process of ‘stacking’ IM filter drivers in a predetermined order and
ensuring exclusive bindings at the Protocol edge are all handled by
NetCfg.
The INF install process for an NDIS IM driver is pretty straight forward.
What part of this process is incompatible with your solution?
Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jacques Fourie
Sent: Monday, September 19, 2005 5:10 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Dynamically loading an NDIS intermediate filter driver
Is it possible to load an NDIS intermediate filter driver dynamically
using OpenService, StartService etc.? I can load and unload the driver
using
the above mentioned methods but I can not get the bindings to work. Is
there
a way to setup these bindings dynamically without using the .inf install
route?
Regards,
jacques
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@msn.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@trispen.com
To unsubscribe send a blank email to xxxxx@lists.osr.com