New uninstaller

Dmitry Timoshkov dmitry at baikal.ru
Sun Feb 27 19:10:49 CST 2005


"Jonathan Ernst" <Jonathan at ErnstFamily.ch> wrote:

> With some help I'll be able to improve it (more unicodification, etc.)
> when I'll come back.

You can't really convert to unicode partially, you have to do it in one go.
That not only will simplify things a lot, but also will save you a lot of time.

> +    for (i=0; i < numentries; i++)
> +    {
> +        len = WideCharToMultiByte(CP_UNIXCP, 0, entries[i].descr, -1, NULL, 0, NULL, NULL); 
> +        descr = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
> +        WideCharToMultiByte(CP_UNIXCP, 0, entries[i].descr, -1, descr, len, NULL, NULL); 
> +        printf("%s|||%s\n", entries[i].key, descr);

There is no need to allocate len * sizeof(WCHAR) bytes, len works just fine.

> +int wmain(int argc, char *argv[])

wmain takes 'WCHAR *argv[]' list.

All remaining problems are caused by the fact that now argv[] array
is passed in unicode but you still handle argv[] strings as ASCII and
pass them around to internal functions which accept 'char *' not 'WCHAR *'
strings.

-- 
Dmitry.




More information about the wine-devel mailing list