6.7  TAPI Initialization

After a WAN miniport has registered, been initialized and indicated that it is a TAPI provider, MiniportQueryInformation is called with an OID_TAPI_PROVIDER_INITIALIZE request. There is a one-to-one relationship between a provider and a TAPI-capable adapter. The NDIS_TAPI_PROVIDER_INITIALIZE structure passed in the call contains a ulDeviceIDBase representing an offset. The miniport should add this offset to its zero-based line device identifiers when it refers to a device in subsequent OID responses. If the miniport manages two devices and it is passed a ulDeviceIDBase of n, those devices will be referenced in future calls as n and n+1, for instance in the ulDeviceID member passed to the miniport in the structure for an OID_TAPI_OPEN.

The miniport should fill in two members of the OID structure before returning from MiniportQueryInformation. The ulNumLineDevs is set to the number of line devices supported by the adapter. The NIC driver should also set the ulProviderID member to a unique (per adapter) value. Since there is currently no means to guarantee unique ulProviderID values, a good strategy is to pass the NDIS handle passed to MiniportInitialize as the ulProviderID. The ulRequestID member of the structure is reserved for NDISTAPI and is opaque to the miniport.

The OID_TAPI_PROVIDER_INITIALIZE request sent to registered WAN miniport NIC drivers is always the result of a higher-level telephony module being loaded and initialized by the first client process. A miniport will only receive the OID_TAPI_PROVIDER_INITIALIZE request once per adapter when the first client process on the machine makes a lineInitialize request.

Communicating Device Characteristics

After the WAN miniport has returned the number of devices it supports, its MiniportQueryInformation function will be called to return the capabilities of its devices with an OID_TAPI_GET_DEV_CAPS and to return its device configuration with an OID_TAPI_GET_DEV_CONFIG. This information describes how the WAN miniport models its device. For instance, the same ISDN adapter can be modelled as:

·1 line, with 1 address, supporting 2 calls per address

·1 line, with 2 addresses on this line, supporting one call per address

·2 lines, each with 1 address, supporting 1 call per address

A miniport will be queried for its characteristics using these already mentioned OIDs, once for each device that it indicated in its response to OID_TAPI_PROVIDER_INITIALIZE.