DXVA2CreateDirect3DDeviceManager9 function (dxva2api.h)

Creates an instance of the Direct3D Device Manager.

Syntax

HRESULT DXVA2CreateDirect3DDeviceManager9(
  [out] UINT                    *pResetToken,
  [out] IDirect3DDeviceManager9 **ppDeviceManager
);

Parameters

[out] pResetToken

Receives a token that identifies this instance of the Direct3D device manager. Use this token when calling IDirect3DDeviceManager9::ResetDevice.

[out] ppDeviceManager

Receives a pointer to the IDirect3DDeviceManager9 interface. The caller must release the interface.

Return value

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

Remarks

Windows Store apps must use IMFDXGIDeviceManager and Direct3D 11 Video APIs.

Examples

HRESULT CreateD3DDeviceManager(
    IDirect3DDevice9 *pDevice, 
    UINT *pReset, 
    IDirect3DDeviceManager9 **ppManager
    )
{
    UINT resetToken = 0;

    IDirect3DDeviceManager9 *pD3DManager = NULL;

    HRESULT hr = DXVA2CreateDirect3DDeviceManager9(&resetToken, &pD3DManager);

    if (FAILED(hr))
    {
        goto done;
    }

    hr = pD3DManager->ResetDevice(pDevice, resetToken);

    if (FAILED(hr))
    {
        goto done;
    }

    *ppManager = pD3DManager;
    (*ppManager)->AddRef();

    *pReset = resetToken;


done:
    SafeRelease(&pD3DManager);
    return hr;
}

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header dxva2api.h
Library Dxva2.lib
DLL Dxva2.dll

See also

Direct3D Device Manager

Media Foundation Functions