> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XMemGetWin32HeapStatistics

> XMemGetWin32HeapStatistics

# XMemGetWin32HeapStatistics

获取给定堆的统计信息。

## 语法

```cpp theme={null}
BOOL XMemGetWin32HeapStatistics(
    _In_ HANDLE Heap,
    _Out_ PWIN32_HEAP_STATISTICS Statistics
    );
```

### 参数

*Heap*   \_In\_\
类型：HANDLE

要获取统计信息的堆句柄

*Statistics*   \_Out\_\
类型：PWIN32\_HEAP\_STATISTICS

指向用于包含统计信息的 [WIN32\_HEAP\_STATISTICS](https://docs.xbox.com/zh-CN/reference/system/xmem/structs/win32_heap_statistics.md) 结构的指针。

### 返回值

类型：BOOL

如果可以填充 [WIN32\_HEAP\_STATISTICS](https://docs.xbox.com/zh-CN/reference/system/xmem/structs/win32_heap_statistics.md) 结构，则返回 `TRUE`；否则返回 `FALSE`。

## 备注

此函数返回统计信息，例如 win32 堆中的提交大小。返回的提交大小是 win32 堆所消耗的总内存的估计值。

## 要求

**标头：** xmem.h

**库：** xmem.lib

**支持的平台：** XBOX One 系列主机和 XBOX Series 主机

## 请参阅

[诊断与内存跟踪](https://docs.xbox.com/zh-CN/build/console-features/memory/system-memory-diagnostics.md)\
[WIN32\_HEAP\_STATISTICS](https://docs.xbox.com/zh-CN/reference/system/xmem/structs/win32_heap_statistics.md)\
[XMem](https://docs.xbox.com/zh-CN/reference/system/xmem/xmem_members.md)


## Related topics

- [WIN32_HEAP_STATISTICS](https://docs.xbox.com/zh-CN/reference/system/xmem/structs/win32_heap_statistics.md)
- [XMemGetWin32HeapName](https://docs.xbox.com/zh-CN/reference/system/xmem/functions/xmemgetwin32heapname.md)
- [XMemSetWin32HeapName](https://docs.xbox.com/zh-CN/reference/system/xmem/functions/xmemsetwin32heapname.md)
- [XMemCreateWin32Heap](https://docs.xbox.com/zh-CN/reference/system/xmem/functions/xmemcreatewin32heap.md)
- [XMemSetWin32HeapTrackingHooks](https://docs.xbox.com/zh-CN/reference/system/xmem/functions/xmemsetwin32heaptrackinghooks.md)
