On Tue, 2 Jun 2026 14:56:36 GMT, Weijun Wang <[email protected]> wrote:
>> Rewrite the `NTSystem.java` using FFM. All FFM classes are generated by >> `jextract`. No new test. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Weijun Wang has updated the pull request with a new target base due to a > merge or a rebase. The incremental webrev excludes the unrelated changes > brought in by the merge/rebase. The pull request contains six additional > commits since the last revision: > > - Merge branch 'master' into 8374154 > - preserve old getTextSid; better error handling > - 8374154: Rewrite JAAS NTLoginModule with FFM > - revert three accidentally modified files > - Simpler GLE-methods that display error texts inside it; LocalFree > - the fix src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTSystem.java line 63: > 61: .varHandle(groupElement("GetLastError")); > 62: > 63: private static void DisplayErrorText(Arena scope, String label, > MemorySegment cs) { Why is this method named with an initial capital letter (seems C# style rather than Java style)? src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTSystem.java line 108: > 106: .downcallHandle(OpenThreadToken$address(), > OpenThreadToken$descriptor(), CCS_GLE); > 107: > 108: private int OpenThreadTokenGLE(MemorySegment ThreadHandle, int > DesiredAccess, int OpenAsSelf, MemorySegment TokenHandle) { These methods seem to share the same fundamental logic. Is it possible to consolidate? src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTSystem.java line 109: > 107: > 108: private int OpenThreadTokenGLE(MemorySegment ThreadHandle, int > DesiredAccess, int OpenAsSelf, MemorySegment TokenHandle) { > 109: try (var arena = POOL.pushFrame(CAPTURE_LAYOUT.byteSize() + 64, Can we define the magic number 64 in a constant? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/30629#discussion_r3354504992 PR Review Comment: https://git.openjdk.org/jdk/pull/30629#discussion_r3354516345 PR Review Comment: https://git.openjdk.org/jdk/pull/30629#discussion_r3354494496
