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

# XStoreIsLicenseValid

> XStoreIsLicenseValid

# XStoreIsLicenseValid

Checks if the specified license is valid.

## Syntax

```cpp theme={null}
bool XStoreIsLicenseValid(  
         const XStoreLicenseHandle storeLicenseHandle  
)  
```

### Parameters

*storeLicenseHandle*   \_In\_\
Type: XStoreLicenseHandle

A handle to the license.

### Return value

Type: bool

Returns true if the license is valid; returns false otherwise.

## Remarks

This API is safe to call on time-sensitive threads.

For a usage example, see [XStoreAcquireLicenseForPackageAsync](/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync).
Use **XStoreIsLicenseValid** to check if a valid license was returned by [XStoreAcquireLicenseForPackageResult](/reference/system/xstore/functions/xstoreacquirelicenseforpackageresult) or [XStoreAcquireLicenseForDurablesResult](/reference/system/xstore/functions/xstoreacquirelicensefordurablesresult).
If the license is valid, you can proceed with further setup, like registering license activity based callback functions.

<Note>This function only checks the static license state when it was originally obtained from the XStoreAcquireLicense\* APIs.
If you register with [XStoreRegisterPackageLicenseLost](/reference/system/xstore/functions/xstoreregisterpackagelicenselost) and the license becomes invalid, you should reacquire a new license to get the correct state before calling this API again.</Note>

## Requirements

**Header:** XStore.h (included in XGameRuntime.h)

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles, and XBOX Series consoles

## Conceptual documentation

* [Granting players access to add-on content](/publishing/xstore-commerce/xstore-granting-access)

## See also

[XStore](/reference/system/xstore/xstore_members)\
[XStoreAcquireLicenseForPackageAsync](/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync)\
[XStoreAcquireLicenseForPackageResult](/reference/system/xstore/functions/xstoreacquirelicenseforpackageresult)\
[XStoreIsLicenseValid](/reference/system/xstore/functions/xstoreislicensevalid)\
[XStoreCloseLicenseHandle](/reference/system/xstore/functions/xstorecloselicensehandle)\
[XStoreRegisterPackageLicenseLost](/reference/system/xstore/functions/xstoreregisterpackagelicenselost)\
[XStoreUnregisterPackageLicenseLost](/reference/system/xstore/functions/xstoreunregisterpackagelicenselost)\
[Granting players access to add-on content](/publishing/xstore-commerce/xstore-granting-access)


## Related topics

- [XStoreAcquireLicenseForPackageAsync](/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync.md)
- [XStoreAcquireLicenseForDurablesResult](/reference/system/xstore/functions/xstoreacquirelicensefordurablesresult.md)
- [XStoreCloseLicenseHandle](/reference/system/xstore/functions/xstorecloselicensehandle.md)
- [XStoreAcquireLicenseForPackageResult](/reference/system/xstore/functions/xstoreacquirelicenseforpackageresult.md)
- [XStoreRegisterPackageLicenseLost](/reference/system/xstore/functions/xstoreregisterpackagelicenselost.md)
