Class ComObjectFFM

Direct Known Subclasses:
IEnumWbemClassObjectFFM, IWbemClassObjectFFM, IWbemLocatorFFM, IWbemServicesFFM

public class ComObjectFFM extends IUnknownFFM
Base class for COM object operations via FFM.

Provides utilities for vtable access. IUnknown interface methods (AddRef, Release, safeRelease) are in IUnknownFFM.

  • Field Details

    • PTR_SIZE

      protected static final long PTR_SIZE
      Size of a pointer in bytes (8 on 64-bit systems).
  • Constructor Details

    • ComObjectFFM

      protected ComObjectFFM()
  • Method Details

    • getVtable

      protected static MemorySegment getVtable(MemorySegment pObject, Arena arena)
      Gets the vtable pointer from a COM object.
      Parameters:
      pObject - the COM object pointer
      arena - the arena for memory reinterpretation
      Returns:
      the vtable memory segment
    • getVtableFunction

      protected static MemorySegment getVtableFunction(MemorySegment vtable, int index)
      Gets a function pointer from a vtable at the specified index.
      Parameters:
      vtable - the vtable memory segment
      index - the function index (0-based)
      Returns:
      the function pointer
    • createDowncall

      protected static MethodHandle createDowncall(MemorySegment fnPtr, FunctionDescriptor descriptor)
      Creates a downcall handle for a vtable function.
      Parameters:
      fnPtr - the function pointer
      descriptor - the function descriptor
      Returns:
      the method handle