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

SetPriorityClass() and SetThreadPriority() are missing from Kernel32 class #1539

Closed
dEajL3kA opened this issue Aug 4, 2023 · 3 comments
Closed

Comments

@dEajL3kA
Copy link
Contributor

dEajL3kA commented Aug 4, 2023

Provide complete information about the problem

  1. Version of JNA and related jars: 5.13.0
  2. Version and vendor of the java virtual machine: OpenJDK 17.0.8 LTS
  3. Operating system: Windows
  4. System architecture (CPU type, bitness of the JVM): x86-64, 64-Bit
  5. Complete description of the problem: Win32 API functions SetPriorityClass() and SetThreadPriority() are missing from the com.sun.jna.platform.win32.Kernel32 class (from jna-platform-5.13.0.jar)
  6. Steps to reproduce: Add jna-platform-5.13.0.jar to the class path and try to call the missing functions SetPriorityClass() or SetThreadPriority() from Kernel32.INSTANCE; they are not currently available 😞

Obviously, those functions, which have been available from Kernel32.DLL since (at least) Windows XP, have been forgotten in the implementation of com.sun.jna.platform.win32.Kernel32. Please consider adding the missing functions 😏

These functions are very useful to change the priority of a process and/or thread.

SetPriorityClass function

Sets the priority class for the specified process. This value together with the priority value of each thread of the process determines each thread's base priority level.

BOOL SetPriorityClass(
  [in] HANDLE hProcess,
  [in] DWORD  dwPriorityClass
);

Requirements

Minimum supported client: Windows XP
Minimum supported server: Windows Server 2003
Header: processthreadsapi.h
Library: Kernel32.lib
DLL: Kernel32.dll

Thanks!

@matthiasblaesing
Copy link
Member

I marked this as feature request. JNA is driven by its users, so you are encouraged to bind them yourself and contribute the bindings.

@dEajL3kA
Copy link
Contributor Author

dEajL3kA commented Aug 8, 2023

Pull request has been updated:
https://github.com/java-native-access/jna/pull/1544/commits

@dblock
Copy link
Member

dblock commented Aug 16, 2023

Closed via #1544

@dblock dblock closed this as completed Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants