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

# ApuHeapGetState

> ApuHeapGetState

# ApuHeapGetState

查詢 APU 實體堆積的目前狀態。

## 語法

```cpp theme={null}
HRESULT ApuHeapGetState(  
         ApuHeapState* apuHeapState,  
         UINT32 flags = APU_ALLOC_CACHED  
)  
```

### 參數

*apuHeapState*   \_Out\_\
類型：[ApuHeapState\*](/zh-TW/reference/audio/apu/structs/apuheapstate)

堆積的目前狀態。

*flags*   \
類型：UINT32

要查詢的堆積：`APU_ALLOC_CACHED` 表示快取堆積，`APU_ALLOC_NONCACHED` 表示非快取堆積。

### 傳回值

類型：HRESULT

| 傳回碼 | 描述 |
| :- | :- |
| S\_OK | 成功 |
| APU\_E\_HEAP\_NOT\_ALLOCATED | 尚未配置 APU 堆積 |
| E\_INVALIDARG | 無效的引數 |

## 備註

此函式會傳回 [ApuHeapState](/zh-TW/reference/audio/apu/structs/apuheapstate) 結構。

若要建立 APU 堆積，請呼叫 [ApuCreateHeap](/zh-TW/reference/audio/apu/functions/apucreateheap)。APU 堆積會在處理序的整個存留期間持續存在。

## 需求

**標頭：** apu.h

**程式庫：** acphal.lib

**支援的平台：** XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[ApuHeapState](/zh-TW/reference/audio/apu/structs/apuheapstate)\
[APU](/zh-TW/reference/audio/apu/apu_members)


## Related topics

- [ApuHeapGetState](/es/reference/audio/apu/functions/apuheapgetstate.md)
- [ApuHeapState](/reference/audio/apu/structs/apuheapstate.md)
