Layered Service Provider

Windows CE .NET

Windows CE supports the concept of a Layered Service Provider (LSP). You can use the Winsock Service Provider Interface (SPI) to extend an existing transport service provider by implementing an LSP. Layered service providers implement only higher-level custom communication functions and rely on an existing underlying base provider for data exchange with a remote endpoint. Chaining providers can be accomplished as long as the providers at both the upper and lower edges support the Winsock SPI.

Windows CE includes sample code for an LSP as well as the corresponding LSP installer code in the %_WINCEROOT%\Public\Common\SDK\Samples\TSP\LSP folder. For more information on LSP, see the article Unraveling the Mysteries of Writing a Winsock 2 Layered Service Provider, which is published on MSDN.

To run the LSP installer

  1. Copy the LSP installation code in a DllRegisterServer function.
  2. Add a registry subkey to the HKEY_LOCAL_MACHINE\COM\WS2\LSP registry key.
  3. To this subkey, add a registry entry named DLL. For the value, insert the path to the DLL with the DllRegisterServer function.
  4. When Winsock loads, it enumerates all keys under the subkey HKEY_LOCAL_MACHINE\COM\WS2\LSP. For each subkey that has a DLL property, it performs a LoadLibrary function call on the value in that property. If successful, it then calls DllRegisterServer for the DLL.

See Also

Multiple Transport Protocols


 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.

Show: