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

# XblMemSetFunctions

> XblMemSetFunctions

# XblMemSetFunctions

選擇性地設定記憶體攔截函式，讓呼叫端可以將記憶體配置路由至自己的記憶體管理員。

## 語法

```cpp theme={null}
HRESULT XblMemSetFunctions(  
         XblMemAllocFunction memAllocFunc,  
         XblMemFreeFunction memFreeFunc  
)  
```

### 參數

*memAllocFunc*   \_In\_opt\_\
類型：XblMemAllocFunction

要使用之自訂配置回呼的指標，或用來還原預設值的 Null 指標。

*memFreeFunc*   \_In\_opt\_\
類型：XblMemFreeFunction

要使用之自訂釋放回呼的指標，或用來還原預設值的 Null 指標。

### 傳回值

類型：HRESULT

此 API 作業的 HRESULT 傳回碼。

## 備註

此函式必須在 XblInitialize() 之前呼叫，而且在 XblCleanup() 之前無法再次呼叫。此方法可讓應用程式安裝自訂記憶體配置常式來處理所有新記憶體緩衝區的要求，而不使用預設配置常式。*memAllocFunc* 和 *memFreeFunc* 參數可以是 Null 指標，以還原預設常式。兩個回呼指標必須同時為 Null 或同時為非 Null。不允許混用自訂常式和預設常式。

## 需求

**標頭：** xbox\_live\_global\_c.h

**程式庫：** Microsoft.Xbox.Services.14x.GDK.C.lib

## 另請參閱

[xbox\_live\_global\_c](/zh-TW/reference/live/xsapi-c/xbox_live_global_c/xbox_live_global_c_members)


## Related topics

- [XblMemGetFunctions](/zh-TW/reference/live/xsapi-c/xbox_live_global_c/functions/xblmemgetfunctions.md)
- [XblInitialize](/zh-TW/reference/live/xsapi-c/xbox_live_global_c/functions/xblinitialize.md)
- [XblCleanupAsync](/zh-TW/reference/live/xsapi-c/xbox_live_global_c/functions/xblcleanupasync.md)
- [XSAPI C 概觀](/zh-TW/services/xbox-services/fundamentals/xbox-services-api/live-xsapi-flat-c.md)
- [HCMemSetFunctions](/zh-TW/reference/live/httpclient/httpclient/functions/hcmemsetfunctions.md)
