ExFetchLicenseData

This function gets the whole of the binary data that the kernel has cached for the ProductPolicy value.

Declaration

NTSTATUS
ExFetchLicenseData (
    PVOID pvData,
    ULONG cbData,
    ULONG *pcbData);

Parameters

The optional pvData and cbData arguments provide the address and size (in bytes) of a buffer that is to receive the license data.

The pcbData argument provides the address of a variable that is to receive the size (in bytes) of the license data .

Return Value

The function returns zero for success, else an error code.

Behaviour

The pcbData argument is required. If this argument is NULL, the function fails (returning STATUS_INVALID_PARAMETER).

The function fails (returning STATUS_INTERNAL_ERROR) if the licensing cache is corrupt or the license data has been tampered with or there is no license data to fetch.

If the function is not given a buffer or if the buffer is too small for all the license data, the function fails (returning STATUS_BUFFER_TOO_SMALL). The variable at pcbData receives the size of license data that could have been fetched. The buffer, if provided, is undisturbed.

Otherwise, the function succeeds, having copied the license data to the given buffer and set the variable at pcbData to the size.

Availability

The ExFetchLicenseData function is exported by name from the kernel in version 6.0 and higher.

The only known use by Microsoft is in SPSYS.SYS.