IDXGIObject::GetPrivateData Method

Get a pointer to the object’s data.

Syntax

public:
HRESULT GetPrivateData(
         REFGUID Name,
         UINT *pDataSize,
         void *pData
)  

Parameters

Name
Type: REFGUID 

[in] A GUID identifying the data.

pDataSize
Type: UINT *

[in, out] The size of the data.

pData
Type: void *

[out] Pointer to the data.

Return value

Type: HRESULT 

Returns one of the following DXGI_ERROR.

Remarks

If the data returned is a pointer to an IUnknown, or one of its derivative classes, previously set by IDXGIObject::SetPrivateDataInterface, you must call ::Release() on the pointer before the pointer is freed to decrement the reference count.

To get the type of device on which the display adapter was created

You can pass GUID_DeviceType in the Name parameter of GetPrivateData to retrieve the device type from the display adapter object (IDXGIAdapter, IDXGIAdapter1, IDXGIAdapter2).

  1. Call IUnknown::QueryInterface on the ID3D11Device or ID3D10Device object to retrieve the IDXGIDevice object.
  2. Call GetParent on the IDXGIDevice object to retrieve the IDXGIAdapter object.
  3. Call GetPrivateData on the IDXGIAdapter object with GUID_DeviceType to retrieve the type of device on which the display adapter was created. pData will point to a value from the driver-type enumeration (for example, a value from D3D_DRIVER_TYPE).

On Windows 7 or earlier, this type is either a value from D3D10_DRIVER_TYPE or D3D_DRIVER_TYPE depending on which kind of device was created. On Windows 8, this type is always a value from D3D_DRIVER_TYPE. Don’t use IDXGIObject::SetPrivateData with GUID_DeviceType because the behavior when doing so is undefined.

Requirements

Header: Declared in d3d11_x.h (dxgi.h on other Windows platforms).

Library: Use d3d11_x.lib (dxgi.lib on other Windows platforms).

See also

IDXGIObject

IDXGIObject Members