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

# XUserIsStoreUser

> XUserIsStoreUser

# 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 上处理不匹配的应用商店帐户方案](/publishing/xstore-commerce/xstore-pc)。

## 要求

**头文件：** XUser.h

**库：** xgameruntime.lib

**支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

## 概念文档

* [在 PC 上处理不匹配的应用商店帐户方案](/publishing/xstore-commerce/xstore-pc)

## 另请参阅

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

[在 PC 上处理不匹配的应用商店帐户方案](/publishing/xstore-commerce/xstore-pc)


## Related topics

- [PC 上的 XStore — DRM、许可证令牌和沙盒](/zh-CN/publishing/xstore-commerce/xstore-pc.md)
- [在 PC 上处理商店账号不匹配的场景](/zh-CN/publishing/xstore-commerce/xstore-mismatched-accounts.md)
- [XUser](/zh-CN/reference/system/xuser/xuser_members.md)
- [面向 GDK 的 Unity C# API 包装器](/zh-CN/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [续订 User Store ID 密钥](/zh-CN/publishing/xstore-commerce/xstore-renew-userstoreid.md)
