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

# XtfStartTitleOS

> XtfStartTitleOS

# XtfStartTitleOS

启动或重新启动指定的 Game OS。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
HRESULT XtfStartTitleOS(
         PCWSTR address,
         PCWSTR osIdentifier
)  
```

<a id="parametersSection" />

### 参数

*address*<br />类型：PCWSTR

\[in] 主机的地址。

*osIdentifier*<br />类型：PCWSTR

\[in, optional] 要启动的 Game OS 的标识符。此标识符可以是以下之一：

* MicrosoftGame.config 文件的完整路径和文件名，该文件包含要启动的 Game OS 版本的四部分版本号
* GameOs.xvd 文件的完整路径和文件名
* 包含 MicrosoftGame.config 或 GameOS.vxd 文件的目录的完整路径
* 要启动的 Game OS 的四部分版本号

有效标识符的示例：

* D:\MyGame
* \MyDevPC\share\MyGame\MicrosoftGame.config
* xd:\Titles\MyGamePFN\GameOs.xvd
* 10.0.18236.1002

<a id="retvalSection" />

### 返回值

类型：HRESULT

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

<a id="remarksSection" />

## 备注

使用此函数从主机的缓存中启动或重新启动指定的 Game OS。

如果你有想要启动的 Game OS 的 [FourPartVersion](/reference/tools/xtf/xtfapi/structs/fourpartversion-xtfapi-xbox-windows-s)，请改用 [XtfStartTitleOSByVersion](/reference/tools/xtf/xtfapi/functions/xtfstarttitleosbyversion-xtfapi-xbox-windows-m) 函数来启动该 Game OS 版本。你可以使用 [XtfGetCachedTitleOSVersions](/reference/tools/xtf/xtfapi/functions/xtfgetcachedtitleosversions-xtfapi-xbox-windows-m) 函数获取主机上缓存的每个 Game OS 的 `FourPartVersion`，或使用 [XtfGetTitleOSFourPartVersion](/reference/tools/xtf/xtfapi/functions/xtfgettitleosfourpartversion-xtfapi-xbox-windows-m) 函数获取当前正在运行的标题的 Game OS 的 `FourPartVersion`。你还可以使用 [XtfStartTitleOSByGameConfig](/reference/tools/xtf/xtfapi/functions/xtfstarttitleosbygameconfig-xtfapi-xbox-windows-m) 函数启动在指定 MicrosoftGame.config 文件内容中标识的 Game OS。

如果需要，你可以通过调用 [XtfCacheTitleOS](/reference/tools/xtf/xtfapi/functions/xtfcachetitleos-xtfapi-xbox-windows-m) 函数向主机的缓存中添加 Game OS。有关管理已预配 Game OS 文件的详细信息，请参阅[应用程序管理 (xbapp.exe) (NDA 主题)](/tools/tools-console/commandlinetools/xbapp)和[预配 (xbprovision.exe) (NDA 主题)](/tools/tools-console/commandlinetools/xbprovision)。

<a id="requirementsSection" />

## 要求

**头文件：** xtfapi.h

**库：** XtfApi.lib

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

<a id="seealsoSection" />

## 另请参阅

[Run from PC Deployment (NDA 主题)](/home/setup-install/concepts/deployment)<br />[XTF 传输错误 (NDA 主题)](/tools/tools-console/commandlinetools/xtf-transport-errors)<br />[其他 Xtf API](/reference/tools/xtf/xtfapi/atoc-xtfapi)


## Related topics

- [XtfStartTitleOSByVersion](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfstarttitleosbyversion-xtfapi-xbox-windows-m.md)
- [XtfStartTitleOSByGameConfig](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfstarttitleosbygameconfig-xtfapi-xbox-windows-m.md)
- [XtfGetCachedTitleOSVersionsCallback](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfgetcachedtitleosversionscallback-xtfapi-xbox-windows-m.md)
- [IXtfDebugMonitorClient::Start Method](/zh-CN/reference/tools/xtf/xtfdebugmonitor/classes/IXtfDebugMonitorClient/methods/start-ixtfdebugmonitorclient-xtfdebugmonitor-xbox-microsoft-m.md)
- [FourPartVersion](/zh-CN/reference/tools/xtf/xtfapi/structs/fourpartversion-xtfapi-xbox-windows-s.md)
