I started to update the NUMA_NODE_RELATIONSHIP structure as mentioned in https://github.com/java-native-access/jna/issues/1324
The docs have been updated at https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-numa_node_relationship to show what is available in Windows Insider headers and will be in a future release.
The use of the last two bytes of “Reserved” isn’t a problem; simply adding a field. However, the singular field GROUP_AFFINITY GroupMask is now an array: GROUP_AFFINITY[] GroupMasks. (Technically it’s a union with one or the other.)
Handling it in a new structure is easy; we initialize it with size 1 which has the space for the existing GroupMask. However, any users relying on that would need to update their code to now refer to GroupMasks[0].
Implementing the union as the API has it doesn’t really provide added value for the variable size array and still breaks compatibility on the Java side.
The only non-API-breaking way to handle it that I can think of is to leave the GroupMask field and potentially add another array field after this; however, this would possibly be zero-sized which doesn’t work well either.
I’m leaning toward the non-backwards-compatible route, with a note in the change log. Any better ideas?
Just thought of a possible solution. Include both fields and override getFieldList() and getFieldOrder() to remove the one not used. We’d still need to do some sort of test on the build number to switch between them.