PFND3DDDI_DESTROYRESOURCE callback function (d3dumddi.h)

The DestroyResource function releases a specified resource.

Syntax

PFND3DDDI_DESTROYRESOURCE Pfnd3dddiDestroyresource;

HRESULT Pfnd3dddiDestroyresource(
  HANDLE hDevice,
  HANDLE unnamedParam2
)
{...}

Parameters

hDevice

A handle to the display device (graphics context) that is used to destroy the resource.

unnamedParam2

hResource [in]

A handle to the resource that the CreateResource or OpenResource function created.

Return value

DestroyResource returns S_OK or an appropriate error result is the resource is not released.

Remarks

After the Microsoft Direct3D runtime calls the user-mode display driver's DestroyResource function, the user-mode display driver must first flush any batched commands that depend on the resource that is being destroyed by calling the runtime's pfnRenderCb function. The driver must then call the runtime's pfnDeallocateCb function to destroy allocations that are associated with the resource.

Note   The driver's DestroyResource function is not required to call pfnDeallocateCb before returning; instead, the driver can defer allocation destruction.
 
Note   A separate DestroyResource call is not made for each surface that is part of the resource. So, if a group of surfaces is atomically created, the group is always atomically destroyed as well.
 
For more information about creating and destroying resources, see Handling Resource Creation and Destruction.

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)

See also

CreateResource

D3DDDI_DEVICEFUNCS

OpenResource

pfnDeallocateCb

pfnRenderCb