> ## 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.

# AddMessage (XBOX Series 主機)

> 將偵錯訊息新增至訊息佇列，並將該訊息傳送至偵錯輸出。

將偵錯訊息新增至訊息佇列，並將該訊息傳送至偵錯輸出。

## 語法

```cpp theme={null}
HRESULT AddMessage(  
         DXGI_DEBUG_ID Producer,  
         DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category,  
         DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity,  
         DXGI_INFO_QUEUE_MESSAGE_ID ID,  
         LPCSTR pDescription  
)  
```

### 參數

*Producer*   \_In\_\
類型：[DXGI\_DEBUG\_ID](https://learn.microsoft.com/en-us/windows/desktop/direct3ddxgi/dxgi-debug-id)

產生訊息之實體的識別碼。

*Category*   \_In\_\
類型：[DXGI\_INFO\_QUEUE\_MESSAGE\_CATEGORY](https://learn.microsoft.com/en-us/windows/desktop/api/dxgidebug/ne-dxgidebug-dxgi_info_queue_message_category)

訊息的類別。

*Severity*   \_In\_\
類型：[DXGI\_INFO\_QUEUE\_MESSAGE\_SEVERITY](https://learn.microsoft.com/en-us/windows/desktop/api/dxgidebug/ne-dxgidebug-dxgi_info_queue_message_severity)

訊息的嚴重性。

*ID*   \_In\_\
類型：DXGI\_INFO\_QUEUE\_MESSAGE\_ID

訊息的唯一識別碼。

*pDescription*   \_In\_\
類型：LPCSTR

訊息字串。

### 傳回值

類型：HRESULT

如果成功，則傳回 S\_OK；否則傳回錯誤碼。如需錯誤碼清單，請參閱 [Direct3D 12 傳回碼](https://learn.microsoft.com/en-us/windows/win32/direct3d12/d3d12-graphics-reference-returnvalues)。

## 需求

**標頭：** d3d12\_xs.h

**程式庫：** d3d12\_xs.lib\
**支援的平台：** XBOX Series 主機

## 另請參閱

[IDXGIInfoQueue](/zh-TW/reference/graphics/d3d12_xs/interfaces/IDXGIInfoQueue/idxgiinfoqueue)


## Related topics

- [NDA 主題目錄 - Microsoft Learn 線上連結](/zh-TW/nda/nda-topic-directory.md)
- [XBOX Series X|S 總覽](/zh-TW/paths/series-xs/overview.md)
- [XBOX 主機遊戲的認證測試 XBOX 需求](/zh-TW/publishing/certification/console-cert-tested-requirements.md)
- [Play Anywhere(主機 + PC)總覽](/zh-TW/paths/play-anywhere/overview.md)
- [XR-130 XBOX Series X|S 世代](/zh-TW/publishing/certification/xr/xr-130.md)
