Bewerken

Delen via


DXGKDDI_DESTROYALLOCATION callback function (d3dkmddi.h)

The DxgkDdiDestroyAllocation function releases allocations.

Syntax

DXGKDDI_DESTROYALLOCATION DxgkddiDestroyallocation;

NTSTATUS DxgkddiDestroyallocation(
  [in] IN_CONST_HANDLE hAdapter,
  [in] IN_CONST_PDXGKARG_DESTROYALLOCATION pDestroyAllocation
)
{...}

Parameters

[in] hAdapter

A handle to a context block that is associated with a display adapter. The display miniport driver previously provided this handle to the Microsoft DirectX graphics kernel subsystem in the MiniportDeviceContext output parameter of the DxgkDdiAddDevice function.

[in] pDestroyAllocation

A pointer to a DXGKARG_DESTROYALLOCATION structure that contains information for releasing allocations.

Return value

DxgkDdiDestroyAllocation returns STATUS_SUCCESS, or an appropriate error result if the allocations are not successfully released.

Remarks

When the user-mode display driver calls the pfnDeallocateCb function, the DirectX graphics kernel subsystem (which is part of Dxgkrnl.sys) calls the display miniport driver's DxgkDdiDestroyAllocation function to release the allocations. The display miniport driver should clean up its internal data structures and references to the allocations. The Microsoft Direct3D runtime initiates calls to the video memory manager (which is also part of Dxgkrnl.sys), which then calls the GPU scheduler (which is also part of Dxgkrnl.sys) to synchronize before video memory is actually released.

The display miniport driver can release the entire resource as well as allocations. To determine whether the resource should be released, the display miniport driver can check whether the DestroyResource flag is set in the Flags member of the DXGKARG_DESTROYALLOCATION structure that the pDestroyAllocation parameter points to. To release the resource, the display miniport driver must clean up the handle that the hResource member of DXGKARG_DESTROYALLOCATION specifies. If the display miniport driver does not release the resource, the driver can change the value in hResource if necessary.

DxgkDdiDestroyAllocation should be made pageable.

Requirements

Requirement Value
Minimum supported client Windows Vista
Target Platform Desktop
Header d3dkmddi.h
IRQL PASSIVE_LEVEL

See also

DXGKARG_DESTROYALLOCATION

DxgkDdiAddDevice

pfnDeallocateCb