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

# XtfDebugStringCallback

> XtfDebugStringCallback

# XtfDebugStringCallback

对由 [XtfCaptureOutputBegin](/reference/tools/xtf/xtfapi/functions/xtfcaptureoutputbegin-xtfapi-xbox-windows-m) 捕获的每个输出调试字符串调用的回调。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
void *XtfDebugStringCallback(
         UINT32 processId,
         UINT32 threadId,
         UINT16 cpuGroup,
         UINT16 cpuIndex,
         UINT32 level,
         UINT32 componentId,
         UINT32 sequenceNumber,
         UINT64 interruptTime,
         UINT32 flags,
         PCWSTR sourceIdentifier,
         PCWSTR messageData,
         PVOID context
)  
```

<a id="parametersSection" />

### 参数

*processId*\
类型：UINT32

\[in] 此调试字符串所属进程的 ID。

*threadId*\
类型：UINT32

\[in] 标题的线程 ID。

*cpuGroup*\
类型：UINT16

\[in] 标题的 CPU 组。

*cpuIndex*\
类型：UINT16

\[in] 标题的 CPU 索引。

*level*\
类型：UINT32

\[in] 保留供内部使用。

*componentId*\
类型：UINT32

\[in] 保留供内部使用。

*sequenceNumber*\
类型：UINT32

\[in] 调试字符串的序列号。在极少数情况下调试字符串可能以错误顺序返回，此参数的值可用于确定调试输出的顺序。

*interruptTime*\
类型：UINT64

\[in] 保留供内部使用。

*flags*\
类型：UINT32

\[in] 保留供内部使用。

*sourceIdentifier*\
类型：PCWSTR

\[in] 调试字符串的来源。此参数将被设置为 "Title" 或 "System"。

*messageData*\
类型：PCWSTR

\[in] 调试输出字符串。

*context*\
类型：PVOID

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

<a id="retvalSection" />

### 返回值

无。

<a id="remarksSection" />

## 备注

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

<a id="requirementsSection" />

## 要求

**头文件：** xtfapi.h

**库：** XtfApi.lib

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

## 另请参阅

[XTF 传输错误 (NDA 主题)](/tools/tools-console/commandlinetools/xtf-transport-errors)\
[其他 Xtf API](/reference/tools/xtf/xtfapi/atoc-xtfapi)


## Related topics

- [XtfDebugStringErrorCallback](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfdebugstringerrorcallback-xtfapi-xbox-windows-m.md)
- [XtfCaptureOutputBegin](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfcaptureoutputbegin-xtfapi-xbox-windows-m.md)
- [IXtfDebugMonitorCallback::OnOutputDebugString Method](/zh-CN/reference/tools/xtf/xtfdebugmonitor/classes/IXtfDebugMonitorCallback/methods/onoutputdebugstring-ixtfdebugmonitorcallback-xtfdebugmonitor-xbox-microsoft-m.md)
- [XTF_OUTPUT_DEBUG_STRING_DATA structure](/zh-CN/reference/tools/xtf/xtfdebugmonitor/structures/XTF_OUTPUT_DEBUG_STRING_DATA-xtfdebugmonitor-xbox-microsoft-t.md)
- [IXtfDebugMonitorClient::Start Method](/zh-CN/reference/tools/xtf/xtfdebugmonitor/classes/IXtfDebugMonitorClient/methods/start-ixtfdebugmonitorclient-xtfdebugmonitor-xbox-microsoft-m.md)
