IFunctionDiscovery::CreateInstanceQuery method (functiondiscoveryapi.h)

[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 specific function instance.

Syntax

HRESULT CreateInstanceQuery(
  [in]      const WCHAR                    *pszFunctionInstanceIdentity,
  [in]      IFunctionDiscoveryNotification *pIFunctionDiscoveryNotification,
  [in, out] FDQUERYCONTEXT                 *pfdqcQueryContext,
  [out]     IFunctionInstanceQuery         **ppIFunctionInstanceQuery
);

Parameters

[in] pszFunctionInstanceIdentity

The identifier of the function instance.

[in] pIFunctionDiscoveryNotification

A pointer to the IFunctionDiscoveryNotification interface implemented by the calling application. If specified, it enables the Function Discovery change notification process. This parameter can be NULL; however it is required for network providers.

[in, out] pfdqcQueryContext

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

[out] ppIFunctionInstanceQuery

A pointer to an IFunctionInstanceQuery interface pointer used to return the generated query.

Return value

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

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

Remarks

Function Discovery Network providers only return instances through the IFunctionDiscoveryNotification interface.

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

Requirements

Requirement Value
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

Function Discovery Queries

IFunctionDiscovery