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

# IXtfConsoleControlClient::ShutdownConsole

> IXtfConsoleControlClient::ShutdownConsole

# IXtfConsoleControlClient::ShutdownConsole

关闭开发主机。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
HRESULT ShutdownConsole(
         DWORD dwFlags
)  
```

<a id="parametersSection" />

### 参数

*dwFlags*\
类型：DWORD

指定如何关闭开发主机的标志的按位或组合。下表列出了可用的标志：

| 值          | 常量                              | 说明                      |
| ---------- | ------------------------------- | ----------------------- |
| 0x00000001 | XTFSHUTDOWN\_REBOOT             | 关闭并重新启动开发主机。            |
| 0x00000002 | XTFSHUTDOWN\_POWER\_MODE\_AWARE | 根据主机的电源模式设置关闭并重新启动开发主机。 |

<a id="retvalSection" />

### 返回值

类型：HRESULT

如果成功，则返回 `S_OK`；否则返回 HRESULT 错误代码。

<a id="remarksSection" />

## 备注

此函数根据 `dwFlags` 中指定的标志组合关闭当前开发主机。如果在调用函数时系统尚未准备好接受关闭请求，则该函数包含重试逻辑，例如在系统 OS 不可访问时尝试使用主机 OS 作为回退关闭主机。该函数会不断尝试关闭主机，直到函数成功或在 5 分钟后超时并返回错误。

有关使用 XBOX Tools Framework (XTF) 关闭并重新启动主机的详细信息，请参阅 [重新启动 (xbreboot.exe) (NDA 主题)](/tools/tools-console/commandlinetools/xbreboot)。

<a id="requirementsSection" />

## 要求

**头文件：** xtfconsolecontrol.h

**库：** xtfconsolecontrol.lib

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

<a id="seealsoSection" />

## 另请参阅

[IXtfConsoleControlClient](/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/ixtfconsolecontrolclient)\
[XtfConsoleControl](/reference/tools/xtf/xtfconsolecontrol/xtfconsolecontrol_members)


## Related topics

- [IXtfConsoleControlClient](/zh-CN/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/ixtfconsolecontrolclient.md)
- [IXtfConsoleControlClient::UpdatesPending](/zh-CN/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/methods/ixtfconsolecontrolclient_updatespending.md)
- [IXtfConsoleControlClient::SetConfigValue](/zh-CN/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/methods/ixtfconsolecontrolclient_setconfigvalue.md)
- [IXtfConsoleControlClient::GetAllSettings](/zh-CN/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/methods/ixtfconsolecontrolclient_getallsettings.md)
- [IXtfConsoleControlClient::GetConfigSettings](/zh-CN/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/methods/ixtfconsolecontrolclient_getconfigsettings.md)
