Export (0) Print
Expand All
Expand Minimize

DxgkDdiDestroyAllocation routine

The DxgkDdiDestroyAllocation function releases allocations.



NTSTATUS APIENTRY DxgkDdiDestroyAllocation(
  _In_  const HANDLE hAdapter,
  _In_  const DXGKARG_DESTROYALLOCATION *pDestroyAllocation
{ ... }


hAdapter [in]

[in] 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.

pDestroyAllocation [in]

[in] 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.


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.



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


D3dkmddi.h (include D3dkmddi.h)



See also




Send comments about this topic to Microsoft

© 2014 Microsoft