Partager via


WSDCreateDeviceHost (Windows Embedded CE 6.0)

1/6/2010

This function creates a device host and returns a pointer to the IWSDDeviceHost interface.

Syntax

HRESULT WSDCreateDeviceHost(
  const WCHAR* pszLocalId,
  IWSDXMLContext* pContext,
  IWSDDeviceHost** ppDeviceHost
);

Parameters

  • pszLocalId
    [in] The logical or physical address of the device. A logical address is of the form urn:uuid:{guid}. If pszLocalId is a logical address, the host will announce the logical address and then convert the address to a physical address when it receives Resolve or Probe messages.

    If pszLocalId is a physical address (such as URL prefixed by http or https), the host will use the address as the physical address and will host on that address instead of the default one.

    For secure communication, pszLocalId must be an URL prefixed by https, and the host will use the SSL/TLS protocol on the port specified in the URL. The recommended port is port 5358, as this port is reserved for secure connections with WSDAPI. If no port is specified, then the host will use port 443. The host port must be configured with an SSL server certificate before calling WSDCreateDeviceHost. For more information about the configuration of host ports, see HttpSetServiceConfiguration.

    Any URL (http or https) must be terminated with a trailing slash. The URL must contain a valid IP address or hostname.

    The following list shows some example values for pszLocalId. It is not a complete list of valid values.

  • pContext
    [in] An IWSDXMLContext object that defines custom message types or namespaces.

    If NULL, a default context representing the built-in message types and namespaces is used.

  • ppDeviceHost
    [out] Pointer to an IWSDDeviceHost object that you use to expose the WSD-specific device semantics associated with a server that responds to incoming requests.

Return Value

The following table shows the possible error code return values.

Error Code Description

S_OK

The function succeeded.

E_INVALIDARG

pszLocalId is NULL or the length in characters of pszLocalId exceeds WSD_MAX_TEXT_LENGTH (8192).

E_POINTER

ppDeviceHost is NULL.

E_OUTOFMEMORY

Insufficient memory to complete the operation.

Remarks

The WSDCreateDeviceHost function calls the IWSDDeviceHost::Init method, which initializes an instance of an IWSDDeviceHost object.

Requirements

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

See Also

Reference

Web Services on Devices Functions
WSDCreateDeviceHostAdvanced
Web Services on Devices Reference