LSP Installation on CE.

[Last Edited on 12/7/2004]

The target audience for this post is LSP developers who are looking to install their LSP.
Developers with experience with desktop LSP installation will also
find this very useful.

This post also explains LSP installation differences between CE
and XP, and explains how to install an LSP on CE.

Note this post applies to Windows CE 5.0 and greater. As with earlier releases, LSP chain order on CE is solely determined by the order of installation.  However, prior to version 5.0 there was no “Order” key and installation order was difficult to coordinate.

1) LSP Installation differences between CE and the desktop

    Installed catalog is not persisted across reboots
    No WSCWriteProviderOrder function
    No SPORDER application
    WSCEnemurateProviders returns current catalog (not catalog at time app started)
    Installing LSP on the fly can be dangerous
    All LSP Installers run on every bootup
    Order of LSP chains is based on order installation routines run
    LSPs have cooperative installers

2) Problems when installing LSPs on the fly:

* LSP change hasn’t taken effect for all apps:
    device.exe/services.exe runs for the lifetime of the CE device
    Already open sockets will not use new LSP but new sockets will
    LSP usually cache catalog at startup.
    LSP won’t see changed catalog till restart.


    Server application is creating and using sockets
    Socket A is created with one chain before the LSP installs
    Socket B is created with another chain after install
    If the application calls select with socket A and B, select fails
    because the sockets have two different providers (see the documentation for select).

3) Why select works for IPv4 / IPv6, TCP / UDP:

    SOCKET sv4 = socket (AF_INET,..);
    SOCKET sv6 = socket (AF_INET6,…);
    FDSET fds;
    Select (fdset1,…);

     You would expect this to fail since sv4 and sv6 should be implemented by
    different providers.  But our default base providers install with same GUID
    so this call will work with no LSPs installed. Several apps, including
    Activesync, call select on both IPv4 and IPv6 sockets in the same fd_set.

 4) What should your LSP Installer do?

  * Layer over TCPv4/TCPv6/UDPv4/UDPv6 with the same ProviderId GUID.
       Keeps select() working for all applications.

 5) How to configure CE to install your LSP

 * Add a key to:

    [HKEY_LOCAL_MACHINE\Comm\WS2\LSP\<your lsp>]
    “Dll”=”your_lsp.dll”  ; DLL containing your installer     
    ;”DllEntry”=”DllRegisterServer” ; // Function called to perform installation
                                           ; // Default value is DllRegisterServer

     “Order”=dword:400    ;  // Order at which you’ll install
                                    ;  //  Default value is 0xFFFFFFFF
                                    ;  // Change this value to change your position in the
                                    ;  // Protocol Stack 

 * On startup, before any apps have called WSAStartup, all installers will be
run in the order specified (lowest Order value first).

[Author: Igor Dvorkin]

Comments (6)

  1. TaoZhang says:

    Hi Igor,

    I follow your indication in this doc and successfully install my lsp in windows CE ( I am using CEPC as a developing enveriment)

    The question is: after I install my LSP, and the system started, when I start the MSN,I get this error printed in the debug window in PB.

    /************error Start *****************/

    443397 PID:63d60b2e TID:63c39632 …… WSPSend ENTRY …..

    443397 PID:63d60b2e TID:63c39632 …… WSPSend OUT …..

    443438 PID:63d60b2e TID:63c39632 …… WSPRecv ENTRY …..

    443438 PID:63d60b2e TID:63c39632 …… WSPRecv OUT …..

    443455 PID:63d60b2e TID:63ce5d1e mydt_dll: Thread Attach

    443457 PID:63d60b2e TID:23d60ace mydt_dll: Thread Attach

    443469 PID:63f7a5ae TID:23d60ace 0x83cd8800: AFD:ResolveName !No IPv6 Interfaces

    443471 PID:63d60b2e TID:a3ce5fca mydt_dll: Thread Attach

    443906 PID:63f7a5ae TID:a3ce5fca 0x83ca88d8: AFD:ResolveName !No IPv6 Interfaces

    444170 PID:63d60b2e TID:63c39632

    *** Wininet Assertion failed: (int)_BytesRemaining >= 0

    *** Source file:

    *** Source line: 997

    *** Thread 63c39632

    /************* error end *******************/

    and the CEPC system will hang there.

    Is there something I need to do to avoid it?

    tnx a lot.


  2. Jeremy says:

    After scouring the entire internet for days, I have done everything that you have described and I am still unable to get WSPSend calls from IE.  

    I DO get WSPSend from messenger perfectly.  The LSP appears to be functioning and installed correctly.

    What is the deal?  Is IE doing some secret magic?  Is an NDIS solution required?  Should I quit my job?

  3. saminglinux says:

    hi TaoZhang!

    I can’t install my lsp on WM5.0?

    can you tell me?

  4. saminglinux says:

    Hi Igor,

    I follow your indication in this doc and  install my lsp in windows mobile 5.0( I am using CEPC as a developing enveriment)

    But can’s install my lsp ,

    can you tell me, what’s problem ?

    thx !

    my msn:

  5. JohnP says:

    Hi Igor,

    I am using the sample LSP implementation thats shipped along with the Winmobile 6.1 AKU. After installing the LSP using the above instructions, i see that its conflicting with the WinM Test Auto server, which i believe is used by the KITL.

    810598 PID:4559ace2 TID:4559acbe WinM Test Auto: Starting automation server

    1027 35: 811833 PID:4559ace2 TID:43f26fd6 Initializing socket 270C80

     1033 35: 811851 PID:4559ace2 TID:43f26fd6 Destroying socket 270C80

     1066 35: 814831 PID:4559ace2 TID:43f26fd6 Initializing socket 27E6D0

     1072 35: 814840 PID:4559ace2 TID:43f26fd6 Destroying socket 27E6D0

     1084 35: 816933 PID:4559ace2 TID:43f26fd6 Initializing socket 27E6D0

     1090 35: 817099 PID:4559ace2 TID:43f26fd6 Destroying socket 27E6D0

    I’d like to know whether this is a known issue?

    Thanks in advance,