3.44.4.5 IUpdateServiceManager::SetOption (Opnum 14)

The IUpdateServiceManager::SetOption (opnum 14) method sets options on this interface. The "AllowedServiceID" option restricts the IUpdateServiceManager::RegisterServiceWithAU (opnum 10) (section 3.44.4.2) method to work only with the given service ID. The "AllowWarningUI" option controls whether a warning UI is displayed when changing the service registered with the automatic update agent.

 HRESULT SetOption(
   [in] BSTR optionName,
   [in] VARIANT optionValue
 );

optionName: MUST be set either to "AllowedServiceID" or "AllowWarningUI".

optionValue: If optionName is "AllowedServiceID", the vt member MUST be set to VT_BSTR, as specified in [MS-OAUT] section 2.2.7, and the bstrVal member MUST contain the identifier of the service to which to restrict the IUpdateServiceManager::RegisterServiceWithAU (section 3.44.4.2) method.

If optionName is "AllowWarningUI", the vt member MUST be set to VT_BOOL, as specified in [MS-OAUT] section 2.2.7, and the boolVal member MUST be set to VARIANT_TRUE if a warning UI is allowed to be displayed when changing the service registered with the automatic update agent, or VARIANT_FALSE if a warning UI is not allowed to be displayed.

Return Values: The method MUST return information in an HRESULT  data structure. The severity bit in the structure identifies the following conditions:

  • If the severity bit is set to 0, the method completed successfully.

  • If the severity bit is set to 1, the method failed and encountered a fatal error.

Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying RPC protocol [MS-RPCE].

If optionName is "AllowedServiceID", this method SHOULD set the value of the AllowedServiceID ADM element to the string stored in optionValue. If optionName is "AllowWarningUI", this method SHOULD set the value of the AllowWarningUI ADM element to the VARIANT_BOOL stored in optionValue.