Class IUnknownFFM

java.lang.Object
oshi.ffm.ForeignFunctions
oshi.ffm.windows.com.IUnknownFFM
Direct Known Subclasses:
ComObjectFFM

public class IUnknownFFM extends ForeignFunctions
FFM helpers for the COM IUnknown interface methods AddRef and Release.

All COM interfaces inherit from IUnknown, so vtable slots 1 (AddRef) and 2 (Release) are present on every COM object. QueryInterface (slot 0) is not implemented here.

  • Constructor Details

    • IUnknownFFM

      protected IUnknownFFM()
  • Method Details

    • addRef

      public static int addRef(MemorySegment pObject, Arena arena)
      Increments the reference count of a COM object.
      Parameters:
      pObject - the COM object
      arena - the arena for vtable access
      Returns:
      the new reference count
    • release

      public static int release(MemorySegment pObject, Arena arena)
      Decrements the reference count of a COM object.
      Parameters:
      pObject - the COM object
      arena - the arena for vtable access
      Returns:
      the new reference count
    • safeRelease

      public static void safeRelease(MemorySegment pObject, Arena arena)
      Safely releases a COM object, ignoring null pointers.
      Parameters:
      pObject - the COM object to release
      arena - the arena for vtable access