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

# OpenExistingHeapFromAddress

> Creates a special-purpose diagnostic heap in system memory from an address. The created heap can persist even in the event of a GPU-fault or device-removed.

Creates a special-purpose diagnostic heap in system memory from an address. The created heap can persist even in the event of a GPU-fault or device-removed scenario.

## Syntax

```cpp theme={null}
HRESULT OpenExistingHeapFromAddress(
    const void  pAddress,
    const IID & riid,
    void  ppvHeap
)
```

### Parameters

*pAddress \[in]*<br />Type: const void \*

The address used to create the heap.

*riid*<br />Type: const IID &

The globally unique identifier (**GUID**) for the heap interface ([ID3D12Heap](/reference/graphics/d3d12/interfaces/id3d12heap/id3d12heap_public)).

The **REFIID**, or **GUID**, of the interface to the heap can be obtained by using the **\_\_uuidof()** macro. For example, **\_\_uuidof(ID3D12Heap)** will retrieve the **GUID** of the interface to a heap.

*ppvHeap \[out]*<br />Type: void \*\*

[SAL](https://learn.microsoft.com/en-us/visualstudio/code-quality/annotating-function-parameters-and-return-values?view=vs-2015\&preserve-view=true): <code>*COM\_Outptr*</code>

A pointer to a memory block. On success, the D3D12 runtime will write a pointer to the newly-opened heap into the memory block. The type of the pointer depends on the provided **riid** parameter.

### Return value

Type: HRESULT

This method returns **E\_OUTOFMEMORY** if there is insufficient memory to open the existing heap. See [Direct3D 12 Return Codes](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/d3d12-graphics-reference-returnvalues) for other possible return values.

## Remarks

The heap is created in system memory and permits CPU access. It wraps the entire VirtualAlloc region.

Heaps can be used for placed and reserved resources, as orthogonally as other heaps. Restrictions may still exist based on the flags that cannot be app-chosen.

## Requirements

**Header:** d3d12\_xs.h or d3d12\_x.h<br />**Library:** d3d12\_xs.lib or d3d12\_x.lib<br />**Supported Platforms**: XBOX Series consoles and XBOX One family

## See Also

[ID3D12Device3 interface](/reference/graphics/d3d12_x/interfaces/id3d12device3/id3d12device3)


## Related topics

- [OpenExistingHeapFromFileMapping](/reference/graphics/d3d12/interfaces/id3d12device3/methods/id3d12device3_openexistingheapfromfilemapping_public.md)
- [PFAuthenticationReLoginWithOpenIdConnectAsync](/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationreloginwithopenidconnectasync.md)
- [D3D12_FEATURE_DATA_EXISTING_HEAPS](/reference/graphics/d3d12/structs/d3d12_feature_data_existing_heaps_public.md)
- [XMemCreateWin32Heap](/reference/system/xmem/functions/xmemcreatewin32heap.md)
- [OpenSharedHandle](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_opensharedhandle_public.md)
