Error Checking

At the TAPI level, an application can pass a variety of different parameters, many of which may be invalid. TAPI verifies parameters and returns errors to the application without calling the service provider. Each function description at the TSPI level describes the parameter errors already tested. The service provider does not have to repeat these tests, though it must perform any additional validity tests appropriate to the function. Titles and descriptions of common parameter validity tests that appear in many functions are listed in the following table.

Validity test Description
Pointer validity TAPI has already tested pointers to data storage to make sure that they point to readable or writable memory of the size appropriate to the operation. In addition, for variably sized data structures starting with a dwTotalSize member, the data structure has been verified to ensure that the indicated total size is available.
Fixed size validity For variable-sized data structures, the data structure has been verified so space for the fixed-sized part of the data structure and that dwTotalSize is sufficient for the fixed part.
Offset/size zeroed For variable-sized data structures, the "...Offset" and "...Size" fields that correspond to parts that the service provider sets have been preset with zero values before the service provider was called.
Handle validity TAPI ensures that line, phone, and call handles (of defined types HDRVLINE, HDRVPHONE, and HDRVCALL) are valid. That is, they are values that have been returned without error as handles in TSPI_lineOpen, TSPI_phoneOpen, or one of the following that starts the lifetime of a call handle: TSPI_lineMakeCall
TSPI_lineCompleteTransfer
TSPI_lineForward
TSPI_linePickup
TSPI_linePrepareAddToConference
TSPI_lineSetupConference
TSPI_lineSetupTransfer
TSPI_lineUnpark
LINE_NEWCALL messages