Partager via


IWSDiscoveryPublisher::UnPublish (Windows Embedded CE 6.0)

1/6/2010

This method announces the departure of a network host by sending a Bye message.

Syntax

HRESULT UnPublish(
  LPCWSTR pszDeviceId,
  ULONGLONG ullInstanceId,
  ULONGLONG ullMessageNumber,
  LPCWSTR pszSessionId,
  const WSDXML_ELEMENT* pAny
);

Parameters

  • pszDeviceId
    [in] Device Identifier to use in the device endpoint address.
  • ullInstanceId
    [in] Identifier for the current instance of the device being unpublished.

    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.
  • 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:

  • pszId is NULL.
  • The length of pszId exceeds WSD_MAX_TEXT_LENGTH (8192).
  • The length of pszSessionId exceeds WSD_MAX_TEXT_LENGTH (8192).

E_ABORT

The publisher has not been started. Attaching a notification sink starts the publisher. To attach a sink, call IWSDiscoveryPublisher::RegisterNotificationSink.

E_OUTOFMEMORY

Insufficient memory to complete the operation.

Remarks

If successful, UnPublish will send a WS-Discovery Bye message to the local subnet with the provided information. ullInstanceId, pszSessionId, and ullMessageNumber are optional parameters that can be used for application sequencing.

Requirements

Header wsdapi.h
Library wsdapi.lib
Windows Embedded CE Windows Embedded CE 6.0 R2

See Also

Reference

IWSDiscoveryPublisher
Web Services on Devices Interfaces