Skip to content

API: ObCreateInterface

Archie_UwU edited this page Dec 27, 2023 · 2 revisions

Creates a global interface object for use by other modules.

Syntax

AurieStatus ObCreateInterface(
    [in] AurieModule*        Module,
    [in] AurieInterfaceBase* Interface,
    [in] const char*         InterfaceName
);

Parameters

Module

The owner module of this interface. The interface is destroyed when this module unloads.

Interface

A pointer to a persistent instance of an interface inheriting from AurieInterfaceBase. This interface must have at least the Create, Destroy, and QueryVersion methods defined.

On initialization, the Create method of this interface is invoked. If the interface fails to initialize, the function fails. If the function fails, the interface is not added to the global registry.

InterfaceName

A unique name for the interface. Other modules can use this name to get a handle to the interface. This name is case-insensitive.

Return Value

The function returns AURIE_SUCCESS on success, otherwise returns a matching error code. If the interface already exists, the function returns AURIE_OBJECT_ALREADY_EXISTS. If the interface's Create function failed, the function returns an interface-specific error code.