SLQueryLicenseValueFromApp function (slpublic.h)

[This API is not available to all Windows/Windows Phone apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime.]

Gets the value for the specified component policy.

Syntax

HRESULT SLQueryLicenseValueFromApp(
  [in]            PCWSTR valueName,
  [out, optional] ULONG  *valueType,
  [out, optional] PVOID  dataBuffer,
  [in]            ULONG  dataSize,
  [out]           ULONG  *resultDataSize
);

Parameters

[in] valueName

The name of the policy for which you want to get information.

[out, optional] valueType

The data type of the policy value. The following table describes the values that this parameter can receive.

Value Description
REG_DWORD A 32-bit integer. For this type, the size of the buffer that the dataBuffer parameter specifies should be at least 4 bytes.
REG_BINARY A binary value.
REG_SZ A wide-character, null-terminated string, including the last null character.

[out, optional] dataBuffer

A buffer that receives the value of the component policy.

[in] dataSize

The size of the supplied buffer, in bytes.

[out] resultDataSize

The actual size of the data received for the policy value, in bytes.

Return value

If this function succeeds, it return S_OK. Otherwise, it returns an HRESULT error code.

Value Meaning
E_INVALIDARG
0x80070057
One or more arguments are not valid.
SL_E_VALUE_NOT_FOUND
0xC004F012
The specified name-value pair was not found.

Remarks

Your app must have the restricted slapiQueryLicenseValue capability to call the SLQueryLicenseValueFromApp function.

Requirements

Requirement Value
Minimum supported client Windows 10 [desktop apps | UWP apps]
Minimum supported server Windows Server 2016 [desktop apps | UWP apps]
Target Platform Windows
Header slpublic.h
Library Api-ms-win-core-slapi-l1-1-0.lib
DLL Api-ms-win-core-slapi-l1-1-0.dll