Skip to content

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

@dEajL3kA

Description

@dEajL3kA

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!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions