Compartilhar via


TSPI_providerRemove (Compact 2013)

3/26/2014

This function asks the user to confirm elimination of the service provider. It is the responsibility of the service provider to remove any registry entries that the service provider added at addProvider time, as well as any other modules and files that are no longer needed.

Syntax

LONG TSPIAPI TSPI_providerRemove(
  HWND hwndOwner, 
  DWORD dwPermanentProviderID 
);

Parameters

  • hwndOwner
    Handle of the parent window in which the function can create any dialog box windows required during the removal.
  • dwPermanentProviderID
    Service provider's permanent provider identifier.

Return Value

Returns zero if the function succeeds or an error number if an error occurs. The following table shows the return values for this method.

Value

Description

LINEERR_OPERATIONFAILED

The operation failed.

LINEERR_INIFILECORRUPT

The INI file is corrupted.

LINEERR_NOMEM

Not enough memory is available.

LINEERR_INVALPARAM

The parameter is invalid.

Remarks

This function must guarantee that the service provider's section and privately-defined information for the service provider is removed from the registry if it returns success. In particular, the [Provider<PPID>] section whose <PPID> matches dwPermanentProviderID must be removed, including its NumLines and NumPhones entries. If the function returns success, it is the caller's responsibility to remove the matching ProviderIDx and ProviderFilenamex entries from the [Providers] section, and renumber the remaining entries in the [Providers] section accordingly.

This procedure must leave the system in a consistent state. It should run to completion, not allowing the user to abort the removal when it is partly completed. If removal fails, it is the provider's responsibility to "back out" what was done and return an error. This may imply pre-scanning to verify that a complete removal is possible, before the removal begins.

This function can be called while the service provider is in use (that is, between TSPI_providerInit and TSPI_providerShutdown). If this happens, the service provider should do an appropriate combination of displaying a user dialog box to announce any conflict and confirm removal, restricting removal options to those that can be performed transparently, or issuing LINE_CLOSE and PHONE_CLOSE messages to inform TAPI and applications that the affected devices have been forcibly closed for removal. In any case, any changes that affect the behavior visible through TSPI should take effect only when the service provider is shut down at the next TSPI_providerShutdown.

This function should not return LINEERR_INUSE or other errors that might occur because the provider is in use by an application; instead, the provider should confer with the user directly about this problem, and then return LINEERR_OPERATIONFAILED if the user decides to abort the operation.

This procedure is called only once, at the time of removal of the service provider, until there is a call to the TSPI_providerInstall function. It is the responsibility of the caller to ensure this.

The Telephony Control Panel utility supplied with Windows Telephony in versions 1.4 and earlier calls this function (with external sequence requirements met as described here) when the "remove" command is invoked.

There is no corresponding function at the TAPI level. At that level, applications expect to have service providers already installed; otherwise their lines and phones do not appear within the available sequence of device identifiers. Running applications are informed about dynamic reconfiguration, including removal of service providers, through the LINEDEVSTATE_REINIT or PHONESTATE_REINIT value in the LINE_LINEDEVSTATE or PHONE_STATE message.

Requirements

Header

tspi.h

Library

CellTSP.dll

See Also

Reference

TSPI Service Provider Functions
TSPI_providerInit
TSPI_providerInstall
TSPI_providerShutdown