[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct USB_PORT_CONNECTOR_PROPERTIES
{
public uint ConnectionIndex;
public uint ActualLength;
public uint Properties;
public ushort CompanionIndex;
public ushort CompanionPortNumber;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]
public string CompanionHubSymbolicLinkName;
}
Structure USB_PORT_CONNECTOR_PROPERTIES
Public TODO
End Structure
None.
The Properties field is a USB_PORT_PROPERTIES, which is a packed ULONG (32-bit int), as shown below.
struct {
ULONG PortIsUserConnectable : 1;
ULONG PortIsDebugCapable : 1;
ULONG PortHasMultipleCompanions : 1;
ULONG PortConnectorIsTypeC : 1;
ULONG ReservedMBZ : 28;
};
USB_PORT_CONNECTOR_PROPERTIES is obtained from an control request using DeviceIOControl.
The control code is:
public const uint IOCTL_USB_GET_PORT_CONNECTOR_PROPERTIES = 0x00220458;