Skip to main content
Gets a pointer to the device that created this interface.

Syntax

Parameters

riid
Type: const IID &
The globally unique identifier (GUID) for the device interface. The REFIID, or GUID, of the interface to the device can be obtained by using the __uuidof() macro. For example, __uuidof(ID3D12Device) will get the GUID of the interface to a device. ppvDevice [out, optional]
Type: void**
A pointer to a memory block that receives a pointer to the ID3D12Device interface for the device.

Return value

Type: void This method returns one of the Direct3D 12 Return Codes.

Remarks

Any returned interfaces have their reference count incremented by one, so be sure to call ::release() on the returned pointers before they are freed or else you will have a memory leak.

Examples

The D3D12Multithreading sample uses ID3D12DeviceChild::GetDevice as follows:
Refer to the Example Code in the D3D12 Reference.

Requirements

Header: d3d12_xs.h or d3d12_x.h
Library: d3d12_xs.lib or d3d12_x.lib
Supported Platforms: XBOX Series consoles and XBOX One family

See Also

ID3D12DeviceChild
Last modified on August 20, 2026