IUpdateServiceManager::AddScanPackageService Method

The AddScanPackageService method registers a scan package as a service with Windows Update Agent (WUA) and then returns an IUpdateService interface.

Syntax

C++
HRESULT AddScanPackageService(
  [in]   BSTR bstrServiceName,
  [in]   BSTR bstrScanFileLocation,
  [in]   LONG flags,
  [out]  IUpdateService **ppService
);

Parameters

bstrServiceName [in]

A descriptive name for the scan package service.

bstrScanFileLocation [in]

The path of the Microsoft signed scan file that has to be registered as a service.

flags [in]

Determines how to remove the service registration of the scan package.

For possible values, see UpdateServiceOption.

ppService [out]

A pointer to an IUpdateService interface that contains service registration information.

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 codeDescription
E_INVALIDARG

A parameter value is invalid.

E_ACCESSDENIED

This method cannot be called from a remote computer.

WU_E_INVALID_OPERATION

The computer could not access the update site.

 

Remarks

You can use the ID of the service in searches by passing the ID as the ServiceID property of the IUpdateSearcher interface.

To free resources, remove the service after it is no longer needed. Use the RemoveService method to remove the service.

Do not call the RegisterServiceWithAU method for the service that the AddScanPackageService method registers.

The service that is returned by AddScanPackageService is in the collection of services that the Services property of the IUpdateServiceManager interface returns. This service has the special IsScanPackageService property.

An error is returned by WinVerifyTrust if the Authorization Cab is not signed.

This method returns WU_E_INVALID_OPERATION if the object that implements the interface has been locked down.

Requirements

Minimum supported clientWindows XP, Windows 2000 Professional with SP3
Minimum supported serverWindows Server 2003, Windows 2000 Server with SP3
ProductUse Windows Update or a Windows Update Services Server to retrieve the update on Windows XP.
HeaderWuapi.h
IDLWuapi.idl
LibraryWuguid.lib
DLLWuapi.dll

See Also

IUpdateServiceManager

Send comments about this topic to Microsoft

Build date: 11/18/2009

Tags :


Page view tracker