草庐IT

SetupDiGetDeviceRegistryProperty

全部标签

c - SetupDiGetDeviceRegistryProperty : "The data area passed to a system call is too small" error

我有一个使用SetupAPI在WindowsXP上枚举USB设备的代码:HDEVINFOhDevInfo=SetupDiGetClassDevs(&_DEVINTERFACE_USB_DEVICE,0,0,DIGCF_DEVICEINTERFACE|DIGCF_PRESENT);for(DWORDi=0;;++i){SP_DEVINFO_DATAdevInfo;devInfo.cbSize=sizeof(SP_DEVINFO_DATA);BOOLsucc=SetupDiEnumDeviceInfo(hDevInfo,i,&devInfo);if(GetLastError()==ERRO