diff --git a/CHANGES.md b/CHANGES.md index 8e723da441..23b07833ce 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ Features -------- * [#1313](https://github.com/java-native-access/jna/issues/1313): Normalize `RESOURCE_PREFIX` for darwin to `darwin-$arch` and split jnidispatch library per architecture - [@matthiasblaesing](https://github.com/matthiasblaesing). * [#1318](https://github.com/java-native-access/jna/pull/1318): Add support for linux-risc64 - [@thentschel](https://github.com/thentschel). +* [#1327](https://github.com/java-native-access/jna/pull/1327): Add partial support for future values of `c.s.j.p.win32.WinNT.LOGICAL_PROCESSOR_RELATIONSHIP` enum present in Windows Insider builds - [@dbwiddis](https://github.com/dbwiddis). Bug Fixes --------- diff --git a/contrib/platform/src/com/sun/jna/platform/win32/WinNT.java b/contrib/platform/src/com/sun/jna/platform/win32/WinNT.java index 2a28d33a3b..2475d6ed0a 100644 --- a/contrib/platform/src/com/sun/jna/platform/win32/WinNT.java +++ b/contrib/platform/src/com/sun/jna/platform/win32/WinNT.java @@ -32,7 +32,6 @@ import com.sun.jna.PointerType; import com.sun.jna.Structure; import com.sun.jna.Structure.FieldOrder; -import com.sun.jna.platform.win32.WinNT.PSID; import com.sun.jna.Union; import com.sun.jna.ptr.ByReference; import com.sun.jna.win32.StdCallLibrary.StdCallCallback; @@ -3030,7 +3029,7 @@ public static SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX fromPointer(Pointer memory result = new GROUP_RELATIONSHIP(memory); break; default: - throw new IllegalStateException("Unmapped relationship: " + relationship); + result = new UNKNOWN_RELATIONSHIP(memory); } result.read(); return result; @@ -3253,6 +3252,24 @@ public void read() { } } + /** + * Represents information associated with a + * {@link LOGICAL_PROCESSOR_RELATIONSHIP} enum value which has not yet been + * mapped. Only the fields from {@link SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX} + * are populated. + */ + @FieldOrder({}) + public static class UNKNOWN_RELATIONSHIP extends SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX { + + public UNKNOWN_RELATIONSHIP() { + super(); + } + + public UNKNOWN_RELATIONSHIP(Pointer memory) { + super(memory); + } + } + /** * Represents a processor group-specific affinity, such as the affinity of a * thread. @@ -3359,6 +3376,30 @@ public interface LOGICAL_PROCESSOR_RELATIONSHIP { */ int RelationGroup = 4; + /** + *

+ * Upcoming value of this enum added for forward compatibility. Documentation + * will be added when available. + *

+ */ + int RelationProcessorDie = 5; + + /** + *

+ * Upcoming value of this enum added for forward compatibility. Documentation + * will be added when available. + *

+ */ + int RelationNumaNodeEx = 6; + + /** + *

+ * Upcoming value of this enum added for forward compatibility. Documentation + * will be added when available. + *

+ */ + int RelationProcessorModule = 7; + /** *

On input, retrieves information about all possible relation types. This value is not used on output.

*