Share via


IWSDDeviceHost::SetMetadata (Compact 2013)

3/26/2014

This method sets the metadata for a device, excluding user-defined service metadata.

Syntax

HRESULT SetMetadata(
  const WSD_THIS_MODEL_METADATA* pThisModelMetadata,
  const WSD_THIS_DEVICE_METADATA* pThisDeviceMetadata,
  const WSD_HOST_METADATA* pHostMetadata,
  const WSD_METADATA_SECTION_LIST* pCustomMetadata
);

Parameters

  • pThisModelMetadata
    [in] Reference to a WSD_THIS_MODEL_METADATA structure which specifies metadata that is common to all instances of the model of this device. The Manufacturer, ModelNames, and ModelNumber members of the structure must contain non-NULL, non-blank entries.
  • pThisDeviceMetadata
    [in] Reference to a WSD_THIS_DEVICE_METADATA structure which specifies metadata unique to this device. The FriendlyName, FirmwareVersion, and SerialNumber members of this structure must contain non-NULL, non-blank entries.
  • pHostMetadata
    [in, optional] Reference to a WSD_HOST_METADATA structure that specifies service host metadata, which the specific data and characteristics of the device (for example, a printer supports color or has a stapler.).
  • pCustomMetadata
    [in, optional] Reference to a WSD_METADATA_SECTION_LIST structure which specifies additional custom metadata associated with this device.

Return Value

The following table shows the possible error code return values.

Error code

Description

S_OK

This method completed successfully.

E_INVALIDARG

pThisDeviceMetadata is NULL, pThisModelMetadata is NULL, or either structure does not contain the required members. See the parameter descriptions for a list of required members.

E_OUTOFMEMORY

Insufficient memory to complete the operation.

Remarks

This method must be called at least once prior to starting any device host which was registered with RegisterService. It may be called after the device is started to update the metadata, in which case WS-Discovery Hello messages are issued indicating the new metadata version.

Note

The update feature is not implemented for this preliminary release.

Requirements

Header

wsdapi.h

Library

wsdapi.lib

See Also

Reference

IWSDDeviceHost
Web Services on Devices Interfaces