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

# XUser (API の内容)

> XUser

# XUser

XUser API のリファレンス情報です。

## 関数

| 関数 | 説明 |
| - | - |
| [XUserAddAsync](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuseraddasync.md) | ゲーム セッションにユーザーを非同期で追加します。 |
| [XUserAddByIdWithUiAsync](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuseraddbyidwithuiasync.md) | ゲーム招待から取得した XUID を基に、ユーザーを非同期でゲーム セッションに追加します。この関数は、ゲーム招待への応答としてのみ使用する必要があります。 |
| [XUserAddByIdWithUiResult](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuseraddbyidwithuiresult.md) | XUserAddByIdWithUiAsync が作成するユーザーのハンドルを取得します。この関数は、ゲーム招待への応答としてのみ使用する必要があります。 |
| [XUserAddResult](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuseraddresult.md) | XUserAddAsync が作成するユーザーのハンドルを取得します。 |
| [XUserChangeEventCallback](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserchangeeventcallback.md) | アプリケーションがユーザー変更イベント用に定義するコールバックです。 |
| [XUserCheckPrivilege](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusercheckprivilege.md) | ユーザーが特定の特権を持っているかどうかを判定します。 |
| [XUserCloseHandle](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserclosehandle.md) | 特定のユーザー ハンドルを閉じます。 |
| [XUserCloseSignOutDeferralHandle](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserclosesignoutdeferralhandle.md) | 特定のユーザーのサインアウト遅延ハンドルを閉じます。 |
| [XUserCompare](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusercompare.md) | 2 つのユーザー ハンドルが等しいかどうかを比較します。 |
| [XUserDefaultAudioEndpointUtf16ChangedCallback](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserdefaultaudioendpointutf16changedcallback.md) | アプリケーションが定義し、ユーザーの既定のオーディオ エンドポイントが変更されたときに呼び出されるコールバックです。 |
| [XUserDeviceAssociationChangedCallback](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserdeviceassociationchangedcallback.md) | ユーザーとデバイスの関連付けが変更されたときに呼び出されるコールバックです。 |
| [XUserDuplicateHandle](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserduplicatehandle.md) | ユーザー ハンドルを複製します。 |
| [XUserFindControllerForUserWithUiAsync](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserfindcontrollerforuserwithuiasync.md) | ユーザーに、使用するコントローラーの電源を入れて識別するよう促すダイアログを表示します。 |
| [XUserFindControllerForUserWithUiResult](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserfindcontrollerforuserwithuiresult.md) | ユーザーが使用することを選んだアプリケーション ローカル デバイス ID (APP\_LOCAL\_DEVICE\_ID) を取得します。 |
| [XUserFindForDevice](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserfindfordevice.md) | 特定のデバイス ID に対応するユーザー ID を取得します。 |
| [XUserFindUserById](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserfinduserbyid.md) | ローカル ユーザーの XBOX ユーザー ID (XUID) を取得します。 |
| [XUserFindUserByLocalId](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserfinduserbylocalid.md) | 特定のローカル ユーザー ID に対応するユーザーのハンドルを取得します。 |
| [XUserGetAgeGroup](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetagegroup.md) | ユーザーの年齢グループを返します。 |
| [XUserGetDefaultAudioEndpointUtf16](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetdefaultaudioendpointutf16.md) | 特定のユーザーの既定のオーディオ エンドポイントを取得します。 |
| [XUserGetGamerPictureAsync](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetgamerpictureasync.md) | 特定のユーザーのゲーマー アイコンを非同期に取得します。 |
| [XUserGetGamerPictureResult](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetgamerpictureresult.md) | XUserGetGamerPictureAsync の呼び出し結果を取得します。 |
| [XUserGetGamerPictureResultSize](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetgamerpictureresultsize.md) | [XUserGetGamerPictureResult](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetgamerpictureresult.md) が、]XUserGetGamerPictureAsync]\(/ja-jp/reference/system/xuser/functions/xusergetgamerpictureasync) が返すゲーマー アイコンを取得するために必要とするバッファー サイズを返します。 |
| [XUserGetGamertag](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetgamertag.md) | 特定のユーザーのゲーマータグを取得します。 |
| [XUserGetId](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetid.md) | 特定のユーザーのユーザー ID を取得します。 |
| [XUserGetIsGuest](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetisguest.md) | ユーザーがゲストかどうかを示すブール値を返します。 |
| [XUserGetLocalId](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetlocalid.md) | ユーザーの一意なゲーム セッション ID を取得します。 |
| [XUserGetMaxUsers](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetmaxusers.md) | 現在のプラットフォームでゲーム セッションに許可されるユーザーの最大数を取得します。 |
| [XUserGetMsaTokenSilentlyAsync](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetmsatokensilentlyasync.md) | この関数は現在非推奨です。 |
| [XUserGetMsaTokenSilentlyResult](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetmsatokensilentlyresult.md) | この関数は現在非推奨です。 |
| [XUserGetMsaTokenSilentlyResultSize](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetmsatokensilentlyresultsize.md) | この関数は現在非推奨です。 |
| [XUserGetSignOutDeferral](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetsignoutdeferral.md) | サインアウト遅延のハンドルを取得します。 |
| [XUserGetState](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergetstate.md) | ユーザーの状態を取得します。 |
| [XUserGetTokenAndSignatureAsync](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergettokenandsignatureasync.md) | Web リクエスト用の xtoken と署名を非同期で取得します。 |
| [XUserGetTokenAndSignatureResult](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergettokenandsignatureresult.md) | XUserGetTokenAndSignatureAsync の呼び出し結果を取得します。 |
| [XUserGetTokenAndSignatureResultSize](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergettokenandsignatureresultsize.md) | XUserGetTokenAndSignatureAsync の呼び出し結果を保持するために必要なバッファー サイズを取得します。 |
| [XUserGetTokenAndSignatureUtf16Async](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergettokenandsignatureutf16async.md) | Web リクエスト用の Unicode xtoken と署名を非同期で取得します。 |
| [XUserGetTokenAndSignatureUtf16Result](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergettokenandsignatureutf16result.md) | XUserGetTokenAndSignatureUtf16Async の呼び出し結果を取得します。 |
| [XUserGetTokenAndSignatureUtf16ResultSize](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xusergettokenandsignatureutf16resultsize.md) | XUserGetTokenAndSignatureUtf16Async の呼び出し結果を保持するために必要なバッファー サイズを取得します。 |
| [XUserIsStoreUser](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserisstoreuser.md) | XUser の MSA が Microsoft Store にサインインしている MSA と同じかどうかを確認します。 |
| [XUserRegisterForChangeEvent](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserregisterforchangeevent.md) | ユーザー変更イベント用のコールバックを登録します。 |
| [XUserRegisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserregisterfordefaultaudioendpointutf16changed.md) | アプリケーションが定義し、既定のオーディオ エンドポイントが変更されたときに呼び出されるコールバックを登録します。 |
| [XUserRegisterForDeviceAssociationChanged](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md) | ユーザーとデバイスの関連付け変更イベント用のコールバックを登録します。 |
| [XUserResolveIssueWithUiAsync](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserresolveissuewithuiasync.md) | 非 Unicode URL を使用してトークンの問題を解決するためのシステム ユーザー インターフェイスを表示します。 |
| [XUserResolveIssueWithUiResult](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserresolveissuewithuiresult.md) | XUserResolveIssueWithUiAsync の呼び出し結果を取得します。 |
| [XUserResolveIssueWithUiUtf16Async](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserresolveissuewithuiutf16async.md) | 特定の Unicode URL を使用してトークンの問題を解決するためのシステム ユーザー インターフェイスを表示します。 |
| [XUserResolveIssueWithUiUtf16Result](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserresolveissuewithuiutf16result.md) | XUserResolveIssueWithUiUtf16Async の呼び出し結果を取得します。 |
| [XUserResolvePrivilegeWithUiAsync](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserresolveprivilegewithuiasync.md) | 必要なユーザー特権を解決するためのユーザー インターフェイスを表示します。 |
| [XUserResolvePrivilegeWithUiResult](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserresolveprivilegewithuiresult.md) | XUserResolvePrivilegeWithUiAsync の呼び出し結果を取得します。 |
| [XUserUnregisterForChangeEvent](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserunregisterforchangeevent.md) | 以前に登録したユーザー変更コールバックの登録を解除します。 |
| [XUserUnregisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserunregisterfordefaultaudioendpointutf16changed.md) | 以前に登録した既定のオーディオ エンドポイント変更コールバックの登録を解除します。 |
| [XUserUnregisterForDeviceAssociationChanged](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserunregisterfordeviceassociationchanged.md) | 以前に登録したユーザーとデバイスの関連付け変更コールバックの登録を解除します。 |
| [xUserPlatformRemoteConnectSetEventHandlers](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserplatformremoteconnectseteventhandlers.md) | リモート接続イベント ハンドラーを設定します。 |
| [XUserPlatformRemoteConnectCancelPrompt](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserplatformremoteconnectcancelprompt.md) | リモート接続プロンプトがユーザーによって閉じられたことを XUser に通知します。 |
| [XUserPlatformRemoteConnectShowPromptEventHandler](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserplatformremoteconnectshowprompteventhandler.md) | リモート接続認証用のプロンプト表示イベント ハンドラーです。 |
| [XUserPlatformRemoteConnectClosePromptEventHandler](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserplatformremoteconnectcloseprompteventhandler.md) | リモート認証用のプロンプトを閉じるイベント ハンドラーです。 |
| [XUserPlatformSpopPromptEventHandler](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserplatformspopprompteventhandler.md) | SPOP 操作用のプロンプト表示イベント ハンドラーです。 |
| [XUserPlatformSpopPromptSetEventHandlers](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserplatformspoppromptseteventhandlers.md) | SPOP プロンプト イベント ハンドラーを設定します。 |
| [XUserPlatformSpopPromptClearEventHandler](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserplatformspoppromptcleareventhandler.md) | XUser の SPOP プロンプト イベント ハンドラーをクリアします。 |
| [XUserPlatformSpopPromptComplete](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserplatformspoppromptcomplete.md) | ユーザーが SPOP プロンプトの操作を終えたことを XUser に通知します。 |

## 構造体

| 構造体 | 説明 |
| - | - |
| [APP\_LOCAL\_DEVICE\_ID](https://docs.xbox.com/ja-jp/reference/system/xuser/structs/app_local_device_id.md) | ローカル入力デバイスのルート ID を指定します。 |
| [XUserDeviceAssociationChange](https://docs.xbox.com/ja-jp/reference/system/xuser/structs/xuserdeviceassociationchange.md) | デバイスとの関連付けが変更されたときの、以前および新しいデバイス関連付けを指定します。 |
| [XUserGetTokenAndSignatureData](https://docs.xbox.com/ja-jp/reference/system/xuser/structs/xusergettokenandsignaturedata.md) | Web リクエスト用に取得する xtoken と署名を指定します。 |
| [XUserGetTokenAndSignatureHttpHeader](https://docs.xbox.com/ja-jp/reference/system/xuser/structs/xusergettokenandsignaturehttpheader.md) | Web リクエスト用の HTTP ヘッダーを指定します。 |
| [XUserGetTokenAndSignatureUtf16Data](https://docs.xbox.com/ja-jp/reference/system/xuser/structs/xusergettokenandsignatureutf16data.md) | Web リクエスト用の Unicode xtoken と署名を格納します。 |
| [XUserGetTokenAndSignatureUtf16HttpHeader](https://docs.xbox.com/ja-jp/reference/system/xuser/structs/xusergettokenandsignatureutf16httpheader.md) | Web リクエスト用の Unicode HTTP ヘッダーを格納します。 |
| [XUserLocalId](https://docs.xbox.com/ja-jp/reference/system/xuser/structs/xuserlocalid.md) | ユーザーのゲーム セッション ID を指定します。 |
| [XUserPlatformRemoteConnectEventHandlers](https://docs.xbox.com/ja-jp/reference/system/xuser/structs/xuserplatformremoteconnecteventhandlers.md) | リモート接続イベント ハンドラーをカプセル化します。 |

## 列挙型

| 列挙型 | 説明 |
| - | - |
| [XUserAddOptions](https://docs.xbox.com/ja-jp/reference/system/xuser/enums/xuseraddoptions.md) | ユーザーを追加するためのオプションを指定します。 |
| [XUserAgeGroup](https://docs.xbox.com/ja-jp/reference/system/xuser/enums/xuseragegroup.md) | ユーザーの年齢グループを指定します。 |
| [XUserChangeEvent](https://docs.xbox.com/ja-jp/reference/system/xuser/enums/xuserchangeevent.md) | ユーザー変更イベントの種類を指定します。 |
| [XUserDefaultAudioEndpointKind](https://docs.xbox.com/ja-jp/reference/system/xuser/enums/xuserdefaultaudioendpointkind.md) | ユーザーの既定のオーディオ エンドポイントがオーディオをレンダリングするかキャプチャするかを指定します。 |
| [XUserGamerPictureSize](https://docs.xbox.com/ja-jp/reference/system/xuser/enums/xusergamerpicturesize.md) | ゲーマー アイコンのサイズをピクセル単位で指定します。 |
| [XUserGamertagComponent](https://docs.xbox.com/ja-jp/reference/system/xuser/enums/xusergamertagcomponent.md) | 取得するゲーマータグの種類 (コンポーネント) を指定します。 |
| [XUserGetMsaTokenSilentlyOptions](https://docs.xbox.com/ja-jp/reference/system/xuser/enums/xusergetmsatokensilentlyoptions.md) | XUserGetMsaTokenSilentlyOptions のオプションです。 |
| [XUserGetTokenAndSignatureOptions](https://docs.xbox.com/ja-jp/reference/system/xuser/enums/xusergettokenandsignatureoptions.md) | GetUserTokenAndSignatureAsync のオプションです。 |
| [XUserPrivilege](https://docs.xbox.com/ja-jp/reference/system/xuser/enums/xuserprivilege.md) | ユーザーの特権を指定します。 |
| [XUserPrivilegeDenyReason](https://docs.xbox.com/ja-jp/reference/system/xuser/enums/xuserprivilegedenyreason.md) | ユーザーが特権を取得できなかった理由を指定します。 |
| [XUserPrivilegeOptions](https://docs.xbox.com/ja-jp/reference/system/xuser/enums/xuserprivilegeoptions.md) | ユーザー特権のオプションを指定します。 |
| [XUserState](https://docs.xbox.com/ja-jp/reference/system/xuser/enums/xuserstate.md) | ユーザーの現在の状態を指定します。 |
| [XUserPlatformOperationResult](https://docs.xbox.com/ja-jp/reference/system/xuser/enums/XUserPlatformOperationResult.md) | クライアント操作の結果を定義する列挙型です。 |
| [XUserPlatformSpopOperationResult](https://docs.xbox.com/ja-jp/reference/system/xuser/enums/xuserplatformspopoperationresult.md) | クライアント操作の結果を定義する列挙型です。 |

## 概念ドキュメント

* [非同期プログラミングの設計目標と改善点](https://docs.xbox.com/ja-jp/build/core-features/common/async/async-whitepaper.md)
* [WinHTTP の概要](https://docs.xbox.com/ja-jp/build/console-features/networking/web-requests/intro-winhttp.md)
* [Web リクエスト (目次)](https://docs.xbox.com/ja-jp/build/console-features/networking/web-requests/web-requests-toc.md)
* [タイム センシティブなスレッド](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)
* [Using C# wrappers for GDK APIs in your Unity project](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/pc-dev/tutorials/get-started-with-unity-pc/features/gdk-unity-api-wrappers)

## 関連項目

[System API リファレンス](https://docs.xbox.com/ja-jp/reference/system/gc-reference-system-toc.md)

## エラー コード

XUser API から返される可能性のあるエラー コードは以下のとおりです。完全な一覧については、「[エラー コード](https://docs.xbox.com/ja-jp/reference/errorcodes.md)」をご覧ください。

| コード | 値 | 説明 |
| - | - | - |
| E\_GAMEUSER\_MAX\_USERS\_ADDED | 0x89245100 | ユーザー数の上限に達しているため、このユーザーを追加できません。 |
| E\_GAMEUSER\_SIGNED\_OUT | 0x89245101 | ユーザーがサインアウトしているため、操作を実行できません。 |
| E\_GAMEUSER\_RESOLVE\_USER\_ISSUE\_REQUIRED | 0x89245102 | このユーザーの問題を解決するために UI が必要です。 |
| E\_GAMEUSER\_DEFERRAL\_NOT\_AVAILABLE | 0x89245103 | 遅延を要求するのに適さないタイミングです。 |
| E\_GAMEUSER\_USER\_NOT\_FOUND | 0x89245104 | ID に一致するユーザーが見つかりませんでした。 |
| E\_GAMEUSER\_NO\_TOKEN\_REQUIRED | 0x89245105 | この呼び出しにはトークンは必要ありません。 |
| E\_GAMEUSER\_NO\_DEFAULT\_USER | 0x89245106 | 現在の既定のユーザーがありません。このエラーが発生した場合は、AddDefaultUserSilently を指定せずに XUserAddAsync をもう一度呼び出してください。 |
| E\_GAMEUSER\_FAILED\_TO\_RESOLVE | 0x89245107 | 指定された特権の解決に失敗しました。 |
| E\_GAMEUSER\_NO\_TITLE\_ID | 0x89245108 | XBOX Live TitleId を構成する必要があります。 |
| E\_GAMEUSER\_UNKNOWN\_GAME\_IDENTITY | 0x89245109 | ゲームの ID が認識されません。MSAAppId と TitleId が、ゲームに関連付けられているものと一致しません。 |
| E\_GAMEUSER\_NO\_PACKAGE\_IDENTITY | 0x89245110 | パッケージ ID を構成する必要があります。 |
| E\_GAMEUSER\_FAILED\_TO\_GET\_TOKEN | 0x89245111 | トークン要求に失敗しました。 |
| E\_GAMEUSER\_INVALID\_APP\_CONFIGURATION | 0x89245112 | ゲーム構成の MSAAppId が無効か、認証スタック用に構成されていません。 |
| E\_GAMEUSER\_MALFORMED\_MSAAPPID | 0x89245113 | ゲーム構成の MSAAppId が期待される形式 (16 文字の文字列または GUID) と一致しません。 |
| E\_GAMEUSER\_INCONSISTENT\_MSAAPPID\_AND\_TITLEID | 0x89245114 | ゲーム構成の MSAAppId と TitleId が、ゲームに関連付けられているものと一致しません。 |


## Related topics

- [ユーザーのサインイン](https://docs.xbox.com/ja-jp/services/xbox-services/fundamentals/identity/auth/live-authentication-nav.md)
- [XStore (API の内容)](https://docs.xbox.com/ja-jp/reference/system/xstore/xstore_members.md)
- [XAppCapture (API の内容)](https://docs.xbox.com/ja-jp/reference/system/xappcapture/xappcapture_members.md)
- [XPersistentLocalStorage (API の内容)](https://docs.xbox.com/ja-jp/reference/system/xpersistentlocalstorage/xpersistentlocalstorage_members.md)
- [XAsync (API の内容)](https://docs.xbox.com/ja-jp/reference/system/xasync/xasync_members.md)
