advpack: Forward AddDelBackupEntryA to its unicode counterpart

Alexandre Julliard julliard at winehq.org
Wed Mar 22 04:24:31 CST 2006


"James Hawkins" <truiken at gmail.com> writes:

> +    do
> +    {
> +        MultiByteToWideChar(CP_ACP, 0, ansi_list, len, ptr, len);
> +
> +        ansi_list += len;
> +        ptr += len;
> +
> +        len = lstrlenA(ansi_list) + 1;
> +        size += len * sizeof(WCHAR);
> +        list = HeapReAlloc(GetProcessHeap(), 0, list, size);
> +    } while (*ansi_list);

You are assuming that A and W have the same length, that's wrong. Also
it will be quite expensive to resize the list all the time. You should
determine the full length of the list and then convert everything in
one go.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list