Hi,
I have some PCI device, which is disabled by default but can be enabled
by software. I want for my driver to start work with this device when my
software enabled it. I also want to prevent appearance of “driver setup”
dialog to user.
I think that the best method to do this is to register my driver as
driver for this device just before enabling the device and removing and
uninstalling of driver after the device disabled… Can anyone advise,
how can I do this from my software without usage of inf file?
I tried to follow the DDK samples, but I got a number of problems:
-It still needs the Inf file.
-how can I know instance name for device when windows will add it? I
cannot supply a good name to SetupDiCreateDeviceInfo.
-After I call SetupDiBuildDriverInfoList, SetupDiEnumDriverInfo returns
ERROR_NO_MORE_ITEMS in first call( with 0 item number ) too.
Lev Zlotin
Ignoring the question of just how you are going to enable/disable this
device from software, the best method for supporting this hotplug device is
the same way you would support any other hotplug device: install the driver
as the function driver for the device using the standard mechanisms and
allow the system to add remove instances of the device as normal.
Install/uninstall around enable/disable is not a good idea and is not the
normal approach. Consider a usb device: would you want the system to
install/uninstall the driver for this device every time you
plugged/unplugged it into the system?
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Zlotin, Lev
Sent: Monday, May 22, 2006 5:19 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] “Hot plug” driver setup
Hi,
I have some PCI device, which is disabled by default but can be enabled
by software. I want for my driver to start work with this device when my
software enabled it. I also want to prevent appearance of “driver setup”
dialog to user.
I think that the best method to do this is to register my driver as
driver for this device just before enabling the device and removing and
uninstalling of driver after the device disabled… Can anyone advise,
how can I do this from my software without usage of inf file?
I tried to follow the DDK samples, but I got a number of problems:
-It still needs the Inf file.
-how can I know instance name for device when windows will add it? I
cannot supply a good name to SetupDiCreateDeviceInfo.
-After I call SetupDiBuildDriverInfoList, SetupDiEnumDriverInfo returns
ERROR_NO_MORE_ITEMS in first call( with 0 item number ) too.
Lev Zlotin
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
For me, it would be much easier to always load the driver to do-nothing
mode, but only enable it when it is needed.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Zlotin, Lev”
To: “Windows System Software Devs Interest List”
Sent: Monday, May 22, 2006 1:18 PM
Subject: [ntdev] “Hot plug” driver setup
Hi,
I have some PCI device, which is disabled by default but can be enabled
by software. I want for my driver to start work with this device when my
software enabled it. I also want to prevent appearance of “driver setup”
dialog to user.
I think that the best method to do this is to register my driver as
driver for this device just before enabling the device and removing and
uninstalling of driver after the device disabled… Can anyone advise,
how can I do this from my software without usage of inf file?
I tried to follow the DDK samples, but I got a number of problems:
-It still needs the Inf file.
-how can I know instance name for device when windows will add it? I
cannot supply a good name to SetupDiCreateDeviceInfo.
-After I call SetupDiBuildDriverInfoList, SetupDiEnumDriverInfo returns
ERROR_NO_MORE_ITEMS in first call( with 0 item number ) too.
Lev Zlotin
—
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