I have a pair of device drivers that support a special pci card.
Main driver claims resources whereas secondary device is dependent
on main device and does not claim any resources but connects to
interrupt. These have worked fine under NT4. I can stop secondary
device any time there is no active open. Naturally, “net stop” command
on primary device requests that dependent device is also stopped, if still
active. This all works fine.
Under Win2K the secondary device can be shut down any time but
attemp to shut down primary device driver with “net stop” results in
message: “The requested pause or stop is not valid for this service”.
After looking at control panel / admin tools, I was able to find device
driver and had the option to disable it but this action required a system
restart. This is not satisfactory.
These two device drivers are not PnP compliant so suspecting this to
be the issue I attempted to do same with “parport” driver stack which
presumably is PnP compliant. “net stop parport” resulted in request
to shutdown dependent driver “parvdm”, which when approved did
shut down “parvdm” but same error message was issued for “parport”
driver. Interestingly enough “parallel” driver is also dependent on
“parport” but was not shown to be at initial attempt to shutdown
“parport”.
Question 1. Why this behavior with “net stop” command?
Question 2. What is acceptable Win2K method to dynamically
control drivers, ie. start/stop? Would ServiceControlManager
apis be also affected?
Question 3. If a restart is a requirement then why this retrograde step
in evolution of NT?
ned
Ned Kacavenda wrote:
These two device drivers are not PnP compliant so suspecting this to
be the issue I attempted to do same with “parport” driver stack which
presumably is PnP compliant. “net stop parport” resulted in request
to shutdown dependent driver “parvdm”, which when approved did
shut down “parvdm” but same error message was issued for “parport”
driver. Interestingly enough “parallel” driver is also dependent on
“parport” but was not shown to be at initial attempt to shutdown
“parport”.
With PnP drivers, disabling the parent device in the Device Manager also
disables child devices and trys to remove their drivers from memory. A
reboot would be needed only if there is some reason (such as an open
handle) why the drivers can’t be removed. The paper
http://www.microsoft.com/hwdev/tech/PnP/no_reboot.asp gives additional
reasons why reboots may be required after actions in the Device Manager.
I only use the service control manager for legacy-type drivers, that
create their device objects in DriverEntry. This mechanism *does* still
work in Win2K, but all handles and references to the driver’s device
objects (apart from the residual reference that IoDeleteDevice will
remove) have to be gone for a NET STOP to be successful.
–
Walter Oney, Consulting and Training
Check out new US seminar schedule at http://www.oneysoft.com
Walter Oney wrote:
With PnP drivers, disabling the parent device in the Device Manager also
disables child devices and trys to remove their drivers from memory. A
reboot would be needed only if there is some reason (such as an open
handle) why the drivers can’t be removed. The paper
http://www.microsoft.com/hwdev/tech/PnP/no_reboot.asp gives additional
reasons why reboots may be required after actions in the Device Manager.
The drivers were installed using an INF file. INF file does not specify
any Reboot option. Only flag used for CopyFile is 0x0000002. In any case
this would only affect installation process.
During normal operation, only one Win32 component opens and interacts
with two device objects created. No such component was in place to prevent
driver shutdown. It things were otherwise then even the secondary device
would not have been available for shut down.
I only use the service control manager for legacy-type drivers, that
create their device objects in DriverEntry. This mechanism *does* still
work in Win2K, but all handles and references to the driver’s device
objects (apart from the residual reference that IoDeleteDevice will
remove) have to be gone for a NET STOP to be successful.
What Apis are available to use the alternative Device Manager mechanism?
Surely I should be able to install/start/stop/uninstall under program control.
Device Manager as available in GUI only allows enable/disable control.
Ned Kacavenda wrote:
What Apis are available to use the alternative Device Manager mechanism?
Surely I should be able to install/start/stop/uninstall under program control.
Device Manager as available in GUI only allows enable/disable control.
Take a look at the DEVCON sample in the DDK, which shows how to use the
SetupDiXxx functions to do stuff like that.
–
Walter Oney, Consulting and Training
Check out new US seminar schedule at http://www.oneysoft.com