IWSDDeviceHost::SetMetadata method

Sets the metadata for a device, excluding user-defined service metadata.

Syntax


HRESULT SetMetadata(
  [in]           const WSD_THIS_MODEL_METADATA   *pThisModelMetadata,
  [in]           const WSD_THIS_DEVICE_METADATA  *pThisDeviceMetadata,
  [in, optional] const WSD_HOST_METADATA         *pHostMetadata,
  [in, optional] 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

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

Return codeDescription
S_OK

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 has not yet been implemented.
 

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

WsdHost.h (include Wsdapi.h)

IDL

WsdHost.idl

DLL

Wsdapi.dll

See also

IWSDDeviceHost

 

 

Community Additions

ADD
Show: