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

# XtfCaptureOutputBegin

> XtfCaptureOutputBegin

# XtfCaptureOutputBegin

デバッグ出力のキャプチャを開始します。

## Syntax

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

### Parameters

*address*\
型: PCWSTR

\[in] コンソールの IP アドレスです。

*debugStringCallback*\
型: [XtfDebugStringCallback](https://docs.xbox.com/ja-jp/reference/tools/xtf/xtfapi/functions/xtfdebugstringcallback-xtfapi-xbox-windows-m.md)

\[in, optional] 出力デバッグ文字列ごとに呼び出される、省略可能なコールバックです。

*debugStringErrorCallback*\
型: [XtfDebugStringErrorCallback](https://docs.xbox.com/ja-jp/reference/tools/xtf/xtfapi/functions/xtfdebugstringerrorcallback-xtfapi-xbox-windows-m.md)

\[in, optional] 発生したエラーごとに呼び出される、省略可能なコールバックです。

*context*\
型: PVOID

\[in, optional] コールバック関数に渡されるオブジェクトへのポインターです。このオブジェクトにより、各コールバックの呼び出しをこのキャプチャ セッションに関連付けることができます。

*hListen*\
型: PHANDLE

\[out] このキャプチャ セッションを表すハンドルです。

### Return value

なし。

## Remarks

この関数と [XtfCaptureOutputEnd](https://docs.xbox.com/ja-jp/reference/tools/xtf/xtfapi/functions/xtfcaptureoutputend-xtfapi-xbox-windows-m.md) 関数を使用して、開発機からの一般的なデバッグ出力のキャプチャを開始および停止します。開発機の特定のプロセス ID からのデバッグ出力を監視する場合は、デバッグ モニター クライアントを使用してください。デバッグ モニター クライアントの使用方法の詳細については、[XtfCreateDebugMonitorClient](https://docs.xbox.com/ja-jp/reference/tools/xtf/xtfdebugmonitor/methods/xtfcreatedebugmonitorclient-xtfdebugmonitor-xbox-microsoft-m.md) を参照してください。

キャプチャ セッションでデバッグ文字列をキャプチャするには、`debugStringCallback` に `XtfDebugStringCallback` 関数を実装して指定する必要があります。同様に、キャプチャ セッション中に発生したエラーをキャプチャするには、`debugStringErrorCallback` に `XtfDebugStringErrorCallback` 関数を実装して指定する必要があります。ただし、どちらのコールバック関数も必須ではありません。

デバッグ出力のキャプチャを停止し、キャプチャ セッションに関連付けられたリソースを解放するには、[XtfCaptureOutputEnd](https://docs.xbox.com/ja-jp/reference/tools/xtf/xtfapi/functions/xtfcaptureoutputend-xtfapi-xbox-windows-m.md) を呼び出し、そのキャプチャ セッションに対して `hListen` で返されたハンドルを指定します。

> [!NOTE]
>
> キャプチャ セッションを停止するには、`XtfCaptureOutputEnd` を呼び出す必要があります。呼び出さない場合、キャプチャ セッションは孤立し、それに関連付けられたリソースが解放されないため、メモリ リークが発生します。

## Requirements

**ヘッダー:** xtfapi.h

**ライブラリ:** XtfApi.lib

**サポートされているプラットフォーム:** Windows (XBOX コンソール ツール用)

## See also

[IXtfDebugMonitorClient Interface](https://docs.xbox.com/ja-jp/reference/tools/xtf/xtfdebugmonitor/classes/IXtfDebugMonitorClient/ixtfdebugmonitorclient-xtfdebugmonitor-xbox-microsoft-t.md)\
[XTF Transport Errors (NDA topic)](https://docs.xbox.com/ja-jp/tools/tools-console/commandlinetools/xtf-transport-errors.md)\
[Additional Xtf APIs](https://docs.xbox.com/ja-jp/reference/tools/xtf/xtfapi/atoc-xtfapi.md)


## Related topics

- [XtfCaptureOutputEnd](https://docs.xbox.com/ja-jp/reference/tools/xtf/xtfapi/functions/xtfcaptureoutputend-xtfapi-xbox-windows-m.md)
- [その他の Xtf API (API の内容)](https://docs.xbox.com/ja-jp/reference/tools/xtf/xtfapi/atoc-xtfapi.md)
- [IXtfDebugMonitorClient インターフェイス (インターフェイスの内容)](https://docs.xbox.com/ja-jp/reference/tools/xtf/xtfdebugmonitor/classes/IXtfDebugMonitorClient/ixtfdebugmonitorclient-xtfdebugmonitor-xbox-microsoft-t.md)
- [XtfDebugStringErrorCallback](https://docs.xbox.com/ja-jp/reference/tools/xtf/xtfapi/functions/xtfdebugstringerrorcallback-xtfapi-xbox-windows-m.md)
- [XtfDebugStringCallback](https://docs.xbox.com/ja-jp/reference/tools/xtf/xtfapi/functions/xtfdebugstringcallback-xtfapi-xbox-windows-m.md)
