Hi all.
I've got a problem while working with SetupApi calls.
I need to retrieve a device type from a device.
The I used to get it:
<DllImport("setupapi.dll", SetLastError:=True)> _
Public Shared Function SetupDiGetDeviceRegistryProperty( _
ByVal DeviceInfoSet As IntPtr, _
ByRef DeviceInfoData As SP_DEVINFO_DATA, _
ByVal [Property] As Win32.SetupDiGetDeviceRegistryPropertyEnum, _
ByRef PropertyRegDataType As Integer, _
ByRef PropertyBuffer As Integer, _
ByVal PropertyBufferSize As Integer, _
ByRef RequiredSize As Integer) As Boolean
End Function
Dim result As Int32
Dim RequiredSize As Integer
Dim DataType As Integer = 4
Dim returnVal As Boolean = Win32.SetupDiGetDeviceRegistryProperty(hDevInfo, DevInfoData, Win32.SetupDiGetDeviceRegistryPropertyEnum.SPDRP_DEVTYPE, _
DataType, result, 4, RequiredSize)
But returnVal is always FALSE, and I'm getting an win32error 13 (ERROR_INVALID_DATA).
I don't know what I am doing wrong, because I can get other properties.
Suggestions??
Thanks