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

# XtfDebugStringErrorCallback

> XtfDebugStringErrorCallback

# XtfDebugStringErrorCallback

对由 [XtfCaptureOutputBegin](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfapi/functions/xtfcaptureoutputbegin-xtfapi-xbox-windows-m.md) 捕获的每个错误调用的回调。

## 语法

```cpp theme={null}
void XtfDebugStringErrorCallback(
         HRESULT errorId,
         PCWSTR errorMessage,
         PVOID context
)  
```

### 参数

*errorId*\
类型：HRESULT

\[in] 发生的错误。

*errorMessage*\
类型：PCWSTR

\[in] 该错误的错误消息。

*context*\
类型：PVOID

\[in, optional] 指向传入 [XtfCaptureOutputBegin](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfapi/functions/xtfcaptureoutputbegin-xtfapi-xbox-windows-m.md) 的上下文对象的指针。

### 返回值

无。

## 备注

在捕获会话期间，`XtfCaptureOutputBegin` 函数会针对捕获到的每个错误调用此回调。将此回调函数与 [XtfDebugStringCallback](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfapi/functions/xtfdebugstringcallback-xtfapi-xbox-windows-m.md) 回调函数一起使用，以从开发主机捕获一般调试输出。如果你想监视开发主机上特定进程 ID 的调试输出，请使用调试监视客户端。有关使用调试监视客户端的更多信息，请参阅 [XtfCreateDebugMonitorClient](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfdebugmonitor/methods/xtfcreatedebugmonitorclient-xtfdebugmonitor-xbox-microsoft-m.md)。

## 要求

**头文件：** xtfapi.h

**库：** XtfApi.lib

**支持的平台：** Windows（用于 XBOX 主机工具）

## 另请参阅

[XTF 传输错误 (NDA 主题)](https://docs.xbox.com/zh-CN/tools/tools-console/commandlinetools/xtf-transport-errors.md)\
[其他 Xtf API](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfapi/atoc-xtfapi.md)


## Related topics

- [XtfDebugStringCallback](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfapi/functions/xtfdebugstringcallback-xtfapi-xbox-windows-m.md)
- [XtfCaptureOutputBegin](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfapi/functions/xtfcaptureoutputbegin-xtfapi-xbox-windows-m.md)
- [其他 Xtf API（API 内容）](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfapi/atoc-xtfapi.md)
- [OnOutputDebugString](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfdebugmonitor/classes/IXtfDebugMonitorCallback/methods/onoutputdebugstring-ixtfdebugmonitorcallback-xtfdebugmonitor-xbox-microsoft-m.md)
- [XTF_OUTPUT_DEBUG_STRING_DATA structure](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfdebugmonitor/structures/XTF_OUTPUT_DEBUG_STRING_DATA-xtfdebugmonitor-xbox-microsoft-t.md)
