// usbpmapi.h
typedef struct _USBPM_CONNECTOR_STATE {
USBPM_CONNECTOR ConnectorHandle;
ULONG ChangeToken;
BOOLEAN Attached;
ULONG AttachCount;
USBC_PARTNER Partner;
USBC_CURRENT CurrentAdvertisement;
USBC_PD_CONN_STATE PdConnState;
USBC_PD_REQUEST_DATA_OBJECT Rdo;
USBC_DATA_ROLE DataRole;
USBC_POWER_ROLE PowerRole;
UINT8 SourceCapsCount;
USBC_PD_POWER_DATA_OBJECT SourceCaps[USBPM_MAX_CAPS_COUNT];
UINT8 SinkCapsCount;
USBC_PD_POWER_DATA_OBJECT SinkCaps[USBPM_MAX_CAPS_COUNT];
UINT8 PartnerSourceCapsCount;
USBC_PD_POWER_DATA_OBJECT PartnerSourceCaps[USBPM_MAX_CAPS_COUNT];
ULONG PdAlternateModesEnteredCount;
} USBPM_CONNECTOR_STATE, *PUSBPM_CONNECTOR_STATE;
View the official Windows Driver Kit DDI referenceNo description available.
Describes the state of a connector. This structure is used in the UsbPm_RetrieveConnectorState call. The client driver must initialize this structure by calling USBPM_CONNECTOR_STATE_INIT.
ConnectorHandleA handle to this connector.
ChangeTokenThe change token number of this state. This value is changed for every connector state change.
AttachedIndicates whether this connector is attached.
AttachCountIndicates the number of attached events that have occurred on this connector. If client driver sees the transition from one “Attached” state to another “Attached” state but with different “AttachCount”, it indicates two attaches and with two different port partners.
PartnerThe type of the port partner, defined in the USBC_PARTNER enumeration.
CurrentAdvertisementThe amount of Type-C current advertised.
PdConnStateIndicates the PD contract state over the connection on this connector.
RdoThe PD Request Data Object that has sent to the port partner of this connector. See USBC_PD_REQUEST_DATA_OBJECT.
DataRoleIndicates the USB Type-C data role of the connector, defined in the USBC_DATA_ROLE enumeration.
PowerRoleIndicates the USB Type-C power role of the connector, defined in the USBC_POWER_ROLE enumeration.
SourceCapsCountThe number of power data objects in the source caps array.
SourceCapsThe source capabilities of the connector. See USBC_PD_POWER_DATA_OBJECT.
SinkCapsCountThe number of power data objects in the corresponding array.
SinkCapsThe sink capability of the connector. See USBC_PD_POWER_DATA_OBJECT.
PartnerSourceCapsCountThe number of power data objects in the corresponding array.
PartnerSourceCapsThe source capabilities of the port partner in the corresponding array. See USBC_PD_POWER_DATA_OBJECT.
PdAlternateModesEnteredCountThe number of alternate modes entered.