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

# XStoreAcquireLicenseForPackageResult

> XStoreAcquireLicenseForPackageResult

# XStoreAcquireLicenseForPackageResult

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

## 語法

```cpp theme={null}
HRESULT XStoreAcquireLicenseForPackageResult(  
         XAsyncBlock* async,  
         XStoreLicenseHandle* storeLicenseHandle  
)  
```

### 參數

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

傳遞給 [XStoreAcquireLicenseForPackageAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync.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)。

*storeLicenseHandle*   \_Out\_\
類型：XStoreLicenseHandle\*

如果呼叫成功，此值即為市集授權的控制代碼。

### 傳回值

類型：HRESULT

如果成功，則傳回 **S\_OK**，否則傳回錯誤碼。

`XStoreAcquireLicenseForPackageResult` 可能傳回下列錯誤碼：

| 錯誤碼 | 描述 |
| - | - |
| 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 次。 |

## 備註

您可以在時間敏感執行緒上安全地呼叫此函式。

此結果函式會擷取 [XStoreAcquireLicenseForPackageAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync.md) 的執行結果，以及在執行成功時函式所要求的授權。
因此，應在 [XStoreAcquireLicenseForPackageAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync.md) 之後呼叫此函式，通常是在回呼函式的內容中。
如果傳回授權，請呼叫 [XStoreIsLicenseValid](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstoreislicensevalid.md) 來確認授權是否有效。

如需使用範例，請參閱 [XStoreAcquireLicenseForPackageAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync.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)\
[XStoreAcquireLicenseForPackageAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync.md)\
[XStoreAcquireLicenseForPackageResult](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstoreacquirelicenseforpackageresult.md)\
[XStoreIsLicenseValid](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstoreislicensevalid.md)\
[XStoreCloseLicenseHandle](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstorecloselicensehandle.md)\
[XStoreRegisterPackageLicenseLost](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstoreregisterpackagelicenselost.md)\
[XStoreUnregisterPackageLicenseLost](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstoreunregisterpackagelicenselost.md)\
[管理及授權可下載內容 (DLC)](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-dlc.md)


## Related topics

- [XStoreAcquireLicenseForPackageAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync.md)
- [XStoreCloseLicenseHandle](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstorecloselicensehandle.md)
- [XStoreUnregisterPackageLicenseLost](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstoreunregisterpackagelicenselost.md)
- [XStoreRegisterPackageLicenseLost](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstoreregisterpackagelicenselost.md)
- [XStoreIsLicenseValid](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstoreislicensevalid.md)
