The poor man's wininet

Windows CE since CE 2.12 has had Wininet.dll ported from the desktop.  It's cool since it's pretty nearly the same as what you get on Windows XP and lets us have stuff like Internet Explorer.  It's not cool for headless devices, where it won't run and would chew up a lot of ROM+RAM even if it did.

In CE 4.0, we brought the tiny wininet that we had in CE 2.11 out of retirement and rechristened it httplite.dll.  Httplite was made to run inside a headless device and provide about %80 of the key functionality that Wininet does.  It's about 65KB of ROM on an x86 build, to get an idea of its size.  Both Wininet and httplite are perfectly safe to run inside servers (like web server) on CE, unlike the wininet on the desktop where I think there are gotchas.

To get an image with httplite in it, add "set __SYSGEN_HTTPLITE=1" and optionally (to get FTP related functionality) "set __SYSGEN_HTTPLITE_FTP=1" to your CEBase.bat.

CE6: If the cebase.bat trick isn't working for you (I've heard , you need to do a "set __SYSGEN_NEED_HTTP_FTP=1" in public\cebase\oak\misc\winceos.bat.  It should go right above the "REM // HTTP Lite" line.  Note I've never tested this in CE6 however.

To build apps using wininet, you need to #include <dubinet.h>.  It's a lot like wininet.h, except dubinet.h only has definitions for stuff httplite.dll supports.  Use it so that if you try to use some wininet construct httplite does not support, you'll get a compile time error that's easy to debug rather than some weird run-time error down the road.  Link to httplite.lib, and then you're ready to start using httplite!

Note 1: Httplite is for OEMs (platform builders) only and is not something ISV's can add to existing images.  If you're an ISV and you want this, talk with your OEM about having them add it to your platform.

Note 2: Httplite is untested and undocumented.  It gets a lot of use by Microsoft components that run on headless devices and use it (UPnP in particular), but this isn't quite the same as extensive API level testing.  I also know of at least one customer via newsgroups who has used it with great success.  If you find bugs Microsoft would like to know, but we cannot promise to fix them or help you debug anything.

Note 3: Httplite is is CE 4.0-5.0.  There are no plans to cut it from future releases, but if we can get wininet.dll smaller and running on headless devices then httplite will be retired again.  It should also be in CE6.0, but we've never tested the FTP functions in particular there.

A good discussion of this took place on the newsgroups at http://groups.google.com/groups?hl=en&lr=&frame=right&th=b5dcc910824dfc88&seekm=%238dcrQWTDHA.3500%40tk2msftngp13.phx.gbl#s.