IWSDDeviceHost::SetMetadata method (wsdhost.h)
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
[in] pThisModelMetadata
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.
[in] pThisDeviceMetadata
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.
[in, optional] pHostMetadata
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.).
[in, optional] pCustomMetadata
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 code | Description |
---|---|
|
Method completed successfully. |
|
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. |
|
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.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | wsdhost.h (include Wsdapi.h) |
DLL | Wsdapi.dll |