> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SetPrivateDataInterface

> 將 IUnknown 衍生的介面與裝置物件建立關聯，並將該介面與應用程式定義的 GUID 建立關聯。

將 [IUnknown](https://learn.microsoft.com/en-us/windows/desktop/api/unknwn/nn-unknwn-iunknown) 衍生的介面與裝置物件建立關聯，並將該介面與應用程式定義的 **GUID** 建立關聯。

## 語法

```cpp theme={null}
HRESULT SetPrivateDataInterface(
    const GUID & guid,
    const IUnknown  pData
)
```

### 參數

*guid \[in]*\
類型：const GUID &

要與介面建立關聯的 **GUID**。

*pData \[in, optional]*\
類型：const IUnknown \*

指向要與裝置物件建立關聯之 [IUnknown](https://learn.microsoft.com/en-us/windows/desktop/api/unknwn/nn-unknwn-iunknown) 衍生介面的指標。

### 傳回值

類型：HRESULT

此方法會傳回其中一個 [Direct3D 12 傳回碼](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/d3d12-graphics-reference-returnvalues)。

## 需求

**標頭:** d3d12\_xs.h 或 d3d12\_x.h\
**程式庫:** d3d12\_xs.lib 或 d3d12\_x.lib\
**支援的平台**: XBOX Series 主機和 XBOX One 系列

## 另請參閱

[ID3D12Object](/zh-TW/reference/graphics/d3d12_xs/interfaces/ID3D12Object/id3d12object)


## Related topics

- [GetPrivateData](/zh-TW/reference/graphics/d3d12/interfaces/id3d12object/methods/id3d12object_getprivatedata_public.md)
- [CreatePipelineLibrary](/zh-TW/reference/graphics/d3d12/interfaces/id3d12device1/methods/id3d12device1_createpipelinelibrary_public.md)
- [SetPrivateData](/zh-TW/reference/graphics/d3d12/interfaces/id3d12object/methods/id3d12object_setprivatedata_public.md)
- [SetName](/zh-TW/reference/graphics/d3d12/interfaces/id3d12object/methods/id3d12object_setname_public.md)
- [Update Shared Group Data](/api-reference/shared-group-data/update-shared-group-data.md)
