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

# QueryResourceResidency (XBOX Series 主機)

> 取得資源陣列的常駐狀態。

取得資源陣列的常駐狀態。

## 語法

```cpp theme={null}
HRESULT QueryResourceResidency(  
         IGraphicsUnknown* ppResources,  
         DXGI_RESIDENCY* pResidencyStatus,  
         UINT NumResources  
)  
```

### 參數

*ppResources*   \_In\_reads\_(NumResources)\
類型：IGraphicsUnknown\*

[IDXGIResource](https://learn.microsoft.com/en-us/windows/win32/api/dxgi/nn-dxgi-idxgiresource) 介面的陣列。

*pResidencyStatus*   \_Out\_writes\_(NumResources)\
類型：DXGI\_RESIDENCY\*

[DXGI\_RESIDENCY](https://learn.microsoft.com/en-us/windows/win32/api/dxgi/ne-dxgi-dxgi_residency) 旗標的陣列。每個元素描述 *ppResources* 引數陣列中對應元素的常駐狀態。

*NumResources*   \_In\_\
類型：UINT

*ppResources* 引數陣列和 *pResidencyStatus* 引數陣列中的資源數目。

### 傳回值

類型：HRESULT

如果成功，會傳回 S\_OK；否則會傳回錯誤碼。如需錯誤碼清單，請參閱 [Direct3D 12 傳回碼](https://learn.microsoft.com/en-us/windows/win32/direct3d12/d3d12-graphics-reference-returnvalues)。

## 需求

**標頭：** d3d12\_xs.h

**程式庫：** d3d12\_xs.lib\
**支援的平台：** XBOX Series 主機

## 另請參閱

[IDXGIDevice](/zh-TW/reference/graphics/d3d12_xs/interfaces/IDXGIDevice/idxgidevice)


## Related topics

- [GetResourceAllocationInfo1 (XBOX Series 主機)](/zh-TW/reference/graphics/d3d12/interfaces/id3d12device4/methods/id3d12device4_getresourceallocationinfo1_public.md)
- [CreateProtectedResourceSession (XBOX Series 主機)](/zh-TW/reference/graphics/d3d12/interfaces/id3d12device4/methods/id3d12device4_createprotectedresourcesession_public.md)
- [SetResidencyPriority](/zh-TW/reference/graphics/d3d12/interfaces/id3d12device1/methods/id3d12device1_setresidencypriority_public.md)
- [D3D12_RESIDENCY_FLAGS](/zh-TW/reference/graphics/d3d12/enums/d3d12_residency_flags_public.md)
- [D3D12_RESIDENCY_PRIORITY](/zh-TW/reference/graphics/d3d12/enums/d3d12_residency_priority_public.md)
