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

旗標的位元 OR 組合，用於指定如何關閉開發主機。下表列出可用的旗標：

| 值 | 常數 | 描述 |
| - | - | - |
| 0x00000001 | XTFSHUTDOWN\_REBOOT | 關閉並重新啟動開發主機。 |
| 0x00000002 | XTFSHUTDOWN\_POWER\_MODE\_AWARE | 根據主機的電源模式設定關閉並重新啟動開發主機。 |

<a id="retvalSection" />

### 傳回值

類型：HRESULT

如果成功，則傳回 `S_OK`；否則傳回 HRESULT 錯誤碼。

<a id="remarksSection" />

## 備註

此函式會依據 `dwFlags` 中指定的旗標組合，關閉目前的開發主機。如果在叫用函式時系統尚未準備好接受關機要求，函式會包含重試邏輯，例如在無法存取 System OS 時，改為使用 Host OS 作為後援來嘗試關閉主機。函式會持續嘗試關閉主機，直到成功，或在 5 分鐘後逾時並傳回錯誤為止。

如需使用 XBOX Tools Framework (XTF) 關閉及重新啟動主機的詳細資訊，請參閱[重新開機 (xbreboot.exe) (NDA 主題)](/zh-TW/tools/tools-console/commandlinetools/xbreboot)。

<a id="requirementsSection" />

## 需求

**標頭：** xtfconsolecontrol.h

**程式庫：** xtfconsolecontrol.lib

**支援的平台：** Windows (適用於 XBOX 主機工具)

<a id="seealsoSection" />

## 另請參閱

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


## Related topics

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