[StructLayout(LayoutKind.Sequential)]
struct SP_DEVINFO_DATA
{
public uint cbSize;
public Guid classGuid;
public uint devInst;
public IntPtr reserved;
}
<StructLayout(LayoutKind.Sequential)> _
Private Structure SP_DEVINFO_DATA
Public cbSize As Integer
Public classGuid As Guid
Public propertyId As Integer
Public reserved As IntPtr
End Structure
cbSize, Size of the structure, in bytes.
classGuid, GUID of the device interface class.
devInst, Handle to this device instance.
reserved, do not use.
None.
On 32bit platforms, all SetupApi structures are 1-Byte packed. On 64bit platforms the SetupApi structures are 8-byte packed. IE for 32 bit SP_DEVINFO_DATA.cbSize=28, for 64Bit SP_DEVINFO_DATA.cbSize=(28+4)=32.
(Or, is it because the size of the Reserved pointer is 4 bytes vs 8 bytes ?)