WsMatchPolicyAlternative function
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 WINAPI WsMatchPolicyAlternative( _In_ WS_POLICY* policy, _In_ ULONG alternativeIndex, _In_ WS_POLICY_CONSTRAINTS* policyConstraints, _In_ BOOL matchRequired, _In_ WS_HEAP* heap, _In_opt_ WS_ERROR* error );
Parameters
- policy [in]
-
A pointer to a WS_POLICY object containing the alternative.
Note Each WS_METADATA_ENDPOINT that is returned from WsGetMetadataEndpoints contains a policy object. - alternativeIndex [in]
-
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.
- policyConstraints [in]
-
A pointer to the constraints that specify policies to match along with the fields to populate if the function returns NOERROR.
Note If a property constraint is not specified the default constraint value for that particular property is used. See WS_POLICY_CONSTRAINTS for more information. - matchRequired [in]
-
Indicates whether a match is required or not.
Note If the value is FALSE a match is not required, and in conjunction with a non-matching policy alternative, the function returns S_FALSE. If the value of this parameter is TRUE a match is required, and if the policy does not match, the function returns an error. - heap [in]
-
A pointer to a Heap object used to store any data requiring allocation beyond the specified constraint.
Note For example pointer types within the constraint "out" fields is allocated using this Heap. - error [in, optional]
-
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 content of the out field of these structures is populated by this function if the call returns NOERROR.
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
|
Minimum supported client | Windows 7 [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server | Windows Server 2008 R2 [desktop apps | Windows Store apps] |
|
Header |
|
|
Library |
|
|
DLL |
|