Class WindowsForeignFunctions
java.lang.Object
oshi.ffm.ForeignFunctions
oshi.ffm.windows.WindowsForeignFunctions
- Direct Known Subclasses:
Advapi32FFM, Kernel32FFM, PsapiFFM
Utility class for working with the Foreign Function invalid input: '&' Memory API (Java 24+). Provides helpers for library lookup,
downcalls, and UTF-16 string conversion.
-
Field Summary
Fields inherited from class ForeignFunctions
LINKER, SYMBOL_LOOKUP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisSuccess(int winBool) Converts Windows BOOL return value to Java boolean.static MemorySegmentsetupTokenPrivileges(Arena arena, MemorySegment luid) Builds a TOKEN_PRIVILEGES struct with a single privilege enabled.static MemorySegmenttoWideString(Arena arena, String s) Allocate a null-terminated UTF-16 string in the given arena.Methods inherited from class ForeignFunctions
downcall, getByteArrayFromNativePointer, getStringFromNativePointer, getStructFromNativePointer, lib
-
Constructor Details
-
WindowsForeignFunctions
protected WindowsForeignFunctions()
-
-
Method Details
-
isSuccess
public static boolean isSuccess(int winBool) Converts Windows BOOL return value to Java boolean. In Windows APIs, 0 = FALSE (failure), non-zero = TRUE (success) -
setupTokenPrivileges
Builds a TOKEN_PRIVILEGES struct with a single privilege enabled. -
toWideString
Allocate a null-terminated UTF-16 string in the given arena.
-