IUpdateServiceManager::SetOption method (wuapi.h)

Set options for the object that specifies the service ID. The SetOption method is also used to determine whether a warning is displayed when you change the registration of Automatic Updates.

Syntax

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

Parameters

[in] optionName

Set this parameter to AllowedServiceID to specify the form of the service ID that is provided to the object.

Set to AllowWarningUI to display a warning when changing the Automatic Updates registration.

[in] optionValue

If the optionName parameter is set to AllowServiceID, the optionValue parameter is set to the service ID that is provided as a VT_BSTR value.

If optionName is set to AllowWarningUI, optionValue is a VT_BOOL value that specifies whether to display a warning when changing the registration of Automatic Updates.

Set the optionValue parameter to VARIANT_TRUE to display the warning UI. Set it to VARIANT_FALSE to suppress the warning UI.

Return value

Returns S_OK if successful. Otherwise, returns a COM or Windows

error code.

Return code Description
WU_E_INVALID_OPERATION
The computer is not allowed to access the update site.
E_INVALIDARG
An argument of the method is invalid.

Requirements

Requirement Value
Minimum supported client Windows XP, Windows 2000 Professional with SP3 [desktop apps only]
Minimum supported server Windows Server 2003, Windows 2000 Server with SP3 [desktop apps only]
Target Platform Windows
Header wuapi.h
Library Wuguid.lib
DLL Wuapi.dll

See also

IUpdateServiceManager