Error Checking

At the TAPI level, an application can pass a variety of different parameters, many of which may be invalid. tapi32.dll checks for bad parameters and returns errors to the application without calling the service provider. Each function description at the TSPI level describes the parameter errors that have already been 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 below.

Validity Test Description
Pointer validity tapi32.dll has already tested pointers to data storage to make sure that they point to readable or writeable 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 really available.
Fixed size validity For variably sized data strucutres, the data structure has been checked to make sure that there is at least enough space for the fixed size part of the data structure and that dwTotalSize is sufficient to cover the fixed part.
Offset/size zeroed For variably sized data structures, the "...Offset" and "...Size" fields corresponding to parts that the service provider fills in have been preset with zero values before the service provider was called.
Handle validity tapi32.dll guarantees 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