Can't install driver using UpdateDriverForPlugAndPlayDevices
-
Friday, April 13, 2012 2:29 PM
Hello,
I oringally asked this question in the general windows development forum but was redirected here. (My original post is (here)). The problem now seems that the simple command line program which I've written to install a custom miniport port driver for AHCI HBAs is failing to install to the driver store. The irritating thing is, it works on some machines and not on others.
When it fails, I get error e0000247 which is defined in SetupApi.h as ERROR_DRIVER_STORE_ADD_FAILED. To add to the irritation, I can point to the inf file I've made for these drivers (there's a 32 and 64 bit version) and install the driver, even on these machines that my command line program fails for, using the update driver dialog/wizard in Device Management. So, why would I get the error using my command line program when I can install using the wizard just fine?
My command line program is by no means complicated. My install steps are:
1) Attempt driver rollback (DiRollbackDriver(hDevSet, devInfo.DevInst, NULL, ROLLBACK_FLAG_NO_UI, &reboot))
2) Attempt driver install (UpdateDriverForPlugAndPlayDevices(NULL, hardwareId, pathToInf, INSTALLFLAG_FORCE | INSTALLFLAG_NONINTERACTIVE, &reboot))
That's it. The install targets thus far are Windows 7 32 and 64 bit machines. I'm seeing the same behavior on both platforms. In both cases, I've attempted the install to 3 machines (6 total). I can successfully install to only 1 of them (ironically, the first one I try to install to) using the command line installer, but the rest I cannot except through the update driver wizard.
Please help me understand what it is I'm missing regarding driver installation. Thanks.
Andy
All Replies
-
Friday, April 13, 2012 3:23 PM
Have you checked setupapi.dev.log for the error details? what are these?
And why DPInst or devcon do not work for you?
-- pa
-
Friday, April 13, 2012 10:29 PM
I will check the logs of the most recent machine on which I tried this installer. Another machine on which I tried this the setupapi log didn't show anything of consequence.
As for DPInst and devcon, I didn't even know about DPInst nor did I know that devcon could be used for installing drivers. I wrote this program because we have a need to install the driver for only specific HBAs instead of all HBAs on the system.
Andy
-
Sunday, April 15, 2012 3:54 AMOwneryou can't redist devcon as is though, you must use your own copy of it and your own name
d -- This posting is provided "AS IS" with no warranties, and confers no rights.


