Error_invalid_data Setupdigetdeviceregistryproperty

Posted on by

Error_invalid_data Setupdigetdeviceregistryproperty 8,1/10 3004votes

BOOL SetupDiGetDeviceProperty( _In_ HDEVINFO DeviceInfoSet, _In_ PSP_DEVINFO_DATA DeviceInfoData, _In_ const DEVPROPKEY *PropertyKey, _Out_ DEVPROPTYPE *PropertyType, _Out_opt_ PBYTE PropertyBuffer, _In_ DWORD PropertyBufferSize, _Out_opt_ PDWORD RequiredSize, _In_ DWORD Flags ); Parameters DeviceInfoSet [in] A handle to a that contains a device instance for which to retrieve a device instance property. DeviceInfoData [in] A pointer to the structure that represents the device instance for which to retrieve a device instance property. PropertyKey [in] A pointer to a structure that represents the device property key of the requested device instance property.

The SetupDiSetDeviceInterfaceProperty function sets a device property of a device interface. Disabling device. Ask Question. // get all devices info while(!SetupDiGetDeviceRegistryProperty. } if(GetLastError() == ERROR_INVALID_DATA).

PropertyType [out] A pointer to a -typed variable that receives the property-data-type identifier of the requested device instance property, where the property-data-type identifier is the bitwise OR between a base-data-type identifier and, if the base-data type is modified, a property-data-type modifier. PropertyBuffer [out, optional] A pointer to a buffer that receives the requested device instance property. SetupDiGetDeviceProperty retrieves the requested property only if the buffer is large enough to hold all the property value data. The pointer can be NULL. If the pointer is set to NULL and RequiredSize is supplied, SetupDiGetDeviceProperty returns the size of the property, in bytes, in * RequiredSize. PropertyBufferSize [in] The size, in bytes, of the PropertyBuffer buffer. If PropertyBuffer is set to NULL, PropertyBufferSize must be set to zero.

Error_invalid_data Setupdigetdeviceregistryproperty

RequiredSize [out, optional] A pointer to a DWORD-typed variable that receives the size, in bytes, of either the device instance property if the property is retrieved or the required buffer size if the buffer is not large enough. Gigaware Usb To Ethernet Windows 7 Driver. This pointer can be set to NULL. Flags [in] This parameter must be set to zero. Return value SetupDiGetDeviceProperty returns TRUE if it is successful. Otherwise, it returns FALSE, and the logged error can be retrieved by calling. The following table includes some of the more common error codes that this function might log.

Error_invalid_data Setupdigetdeviceregistryproperty

Return code Description ERROR_INVALID_FLAGS The value of Flags is not zero. ERROR_INVALID_HANDLE The device information set that is specified by DevInfoSet is not valid. ERROR_INVALID_PARAMETER A supplied parameter is not valid. One possibility is that the device information element is not valid. ERROR_INVALID_REG_PROPERTY The property key that is supplied by PropertyKey is not valid. ERROR_INVALID_DATA An unspecified internal data value was not valid. ERROR_INVALID_USER_BUFFER A user buffer is not valid.

One possibility is that PropertyBuffer is NULL and PropertBufferSize is not zero. ERROR_NO_SUCH_DEVINST The device instance that is specified by DevInfoData does not exist. ERROR_INSUFFICIENT_BUFFER The PropertyBuffer buffer is too small to hold the requested property value, or an internal data buffer that was passed to a system call was too small.

ERROR_NOT_ENOUGH_MEMORY There was not enough system memory available to complete the operation. Future Loops Distance Dubstep Artist. ERROR_NOT_FOUND The requested device property does not exist. ERROR_ACCESS_DENIED The caller does not have Administrator privileges.

Remarks SetupDiGetDeviceProperty is part of the. SetupAPI supports only a Unicode version of SetupDiGetDeviceProperty. To obtain the device property keys that represent the device properties that are set for a device instance, call. To set a device instance property, call. Requirements Target platform Desktop For, call Version Available in Windows Vista and later versions of Windows. Header SetupAPI.h (include SetupAPI.h) Library SetupAPI.lib DLL SetupAPI.dll Unicode and ANSI names SetupDiGetDevicePropertyW (Unicode) See also.

Hello, I'm working to update a WDM Functionaldriver for an USB device from XP to Vista and Seven OS. The existing CoInstaller uses SetupDiGetDeviceRegistryProperty API to get the UI_NUMBER of the device and uses it to build an indexed Friendlyname. I'm using WDK 7600.16385.1 Windows Server 2003 x86 build environment and the code is based on the 'bulkusb' sample of a previous DDK (3790.1830). This is working fine in XP but the call to SetupDiGetDeviceRegistryProperty fail under Vista and Seven. Did the API specifications have changed? Did the underlying Bus driver always provide this property?

Is there a different way to get this information in Vista and Seven? Thanks in advance for your help.