Class ComObjectFFM
java.lang.Object
oshi.ffm.ForeignFunctions
oshi.ffm.windows.com.IUnknownFFM
oshi.ffm.windows.com.ComObjectFFM
- Direct Known Subclasses:
IEnumWbemClassObjectFFM, IWbemClassObjectFFM, IWbemLocatorFFM, IWbemServicesFFM
Base class for COM object operations via FFM.
Provides utilities for vtable access. IUnknown interface methods (AddRef, Release, safeRelease) are in
IUnknownFFM.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final longSize of a pointer in bytes (8 on 64-bit systems).Fields inherited from class ForeignFunctions
CAPTURE_CALL_STATE, CAPTURED_STATE_LAYOUT, ERRNO_HANDLE, LIBRARY_ARENA, LINKER, SYMBOL_LOOKUP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static MethodHandlecreateDowncall(MemorySegment fnPtr, FunctionDescriptor descriptor) Creates a downcall handle for a vtable function.protected static MemorySegmentgetVtable(MemorySegment pObject, Arena arena) Gets the vtable pointer from a COM object.protected static MemorySegmentgetVtableFunction(MemorySegment vtable, int index) Gets a function pointer from a vtable at the specified index.Methods inherited from class IUnknownFFM
addRef, release, safeReleaseMethods inherited from class ForeignFunctions
downcall, getByteArrayFromNativePointer, getErrno, getStringFromNativePointer, getStructFromNativePointer, lib, libraryLookup
-
Field Details
-
PTR_SIZE
protected static final long PTR_SIZESize of a pointer in bytes (8 on 64-bit systems).
-
-
Constructor Details
-
ComObjectFFM
protected ComObjectFFM()
-
-
Method Details
-
getVtable
Gets the vtable pointer from a COM object.- Parameters:
pObject- the COM object pointerarena- the arena for memory reinterpretation- Returns:
- the vtable memory segment
-
getVtableFunction
Gets a function pointer from a vtable at the specified index.- Parameters:
vtable- the vtable memory segmentindex- the function index (0-based)- Returns:
- the function pointer
-
createDowncall
Creates a downcall handle for a vtable function.- Parameters:
fnPtr- the function pointerdescriptor- the function descriptor- Returns:
- the method handle
-