Hi,

The following (XP DDK devcon sample) series of API calls ends with failure:

DeviceInfoSet = SetupDiCreateDeviceInfoList(Net Class GUID, 0)
SetupDiCreateDeviceInfo(DeviceInfoSet, (char *)class_name, &class_guid,
NULL, 0, DICD_GENERATE_ID, &DeviceInfoData)
SetupDiSetDeviceRegistryProperty(DeviceInfoSet, &DeviceInfoData,
SPDRP_HARDWAREID, (LPBYTE)hw_id, strlen(hw_id) + 2)

The last call fails and GetLastError indicates : The parameter is invalid


What can possibly fail this series of API calls , which definitely worked
for on most occasions.

Thanks,
Gadi.

Re: SetupDiSetDeviceRegistryProperty failure by Pavel

Pavel
Thu Jul 03 10:32:34 CDT 2003

<Gadi Naor> wrote in message news:%23Zo1Z8UQDHA.304@tk2msftngp13.phx.gbl...

> What can possibly fail this series of API calls , which definitely worked
> for on most occasions.

Have you enabled setupapi logging?
http://msdn.microsoft.com/library/en-us/install/hh/install/troubleshoot_7s6f.asp





Re: SetupDiSetDeviceRegistryProperty failure by news

news
Thu Jul 03 12:14:57 CDT 2003

Yes,

I added

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup\LogLevel
0x8000ffff

And the setupapi.log didn't contain any valuable information except the name
of the command I run.

Please advise on how to proceed with this.
Thanks,
Gadi.


"Pavel A." <pavel_a@geeklife.com> wrote in message
news:uemZL$WQDHA.2228@tk2msftngp13.phx.gbl...
> <Gadi Naor> wrote in message
news:%23Zo1Z8UQDHA.304@tk2msftngp13.phx.gbl...
>
> > What can possibly fail this series of API calls , which definitely
worked
> > for on most occasions.
>
> Have you enabled setupapi logging?
>
http://msdn.microsoft.com/library/en-us/install/hh/install/troubleshoot_7s6f
.asp
>
>
>
>



Re: SetupDiSetDeviceRegistryProperty failure by Eliyas

Eliyas
Thu Jul 03 12:22:56 CDT 2003

Please first change your name in the newsgroup reader profile from
"msnews.microsoft.com" to "Gadi Naor". Just imagine how you would feel if
everybody starts using the same name.

Thanks.

--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
http://www.microsoft.com/whdc/hwdev/driver/kb-drv.mspx



Re: SetupDiSetDeviceRegistryProperty failure by Eliyas

Eliyas
Thu Jul 03 12:27:21 CDT 2003

I think you are mixing unicode and ansi version functions. Try chaning the
strlen to lstrlen in the code below.

--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
http://www.microsoft.com/whdc/hwdev/driver/kb-drv.mspx
"news.microsoft.com" <Gadi Naor> wrote in message
news:%23Zo1Z8UQDHA.304@tk2msftngp13.phx.gbl...
> Hi,
>
> The following (XP DDK devcon sample) series of API calls ends with
failure:
>
> DeviceInfoSet = SetupDiCreateDeviceInfoList(Net Class GUID, 0)
> SetupDiCreateDeviceInfo(DeviceInfoSet, (char *)class_name, &class_guid,
> NULL, 0, DICD_GENERATE_ID, &DeviceInfoData)
> SetupDiSetDeviceRegistryProperty(DeviceInfoSet, &DeviceInfoData,
> SPDRP_HARDWAREID, (LPBYTE)hw_id, strlen(hw_id) + 2)
>
> The last call fails and GetLastError indicates : The parameter is invalid
>
>
> What can possibly fail this series of API calls , which definitely worked
> for on most occasions.
>
> Thanks,
> Gadi.
>
>