> ## 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 物理堆的当前状态。

## Syntax

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

### Parameters

*apuHeapState*   \_Out\_\
Type: [ApuHeapState\*](/reference/audio/apu/structs/apuheapstate)

堆的当前状态。

*flags*   \
Type: UINT32

要查询的堆:`APU_ALLOC_CACHED` 表示已缓存堆,`APU_ALLOC_NONCACHED` 表示非缓存堆。

### Return value

Type: HRESULT

| 返回代码                         | 说明         |
| :--------------------------- | :--------- |
| S\_OK                        | 成功         |
| APU\_E\_HEAP\_NOT\_ALLOCATED | 尚未分配 APU 堆 |
| E\_INVALIDARG                | 参数无效       |

## Remarks

此函数返回一个 [ApuHeapState](/reference/audio/apu/structs/apuheapstate) 结构。

若要创建 APU 堆,请调用 [ApuCreateHeap](/reference/audio/apu/functions/apucreateheap)。APU 堆在进程的整个生命周期内保持有效。

## Requirements

**头文件:** apu.h

**库:** acphal.lib

**支持的平台:** XBOX One 系列主机和 XBOX Series 主机

## See also

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


## Related topics

- [ApuHeapState](/zh-CN/reference/audio/apu/structs/apuheapstate.md)
- [APU(音频处理单元)](/zh-CN/reference/audio/apu/apu_members.md)
- [ApuCreateHeap](/zh-CN/reference/audio/apu/functions/apucreateheap.md)
- [XApuStateOptions](/zh-CN/reference/audio/xapu/enums/xapustateoptions.md)
- [XApuProcessType](/zh-CN/reference/audio/xapu/enums/xapuprocesstype.md)
