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

即使沒有可下載的套件，此產品類型仍會依據[遊戲的產品共用模型](/zh-TW/publishing/xstore-commerce/xstore-product-sharing)提供授權。

僅使用 [XStoreQueryEntitledProductsAsync](/zh-TW/reference/system/xstore/xstore_members) 檢查擁有權並不足夠。請改用 [XStoreAcquireLicenseForDurablesAsync](/zh-TW/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 內容)](/zh-TW/reference/system/xstore/xstore_members)
  * 函式
    * [XStoreQueryEntitledProductsAsync](/zh-TW/reference/system/xstore/xstore_members)
    * [XStoreAcquireLicenseForDurablesAsync](/zh-TW/reference/system/xstore/xstore_members)

## 另請參閱

[商務概觀](/zh-TW/publishing/xstore-commerce/xstore-commerce-overview)

[管理可下載內容 (DLC) 並授權](/zh-TW/publishing/xstore-commerce/xstore-dlc)

[XStore API 參考](/zh-TW/reference/system/xstore/xstore_members)


## Related topics

- [XR-037 內容套件的相依性](/zh-TW/publishing/certification/xr/xr-037.md)
- [如何使用无包的耐用品](/zh-CN/publishing/xstore-commerce/xstore-dwob.md)
- [XStoreAcquireLicenseForDurablesAsync](/zh-CN/reference/system/xstore/functions/xstoreacquirelicensefordurablesasync.md)
- [XStoreAcquireLicenseForDurablesResult](/zh-CN/reference/system/xstore/functions/xstoreacquirelicensefordurablesresult.md)
- [XBOX 主機遊戲的認證測試 XBOX 需求](/zh-TW/publishing/certification/console-cert-tested-requirements.md)
