Class Ole32FFM
java.lang.Object
oshi.ffm.ForeignFunctions
oshi.ffm.windows.WindowsForeignFunctions
oshi.ffm.windows.com.Ole32FFM
FFM bindings for OLE32.dll COM initialization and object creation functions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields 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 -
Method Summary
Modifier and TypeMethodDescriptionstatic MemorySegmentCoCreateInstance(Arena arena, MemorySegment clsid, int clsctx, MemorySegment iid) Creates a single uninitialized object of the class associated with a specified CLSID.static OptionalIntCoInitializeEx(int coInit) Initializes the COM library for use by the calling thread.static OptionalIntCoInitializeSecurity(int authnLevel, int impLevel, int capabilities) Registers security and sets the default security values for the process.static OptionalIntCoSetProxyBlanket(MemorySegment pProxy, int authnSvc, int authzSvc, int authnLevel, int impLevel, int capabilities) Sets the authentication information for a proxy.static voidCloses the COM library on the current thread.static booleanfailed(int hr) Checks if an HRESULT indicates failure (negative value).static booleansucceeded(int hr) Checks if an HRESULT indicates success (non-negative value).Methods inherited from class WindowsForeignFunctions
checkSuccess, isSuccess, readAnsiString, readWideString, setupTokenPrivileges, toWideStringMethods inherited from class ForeignFunctions
downcall, getByteArrayFromNativePointer, getErrno, getStringFromNativePointer, getStructFromNativePointer, lib, libraryLookup
-
Field Details
-
COINIT_APARTMENTTHREADED
public static final int COINIT_APARTMENTTHREADED- See Also:
-
COINIT_MULTITHREADED
public static final int COINIT_MULTITHREADED- See Also:
-
COINIT_DISABLE_OLE1DDE
public static final int COINIT_DISABLE_OLE1DDE- See Also:
-
COINIT_SPEED_OVER_MEMORY
public static final int COINIT_SPEED_OVER_MEMORY- See Also:
-
CLSCTX_INPROC_SERVER
public static final int CLSCTX_INPROC_SERVER- See Also:
-
CLSCTX_INPROC_HANDLER
public static final int CLSCTX_INPROC_HANDLER- See Also:
-
CLSCTX_LOCAL_SERVER
public static final int CLSCTX_LOCAL_SERVER- See Also:
-
CLSCTX_REMOTE_SERVER
public static final int CLSCTX_REMOTE_SERVER- See Also:
-
CLSCTX_SERVER
public static final int CLSCTX_SERVER- See Also:
-
RPC_C_AUTHN_LEVEL_DEFAULT
public static final int RPC_C_AUTHN_LEVEL_DEFAULT- See Also:
-
RPC_C_AUTHN_LEVEL_NONE
public static final int RPC_C_AUTHN_LEVEL_NONE- See Also:
-
RPC_C_AUTHN_LEVEL_CONNECT
public static final int RPC_C_AUTHN_LEVEL_CONNECT- See Also:
-
RPC_C_AUTHN_LEVEL_CALL
public static final int RPC_C_AUTHN_LEVEL_CALL- See Also:
-
RPC_C_AUTHN_LEVEL_PKT
public static final int RPC_C_AUTHN_LEVEL_PKT- See Also:
-
RPC_C_AUTHN_LEVEL_PKT_INTEGRITY
public static final int RPC_C_AUTHN_LEVEL_PKT_INTEGRITY- See Also:
-
RPC_C_AUTHN_LEVEL_PKT_PRIVACY
public static final int RPC_C_AUTHN_LEVEL_PKT_PRIVACY- See Also:
-
RPC_C_IMP_LEVEL_DEFAULT
public static final int RPC_C_IMP_LEVEL_DEFAULT- See Also:
-
RPC_C_IMP_LEVEL_ANONYMOUS
public static final int RPC_C_IMP_LEVEL_ANONYMOUS- See Also:
-
RPC_C_IMP_LEVEL_IDENTIFY
public static final int RPC_C_IMP_LEVEL_IDENTIFY- See Also:
-
RPC_C_IMP_LEVEL_IMPERSONATE
public static final int RPC_C_IMP_LEVEL_IMPERSONATE- See Also:
-
RPC_C_IMP_LEVEL_DELEGATE
public static final int RPC_C_IMP_LEVEL_DELEGATE- See Also:
-
EOAC_NONE
public static final int EOAC_NONE- See Also:
-
EOAC_DEFAULT
public static final int EOAC_DEFAULT- See Also:
-
S_OK
public static final int S_OK- See Also:
-
S_FALSE
public static final int S_FALSE- See Also:
-
RPC_E_CHANGED_MODE
public static final int RPC_E_CHANGED_MODE- See Also:
-
RPC_E_TOO_LATE
public static final int RPC_E_TOO_LATE- See Also:
-
-
Method Details
-
CoInitializeEx
Initializes the COM library for use by the calling thread.- Parameters:
coInit- the concurrency model and initialization options (COINIT_*)- Returns:
- HRESULT: S_OK if successful, S_FALSE if already initialized, or error code
-
CoUninitialize
public static void CoUninitialize()Closes the COM library on the current thread. -
CoInitializeSecurity
Registers security and sets the default security values for the process.- Parameters:
authnLevel- the default authentication levelimpLevel- the default impersonation levelcapabilities- additional capabilities (EOAC_*)- Returns:
- HRESULT: S_OK if successful, RPC_E_TOO_LATE if already called, or error code
-
CoCreateInstance
public static MemorySegment CoCreateInstance(Arena arena, MemorySegment clsid, int clsctx, MemorySegment iid) Creates a single uninitialized object of the class associated with a specified CLSID.- Parameters:
arena- the arena for memory allocationclsid- the CLSID of the object to createclsctx- the context in which the code that manages the object will run (CLSCTX_*)iid- the IID of the interface to obtain- Returns:
- the interface pointer, or NULL if failed
-
CoSetProxyBlanket
public static OptionalInt CoSetProxyBlanket(MemorySegment pProxy, int authnSvc, int authzSvc, int authnLevel, int impLevel, int capabilities) Sets the authentication information for a proxy.- Parameters:
pProxy- the proxy to set authentication onauthnSvc- the authentication service (use -1 for default)authzSvc- the authorization service (use -1 for default)authnLevel- the authentication levelimpLevel- the impersonation levelcapabilities- additional capabilities- Returns:
- HRESULT
-
succeeded
public static boolean succeeded(int hr) Checks if an HRESULT indicates success (non-negative value).- Parameters:
hr- the HRESULT value- Returns:
- true if successful
-
failed
public static boolean failed(int hr) Checks if an HRESULT indicates failure (negative value).- Parameters:
hr- the HRESULT value- Returns:
- true if failed
-