IUpdateServiceManager::AddService method (wuapi.h)

Registers a service with Windows Update Agent (WUA).

Syntax

HRESULT AddService(
  [in]  BSTR           serviceID,
  [in]  BSTR           authorizationCabPath,
  [out] IUpdateService **retval
);

Parameters

[in] serviceID

An identifier for a service to be registered.

[in] authorizationCabPath

The path of the Microsoft signed local cabinet file that has the information that is required for a service registration.

[out] retval

An IUpdateService interface that represents an added service.

Return value

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

This method can also return the following error codes.

Return code Description
E_INVALIDARG
A parameter value is invalid.
E_ACCESSDENIED
This method cannot be called from a remote computer.
WU_E_DS_SERVICEEXPIRED
The Authorization Cab has expired.
WU_E_DS_INVALIDOPERATION
The state of Automatic Updates could not be changed.

Remarks

This method returns WU_E_DS_INVALIDOPERATION if the requested change in the state of Automatic Updates is contrary to the specifications in the Authorization Cab. An error is returned by WinVerifyTrust if the Authorization Cab has not been signed.

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