Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add partial support for future values of LOGICAL_PROCESSOR_RELATIONSHIP #1327

Merged
merged 2 commits into from
Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------
Expand Down
45 changes: 43 additions & 2 deletions contrib/platform/src/com/sun/jna/platform/win32/WinNT.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -3359,6 +3376,30 @@ public interface LOGICAL_PROCESSOR_RELATIONSHIP {
*/
int RelationGroup = 4;

/**
* <p>
* Upcoming value of this enum added for forward compatibility. Documentation
* will be added when available.
* </p>
*/
int RelationProcessorDie = 5;

/**
* <p>
* Upcoming value of this enum added for forward compatibility. Documentation
* will be added when available.
* </p>
*/
int RelationNumaNodeEx = 6;

/**
* <p>
* Upcoming value of this enum added for forward compatibility. Documentation
* will be added when available.
* </p>
*/
int RelationProcessorModule = 7;

/**
* <p>On input, retrieves information about all possible relation types. This value is not used on output.</p>
*
Expand Down