Class IUnknownFFM
java.lang.Object
oshi.ffm.ForeignFunctions
oshi.ffm.windows.com.IUnknownFFM
- Direct Known Subclasses:
ComObjectFFM
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.
-
Field Summary
Fields inherited from class ForeignFunctions
CAPTURE_CALL_STATE, CAPTURED_STATE_LAYOUT, ERRNO_HANDLE, LIBRARY_ARENA, LINKER, NATIVE_LONG_SIZE, NATIVE_POINTER_SIZE, NATIVE_SIZE_T_SIZE, SYMBOL_LOOKUP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intaddRef(MemorySegment pObject, Arena arena) Increments the reference count of a COM object.static intrelease(MemorySegment pObject, Arena arena) Decrements the reference count of a COM object.static voidsafeRelease(MemorySegment pObject, Arena arena) Safely releases a COM object, ignoring null pointers.Methods inherited from class ForeignFunctions
downcall, getByteArrayFromNativePointer, getErrno, getStringFromNativePointer, getStructFromNativePointer, lib, libraryLookup
-
Constructor Details
-
IUnknownFFM
protected IUnknownFFM()
-
-
Method Details
-
addRef
Increments the reference count of a COM object.- Parameters:
pObject- the COM objectarena- the arena for vtable access- Returns:
- the new reference count
-
release
Decrements the reference count of a COM object.- Parameters:
pObject- the COM objectarena- the arena for vtable access- Returns:
- the new reference count
-
safeRelease
Safely releases a COM object, ignoring null pointers.- Parameters:
pObject- the COM object to releasearena- the arena for vtable access
-