Apologies for the size of this patch - I tried 3 or 4 ways of converting chunks to unicode and always ended up duplicating huge bits of code and having problems keeping track of duplicated variables that in the end I did the lot in one go.
You need TCHAR and friends to reduce the Patch-Size (char => TCHAR when you did char => WCHAR)
Alexandre explicitly stated he didn't want TCHAR's anywhere, hence the conversion to WCHAR (See post on 5/4/2007, 8:31 re regedit)
Jason