Skip to content

Windows is adding new Relationship values to LOGICAL_PROCESSOR_RELATIONSHIP enum #1324

Closed
@dbwiddis

Description

@dbwiddis

The existing implementation of Kernel32Util.getLogicalProcessorInformationEx() assumes that only the values 0 through 4 are possible values of the Relationship field of SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX based on existing documentation.

However, a value of 7 has been observed using Insider preview versions of Windows 10: See oshi/oshi#1554

Interestingly, the SYSTEM_LOGICAL_PROCESSOR_INFORMATION docs (which included only enum values 0,1,2,3) include this tidbit:

Future versions of Windows may support additional values for the Relationship member.

That caveat didn't extend to the _EX version but it's apparently true. The latest published SDK headers (build 20279) include values 5 and 6:

typedef enum _LOGICAL_PROCESSOR_RELATIONSHIP {
    RelationProcessorCore,
    RelationNumaNode,
    RelationCache,
    RelationProcessorPackage,
    RelationGroup,
    RelationProcessorDie,
    RelationNumaNodeEx,
    RelationAll = 0xffff
} LOGICAL_PROCESSOR_RELATIONSHIP;

This introduces a future compatibility problem because we currently throw an exception for values other than the first five in the list.

There are still only four possible mappings in the union, and the mystery enum value 7 appears to align with the PROCESSOR_RELATIONSHIP structure. One would guess that works for 5 as well, and 6 would map to the NUMA_NODE_RELATIONSHIP.

Opening this now as a reminder to track this. Not sure if we want to guess at the new mappings, but I think it might be reasonable to allow values 5, 6, and 7 to just be skipped in the iteration rather than throwing an exception.

Metadata

Metadata

Assignees

Labels

documentationUpdating site docs or javadocs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions