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

> 從位址在系統記憶體中建立特殊用途的診斷堆積。即使發生 GPU 錯誤或裝置移除，所建立的堆積仍可持續存在。

從位址在系統記憶體中建立特殊用途的診斷堆積。即使在 GPU 錯誤或裝置移除的情況下，所建立的堆積仍可持續存在。

## 語法

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

### 參數

*pAddress \[in]*<br />類型：const void \*

用來建立堆積的位址。

*riid*<br />類型：const IID &

堆積介面 ([ID3D12Heap](/zh-TW/reference/graphics/d3d12/interfaces/id3d12heap/id3d12heap_public)) 的全域唯一識別碼 (**GUID**)。

堆積介面的 **REFIID** (或 **GUID**) 可以使用 **\_\_uuidof()** 巨集取得。例如，**\_\_uuidof(ID3D12Heap)** 會擷取堆積介面的 **GUID**。

*ppvHeap \[out]*<br />類型：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>

記憶體區塊的指標。成功時，D3D12 執行階段會將新開啟之堆積的指標寫入記憶體區塊。指標的類型取決於提供的 **riid** 參數。

### 傳回值

類型：HRESULT

如果記憶體不足而無法開啟現有的堆積，此方法會傳回 **E\_OUTOFMEMORY**。如需其他可能的傳回值，請參閱 [Direct3D 12 傳回碼](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/d3d12-graphics-reference-returnvalues)。

## 備註

堆積會在系統記憶體中建立，並允許 CPU 存取。它會包裝整個 VirtualAlloc 區域。

堆積可以用於放置的資源和保留的資源，與其他堆積一樣具有正交性。根據無法由應用程式選擇的旗標，可能仍會存在限制。

## 需求

**標頭：** d3d12\_xs.h 或 d3d12\_x.h<br />**程式庫：** d3d12\_xs.lib 或 d3d12\_x.lib<br />**支援的平台**：XBOX Series 主機與 XBOX One 系列

## 另請參閱

[ID3D12Device3 介面](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12device3/id3d12device3)


## Related topics

- [OpenExistingHeapFromFileMapping](/zh-TW/reference/graphics/d3d12/interfaces/id3d12device3/methods/id3d12device3_openexistingheapfromfilemapping_public.md)
- [D3D12_FEATURE_DATA_EXISTING_HEAPS](/zh-TW/reference/graphics/d3d12/structs/d3d12_feature_data_existing_heaps_public.md)
- [OpenSharedHandle](/zh-TW/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_opensharedhandle_public.md)
- [Update Open Id Connection](/api-reference/authentication/update-open-id-connection.md)
- [更新 OpenId 連線](/zh-TW/services/playfab/api-references/rest/admin/authentication/update-openid-connection.md)
