0

The Microsoft documentation for the DISPLAYCONFIG_TARGET_DEVICE_NAME struct has this to say about its connectorInstance member:

The one-based instance number of this particular target only when the adapter has multiple targets of this type. The connector instance is a consecutive one-based number that is unique within each adapter. If this is the only target of this type on the adapter, this value is zero.

When I have a single monitor connected to a video card, I get back a 1 in this field. However, when I have multiple monitors connected to a video card, I get a 0 in this field for each of them.

I was expecting this to be 1... 2... 3..., etc. What's more, the code based upon this assumption has been in production for over a year with no reported issues. Then within the last month or two we suddenly got a flood of user support issues that boil down to our getting zero back for all connected monitors (for users with multiple monitors). Maybe that's coincidence, but it makes me wonder if some behavior changed on the Windows side of things...

...only when the adapter has multiple targets of this type. ... If this is the only target of this type on the adapter, this value is zero.

Maybe I'm misunderstanding what's meant here by 'type'. It's kind of vague, so it could be referring to something in the EDID, or some combination of attributes... bleh.

Anyone familiar enough with the DisplayConfigGetDeviceInfo(...) API to provide any insight on this?

Scott Smith
  • 3,900
  • 2
  • 31
  • 63
  • Could a display driver update cause this? If so, all reports should come from AMD/Nvidia/Intel systems... – Anders Mar 21 '22 at 23:47
  • Please provide a [mcve] showing how your code is trying to use `DISPLAYCONFIG_TARGET_DEVICE_NAME`. – Remy Lebeau Mar 22 '22 at 00:15
  • 1
    You can use this code to test: https://stackoverflow.com/questions/66155083/windows-api-to-get-whether-hdrhigh-dynamic-range-is-active connectorInstance is only meaningful when you have multiple connector of the same type, eg: two HDMI output on the same adapter. I you have one HDMI and one DISPLAYPORT on the same adapter, you will have 0 for both. What's strange is to get 1 if you have only one monitor connected... (note a monitor that is off is still a connected monitor) – Simon Mourier Mar 22 '22 at 07:55
  • @SimonMourier - OK, so '**type**' here refers to `DISPLAYCONFIG_TARGET_BASE_TYPE.baseOutputTechnology`? That would make some sense. I'll file a change request with the Microsoft documentation folks. – Scott Smith Mar 22 '22 at 12:43
  • @RemyLebeau - I didn't include a code example here, because it would be massive, and kind of pointless; I've verified this behavior in our app, and in a completely independently-coded test jig. This issue is really focused on the apparent mismatch between the documented behavior and the observed behavior. – Scott Smith Mar 22 '22 at 12:50
  • @Anders - Could have been caused by a driver update. If SimonMourier is correct, then it may be that something got fixed in a driver update and the incorrect assumption in our code stopped working as a result... – Scott Smith Mar 22 '22 at 12:55

0 Answers0