PFND3DDDI_DESTROYCONTEXTCB callback function (d3dumddi.h)
The pfnDestroyContextCb function destroys the context that was created through a call to the pfnCreateContextCb function.
Syntax
PFND3DDDI_DESTROYCONTEXTCB Pfnd3dddiDestroycontextcb;
HRESULT Pfnd3dddiDestroycontextcb(
HANDLE hDevice,
const D3DDDICB_DESTROYCONTEXT *unnamedParam2
)
{...}
Parameters
hDevice
A handle to a display device (that is, the graphics context).
unnamedParam2
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 code | Description |
---|---|
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
Requirement | Value |
---|---|
Minimum supported client | Available in Windows Vista and later versions of the Windows operating systems. |
Target Platform | Desktop |
Header | d3dumddi.h (include D3dumddi.h) |