TSPI_providerEnumDevices

TAPI calls the TSPI_providerEnumDevices function before TSPI_providerInit to determine the number of line and phone devices supported by the service provider.

LONG TSPIAPI TSPI_providerEnumDevices(
  DWORD dwPermanentProviderID,  
  LPDWORD lpdwNumLines,         
  LPDWORD lpdwNumPhones,        
  HPROVIDER hProvider,          
  LINEEVENT lpfnLineCreateProc,  
  PHONEEVENT lpfnPhoneCreateProc  
);
 

Parameters

dwPermanentProviderID
The permanent identifier, unique within the service providers on this system, of the service provider being initialized.
lpdwNumLines
A pointer to a DWORD-sized memory location into which the service provider must write the number of line devices it is configured to support. TAPI initializes the value to 0, so if the service provider fails to write a different value, the value 0 is assumed.
lpdwNumPhones
A pointer to a DWORD-sized memory location into which the service provider must write the number of phone devices it is configured to support. TAPI initializes the value to 0, so if the service provider fails to write a different value, the value 0 is assumed.
hProvider
An opaque DWORD-sized value that uniquely identifies this instance of this service provider during this execution of the Win32 Telephony environment.
lpfnLineCreateProc
A pointer to the LINEEVENT callback procedure supplied by TAPI. The service provider uses this function to send LINE_CREATE messages when a new line device needs to be created. This function should not be called to send a LINE_CREATE message until after the service provider has returned from the TSPI_providerInit procedure.
lpfnPhoneCreateProc
A pointer to the PHONEEVENT callback procedure supplied by TAPI. The service provider uses this function to send PHONE_CREATE messages when a new phone device needs to be created. This function should not be called to send a PHONE_CREATE message until after the service provider has returned from the TSPI_providerInit procedure.

Return Values

Returns zero if the request succeeds or an error number if an error occurs. Possible return values are:

LINEERR_NOMEM, LINEERR_OPERATIONFAILED.

Remarks

In previous versions of TAPI, implementation of this function was optional. Beginning with TAPI 2.0, implementation of this function is mandatory in all service providers. TAPI no longer checks telephon.ini or the Registry at TAPI startup to determine the initial number of lines and phones supported by a service provider.

See Also

LINE_CREATE, LINEEVENT, PHONE_CREATE, PHONEEVENT, TSPI_providerInit