WsMatchPolicyAlternative function (webservices.h)
Verifies that a Policy Alternative is compatible with the specified Policy Constraint. If the alternative is compatible the constraint structures are populated with Policy information.
Syntax
HRESULT WsMatchPolicyAlternative(
[in] WS_POLICY *policy,
[in] ULONG alternativeIndex,
[in] WS_POLICY_CONSTRAINTS *policyConstraints,
[in] BOOL matchRequired,
[in] WS_HEAP *heap,
[in, optional] WS_ERROR *error
);
Parameters
[in] policy
A pointer to a WS_POLICY object containing the alternative.
[in] alternativeIndex
Specifies the zero-based index that identifies the alternative to use within the policy object. The number of alternatives present in the policy object can be obtained using WsGetPolicyAlternativeCount.
[in] policyConstraints
A pointer to the constraints that specify policies to match along with the fields to populate if the function returns NOERROR.
See WS_POLICY_CONSTRAINTS for more information.
[in] matchRequired
Indicates whether a match is required or not.
If the value of this parameter is TRUE a match is required, and if the policy does not match, the function returns an error.
[in] heap
A pointer to a Heap object used to store any data requiring allocation beyond the specified constraint.
[in, optional] error
A pointer to a WS_ERROR object where additional information about the error should be stored if the function fails.
Return value
This function can return one of these values.
Return code | Description |
---|---|
|
One or more arguments are invalid. |
|
The policy alternative does not meet the specified constraints and matchRequired was set to TRUE.
The policy or other metadata was in an invalid format. |
|
The policy alternative does not meet the specified constraints and matchRequired was set to FALSE. |
|
The policy alternative meets the specific constraints. The out fields of the constraints structures have been filled with values from the policy. |
Remarks
Each of these data types contain a struct field called "out".
- WS_CHANNEL_PROPERTY_CONSTRAINT
- WS_SECURITY_PROPERTY_CONSTRAINT
- WS_SECURITY_BINDING_PROPERTY_CONSTRAINT
- WS_SSL_TRANSPORT_SECURITY_BINDING_CONSTRAINT
The policy object may delay some processing until this function is called. If the processing fails the policy object is set to WS_POLICY_STATE_FAULTED.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7 [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2008 R2 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | webservices.h |
Library | WebServices.lib |
DLL | WebServices.dll |