CryptoSessionGetHandle function

Returns a handle for a cryptographic session.


HRESULT APIENTRY* CryptoSessionGetHandle(
  _In_  D3D10DDI_HDEVICE          hDevice,
  _In_  D3D11_1DDI_HCRYPTOSESSION hCryptoSession,
  _Out_ HANDLE                    *pHandle


hDevice [in]

A handle to the display device (graphics context).

hCryptoSession [in]

A handle to the driver's private data for the cryptographic session. This handle was created by the Direct3D runtime and passed to the driver in the call to CreateCryptoSession.

pHandle [out]

A handle that is created by the driver for the cryptographic session.

Return value

CryptoSessionGetHandle returns one of the following values:

Return codeDescription

The cryptographic session handle was returned successfully.


The graphics adapter was removed.


Memory was not available to complete the operation.



The CryptoSessionGetHandle function returns a driver-specified handle for the cryptographic session. This handle is used by the application when it associates the cryptographic session with the video decoder. This enables the decoder to decrypt data that is encrypted by using this session.

This function allows the driver to define its own handle to its state data for the cryptographic session. This bypasses any handle mapping that may be performed by the Direct3D runtime.

Note  Drivers can return the same handle in the pHandle parameter that was passed in the hCryptoSession parameter.


Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Target platform


D3d10umddi.h (include D3d10umddi.h)

See also




Send comments about this topic to Microsoft