IDirect3DDeviceManager9::OpenDeviceHandle method (dxva2api.h)

Gets a handle to the Direct3D device.

Syntax

HRESULT OpenDeviceHandle(
  [out] HANDLE *phDevice
);

Parameters

[out] phDevice

Receives the device handle.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The method succeeded.
DXVA2_E_NOT_INITIALIZED
The Direct3D device manager was not initialized. The owner of the device must call IDirect3DDeviceManager9::ResetDevice.

Remarks

To get the Direct3D device's IDirect3DDevice9 pointer, call IDirect3DDeviceManager9::LockDevice with the handle returned in phDevice. Close the device handle when you are done using it, by calling IDirect3DDeviceManager9::CloseDeviceHandle.

To test whether a device handle is still valid, call IDirect3DDeviceManager9::TestDevice.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header dxva2api.h

See also

Direct3D Device Manager

IDirect3DDeviceManager9