IWSDiscoveryProvider::SearchById method (wsddisco.h)

Initializes a search for WS-Discovery hosts by device identifier.

Syntax

HRESULT SearchById(
  [in]           LPCWSTR pszId,
  [in, optional] LPCWSTR pszTag
);

Parameters

[in] pszId

Device identifier of the desired discovery provider.

[in, optional] pszTag

Optional identifier tag for this search. May be NULL.

Return value

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

Return code Description
S_OK
Method completed successfully.
E_INVALIDARG
pszId is NULL, the length in characters of pszId exceeds WSD_MAX_TEXT_LENGTH (8192), or the length in characters of pszTag exceeds WSD_MAX_TEXT_LENGTH (8192).
E_ABORT
A callback interface has not been attached. You must call Attach before calling this method.
E_OUTOFMEMORY
Not enough memory exists to perform the operation.

Remarks

SearchById initiates a WS-Discovery Resolve in an attempt to locate a previously known specific device. pszId is used as the endpoint address in the Resolve. This call may result in one or more Add callbacks. If any Add callbacks are issued before the search completes, a SearchComplete callback will be issued; otherwise, a SearchFailed callback will be issued.

pszTag is an optional user provided string which will be fed back in either callback, allowing the caller to associate the callback with the original query.

For information about troubleshooting applications calling this method, see Troubleshooting WSDAPI Applications.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header wsddisco.h (include Wsdapi.h)
DLL Wsdapi.dll

See also

IWSDiscoveryProvider