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

# XUserIsStoreUser

> XUserIsStoreUser 的參考資料，這是 GDK XUser API 函式，用來檢查 XUser 的 MSA 是否與 PC 上登入 Microsoft Store 的帳戶相符。

# XUserIsStoreUser

檢查 XUser 的 MSA 是否與登入 Microsoft Store 的 MSA 相同。

## 語法

```cpp theme={null}
bool XUserIsStoreUser(  
         XUserHandle user
)  
```

### 參數

*user*   \_In\_opt\_\
類型：XUserHandle

使用者控制代碼。

### 傳回值

類型：bool

在主機上一律傳回 true。在 PC 上，只有在 XUser 的 MSA 與登入
Microsoft Store 的 MSA 相同時，才會傳回 true。在 PC 上，如果沒有人登入 Microsoft Store，或是 XUser 和 Microsoft Store
分別以兩個不同的 MSA 登入，則會傳回 false。

## 備註

如需如何正確使用此函式的詳細資料，請參閱
[處理 PC 上市集帳戶不相符的情況](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-pc.md)。

## 需求

**標頭：** XUser.h

**程式庫：** xgameruntime.lib

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

## 概念文件

* [處理 PC 上市集帳戶不相符的情況](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-pc.md)

## 另請參閱

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

[處理 PC 上市集帳戶不相符的情況](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-pc.md)


## Related topics

- [PC 上的 XStore — DRM、授權權杖和沙箱](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-pc.md)
- [處理 PC 上商店帳戶不相符的案例](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-mismatched-accounts.md)
- [在 Unity 專案中使用 GDK API 的 C# 包裝函式](https://docs.xbox.com/zh-TW/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XUser (API 內容)](https://docs.xbox.com/zh-TW/reference/system/xuser/xuser_members.md)
- [更新 User Store ID 金鑰](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-renew-userstoreid.md)
