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

# GetHeapProperties

> 針對放置資源和認可資源，擷取資源堆積的屬性。

針對放置資源和認可資源，擷取資源堆積的屬性。

## 語法

```cpp theme={null}
HRESULT GetHeapProperties(
    D3D12_HEAP_PROPERTIES  pHeapProperties,
    D3D12_HEAP_FLAGS  pHeapFlags
)
```

### 參數

*pHeapProperties \[out, optional]*<br />類型：D3D12\_HEAP\_PROPERTIES \*

指向 [D3D12\_HEAP\_PROPERTIES](/zh-TW/reference/graphics/d3d12/structs/d3d12_heap_properties_public) 結構的指標，方法成功完成時，該結構會包含資源堆積屬性。

*pHeapFlags \[out, optional]*<br />類型：D3D12\_HEAP\_FLAGS \*

指定 [D3D12\_HEAP\_FLAGS](/zh-TW/reference/graphics/d3d12_x/enums/d3d12_heap_flags) 變數，方法成功完成時，該變數會包含任何其他堆積旗標。

### 傳回值

類型：HRESULT

此方法會傳回其中一個 [Direct3D 12 傳回碼](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/d3d12-graphics-reference-returnvalues)。如果資源是以保留資源的方式建立，則會傳回 E\_INVALIDARG。

## 備註

此方法僅適用於放置資源和認可資源，不適用於保留資源。如果資源是以保留資源的方式建立，則會傳回 E\_INVALIDARG。這些頁面可能未對應至任何堆積，或對應至一個或多個堆積。

如需詳細資訊，請參閱 [Direct3D 12 中的記憶體管理](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/memory-management)。

## 需求

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

## 另請參閱

[ID3D12Resource](/zh-TW/reference/graphics/d3d12_xs/interfaces/ID3D12Resource/id3d12resource_xs)


## Related topics

- [D3D12_HEAP_TYPE](/zh-TW/reference/graphics/d3d12/enums/d3d12_heap_type_public.md)
- [D3D12_CPU_PAGE_PROPERTY](/zh-TW/reference/graphics/d3d12/enums/d3d12_cpu_page_property_public.md)
- [XMemGetTitleHeap](/zh-TW/reference/system/xmem/functions/xmemgettitleheap.md)
- [ApuHeapGetState](/zh-TW/reference/audio/apu/functions/apuheapgetstate.md)
- [XMemGetWin32HeapName](/zh-TW/reference/system/xmem/functions/xmemgetwin32heapname.md)
