IUpdateServiceManager::AddService method (wuapi.h)

Registers a service with Windows Update Agent (WUA).


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


[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
A parameter value is invalid.
This method cannot be called from a remote computer.
The Authorization Cab has expired.
The state of Automatic Updates could not be changed.


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.


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