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

# XtfCacheTitleOS

> XtfCacheTitleOS

# XtfCacheTitleOS

将一个 Game OS 添加到 OS 缓存。

<a id="syntaxSection" />

## 语法

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

<a id="parametersSection" />

### 参数

*address*<br />类型：PCWSTR

\[in] 主机的地址。

*osIdentifier*<br />类型：PCWSTR

\[in] 要添加的 Game OS 的标识符。此标识符可以是以下之一：

* 包含要添加的 Game OS 版本四部分版本号的 MicrosoftGame.config 文件的完整路径和文件名
* 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 文件。你可以使用 [XtfGetCachedTitleOSVersions](/reference/tools/xtf/xtfapi/functions/xtfgetcachedtitleosversions-xtfapi-xbox-windows-m) 函数获取主机上缓存的每个 Game OS 的版本信息。你还可以通过调用 [XtfRemoveTitleOSFromCache](/reference/tools/xtf/xtfapi/functions/xtfremovetitleosfromcache-xtfapi-xbox-windows-m) 或 [XtfRemoveTitleOSFromCacheByVersion](/reference/tools/xtf/xtfapi/functions/xtfremovetitleosfromcachebyversion-xtfapi-xbox-windows-m) 函数从缓存中移除现有的 Game OS。有关管理已配置的 Game OS 文件的更多信息，请参阅 [应用程序管理 (xbapp.exe) (NDA 主题)](/tools/tools-console/commandlinetools/xbapp) 和 [Provision (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

- [XtfRemoveTitleOSFromCache](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfremovetitleosfromcache-xtfapi-xbox-windows-m.md)
- [XtfRemoveTitleOSFromCacheByVersion](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfremovetitleosfromcachebyversion-xtfapi-xbox-windows-m.md)
- [XtfGetCachedTitleOSVersions](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfgetcachedtitleosversions-xtfapi-xbox-windows-m.md)
- [XtfStartTitleOS](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfstarttitleos-xtfapi-xbox-windows-m.md)
- [XtfStartTitleOSByVersion](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfstarttitleosbyversion-xtfapi-xbox-windows-m.md)
