Skip to content

Commit

Permalink
Bump net.java.dev.jna:jna from 5.13.0 to 5.14.0 (#3083)
Browse files Browse the repository at this point in the history
* Bump net.java.dev.jna:jna from 5.13.0 to 5.14.0

Bumps [net.java.dev.jna:jna](https://github.com/java-native-access/jna) from 5.13.0 to 5.14.0.
- [Changelog](https://github.com/java-native-access/jna/blob/master/CHANGES.md)
- [Commits](java-native-access/jna@5.13.0...5.14.0)

---
updated-dependencies:
- dependency-name: net.java.dev.jna:jna
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Fix overridden method

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sheikah45 <[email protected]>
Co-authored-by: Sheikah45 <[email protected]>
  • Loading branch information
3 people authored Mar 9, 2024
1 parent f87ddcc commit 31536fb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ dependencies {
implementation("com.github.FAForever.faf-java-commons:faf-commons-lobby:${commonsVersion}")
implementation("com.google.guava:guava:33.0.0-jre")
implementation("org.apache.commons:commons-compress:1.26.0")
implementation("net.java.dev.jna:jna:5.13.0")
implementation("net.java.dev.jna:jna-platform:5.13.0")
implementation("net.java.dev.jna:jna:5.14.0")
implementation("net.java.dev.jna:jna-platform:5.14.0")
implementation("org.jetbrains:annotations:24.1.0")
implementation("com.neovisionaries:nv-i18n:1.29")
implementation("com.nativelibs4java:bridj:0.7.0")
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/faforever/client/os/Kernel32Ex.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface Kernel32Ex extends Kernel32 {
* @return If the function succeeds, the return value is the previous value of the specified offset. If the function
* fails, the return value is zero. To get extended error information, call GetLastError.
*/
BOOL SetPriorityClass(HANDLE hProcess, DWORD dwPriorityClass);
boolean SetPriorityClass(HANDLE hProcess, DWORD dwPriorityClass);

enum WindowsPriority {
REALTIME_PRIORITY_CLASS(0x00000100),
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/faforever/client/os/OsWindows.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.sun.jna.platform.win32.Kernel32;
import com.sun.jna.platform.win32.Shell32Util;
import com.sun.jna.platform.win32.ShlObj;
import com.sun.jna.platform.win32.WinDef.BOOL;
import com.sun.jna.platform.win32.WinDef.DWORD;
import com.sun.jna.platform.win32.WinNT;
import com.sun.jna.platform.win32.WinNT.HANDLE;
Expand Down Expand Up @@ -116,8 +115,8 @@ private void setProcessPriority(Process process, WindowsPriority priority) {
log.debug("Settings priority of process {} to {}", process.pid(), priority);
try {
DWORD dwPriorityClass = priority.dword();
BOOL success = Kernel32Ex.INSTANCE.SetPriorityClass(getProcessHandle(process), dwPriorityClass);
if (!success.booleanValue()) {
boolean success = Kernel32Ex.INSTANCE.SetPriorityClass(getProcessHandle(process), dwPriorityClass);
if (!success) {
int lastError = Kernel32.INSTANCE.GetLastError();
log.warn("Could not set priority of process {} (error {})", process.pid(), lastError);
}
Expand Down

0 comments on commit 31536fb

Please sign in to comment.