Hi,
The following code works on some m/c (win200) but not on all m/c’s.
===
deviceListHandle = SetupDiGetClassDevs( NULL, DEVICE_ENUMERATOR, //“USB”
NULL,DIGCF_ALLCLASSES);
if(deviceListHandle != INVALID_HANDLE_VALUE )
{
index = 0;
do
{
// Get the device info data
fSuccess = SetupDiEnumDeviceInfo(deviceListHandle,index++, &deviceInfoData);
if(!fSucccess)
break;
fSuccess = SetupDiGetDeviceRegistryProperty(deviceListHandle,
&deviceInfoData,
SPDRP_HARDWAREID,
&type,
(PBYTE)hardwareID,
sizeof(hardwareID),
&requiredSize);
if(!fSuccess)
{
printf(“SetupDiGetDeviceRegistryProperty failed with error %d \n”, GetLastError());
break;
}
…
}while (fSuccess);
}
On one of the m/c(win2k) I get:
SetupDiGetDeviceRegistryProperty failed with error 13 (data is invalid).
On the other m/c it lists all the hardware ids.
If a class GUID, say standard USB class GUID, is given as follows:
deviceListHandle = SetupDiGetClassDevs( USB_GUID, DEVICE_ENUMERATOR, //“USB”
NULL,0);
then it works on the m/c that fails with the previous code.
Is there any security bit set that disables accessing the devices of all Class GUIDs on the failing m/c.
What is different in the two m/c’s that is resulting in the different behaviour? (both have SP3 installed).
THanks in advance.