Constraints

[Function Discovery is available for use in the following versions of Windows: Windows Server 2012, Windows 8, Windows Server 2008 R2, Windows 7, Windows Server 2008, and Windows Vista. It may be altered or unavailable in subsequent versions.]

Constraints are used to limit the results returned by a function instance collection query or by a function instance query.

Constraints are applied to a query by calling IFunctionInstanceCollectionQuery::AddQueryConstraint. Generally, this method applies to collection queries. There is no similar method on the IFunctionInstanceQuery interface, but you can constrain function instance queries using the IFunctionInstanceCollectionQuery interface. To constrain a function instance query, create a IFunctionInstanceCollectionQuery object, apply the FD_QUERYCONSTRAINT_PROVIDERINSTANCEID constraint with the value set to the provider instance identifier returned by IFunctionInstance::GetProviderInstanceID for the function instance you want to query, and then apply other query constraints as required.

A list of constraints defined in the SDK appears in the topic Constraint Definitions. Not all constraints are supported by all Function Discovery providers. For more information about the query constraints supported by a provider, see Built-in Providers. If a provider does not understand a constraint, the provider will ignore it. For example, a SSDP_CONSTRAINTVALUE_TYPE_DEV_MDASRVR will be ignored by a query to PnP.

Constraint Definitions