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

# XUserAddByIdWithUiResult

> XUserAddByIdWithUiResult

# XUserAddByIdWithUiResult

[XUserAddByIdWithUiAysnc](/reference/system/xuser/functions/xuseraddbyidwithuiasync) が作成したユーザーへのハンドルを取得します。この関数はゲーム招待への応答の場合にのみ使用してください。

## 構文

```cpp theme={null}
HRESULT XUserAddByIdWithUiResult(  
         XAsyncBlock* async,  
         XUserHandle* newUser  
)  
```

### パラメーター

*async*   \_Inout\_\
Type: [XAsyncBlock\*](/reference/system/xasync/structs/xasyncblock)

以前 [XUserAddByIdWithUiAysnc](/reference/system/xuser/functions/xuseraddbyidwithuiasync) に渡された [XAsyncBlock](/reference/system/xasync/structs/xasyncblock)。

*newUser*   \_Out\_\
Type: XUserHandle\*

新しいユーザーへのハンドルを格納します。

### 戻り値

Type: HRESULT

HRESULT の成功またはエラー コード。
エラー コードの一覧については、[エラー コード](/reference/errorcodes) を参照してください。

| 戻りコード                       | 説明                                                                                                                            |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| S\_OK                       | 操作が成功しました。                                                                                                                    |
| E\_GAMEUSER\_USER\_NOTFOUND | [XUserAddByIdWithUiAysnc](/reference/system/xuser/functions/xuseraddbyidwithuiasync) に渡された XUID で指定されたユーザーは、デバイスにサインインしていません。 |

## 解説

この関数の使用方法の詳細については、[XUserAddByIdWithUiAysnc](/reference/system/xuser/functions/xuseraddbyidwithuiasync) を参照してください。

## 要件

**ヘッダー:** XUser.h

**ライブラリ:** xgameruntime.lib

**サポートされているプラットフォーム:** Windows、Steam Deck、XBOX One 本体、XBOX Series 本体

## 関連項目

[XUser](/reference/system/xuser/xuser_members)\
[XUserCloseHandle](/reference/system/xuser/functions/xuserclosehandle)


## Related topics

- [XUserAddByIdWithUiAsync](/ja-jp/reference/system/xuser/functions/xuseraddbyidwithuiasync.md)
- [XUser](/ja-jp/reference/system/xuser/xuser_members.md)
- [GDK 向け Unity C# API ラッパー](/ja-jp/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XUserAddResult](/ja-jp/reference/system/xuser/functions/xuseraddresult.md)
- [XUserFindControllerForUserWithUiResult](/ja-jp/reference/system/xuser/functions/xuserfindcontrollerforuserwithuiresult.md)
