IWSDiscoveryPublisher::PublishEx (Compact 2013)
3/26/2014
This method announces the presence of a network host by sending a Hello message with extended information.
Syntax
HRESULT MatchResolve(
LPCWSTR pszId,
ULONGLONG ullMetadataVersion,
ULONGLONG ullInstanceId,
ULONGLONG ullMessageNumber,
LPCWSTR pszSessionId,
const WSD_NAME_LIST* pTypesList,
const WSD_URI_LIST* pScopesList,
const WSD_URI_LIST* pXAddrsList
const WSDXML_ELEMENT* pHeaderAny,
const WSDXML_ELEMENT* pReferenceParameterAny,
const WSDXML_ELEMENT* pPolicyAny,
const WSDXML_ELEMENT* pEndpointReferenceAny,
const WSDXML_ELEMENT* pAny
);
Parameters
- pszId
[in] Device identifier to use in the device endpoint address. This identifier is of the form urn:uuid:{guid}.
ullMetadataVersion
[in] Current metadata version.Note
For compatibility with the WS-Discovery specification, this value must be less than or equal to UINT_MAX (4294967295).
ullInstanceId
[in] Identifier for the current instance of the device being published.Note
For compatibility with the WS-Discovery specification, this value must be less than or equal to UINT_MAX (4294967295).
ullMessageNumber
[in] Counter within the scope of the instance identifier for the current message.Note
For compatibility with the WS-Discovery specification, this value must be less than or equal to UINT_MAX (4294967295).
- pszSessionId
[in, optional] Unique identifier within the scope of the instance identifier for the current session.
- pTypesList
[in, optional] List of types supported by the publishing host. May be NULL.
- pScopesList
[in, optional] List of scopes supported by the publishing host. May be NULL.
- pXAddrsList
[in, optional] List of transport addresses supported by the publishing host. pXAddrsList and pXAddrsList->Element may not be NULL.
- pHeaderAny
[in, optional] DOM to be inserted in the ANY section of the header.
- pReferenceParameterAny
[in, optional] DOM to be inserted in the ANY section of the reference parameter properties.
- pPolicyAny
[in, optional] DOM to be inserted in the ANY section of the endpoint policy.
- pEndpointReferenceAny
[in, optional] DOM to be inserted in the ANY section of the endpoint.
- pAny
[in, optional] DOM to be inserted in the ANY section of the message body.
Return Value
The following table shows the possible error code return values.
Error code |
Description |
---|---|
S_OK |
This method completed successfully. |
E_INVALIDARG |
One or more of the following conditions is true:
|
HRESULT_FROM_WIN32 (ERROR_NO_CALLBACK_ACTIVE) |
There is no registered notification sink. To attach a sink, call IWSDiscoveryPublisher::RegisterNotificationSink. |
E_ABORT |
The publisher has not been started. Attaching a notification sink starts the publisher. To attach a sink, call RegisterNotificationSink. |
E_OUTOFMEMORY |
Insufficient memory to complete the operation. |
Remarks
If successful, PublishEx will send a WS-Discovery Hello message to the local subnet with the provided information.ullInstanceId, pszSessionId, and ullMessageNumber are optional parameters that can be used for application sequencing. The DOM parameters can be used to extend the contents of the Hello message being sent with custom information.
Requirements
Header |
wsdapi.h |
Library |
wsdapi.lib |