Stephan
Thu Oct 12 10:39:45 CDT 2006
Several things come to mind:
- What's wrong with the driver getting unloaded?
- IIRC, the driver will not get unloaded as long as the driver
maintains a "private" device object, which it created using
NdisMRegisterDevice(). Thus, if you call NdisMRegisterDevice() from
DriverEntry(), you will not get unloaded unless you call
NdisMDeregisterDevice().
- If that does not help, simply open a file handle from your user-mode
program to the miniport and keep it open. You can use either a private
or the miniport's standard device object (owned by NDIS, see e.g.
http://www.ndis.com/faq/QA10290101.htm).
- Also, driver unload can be detected by the miniport in an unload
handler, see NdisMRegisterUnloadHandler().
- Using IO/ controls to a "private" device object is actually a perfect
way to tell the miniport about new configuration parameters and/or to
trigger a re-read of registry settings.
- More, a miniport *can* read its registry settings even after
MiniportInitialize(). The important part is that everything must be
done at IRQL PASSIVE_LEVEL. If necessary, this can be achieved by using
a work item callback, see NdisScheduleWorkItem().
Stephan