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

# XUserGetId

> XUserGetId

# XUserGetId

特定のユーザーのユーザー ID を取得します。

## 構文

```cpp theme={null}
HRESULT XUserGetId(  
         XUserHandle user,  
         uint64_t* userId  
)  
```

### パラメーター

*user*   \_In\_\
Type: XUserHandle

ユーザー ID を取得する対象のユーザーへのハンドルです。

*userId*   \_Out\_\
Type: uint64\_t\*

特定のユーザーのユーザー ID が格納されます。

### 戻り値

Type: HRESULT

HRESULT の成功またはエラー コード。

| 戻り値コード | 説明 |
| - | - |
| S\_OK | 操作は成功しました。 |
| E\_GAMEUSER\_RESOLVE\_USER\_ISSUE\_REQUIRED | ユーザーは UI を使用して問題を解決する必要があります。[XUserResolveIssueWithUiAsync](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserresolveissuewithuiasync.md) を呼び出して UI をユーザーに表示してください。 |

## 解説

ユーザーの XUID を取得します。この関数が **E\_GAMEUSER\_RESOLVE\_USER\_ISSUE\_REQUIRED** を返す場合、プロパティを取得できるようになる前に、ユーザーがシステム UI を使用して問題を解決する必要があります。[XUserResolveIssueWithUiAsync](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserresolveissuewithuiasync.md) を呼び出してシステム UI を表示し、問題を解決します。

## 要件

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

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

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

## 概念ドキュメント

* [Game Chat 2 C++ API の使用](https://docs.xbox.com/ja-jp/services/xbox-services/multiplayer/chat/game-chat2/using-game-chat-2.md)

## 関連項目

[XUser](https://docs.xbox.com/ja-jp/reference/system/xuser/xuser_members.md)

[XUserFindUserById](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserfinduserbyid.md)

[XUserFindUserByLocalId](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserfinduserbylocalid.md)


## Related topics

- [XUserGetLocalId](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetlocalid.md)
- [XUserGetMaxUsers](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetmaxusers.md)
- [XUserGetGamertag](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetgamertag.md)
- [PC 上の XStore — DRM、ライセンス トークン、サンドボックス](https://docs.xbox.com/ja-jp/publishing/xstore-commerce/xstore-pc.md)
- [ユーザー ID と XUser](https://docs.xbox.com/ja-jp/build/core-features/common/user/player-identity-xuser.md)
