Skip to content

Add FFM version of Pageant AgentConnector#1001

Open
norrisjeremy wants to merge 12 commits intomwiede:masterfrom
norrisjeremy:20260220
Open

Add FFM version of Pageant AgentConnector#1001
norrisjeremy wants to merge 12 commits intomwiede:masterfrom
norrisjeremy:20260220

Conversation

@norrisjeremy
Copy link
Contributor

@norrisjeremy norrisjeremy commented Feb 20, 2026

This adds support for using Pageant using the JEP 454 FFM API with Java 23+ as an alternative to using JNA.

Additionally, include a few minor updates & fixes to the existing JNA based PageantConnector.

To use the new PageantFFMConnector, users will need to pass an argument of --enable-native-access=ALL-UNNAMED (if JSch is on the classpath) or --enable-native-access=com.jcraft.jsch (if JSch is on the modulepath).

</execution>
</executions>
</plugin>
<!-- see https://github.com/manuelbl/WindowsApiGenerator/issues/7 -->
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a workaround for manuelbl/WindowsApiGenerator#7 that I opened.
I also opened manuelbl/WindowsApiGenerator#9 with a possible solution.
Once this issue is resolved upstream, we should be able to remove this find-and-replace-maven-plugin.

…ProcessId() and the Java thread id.

This is needed to support virtual threads correctly, since GetCurrentThreadId() could change if the virtual thread is parked and resumed on a different carrier thread.
…d() and the Java thread id for Java 19+.

Thread.getId() isn't final and thus could be overriden, leaving the possibility that it isn't unique.
Since virtual threads were only introduced in Java 19, using GetCurrentThreadId() should work for earlier Java releases.
This allows PageantFFMConnector to connect to an unprivileged Pageant when JSch is executed via run as Administrator.
…up fails and throws an exception, the second resource cleanup will still execute.
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant