Why aren't my virtual roots showing up in the CE Web Server?

When configuring the CE Web Server's virtual root settings in the registry, there are a number of mistakes people make that cause their VRoot to not show up the way they expect.  I'm targeting this both at OEMs who will typically put these registry settings into project.reg, and PPC/SP ISVs who will be putting the config in some CAB file or write it out dynamically or even just use a reg editor for their development.

Rather than constantly copying the base web server vroot registry key name ([HKEY_LOCAL_MACHINE\COMM\HTTPD\VROOTS]), I'm going to abbreviate it VROOTBASE whenever I can.

MISTAKE 1 - Don't forget the '/' before the vroot name
In the VROOTBASE above, there's a bunch of '\' to indicate different reg subkeys.  The '/' character is a string literal, though.  It is REQUIRED in front of the vroot name itself -- so "VROOTBASE\FooBar" is no good.  You need "VROOTBase\/FooBar".  The web server uses this '/' as the first character to compare against in the URL.

MISTAKE 2 - Confusing what the default registry value means
The web server reads the physical path name from the default registry value associated with a particular VROOT key.  This default in a project.reg for OEMs is indicated by a @ as the registry value name.  How it is reflected in a given registry editor depends on the editor.  This default is the value that RegQueryValueEx() returns when lpValueName=NULL.

Unfortunately people have entered in the text string "(default)" or "default", not realizing that this doesn't have any meaning to the CE Web server.

The moral here is not to use the default/@ registry value if you can avoid it since it causes confusion for developers.

MISTAKE 3 - Getting the slashes and escaping confused
It's yet another '/' and '\' issue!  If you are creating your vroots in project.reg, then must not escape slashes in the registry key name.  So you want VROOTBase\/FooBar, and not VROOTBase\\/FooBar.  However, in the string values you must escape the '\' character.  So if you want to point at \windows\www, you need the default registry sting to be "\\Windows\\www".  The makeimg tool requires that string values be escaped, just as in the C programming language.

However... if you are using a registry editor, then you must not escape the string name.  So you'd enter it in as "\Windows\www" directly.  Registry editors don't have to deal with C escaping.

This causes confusion because someone will enter in a project.reg settings directly with a registry editor, or copy and paste settings from their registry editor directly into a project.reg.

MISTAKE 4 - Not using all the debugging facilities at hand
If you're an OEM with access to debug web server DLL, it can be configured to spit out tons of DEBUGOUT to make tracking down configuration issues much easier. 

\windows\www\current-httpd.log may prove handy in tracking down config issues.  It's not as verbose as full debug builds, but it is available on retail builds of the web server (including on PPC + SP).

--
For reference, here is a simple VROOT you can copy + paste into a project.reg.

[HKEY_LOCAL_MACHINE\COMM\HTTPD\VROOTS\/FilesRWS]
@="\\Windows\\www"

[Author: John Spaith]