java-native-access / java-native-access/jna
Windows32Exception - The parameter is incorrect
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 8.9k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
Hello
I am calling WindowsUtils.getAllWindows(false) from a service every 10 seconds and is throwing a Win32Exception, for some specific windows, I assume.
com.sun.jna.platform.win32.Win32Exception: The parameter is incorrect.
at com.sun.jna.platform.WindowUtils$W32WindowUtils.getProcessFilePath(WindowUtils.java:1302)
at com.sun.jna.platform.WindowUtils$W32WindowUtils$5.callback(WindowUtils.java:1252)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:585)
at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:613)
at com.sun.jna.Native.invokeInt(Native Method)
at com.sun.jna.Function.invoke(Function.java:429)
I am not sure how to even begin debugging this error or what to do about it. It keeps filling my logs and I cannot see relevant logs anymore
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in WindowUtils.java around W32WindowUtils.getProcessFilePath at line 1302 and the callback near line 1252, then trace the WindowsUtils.getAllWindows(false) path. Reproduce the exception for the affected windows and inspect how the Win32Exception is surfaced. Done should include a defined handling for this failure that prevents repeated irrelevant log noise, with any relevant existing tests updated or added.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100