> ## 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](/reference/graphics/d3d12/structs/d3d12_heap_properties_public) 结构的指针，在方法成功完成后，该结构将包含资源堆属性。

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

指定一个 [D3D12\_HEAP\_FLAGS](/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](/reference/graphics/d3d12_xs/interfaces/ID3D12Resource/id3d12resource_xs)


## Related topics

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