Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CreateInstanceCollectionQuery Method

IFunctionDiscovery::CreateInstanceCollectionQuery 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.]

Creates a query for a collection of specific function instances.

Syntax


HRESULT CreateInstanceCollectionQuery(
  [in]      const WCHAR                            *pszCategory,
  [in]      const WCHAR                            *pszSubCategory,
  [in]            BOOL                             fIncludeAllSubCategories,
  [in]            IFunctionDiscoveryNotification   *pIFunctionDiscoveryNotification,
  [in, out]       FDQUERYCONTEXT                   *pfdqcQueryContext,
  [out]           IFunctionInstanceCollectionQuery **ppIFunctionInstanceCollectionQuery
);

Parameters

pszCategory [in]

The category for the query. See Category Definitions.

pszSubCategory [in]

The subcategory for the query. See Subcategory Definitions. This parameter can be NULL.

Subcategory queries are only supported for layered categories and some provider categories. The Registry Provider, the PnP-X association provider, and the publication provider support subcategory queries. Custom providers can be explicitly designed to support subcategory queries. This means the pszSubCategory parameter should be set to a non-NULL value only when the pszCategory parameter is set to FCTN_CATEGORY_REGISTRY, FCTN_CATEGORY_PUBLICATION, FCTN_CATEGORY_PNPXASSOCIATION, or a custom category value defined for either a layered category or a custom provider supporting subcategory queries.

fIncludeAllSubCategories [in]

If TRUE, this method recursively creates a query for all the subcategories of the category specified in pszCategory, returning a collection containing function instances from all the subcategories of pszCategory.

If FALSE, this method restricts the created query to returning function instances in the category specified by pszCategory and the subcategory specified by pszSubCategory.

pIFunctionDiscoveryNotification [in]

A pointer to the IFunctionDiscoveryNotification interface implemented by the calling application. This parameter can be NULL. This pointer is valid until the returned query object is released.

pfdqcQueryContext [in, out]

A pointer to the context in which the query was created. The type FDQUERYCONTEXT is defined as a DWORDLONG.

ppIFunctionInstanceCollectionQuery [out]

A pointer to the IFunctionInstanceCollectionQuery interface pointer.

Return value

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

Return code/valueDescription
S_OK

The method completed successfully.

E_INVALIDARG

The value of pszCategory or pIID is invalid. The value returned in ppIFunctionInstanceCollectionQuery parameter is NULL.

E_OUTOFMEMORY

The method is unable to allocate the memory required to perform this operation.

HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
0x80070002

The value of pszCategory or pszSubCategory is unknown.

 

Remarks

If pIFunctionDiscoveryNotification is specified, it enables the Function Discovery change notification process. This parameter can be NULL. However, it is required for network providers since they do not return synchronous results. Function Discovery network providers only return instances through the IFunctionDiscoveryNotification interface.

This method only initializes the query call. The Execute method of the IFunctionInstanceCollectionQuery interface returned in ppIFunctionInstanceCollectionQuery must be called to perform the query and return any data.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

FunctionDiscoveryAPI.h

IDL

FunctionDiscoveryAPI.idl

DLL

FunDisc.dll

See also

IFunctionDiscovery
Function Discovery Queries

 

 

Community Additions

ADD
Show:
© 2015 Microsoft