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

# XMemTransferMemory

> XMemTransferMemory

# XMemTransferMemory

在分割區之間傳輸記憶體。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
BOOL XMemTransferMemory(  
         XMEM_TRANSFER_TYPE TransferType,  
         SIZE_T TransferSize  
)  
```

<a id="parametersSection" />

### 參數

*TransferType*   \_In\_<br />類型：[XMEM\_TRANSFER\_TYPE](/zh-TW/reference/system/xmem/enums/xmem_transfer_type)

指定要傳輸之記憶體的來源和目的地分割區。

*TransferSize*   \_In\_<br />類型：SIZE\_T

要在分割區之間傳輸的記憶體數量 (以位元組為單位)。此值會無條件進位到下一個 2 MB 邊界。如果此值設定為零，則不會傳輸任何記憶體。

<a id="retvalSection" />

### 傳回值

類型：BOOL

如果已成功在分割區之間傳輸記憶體，或 `TransferSize` 設定為零，則傳回 `TRUE`；否則傳回 `FALSE`。若要取得延伸錯誤資訊，請呼叫 <a href="https://msdn.microsoft.com/library/windows/desktop/ms679360(v=vs.85).aspx">GetLastError</a>。

<a id="remarksSection" />

## 備註

此函式會以 2 MB 分頁為單位，在分割區之間傳輸記憶體。如果 `TransferSize` 設定為大於零的值，該值會無條件進位到下一個 2 MB 邊界。如果該值設定為零，則不會傳輸任何記憶體，且函式會傳回 `TRUE`。

在 AnacondaProfiling 模式下，對 XBOX Series X 主機系列或 XBOX Series X|S 主機系列使用進階記憶體模式時，適用下列額外限制：

* `XMemTransferToolsToTitle` 只會傳輸 GPU 最佳頻寬記憶體。此功能類似於 XBOX Tools Framework (XTF) 隨附之組態 (xbconfig.exe) 工具中的 `ExtraTitleMemory` 選項。如需詳細資訊，請參閱[組態 (xbconfig.exe)](/zh-TW/tools/tools-console/commandlinetools/xbconfig)。
* `XMemTransferToolsToSystem` 和 `XMemTransferTitleToSystem` 只會傳輸標準頻寬記憶體。

使用 Lockhart 分析模式時，不支援 `XMemTransferToolsToTitle`。

如需主機系列記憶體組態的詳細資訊，請參閱[為您的遊戲和開發套件設定記憶體](/zh-TW/build/console-features/memory/system-memory-tooling)。

<Note>
  傳輸到系統的記憶體在多次呼叫 [XLaunchNewGame](/zh-TW/reference/system/xgame/functions/xlaunchnewgame) 之間會持續保留。
</Note>

<a id="requirementsSection" />

## 需求

**標頭：** xmem.h

**程式庫：** xmem.lib

**支援的平台**：XBOX One 系列主機和 XBOX Series 主機

<a id="seealsoSection" />

## 另請參閱

[記憶體](/zh-TW/build/console-features/memory/system-memory-overview)<br />[XMem](/zh-TW/reference/system/xmem/xmem_members)


## Related topics

- [Profile-guided optimization in Visual Studio](/tools/tools-console/pgo/pgo_full.md)
- [Optimización guiada por perfiles en Visual Studio](/es/tools/tools-console/pgo/pgo_full.md)
- [Visual Studio에서의 프로필 기반 최적화](/ko/tools/tools-console/pgo/pgo_full.md)
- [XLaunchNewGame](/reference/system/xgame/functions/xlaunchnewgame.md)
- [Visual Studio でのプロファイルガイド付き最適化](/ja-jp/tools/tools-console/pgo/pgo_full.md)
