Microsoft KB Archive/290209

= INFO: Tips for Porting Windows NT TAPI Service Providers to Windows CE =

Article ID: 290209

Article Last Modified on 4/5/2006

-

APPLIES TO


 * Microsoft Windows CE 3.0 for the Handheld PC

-



This article was previously published under Q290209



SUMMARY
The Telephony API (TAPI) Telephony Service Provider (TSP) porting notes in the CE Platform Builder documentation describe most of the differences between Windows NT and Windows CE. There are further differences that need to be clarified, and this article provides that information.

NOTE: For detailed information on Windows NT TAPI TSP, see MSDN Online:

http://msdn.microsoft.com



MORE INFORMATION
The following are significant differences between Windows NT and Windows CE with regard to TAPI TSP that are not detailed in the Windows CE documentation:  TAPI response to the TSP LINE_CREATE message

Windows NT TAPI calls TSPI_providerCreateLineDevice in response to a TAPI service provider LINE_CREATE message. Windows CE TAPI does not call TSPI_providerCreateLineDevice. In Windows CE, TAPI treats dwParam2 as a pointer to a DWORD which will receive the TAPI assigned line device identifier. TAPI assigns this ID before it returns to the TSP. When a TSP wants to create a new line device in Windows CE, it is sufficient to simply send a LINE_CREATE message.  TSPI_providerCreateLineDevice parameters

TSPI_providerCreateLineDevice parameters are different in Windows CE than Windows NT. For Windows CE, the function prototype is: LONG TSPI_providerCreateLineDevice(          HKEY hActiveKey,           LPCWSTR lpszDevPath,           LPCWSTR lpszDeviceName      );

Returns: TAPI error code

hActiveKey - Open handle to the device's &quot;active&quot; key in the registry. lpszDevPath - registry path string to the device's driver key lpszDeviceName - the device name (i.e. COM3: ) On Windows CE, TSPI_providerCreateLineDevice is called when TAPI is notified by the operating system that a new device has been created that has an associated TSP. This is a registry-driven process. A serial device typically has subkeys that describe the associated TSPs. When the device loader sees that a device has an associated TSP, it calls TAPI, passing an open handle to the device's &quot;active&quot; key in the registry, the registry path string to the device's driver key, and the device name. (Note how those correspond directly to the parameters to TSPI_providerCreateLineDevice.)  Unmatched DLL_PROCESS_ATTACH/DLL_PROCESS_DETACH indications

On Windows CE, the TAPI functions are exported as an API set from the Device.exe protected server library (PSL). The implications of this are that TAPI.dll and the TSP DLLs are loaded only in the Device.exe process. An application thread calling one of the TAPI functions goes through a thunk that switches the thread into the Device.exe PSL and on return thunks back to the application process context. This means a TSP DLL will be loaded once and receive one DLL_PROCESS_ATTACH indication. It will not be unloaded, and therefore there will be no corresponding DLL_PROCESS_DETACH.

Keywords: kbinfo kbfix KB290209

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.