IFunctionInstanceCollectionQuery::AddQueryConstraint method

[Function Discovery is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]

The AddQueryConstraint method adds a query constraint to the query.

This method enables the application to filter the result set to only those instances that fulfill this constraint.

Syntax

HRESULT AddQueryConstraint(
  const WCHAR *pszConstraintName,
  const WCHAR *pszConstraintValue
);

Parameters

pszConstraintName

The query constraint.

pszConstraintValue

The constraint value.

Return Value

Possible return values include, but are not limited to, the following.

Return code Description
S_OK
The method completed successfully.
E_OUTOFMEMORY
The method is unable to allocate the memory required to perform this operation.

Remarks

If multiple constraints are added, all constraints must be supported to satisfy the query.

AddQueryConstraint will fail with an error if the IFunctionInstanceCollectionQuery object includes all subcategories and the AddQueryConstraint method is called with the pszConstraintName parameter set to FD_QUERYCONSTRAINT_PROVIDERINSTANCEID. To avoid this error, create a IFunctionInstanceCollectionQuery object that does not include all subcategories. You can create such an object by calling CreateInstanceCollectionQuery with the fIncludeAllSubCategories parameter set to false.

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header functiondiscoveryapi.h
DLL FunDisc.dll

See Also

Constraint Definitions

Function Discovery Queries

IFunctionInstanceCollectionQuery