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

# XStoreGameLicense

> XStoreGameLicense

# XStoreGameLicense

描述遊戲授權。

## 語法

```cpp theme={null}
typedef struct XStoreGameLicense {  
    char skuStoreId[STORE_SKU_ID_SIZE];  
    bool isActive;  
    bool isTrialOwnedByThisUser;  
    bool isDiscLicense;  
    bool isTrial;  
    uint32_t trialTimeRemainingInSeconds;  
    char trialUniqueId[TRIAL_UNIQUE_ID_MAX_SIZE];  
    time_t expirationDate;  
} XStoreGameLicense  
```

### 成員

*skuStoreId*\
類型：char\[STORE\_SKU\_ID\_SIZE]

商店識別碼。

*isActive*\
類型：bool

指出授權是否為使用中。

*isTrialOwnedByThisUser*\
類型：bool

指出試用版是否由與 XStoreContext 相關聯的使用者擁有。如果是在 PC 上，這會是目前登入 Microsoft Store 應用程式的使用者。

*isDiscLicense*\
類型：bool

指出授權是否為光碟授權。

*isTrial*\
類型：bool

指出授權是否為試用版授權。

*trialTimeRemainingInSeconds*\
類型：uint32\_t

試用版授權的剩餘時間。

*trialUniqueId*\
類型：char\[TRIAL\_UNIQUE\_ID\_MAX\_SIZE]

試用版的唯一識別碼。

*expirationDate*\
類型：time\_t

授權的到期日。

## 備註

若要取得遊戲授權，請呼叫 [XStoreQueryGameLicenseAsync](/zh-TW/reference/system/xstore/functions/xstorequerygamelicenseasync)。您可以在其結果函式 [XStoreQueryGameLicenseResult](/zh-TW/reference/system/xstore/functions/xstorequerygamelicenseresult) 中找到傳回的授權。**XStoreGameLicense** 是 [XStoreQueryGameLicenseResult](/zh-TW/reference/system/xstore/functions/xstorequerygamelicenseresult) 的輸出參數。

## 需求

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

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

## 概念文件

* [為您的遊戲實作試用版](/zh-TW/publishing/xstore-commerce/xstore-trials)

## 另請參閱

[XStore](/zh-TW/reference/system/xstore/xstore_members)\
[XStoreQueryGameLicenseAsync](/zh-TW/reference/system/xstore/functions/xstorequerygamelicenseasync)\
[XStoreQueryGameLicenseResult](/zh-TW/reference/system/xstore/functions/xstorequerygamelicenseresult)


## Related topics

- [XStoreGameLicense](/reference/system/xstore/structs/xstoregamelicense.md)
- [XStoreQueryGameLicenseResult](/reference/system/xstore/functions/xstorequerygamelicenseresult.md)
