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

# 如何使用无包的耐用品

> 在游戏中使用无包的耐用品 (DWOB) — 授权设置、权益检查，以及 DWOB 与带包的可下载内容产品之间的区别。

耐用品可以配置为带包（下载到客户端）或不带包。无包的耐用品配置和使用起来更简单。这些耐用品类型通常用于对已包含在基础游戏中的内容进行访问控制。许多游戏选择在基础游戏包中包含附加内容的资产，因为它们即使在未获得许可时也会用于多人游戏或预览目的。

<Note>
  无包的耐用品不支持光盘发行。
</Note>

即使没有可下载包，该产品类型仍会按照[游戏的产品共享模式](/publishing/xstore-commerce/xstore-product-sharing)提供许可证。

仅使用 [XStoreQueryEntitledProductsAsync](/reference/system/xstore/xstore_members) 检查所有权是不够的。相反，应使用 [XStoreAcquireLicenseForDurablesAsync](/reference/system/xstore/xstore_members) 正确检查对耐用品的访问权限：

```cpp theme={null}
void AcquireLicenseForDurable(const char* storeId)
{
    auto async = new XAsyncBlock{};
    async->queue = m_asyncQueue;
    async->callback = [](XAsyncBlock* async)
    {
        XStoreLicenseHandle result = {};

        HRESULT hr = XStoreAcquireLicenseForDurablesResult(
            async,
            &result);

        if (SUCCEEDED(hr))
        {
            bool isValid = XStoreIsLicenseValid(result);
            printf("Is valid license: %s\n", isValid? "yes" : "no");
        }
        else
        {
            printf("Error calling XStoreAcquireLicenseForDurablesResult: 0x%x\n", hr);
        }

        delete async;
    };

    HRESULT hr = XStoreAcquireLicenseForDurablesAsync(
        m_xStoreContext,
        storeId,
        async);

    if (FAILED(hr))
    {
        delete async;
        return;
    }
}
```

## 参考 API 文档

* [XStore（API 内容）](/reference/system/xstore/xstore_members)
  * 函数
    * [XStoreQueryEntitledProductsAsync](/reference/system/xstore/xstore_members)
    * [XStoreAcquireLicenseForDurablesAsync](/reference/system/xstore/xstore_members)

## 另请参阅

[商务概述](/publishing/xstore-commerce/xstore-commerce-overview)

[管理并授权可下载内容 (DLC)](/publishing/xstore-commerce/xstore-dlc)

[XStore API 参考](/reference/system/xstore/xstore_members)


## Related topics

- [管理并授权可下载内容 (DLC)](/zh-CN/publishing/xstore-commerce/xstore-dlc.md)
- [商店基本操作](/zh-CN/publishing/xstore-commerce/xstore-basic-operations.md)
- [选择合适的产品类型](/zh-CN/publishing/xstore-commerce/xstore-choosing-product-type.md)
- [启用授权测试](/zh-CN/publishing/xstore-commerce/xstore-licensing-setup.md)
- [GDK 商务系统概述](/zh-CN/publishing/xstore-commerce/xstore-overview.md)
