[Function Discovery is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]
Adds a property constraint to the query.
This method limits query results to only function instances with a property key (PKEY) matching the specified constraint.
HRESULT AddPropertyConstraint( REFPROPERTYKEY Key, const PROPVARIANT *pv, PropertyConstraint enumPropertyConstraint );
The property key (PKEY) for the constraint. For more information about PKEYs, see Key Definitions.
A PROPVARIANT used for the constraint. This type must match the PROPVARIANT type associated with Key.
The following shows possible values. Note that only a subset of the PROPVARIANT types supported by the built-in providers can be used as a property constraint.
A PropertyConstraint value that specifies the type of comparison to use when comparing the constraint's PKEY to the function instance's PKEY.
Possible return values include, but are not limited to, the following.
||The method completed successfully.|
||The method is unable to allocate the memory required to perform this operation.|
||The constraint specified for the query is not supported. Either the constraint is not supported for a specific VARENUM type, or the VARENUM type is not supported at all.|
A function instance will only match a property constraint when the PROPVARIANT type of the function instance's PKEY matches the PROPVARIANT type of the constraint's PKEY and the function instance's PKEY value matches the constraint's PKEY value using the comparison operator specified by enumPropertyConstraint.
If multiple constraints are added, all constraints must be supported to satisfy the query.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2008 [desktop apps only]|