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

# SetResidencyPriority

> 此方法设置指定对象列表的驻留优先级。

此方法设置指定对象列表的驻留优先级。

## 语法

```cpp theme={null}
HRESULT SetResidencyPriority(
    UINT NumObjects,
    ID3D12Pageable const  ppObjects,
    const D3D12_RESIDENCY_PRIORITY  pPriorities
)
```

### 参数

*NumObjects*<br />类型：UINT

指定 <i>ppObjects</i> 和 <i>pPriorities</i> 数组中的对象数量。

*ppObjects \[in]*<br />类型：ID3D12Pageable \*const \*

指定一个长度为 <i>NumObjects</i> 的数组，包含对 [ID3D12Pageable](/reference/graphics/d3d12/interfaces/id3d12pageable/id3d12pageable_public) 对象的引用。

*pPriorities \[in]*<br />类型：const D3D12\_RESIDENCY\_PRIORITY \*

指定一个长度为 <i>NumObjects</i> 的 [D3D12\_RESIDENCY\_PRIORITY](/reference/graphics/d3d12/enums/d3d12_residency_priority_public) 值数组，用于对象列表。

### 返回值

类型：HRESULT

此方法返回 HRESULT 成功或错误代码。

## 备注

有关更多信息，请参阅 [Residency](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/residency)。

## 要求

**头文件：** d3d12\_xs.h 或 d3d12\_x.h<br />**库：** d3d12\_xs.lib 或 d3d12\_x.lib<br />**支持的平台**：XBOX Series 主机和 XBOX One 系列

## 另请参阅

[ID3D12Device1](/reference/graphics/d3d12/interfaces/id3d12device1/id3d12device1_public)


## Related topics

- [D3D12_RESIDENCY_PRIORITY](/zh-CN/reference/graphics/d3d12/enums/d3d12_residency_priority_public.md)
- [DSTORAGE_PRIORITY](/zh-CN/reference/system/dstorage/enums/dstorage_priority.md)
- [D3D12_RESIDENCY_FLAGS](/zh-CN/reference/graphics/d3d12/enums/d3d12_residency_flags_public.md)
- [DSTORAGE_PRIORITY_STATS](/zh-CN/reference/system/dstorage/structs/dstorage_priority_stats.md)
- [XAppCaptureMetadataPriority](/zh-CN/reference/system/xappcapture/enums/xappcapturemetadatapriority.md)
