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

# XMemGetWin32HeapName

> XMemGetWin32HeapName

# XMemGetWin32HeapName

Retrieves the name of a Win32 heap

## Syntax

```cpp theme={null}
BOOL XMemGetWin32HeapName(
  HANDLE Heap,
  PSTR Buffer,
  SIZE_T SizeOfBuffer,
  PSIZE_T ReturnLength
)
```

### Parameters

*Heap*   \_In\_\
Type: HANDLE

Heap Handle

*Buffer*   \_Out\_\
Type: PCSTR

Buffer to return the heap name in

*SizeOfBuffer*   \_In\_\
Type: SIZE\_T

Size in bytes of Buffer

*ReturnLength*   \_Out\_opt\_\
Type: PSIZE\_T

Number of bytes returned including the NULL terminator

### Return value

Type: BOOL

On success XMemGetWin32HeapName returns TRUE. If the function fails, the return value is FALSE.  To get extended error information, call <a href="https://msdn.microsoft.com/library/windows/desktop/ms679360(v=vs.85).aspx">GetLastError</a>.

## Remarks

The heap name is limited to 8 characters not including the NULL terminator.  XMemGetWin32HeapName will always NULL terminate the supplied buffer upon success.  To ensure the full name is retrieved, supply a buffer that is at least 9 bytes.

## Requirements

**Header:** xmem.h

**Library:** xmem.lib

**Supported platforms:** XBOX One family consoles and XBOX Series consoles

## See also

[xmem members](/reference/system/xmem/xmem_members)


## Related topics

- [XMemSetWin32HeapName](/reference/system/xmem/functions/xmemsetwin32heapname.md)
- [XMemGetWin32HeapStatistics](/reference/system/xmem/functions/xmemgetwin32heapstatistics.md)
- [WIN32_HEAP_STATISTICS](/reference/system/xmem/structs/win32_heap_statistics.md)
- [XMemCreateWin32Heap](/reference/system/xmem/functions/xmemcreatewin32heap.md)
- [XMemSetWin32HeapTrackingHooks](/reference/system/xmem/functions/xmemsetwin32heaptrackinghooks.md)
