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

# GetDeviceId

> ILampArray::GetDeviceId

# ILampArray::GetDeviceId

返回 ILampArray 的系统生成 ID。

## 语法

```cpp theme={null}
void GetDeviceId(
    APP_LOCAL_DEVICE_ID* deviceId)
```

### 参数

*deviceId*  \_Out\_
类型：APP\_LOCAL\_DEVICE\_ID\*

指向 APP\_LOCAL\_DEVICE\_ID 结构的指针，设备 ID 将被复制到该结构中。

### 返回值

类型：void

## 备注

*应用程序本地设备 ID* 是一个特殊的 32 字节值，可唯一标识设备，即使应用程序重启或系统重新启动后仍然保持一致。对于无线设备的断开与重连，以及只要重新插入同一 USB 端口的有线 USB 设备，此 ID 也保持稳定。

在初始版本中，此函数将填充一个全零值。

## 要求

**头文件：** LampArray.h

**库：** xgameplatform.lib

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

## 另请参阅

[光照 API 概览](https://docs.xbox.com/zh-CN/build/core-features/common/lighting/gc-lighting-toc.md)\
[ILampArray](https://docs.xbox.com/zh-CN/reference/lighting/lamparray/interfaces/ilamparray/ilamparray.md)


## Related topics

- [ILampArray（接口内容）](https://docs.xbox.com/zh-CN/reference/lighting/lamparray/interfaces/ilamparray/ilamparray.md)
- [post_decode_audio_sink_stream::get_device_id](https://docs.xbox.com/zh-CN/reference/chat/gamechat2/classes/post_decode_audio_sink_stream/methods/post_decode_audio_sink_stream_get_device_id.md)
- [XInputGetDeviceId](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputgetdeviceid.md)
- [XSystemGetAppSpecificDeviceId](https://docs.xbox.com/zh-CN/reference/system/xsystem/functions/xsystemgetappspecificdeviceid.md)
- [APP_LOCAL_DEVICE_ID](https://docs.xbox.com/zh-CN/reference/system/xuser/structs/app_local_device_id.md)
