Hardware Dev Center

Expand Minimize

pfnDestroyContextCb routine

The pfnDestroyContextCb function destroys the context that was created through a call to the pfnCreateContextCb function.

Syntax


PFND3DDDI_DESTROYCONTEXTCB pfnDestroyContextCb;

_checkReturn HRESULT APIENTRY CALLBACK pfnDestroyContextCb(
  _In_       HANDLE                  hDevice,
  _In_ const D3DDDICB_DESTROYCONTEXT *pData
)
{ ... }

Parameters

hDevice [in]

A handle to a display device (that is, the graphics context).

pData [in]

A pointer to a D3DDDICB_DESTROYCONTEXT structure that contains a handle to the context to destroy.

Return value

pfnDestroyContextCb returns one of the following values:

Return codeDescription
S_OK

The context was successfully destroyed.

E_INVALIDARG

Parameters were validated and determined to be incorrect.

 

This function might also return other HRESULT values.

Remarks

If the specified context has not finished the work that is currently queued to it, the pfnDestroyContextCb function blocks until the context finishes its work and then returns.

pfnDestroyContextCb returns an error if the context to destroy currently owns a synchronization object.

Direct3D Version 11 Note:  For more information about how the driver calls pfnDestroyContextCb, see Changes from Direct3D 10.

The following code example shows how to destroy the default context for a display device.


    if (m_d3dCallbacks.pfnDestroyContextCb) {
        D3DDDICB_DESTROYCONTEXT DestroyContext;
        DestroyContext.hContext = m_sContexts[MULTI_ENGINE_NODE_3D].hContext;
        m_d3dCallbacks.pfnDestroyContextCb(m_hD3D, &DestroyContext);
        m_sContexts[MULTI_ENGINE_NODE_3D].hContext = NULL;
    }

Requirements

Target platform

Desktop

Version

Available in Windows Vista and later versions of the Windows operating systems.

Header

D3dumddi.h (include D3dumddi.h)

See also

D3DDDICB_DESTROYCONTEXT
pfnCreateContextCb

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft