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

# XUserFindControllerForUserWithUiResult

> XUserFindControllerForUserWithUiResult

# XUserFindControllerForUserWithUiResult

检索用户选择使用的应用程序本地设备 ID (APP\_LOCAL\_DEVICE\_ID)。

## 语法

```cpp theme={null}
HRESULT XUserFindControllerForUserWithUiResult(  
         XAsyncBlock* async,  
         APP_LOCAL_DEVICE_ID* deviceId  
)  
```

### 参数

*async*   \_Inout\_\
类型：XAsyncBlock\*

发送给 [XUserFindControllerForUserWithUiAsync](/reference/system/xuser/functions/xuserfindcontrollerforuserwithuiasync) 的异步块。

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

现已与用户关联的控制器的设备 ID。

### 返回值

类型：HRESULT

HRESULT 成功或错误代码。有关错误代码列表，请参阅[错误代码](/reference/errorcodes)。

### 注解

在桌面上，此函数将始终返回全零的设备 ID。

## 要求

**头文件：** XUser.h\
**库：** xgameruntime.lib\
**支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

## 另请参阅

[XUser](/reference/system/xuser/xuser_members)\
[处理控制器丢失（NDA 主题）](/build/core-features/common/user/users-dealing-with-controller-loss)


## Related topics

- [XUserFindControllerForUserWithUiAsync](/zh-CN/reference/system/xuser/functions/xuserfindcontrollerforuserwithuiasync.md)
- [处理手柄丢失](/zh-CN/build/core-features/common/user/users-dealing-with-controller-loss.md)
- [XUser](/zh-CN/reference/system/xuser/xuser_members.md)
- [面向 GDK 的 Unity C# API 包装器](/zh-CN/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XUserResolveIssueWithUiResult](/zh-CN/reference/system/xuser/functions/xuserresolveissuewithuiresult.md)
