SLGetApplicationPolicy function (slpublic.h)

Queries a policy from the set stored with the SLPersistApplicationPolicies function
and loaded using the SLLoadApplicationPolicies function.

Syntax

HRESULT SLGetApplicationPolicy(
  [in]            HSLP       hPolicyContext,
  [in]            PCWSTR     pwszValueName,
  [out, optional] SLDATATYPE *peDataType,
  [out]           UINT       *pcbValue,
  [out]           PBYTE      *ppbValue
);

Parameters

[in] hPolicyContext

Type: HSLP

The context handle returned by the SLLoadApplicationPolicies function.

[in] pwszValueName

Type: PCWSTR

The name of the policy to query, or "*" for all policies.

[out, optional] peDataType

Type: SLDATATYPE*

A pointer to the type of the data, if available.

[out] pcbValue

Type: UINT*

A pointer to the size, in bytes, of the data, if available.

[out] ppbValue

Type: PBYTE*

The data, if available.

Return value

Type: HRESULT WINAPI

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

Return code/value Description
E_INVALIDARG
0x80070057
One or more arguments are not valid.
SL_E_APPLICATION_POLICIES_NOT_LOADED
0xC004F073
The policy context was not found.
SL_E_VALUE_NOT_FOUND
0xC004F012
The policy is not found.
SL_E_RIGHT_NOT_GRANTED
0xC004F013
The policy list is empty.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header slpublic.h
Library Slc.lib
DLL Slc.dll