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

# PHEAP_TRACK_REALLOC_ROUTINE 回呼

> PHEAP_TRACK_REALLOC_ROUTINE 回呼

# PHEAP\_TRACK\_REALLOC\_ROUTINE 回呼

代表堆積重新配置的追蹤回呼函式。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
void PHEAP_TRACK_REALLOC_ROUTINE(  
         HANDLE Heap,  
         DWORD Flags,  
         SIZE_T Size,  
         PVOID OldAddr,  
         PVOID NewAddr  
)  
```

<a id="parametersSection" />

### 參數

*Heap*   \
類型：HANDLE

重新配置記憶體區塊之堆積的控制代碼。

*Flags*   \
類型：DWORD

傳遞給 [HeapReAlloc](https://learn.microsoft.com/windows/desktop/api/heapapi/nf-heapapi-heaprealloc) 的堆積重新配置選項。

*Size*   \
類型：SIZE\_T

記憶體區塊的新大小 (以位元組為單位)。

*OldAddr*   \
類型：PVOID

`HeapReAlloc` 所重新配置之記憶體區塊的原始位址。

*NewAddr*   \
類型：PVOID

重新配置之記憶體區塊的新位址。

<a id="retvalSection" />

### 傳回值

類型：void

無。

<a id="remarksSection" />

## 備註

可以實作此回呼函式，以追蹤何時從 Win32 堆積重新配置記憶體區塊。實作後，您必須呼叫 [XMemSetWin32HeapTrackingHooks](/zh-TW/reference/system/xmem/functions/xmemsetwin32heaptrackinghooks) 來註冊已實作的回呼函式。之後，在呼叫 `HeapReAlloc` 從 Win32 堆積重新配置先前已配置的記憶體區塊後，就會叫用此回呼函式。如需實作此回呼函式的詳細資訊，請參閱 `XMemSetWin32HeapTrackingHooks` 的[備註](/zh-TW/reference/system/xmem/functions/xmemsetwin32heaptrackinghooks#remarksSection)一節。

<a id="requirementsSection" />

## 需求

**標頭：** xmem.h

**程式庫：** xmem.lib

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

<a id="seealsoSection" />

## 另請參閱

[診斷與記憶體追蹤](/zh-TW/build/console-features/memory/system-memory-diagnostics)\
[XMemCreateWin32Heap](/zh-TW/reference/system/xmem/functions/xmemcreatewin32heap)\
[PHEAP\_TRACK\_ALLOC\_ROUTINE](/zh-TW/reference/system/xmem/functions/pheap_track_alloc_routine)\
[PHEAP\_TRACK\_FREE\_ROUTINE](/zh-TW/reference/system/xmem/functions/pheap_track_free_routine)\
[XMem](/zh-TW/reference/system/xmem/xmem_members)


## Related topics

- [PHEAP_TRACK_REALLOC_ROUTINE callback](/reference/system/xmem/functions/pheap_track_realloc_routine.md)
- [PHEAP_TRACK_ALLOC_ROUTINE callback](/reference/system/xmem/functions/pheap_track_alloc_routine.md)
- [PHEAP_TRACK_FREE_ROUTINE callback](/reference/system/xmem/functions/pheap_track_free_routine.md)
