I have a device coinstaller that handles DIF_INSTALLDEVICE. While
processing DIF_INSTALLDEVICE, the coinstaller calls SetupDiOpenDevRegKey to
open the hardware key so it can write some registry entries prior to the
device starting.
I am getting an error from SetupDiOpenDevRegKey: 0xe0000204
(ERROR_KEY_DOES_NOT_EXIST). I am passing SetupDiOpenDevRegKey the HDEVINFO
and PSP_DEVINFO_DATA parameters being passed to the coinstaller function:
hDeviceKey = SetupDiOpenDevRegKey(hdiDeviceInfoSet, psdidDeviceInfoData,
DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_ALL_ACCESS);
I did see a thread about a similar-sounding problem on one of the
newsgroups, but there did not appear to be a resolution.
Is there a restriction as to when I can use SetupDiOpenDevRegKey to open the
hardware key (i.e., am I trying to access it too soon)? Is there a better
point in the install process to do this? As long as I can write the
registry entries so they exist when the device is started, that’s all that
matters. I’d do it in the INF, but I need to have unique data for each card
in the system.
The funny thing is, this has worked in the past on multiple machines. Of
course, that doesn’t mean anything in the world of debugging… it just
makes me wonder if it is, in fact, a timing issue.
Thank you!
-Dan