> ## 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 的識別碼。此識別碼可以是下列其中之一:

* 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 檔案。您可以使用 [XtfGetCachedTitleOSVersions](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfgetcachedtitleosversions-xtfapi-xbox-windows-m) 函式取得快取在主機上之每個 Game OS 的版本資訊。您也可以呼叫 [XtfRemoveTitleOSFromCache](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfremovetitleosfromcache-xtfapi-xbox-windows-m) 或 [XtfRemoveTitleOSFromCacheByVersion](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfremovetitleosfromcachebyversion-xtfapi-xbox-windows-m) 函式，從快取中移除現有的 Game OS。如需管理已佈建 Game OS 檔案的詳細資訊，請參閱[應用程式管理 (xbapp.exe) (NDA 主題)](/zh-TW/tools/tools-console/commandlinetools/xbapp) 和[佈建 (xbprovision.exe) (NDA 主題)](/zh-TW/tools/tools-console/commandlinetools/xbprovision)。

<a id="requirementsSection" />

## 需求

**標頭:** xtfapi.h

**程式庫:** XtfApi.lib

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

<a id="seealsoSection" />

## 另請參閱

[從 PC 執行部署 (NDA 主題)](/zh-TW/home/setup-install/concepts/deployment)<br />[XTF 傳輸錯誤 (NDA 主題)](/zh-TW/tools/tools-console/commandlinetools/xtf-transport-errors)<br />[其他 Xtf API](/zh-TW/reference/tools/xtf/xtfapi/atoc-xtfapi)


## Related topics

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