LINE_CREATE

A service provider sends a LINE_CREATE message to the LINEEVENT callback function when it desires to create a new device. This can occur when a new device is detected by Plug and Play, or dynamically enabled by the user through a provider configuration function. During the LINEEVENT callback procedure, TAPI simply queues this message for later processing. When the message is received from the queue, the TSPI_providerCreateLineDevice function is called in the context of the TAPISRV.EXE process.

LINE_CREATE
htLine = (HTAPILINE) 0;
htCall = (HTAPICALL) 0;
dwMsg = (DWORD) LINE_CREATE;
dwParam1 = (DWORD) hProvider;
dwParam2 = (DWORD) TempDeviceId;
dwParam3 = (DWORD) 0;
 

Parameters

htLine
Unused.
htCall
Unused.
dwMsg
The value LINE_CREATE.
dwParam1
The service provider handle (hProvider) as received in TSPI_providerEnumDevices.
dwParam2
Contains a temporary device identifier generated by the service provider. TAPI uses this value in a subsequent call to TSPI_providerCreateLineDevice to assist the provider in associating the message and the function call (in the event that multiple devices are being created).
dwParam3
Unused.

Return Values

No return value.

Remarks

Service providers can (and should) continue to make "static" device allocations at startup when TAPI calls TSPI_providerEnumDevices. Creating known devices using this mechanism, instead of always using LINE_CREATE, involves lower overhead for applications (because they don't have to process LINE_CREATE messages, updated device information, and so on). The LINE_CREATE mechanism is intended to be used only if new devices are created while the service provider is active (for example, between TSPI_providerInit and TSPI_providerShutdown).

This message is sent to the LINEEVENT callback entry point in TAPI. The service provider receives a pointer to this callback in the TSPI_providerEnumDevices function and in each TSPI_lineOpen function; the LINE_CREATE message can be sent to the LINEEVENT callback function given to any open line or at startup.

Devices cannot be removed dynamically. If a service provider wants to remove a line from service, it can send a LINE_LINEDEVSTATE (LINEDEVSTATE_OUTOFSERVICE) message. It would then refuse (for example, by returning LINEERR_INVALLINESTATE) to perform any operation with the device until it returns to service or the provider is shut down and restarted (in which case the device could not be declared in TSPI_providerEnumDevices, effectively removing it from the system).

For backward compatibility, older service providers are not expected to send this message. If they do, the message is treated in the same manner as described earlier for new service providers.

See Also

LINE_LINEDEVSTATE, LINEEVENT, TSPI_lineOpen, TSPI_providerCreateLineDevice, TSPI_providerEnumDevices, TSPI_providerInit, TSPI_providerShutdown