Skip to content

Latest commit

 

History

History
107 lines (75 loc) · 4.51 KB

nf-dxgi-idxgiobject-setprivatedata.md

File metadata and controls

107 lines (75 loc) · 4.51 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:dxgi.IDXGIObject.SetPrivateData
IDXGIObject::SetPrivateData (dxgi.h)
Sets application-defined data to the object and associates that data with a GUID.
5949633e-2d65-5d04-b6ba-29414dfded94
IDXGIObject interface [DXGI]
SetPrivateData method
IDXGIObject.SetPrivateData
IDXGIObject::SetPrivateData
SetPrivateData
SetPrivateData method [DXGI]
SetPrivateData method [DXGI]
IDXGIObject interface
direct3ddxgi.idxgiobject_setprivatedata
dxgi/IDXGIObject::SetPrivateData
direct3ddxgi\idxgiobject_setprivatedata.htm
direct3ddxgi
VS|directx_sdk|~\idxgiobject_setprivatedata.htm
12/05/2018
5949633e-2d65-5d04-b6ba-29414dfded94, IDXGIObject interface [DXGI],SetPrivateData method, IDXGIObject.SetPrivateData, IDXGIObject::SetPrivateData, SetPrivateData, SetPrivateData method [DXGI], SetPrivateData method [DXGI],IDXGIObject interface, direct3ddxgi.idxgiobject_setprivatedata, dxgi/IDXGIObject::SetPrivateData
dxgi.h
Windows
DXGI.lib
Windows
19H1
IDXGIObject::SetPrivateData
dxgi/IDXGIObject::SetPrivateData
c++
APIRef
kbSyntax
COM
DXGI.lib
DXGI.dll
IDXGIObject.SetPrivateData

IDXGIObject::SetPrivateData

-description

Sets application-defined data to the object and associates that data with a GUID.

-parameters

-param Name [in]

Type: REFGUID

A GUID that identifies the data. Use this GUID in a call to GetPrivateData to get the data.

-param DataSize

Type: UINT

The size of the object's data.

-param pData [in]

Type: const void*

A pointer to the object's data.

-returns

Type: HRESULT

Returns one of the DXGI_ERROR values.

-remarks

SetPrivateData makes a copy of the specified data and stores it with the object.

Private data that SetPrivateData stores in the object occupies the same storage space as private data that is stored by associated Direct3D objects (for example, by a Microsoft Direct3D 11 device through ID3D11Device::SetPrivateData or by a Direct3D 11 child device through ID3D11DeviceChild::SetPrivateData).

The debug layer reports memory leaks by outputting a list of object interface pointers along with their friendly names. The default friendly name is "<unnamed>". You can set the friendly name so that you can determine if the corresponding object interface pointer caused the leak. To set the friendly name, use the SetPrivateData method and the well-known private data GUID (WKPDID_D3DDebugObjectName) that is in D3Dcommon.h. For example, to give pContext a friendly name of My name, use the following code:


static const char c_szName[] = "My name";
hr = pContext->SetPrivateData( WKPDID_D3DDebugObjectName, sizeof( c_szName ) - 1, c_szName );

You can use WKPDID_D3DDebugObjectName to track down memory leaks and understand performance characteristics of your applications. This information is reflected in the output of the debug layer that is related to memory leaks (ID3D11Debug::ReportLiveDeviceObjects) and with the event tracing for Windows events that we've added to Windows 8.

-see-also

DXGI Interfaces

IDXGIObject