> ## 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::PairControllerWithUser メソッド

> IXtfUserClient::PairControllerWithUser メソッド

# IXtfUserClient::PairControllerWithUser メソッド

指定されたメール アドレスで識別されるユーザーを、指定されたコントローラー ID のコントローラーとペアリングします。

## 構文

```cpp theme={null}
public:
HRESULT PairControllerWithUser(
         LPCWSTR userName,
         UINT64 controllerId
)  
```

### パラメーター

*userName*\
型: LPCWSTR

コントローラーとペアリングするユーザーのメール アドレス。

*controllerId*\
型: UINT64

コントローラーのコントローラー ID。

### 戻り値

型: HRESULT

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

## 解説

ユーザーのメール アドレスを取得するには、[ListUsers](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/listusers-ixtfuserclient-xtfuser-xbox-windows-m) を呼び出します。返された [XTF\_USER\_DATA](/reference/tools/xtf/xtfuser/structures/XTF_USER_DATA-xtfuser-xbox-windows-t) 構造体の *pszEmailAddress* メンバーを確認してください。

**PairControllerWithUser** を使用してコントローラーをペアリングすることは追加的な操作です。既にユーザーがコントローラーとペアリングされている場合、*userName* で指定されたユーザーもコントローラーとペアリングされます。排他的なペアリングを作成するには、**PairControllerWithUserIdExclusive** または **PairControllerWithUserExclusive** を呼び出します。

## 要件

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

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

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

## 関連項目

[PairControllerWithUserId](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/paircontrollerwithuserid-ixtfuserclient-xtfuser-xbox-windows-m)


## Related topics

- [IXtfUserClient::PairControllerWithUserId メソッド](/ja-jp/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/paircontrollerwithuserid-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::DeleteAllUsers](/ja-jp/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/deleteallusers-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [XTF_USER_DATA](/ja-jp/reference/tools/xtf/xtfuser/structures/XTF_USER_DATA-xtfuser-xbox-windows-t.md)
- [IXtfUserClient::SigninUser](/ja-jp/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/signinuser-ixtfuserclient-xtfuser-xbox-windows-m.md)
