advpack: Forward the remaining advpack.c ansi functions to their unicode counterparts

Alexandre Julliard julliard at winehq.org
Wed Mar 22 14:43:49 CST 2006


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

> +HRESULT WINAPI SetPerUserSecValuesA(PERUSERSECTIONA* pPerUser)
> +{
> +    PERUSERSECTIONW perUserW;
> +
> +    if (!pPerUser)
> +        return E_INVALIDARG;
> +
> +    TRACE("(%p)\n", pPerUser);
> +
> +    /* lengths copied from PERUSERSECTION structure definition */
> +    MultiByteToWideChar(CP_ACP, 0, pPerUser->szGUID, 59, perUserW.szGUID, 59);
> +    MultiByteToWideChar(CP_ACP, 0, pPerUser->szDispName, 128, perUserW.szDispName, 128);
> +    MultiByteToWideChar(CP_ACP, 0, pPerUser->szLocale, 10, perUserW.szLocale, 10);
> +    MultiByteToWideChar(CP_ACP, 0, pPerUser->szStub, MAX_PATH * 4, perUserW.szStub, MAX_PATH * 4);
> +    MultiByteToWideChar(CP_ACP, 0, pPerUser->szVersion, 32, perUserW.szVersion, 32);
> +    MultiByteToWideChar(CP_ACP, 0, pPerUser->szCompID, 128, perUserW.szCompID, 128);

The source lengths are wrong, these are null-terminated strings. Also
please use sizeof() instead of hardcoding the constants.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list