> ## Documentation Index
> Fetch the complete documentation index at: https://docs.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\*](https://docs.xbox.com/zh-CN/reference/audio/apu/structs/apuheapstate.md)

堆的当前状态。

*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](https://docs.xbox.com/zh-CN/reference/audio/apu/structs/apuheapstate.md) 结构。

若要创建 APU 堆,请调用 [ApuCreateHeap](https://docs.xbox.com/zh-CN/reference/audio/apu/functions/apucreateheap.md)。APU 堆在进程的整个生命周期内保持有效。

## Requirements

**头文件:** apu.h

**库:** acphal.lib

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

## See also

[ApuHeapState](https://docs.xbox.com/zh-CN/reference/audio/apu/structs/apuheapstate.md)\
[APU](https://docs.xbox.com/zh-CN/reference/audio/apu/apu_members.md)


## Related topics

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