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

# XStoreCanAcquireLicenseForStoreIdResult

> XStoreCanAcquireLicenseForStoreIdResult

# XStoreCanAcquireLicenseForStoreIdResult

取得 [XStoreCanAcquireLicenseForStoreIdAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidasync.md) 呼叫的結果。

## 語法

```cpp theme={null}
HRESULT XStoreCanAcquireLicenseForStoreIdResult(  
         XAsyncBlock* async,  
         XStoreCanAcquireLicenseResult* storeCanAcquireLicense  
)  
```

### 參數

*async*   \_Inout\_\
類型：[XAsyncBlock\*](https://docs.xbox.com/zh-TW/reference/system/xasync/structs/xasyncblock.md)

您傳遞給 [XStoreCanAcquireLicenseForStoreIdAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidasync.md) 的 `XAsyncBlock`。
使用 [XAsyncBlock](https://docs.xbox.com/zh-TW/reference/system/xasync/structs/xasyncblock.md) 來輪詢呼叫的狀態並擷取呼叫結果。
如需詳細資訊，請參閱 [XAsyncBlock](https://docs.xbox.com/zh-TW/reference/system/xasync/structs/xasyncblock.md)。

*storeCanAcquireLicense*   \_Out\_\
類型：[XStoreCanAcquireLicenseResult\*](https://docs.xbox.com/zh-TW/reference/system/xstore/structs/xstorecanacquirelicenseresult.md)

傳回時，請檢查結果的狀態，以查看使用者是否可以授權此產品。
請針對遊戲和耐久性產品 (含或不含套件) 呼叫此 API。
如果產品可以透過已插入的光碟授權，它也會傳回結果。
結果包括使用者可以授權的 SKU。
對於使用者可以透過光碟授權的內容，SKU 為 'DISC'。

### 傳回值

類型：HRESULT

成功時傳回 S\_OK；否則傳回錯誤碼。

`XStoreCanAcquireLicenseForStoreIdResult` 函式會傳回下列錯誤碼：

| 錯誤碼 | 意義 |
| - | - |
| 0x87E10BC6 `LM_E_CONTENT_NOT_IN_CATALOG` | 在目錄中找不到此產品。 |
| 0x803F8001 `LM_E_CONTENT_NOT_OWNED` | 未擁有此產品。 |
| 0x803F8008 `LM_E_PREDOWNLOAD_LICENSE_NOT_YET_AVAILABLE` | 已擁有此產品，但因為尚未發行而無法授權。 |
| 0x803F9006 `LM_E_ENTITLED_USER_SIGNED_OUT` | 產品的擁有者未登入。 |
| 0x89245305 `E_GAMESTORE_LICENSE_ACTION_THROTTLED` | 遊戲過度查詢此產品的授權，現已受到節流。限制為同一產品在 10 分鐘內最多嘗試授權 30 次。 |

## 備註

此函式會擷取 [XStoreCanAcquireLicenseForStoreIdAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidasync.md) 的執行結果，以及在執行成功時函式所要求的預覽授權。
請在 [XStoreCanAcquireLicenseForStoreIdAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidasync.md) 之後呼叫此函式，通常是在回呼函式的內容中。
如需使用範例，請參閱 [XStoreCanAcquireLicenseForStoreIdAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidasync.md)。

## 需求

**標頭：** XStore.h (包含在 XGameRuntime.h 中)

**程式庫：** xgameruntime.lib

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

## 概念文件

* [授予玩家附加元件內容的存取權](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-granting-access.md)

## 另請參閱

[XStore](https://docs.xbox.com/zh-TW/reference/system/xstore/xstore_members.md)\
[XStoreCanAcquireLicenseForStoreIdAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidasync.md)\
[如何使用不含套件的耐久性產品](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-dwob.md)\
[授予玩家附加元件內容的存取權](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-granting-access.md)


## Related topics

- [XStoreCanAcquireLicenseResult](https://docs.xbox.com/zh-TW/reference/system/xstore/structs/xstorecanacquirelicenseresult.md)
- [XStoreCanAcquireLicenseForStoreIdAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidasync.md)
- [XStore (API 內容)](https://docs.xbox.com/zh-TW/reference/system/xstore/xstore_members.md)
- [在 Unity 專案中使用 GDK API 的 C# 包裝函式](https://docs.xbox.com/zh-TW/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XStoreCanAcquireLicenseForPackageResult](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstorecanacquirelicenseforpackageresult.md)
