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

# XTFCONSOLEDATA Structure

> XTFCONSOLEDATA Structure

# XTFCONSOLEDATA Structure

包含 [IXtfConsoleManager](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t) 实例中的开发主机的相关信息。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
typedef struct _XTFCONSOLEDATA {
    BSTR bstrAlias;
    BSTR bstrAddress;
} XTFCONSOLEDATA, *PXTFCONSOLEDATA;  
```

<a id="membersSection" />

### 成员

*bstrAlias*\
主机的名称。

*bstrAddress*\
主机的工具 IP 地址。

<a id="remarksSection" />

## 备注

此结构包含 [IXtfConsoleManager](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t) 实例中开发主机的相关信息，包括别名和 IP 地址。

**IXtfConsoleManagerCallback** 和 **IXtfEnumerateConsolesCallback** 接口在其任何回调方法被 [IXtfConsoleManager](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t) 实例调用时，会使用 `XTFCONSOLEDATA` 结构传递开发主机的相关信息。类似地，[IXtfConsoleManager](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t) 接口在 [GetConsole](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/getconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m) 和 [GetDefaultConsole](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/getdefaultconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m) 方法中使用此结构来提供有关开发主机的信息。

有关查询开发主机的详细信息，请参阅 [Connect (xbconnect.exe) (NDA 主题)](/tools/tools-console/commandlinetools/xbconnect)。

<a id="remarks_output" />

### 处理 BSTR 指针

有关处理此结构中返回的 BSTR 指针的详细信息，请参阅 [为 BSTR 分配和释放内存](https://learn.microsoft.com/cpp/atl-mfc-shared/allocating-and-releasing-memory-for-a-bstr?view=vs-2019)。

<a id="requirementsSection" />

## 要求

**头文件：** xtfconsolemanager.h

**库：** xtfconsolemanager.lib

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

<a id="seealsoSection" />

## 另请参阅

[IXtfConsoleManager Interface](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t)\
[XtfConsoleManager](/reference/tools/xtf/xtfconsolemanager/xtfconsolemanager-xbox-microsoft-n)


## Related topics

- [IXtfConsoleManagerCallback::OnAddConsole Method](/zh-CN/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManagerCallback/methods/onaddconsole-ixtfconsolemanagercallback-xtfconsolemanager-xbox-microsoft.md)
- [IXtfEnumerateConsolesCallback::OnConsoleFound Method](/zh-CN/reference/tools/xtf/xtfconsolemanager/classes/IXtfEnumerateConsolesCallback/methods/onconsolefound-ixtfenumerateconsolescallback-xtfconsolemanager-xbox-mi.md)
- [IXtfConsoleManagerCallback::OnRemoveConsole Method](/zh-CN/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManagerCallback/methods/onremoveconsole-ixtfconsolemanagercallback-xtfconsolemanager-xbox-microso.md)
- [IXtfConsoleManagerCallback::OnChangedDefaultConsole Method](/zh-CN/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManagerCallback/methods/onchangeddefaultconsole-ixtfconsolemanagercallback-xtfconsolemanager-xbox.md)
- [GAMEPAD_REPORT structure](/zh-CN/reference/tools/xtf/xtfinput/structures/GAMEPAD_REPORT-xtfinput-xbox-windows-t.md)
