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

# IXtfUserClient::AddSponsoredUser

> IXtfUserClient::AddSponsoredUser

# IXtfUserClient::AddSponsoredUser

ゲスト ユーザーを追加します。

<a id="syntaxSection" />

## 構文

```cpp theme={null}
public:
HRESULT AddSponsoredUser(
         UINT32 *pUserId
)  
```

<a id="parametersSection" />

### パラメーター

*pUserId*\
型: UINT32 \*

正常に完了した場合、ゲスト ユーザーのユーザー ID を指します。

<a id="retvalSection" />

### 戻り値

型: HRESULT

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

<a id="remarksSection" />

## 解説

ゲスト ユーザー (*スポンサー付きゲスト* とも呼ばれます) は、既にサインインしているアカウントに関連付けられます。コードがこのメソッドを呼び出すと、システムは一覧の最初にサインインしているユーザーをスポンサーとして使用し、その後のすべてのスポンサー付きユーザーに対してもそのユーザーを使用し続けます。選択されたユーザーがサインアウトすると、その時点でスポンサー付きユーザーもすべてサインアウトされます。

<Note>スポンサー付きユーザーを追加するために使用される UI とは異なり、このメソッドは選択を行う際に XBOX Live プライバシー設定やオンライン セーフティ設定にアクセスしません。</Note>

ゲスト以外のユーザーを追加するには、[AddUser](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/adduser-ixtfuserclient-xtfuser-xbox-windows-m) を使用します。

ゲスト ユーザーの詳細については、[ゲスト ユーザーの概要](/build/core-features/common/user/users-guest-overview)を参照してください。

<a id="requirementsSection" />

## 要件

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

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

**対応プラットフォーム:** Windows (XBOX コンソール ツール用)

<a id="seealsoSection" />

## 関連項目

[IXtfUserClient インターフェイス](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/ixtfuserclient-xtfuser-xbox-windows-t)


## Related topics

- [IXtfUserClient::ListUsers](/ja-jp/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/listusers-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient::AddUser メソッド](/ja-jp/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/adduser-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient::DeleteUser](/ja-jp/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/deleteuser-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient::DeleteAllUsers](/ja-jp/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/deleteallusers-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient::DeleteUserId](/ja-jp/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/deleteuserid-ixtfuserclient-xtfuser-xbox-windows-m.md)
