LPD3DHAL_CONTEXTDESTROYCB callback function (d3dhal.h)

The D3dContextDestroy function deletes the specified context.

Syntax

LPD3DHAL_CONTEXTDESTROYCB Lpd3dhalContextdestroycb;

DWORD Lpd3dhalContextdestroycb(
  LPD3DHAL_CONTEXTDESTROYDATA unnamedParam1
)
{...}

Parameters

unnamedParam1

pcdd [in]

Points to a D3DHAL_CONTEXTDESTROYDATA structure that contains the information required for the driver to destroy the context.

Return value

D3dContextDestroy returns one of the following callback codes:

Remarks

All Microsoft Direct3D drivers must support D3dContextDestroy.

The driver should free all resources it allocated to the context that is being deleted. For example, the driver should free the following resources it associated with the context:

The driver should not free the Microsoft DirectDraw surfaces associated with the context because these will be freed by DirectDraw in response to an application or Direct3D runtime request.

If the driver cached the pointer to the DD_DIRECTDRAW_LOCAL structure that was passed in as the lpDDLcl member of the D3DHAL_CONTEXTCREATEDATA structure when D3dContextCreate was called, the pointer might become invalid before D3dContextDestroy is called. Therefore, D3dContextDestroy must not dereference this DD_DIRECTDRAW_LOCAL pointer because an access violation might result or random data might be returned. For example, if the driver's D3dDestroyDDLocal function is called before D3dContextDestroy, the operating system releases this DD_DIRECTDRAW_LOCAL pointer before the D3dContextDestroy call.

D3dContextDestroy can be called with a disabled PDEV. A PDEV is disabled or enabled by calling the display driver's DrvAssertMode function. See Managing PDEVs for more information.

Requirements

Requirement Value
Target Platform Desktop
Header d3dhal.h (include D3dhal.h)

See also

D3DHAL_CONTEXTCREATEDATA

D3DHAL_CONTEXTDESTROYDATA

D3dContextCreate

D3dDestroyDDLocal

DD_DIRECTDRAW_LOCAL