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

# 如何使用不含套件的耐久性產品

> 在您的遊戲中使用不含套件的耐久性產品 (DWOB)：授權設定、權利檢查，以及 DWOB 與含套件的可下載內容產品有何不同。

耐久性產品可以設定為包含或不包含下載到用戶端的套件。不含套件的耐久性產品更容易設定和使用。這類耐久性產品通常用來控管對已屬於基礎遊戲一部分之內容的存取。許多遊戲選擇將附加元件的內容包含在基礎遊戲套件中，因為即使未取得授權，它們仍會將這些資產用於多人遊戲或預覽用途。

> [!NOTE]
>
> 光碟不支援不含套件的耐久性產品。

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

僅使用 [XStoreQueryEntitledProductsAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/xstore_members.md) 檢查擁有權並不足夠。請改用 [XStoreAcquireLicenseForDurablesAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/xstore_members.md) 正確檢查耐久性產品的存取權：

```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 內容)](https://docs.xbox.com/zh-TW/reference/system/xstore/xstore_members.md)
  * 函式
    * [XStoreQueryEntitledProductsAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/xstore_members.md)
    * [XStoreAcquireLicenseForDurablesAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/xstore_members.md)

## 另請參閱

[商務概觀](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-commerce-overview.md)

[管理可下載內容 (DLC) 並授權](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-dlc.md)

[XStore API 參考](https://docs.xbox.com/zh-TW/reference/system/xstore/xstore_members.md)


## Related topics

- [耐久性附加元件](https://docs.xbox.com/zh-TW/publishing/game-publishing/concepts/add-ons/durable-add-ons.md)
- [基本商店作業](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-basic-operations.md)
- [管理可下載內容 (DLC) 並授權](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-dlc.md)
- [選擇正確的產品類型](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-choosing-product-type.md)
- [XStoreAcquireLicenseForDurablesAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstoreacquirelicensefordurablesasync.md)
