3.1.7.9 TSPI_phoneGetID

Syntax

LONG TSPI_phoneGetID(dwRequestID, hdPhone, lpDeviceID, lpszDeviceClass)
This function returns a device ID for the given device class associated with the specified phone device.

Parameters

DRV_REQUESTID dwRequestID
Specifies the identifier of the asynchronous request. The Service Provider returns this value if the function completes asynchronously.

HDRVPHONE hdPhone
Specifies the Service Provider's opaque handle to the phone to be queried.

LPVARSTRING lpDeviceID
Specifies a far pointer to a data structure of type VARSTRING where the device ID is returned. Upon successful completion of the request, this location is filled with the device ID. The format of the returned information depends on the method used by the device class (API) for naming devices.

LPCSTR const lpszDeviceClass
Specifies a far pointer to a NULL-terminated string that specifies the device class of the device whose ID is requested. Valid device class strings are those used in the SYSTEM.INI section to identify device classes.

Return Value

Returns zero if the function is successful, the (positive) dwRequestID value if the function will be completed asynchronously, or a negative error number if an error has occurred. Possible error returns are:

PHONEERR_INVALPHONEHANDLE
The hdPhone parameter is an invalid handle.

PHONEERR_INVALPOINTER
One of the specified pointer parameters are invalid.

PHONEERR_NODEVICE
The phone device has no associated device for the given device class.

PHONEERR_OPERATIONFAILED
The specified operation failed for unspecified reasons.

Comments

This operation can be used to retrieve a phone device ID given a phone handle. It can also be used to obtain the device ID of the media device (e.g., mci waveform, mci midi, waveform, etc.) associated with the opened phone device. This ID can then be used with the appropriate media API (e.g., mci, midi, wav, etc.) to select the corresponding device.

See Also

Data Types: VARSTRING

Fields:

The following table indicates which fields of the VARSTRING data structure are filled in by the Service Provider and which fields are filled in by the TAPI DLL. The Service Provider must preserve (i.e., must not overwrite) the values filled in by the TAPI DLL.


Field Name

TAPI DLL

Service Provider


dwTotalSize;

X

dwNeededSize;

X

dwUsedSize;

X

dwStringFormat;

X

dwStringSize;

X

dwStringOffset;

X