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

# XtfCaptureOutputBegin

> XtfCaptureOutputBegin

# XtfCaptureOutputBegin

開始擷取偵錯輸出。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
void XtfCaptureOutputBegin(
         PCWSTR address,
         XtfDebugStringCallback debugStringCallback,
         XtfDebugStringErrorCallback debugStringErrorCallback,
         PVOID context,
         PHANDLE hListen
)  
```

<a id="parametersSection" />

### 參數

*address*\
類型: PCWSTR

\[in] 主機的 IP 位址。

*debugStringCallback*\
類型: [XtfDebugStringCallback](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfdebugstringcallback-xtfapi-xbox-windows-m)

\[in, optional] 針對每個輸出偵錯字串叫用的選擇性回呼。

*debugStringErrorCallback*\
類型: [XtfDebugStringErrorCallback](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfdebugstringerrorcallback-xtfapi-xbox-windows-m)

\[in, optional] 針對每個遇到的錯誤叫用的選擇性回呼。

*context*\
類型: PVOID

\[in, optional] 傳入回呼函式之物件的指標。此物件可讓每次的回呼叫用與此擷取工作階段產生關聯。

*hListen*\
類型: PHANDLE

\[out] 代表此擷取工作階段的控制代碼。

<a id="retvalSection" />

### 傳回值

無。

<a id="remarksSection" />

## 備註

使用此函式和 [XtfCaptureOutputEnd](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfcaptureoutputend-xtfapi-xbox-windows-m) 函式，開始和停止擷取來自開發主機的一般偵錯輸出。如果您想要監視來自開發主機上特定處理序識別碼的偵錯輸出，請使用偵錯監視器用戶端。如需使用偵錯監視器用戶端的詳細資訊，請參閱 [XtfCreateDebugMonitorClient](/zh-TW/reference/tools/xtf/xtfdebugmonitor/methods/xtfcreatedebugmonitorclient-xtfdebugmonitor-xbox-microsoft-m)。

如果您想要擷取擷取工作階段的偵錯字串，就必須實作 `XtfDebugStringCallback` 函式並在 `debugStringCallback` 中指定。同樣地，您必須實作 `XtfDebugStringErrorCallback` 函式並在 `debugStringErrorCallback` 中指定，才能擷取在擷取工作階段期間遇到的錯誤。不過，這兩個回呼函式都不是必要的。

若要停止擷取偵錯輸出並釋放與擷取工作階段相關聯的資源，請呼叫 [XtfCaptureOutputEnd](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfcaptureoutputend-xtfapi-xbox-windows-m)，並指定該擷取工作階段在 `hListen` 中傳回的控制代碼。

<Note>您必須呼叫 `XtfCaptureOutputEnd` 來停止擷取工作階段。否則，擷取工作階段會成為孤立狀態，且與擷取工作階段相關聯的資源不會被釋放，進而造成記憶體流失。</Note>

<a id="requirements" />

## 需求

**標頭:** xtfapi.h

**程式庫:** XtfApi.lib

**支援的平台:** Windows (適用於 XBOX 主機工具)

<a id="seealsoSection" />

## 另請參閱

[IXtfDebugMonitorClient 介面](/zh-TW/reference/tools/xtf/xtfdebugmonitor/classes/IXtfDebugMonitorClient/ixtfdebugmonitorclient-xtfdebugmonitor-xbox-microsoft-t)\
[XTF 傳輸錯誤 (NDA 主題)](/zh-TW/tools/tools-console/commandlinetools/xtf-transport-errors)\
[其他 Xtf API](/zh-TW/reference/tools/xtf/xtfapi/atoc-xtfapi)


## Related topics

- [XtfCaptureOutputEnd](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfcaptureoutputend-xtfapi-xbox-windows-m.md)
- [XtfDebugStringErrorCallback](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfdebugstringerrorcallback-xtfapi-xbox-windows-m.md)
- [XtfDebugStringCallback](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfdebugstringcallback-xtfapi-xbox-windows-m.md)
- [PIXBeginCapture](/zh-TW/reference/tools/pix3/functions/pixbegincapture.md)
- [PIXCaptureParameters](/zh-TW/reference/tools/pix3/structs/pixcaptureparameters.md)
