3.44.5.4 IUpdateServiceManager2::AddService2 (Opnum 18)

The IUpdateServiceManager2::AddService2 (opnum 18) method registers an update service with the update agent.

 HRESULT AddService2(
   [in] BSTR serviceID,
   [in] LONG flags,
   [in] BSTR authorizationCabPath,
   [out, retval] IUpdateServiceRegistration** retval
 );

serviceID: A string identifying the service.

flags: A bitmask created with values from the AddServiceFlag (section 2.2.15) enumeration specifying options.

authorizationCabPath: The filesystem path of the authorization cabinet file containing information required for a service registration. If this is NULL or the empty string, the server SHOULD search for the authorization cabinet file online when a network connection is available.

retval: An IUpdateServiceRegistration instance.

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].

This method SHOULD trigger the update agent to add this update service through an implementation-dependent<48> interface. This method SHOULD add the given service to the Services ADM element maintained by the IUpdateServiceManager (section 3.44) interface and return an IUpdateServiceRegistration instance that represents the service registration.