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

# 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](/reference/system/xuser/functions/xuserresolveissuewithuiasync) を呼び出して UI をユーザーに表示してください。 |

## 解説

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

## 要件

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

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

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

## 概念ドキュメント

* [Game Chat 2 C++ API の使用](/services/xbox-services/multiplayer/chat/game-chat2/using-game-chat-2)

## 関連項目

[XUser](/reference/system/xuser/xuser_members)

[XUserFindUserById](/reference/system/xuser/functions/xuserfinduserbyid)

[XUserFindUserByLocalId](/reference/system/xuser/functions/xuserfinduserbylocalid)


## Related topics

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