IDXCoreAdapterList::GetFactory method

Retrieves an IDXCoreAdapterFactory interface pointer to the DXCore adapter factory object. For programming guidance, and code examples, see Using DXCore to enumerate adapters.

Syntax

virtual HRESULT STDMETHODCALLTYPE GetFactory(
  REFIID riid,
  _COM_Outptr_ void** ppvFactory) = 0;

template <class T>
HRESULT GetFactory(
  _COM_Outptr_ T** ppvFactory);

Parameters

riid

Type: REFIID

A reference to the globally unique identifier (GUID) of the interface that you wish to be returned in ppvFactory. This is expected to be the interface identifier (IID) of IDXCoreAdapterFactory.

ppvFactory [out]

Type: void**

The address of a pointer to an interface with the IID specified in the riid parameter. Upon successful return, *ppvFactory (the dereferenced address) contains a pointer to the existing DXCore adapter factory object. Before returning, the function increments the reference count on the factory object's IDXCoreAdapterFactory interface.

Returns

Type: HRESULT

If the function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Return value Description
E_NOINTERFACE An invalid value was provided for riid.
E_POINTER nullptr was provided for ppvFactory.

Remarks

For the duration of time that a reference exists on an IDXCoreAdapterFactory interface, an IDXCoreAdapterList interface, or an IDXCoreAdapter interface, additional calls to DXCoreCreateAdapterFactory, IDXCoreAdapterList::GetFactory, or IDXCoreAdapter::GetFactory will return pointers to the same object, increasing the reference count of the IDXCoreAdapterFactory interface.

See also

IDXCoreAdapterList, DXCore Reference, Using DXCore to enumerate adapters