winhttp(1/12): Implement WinHttpGetDefaultProxyConfiguration

Alexandre Julliard julliard at winehq.org
Tue Jul 14 04:03:01 CDT 2009


Juan Lang <juan.lang at gmail.com> writes:

> +static inline void copy_char_to_wchar_sz(const BYTE *src, DWORD len, WCHAR *dst)
> +{
> +    const BYTE *begin;
> +
> +    for (begin = src; src - begin < len; src++, dst++)
> +        *dst = *src;
> +    *dst = 0;
> +}

That looks very wrong. Is there really evidence that Unicode chars are
truncated?

> +        l = RegQueryValueExW( key, WinHttpSettings, NULL, &type, NULL, &size );
> +        if (!l && type == REG_BINARY && size >= 5 * sizeof(DWORD))
> +        {
> +            BYTE *buf = HeapAlloc( GetProcessHeap(), 0, size );
> +
> +            if (buf)
> +            {
> +                DWORD *magic = (DWORD *)buf;
> +                DWORD *unknown = magic + 1;
> +                DWORD *flags = unknown + 1;
> +                DWORD *len = flags + 1;

Please define an appropriate structure.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list