kernel32: Partially implement GetGeoInfo() (try2)

Alexandre Julliard julliard at winehq.org
Wed Jul 9 02:36:45 CDT 2014


Nikolay Sivov <nsivov at codeweavers.com> writes:

> +    ptr = &geoinfodata[geoid];
> +    if (!*ptr->iso2W) {
> +        SetLastError(ERROR_INVALID_PARAMETER);
> +        return 0;
> +    }
> +
> +    len = get_geoinfo_len(geoid, geotype);
> +    if (!data || !data_len)
> +        return len;

You could check this at the end before copying the string instead of
having a duplicate function for the length.

> +INT WINAPI GetGeoInfoA(GEOID geoid, GEOTYPE geotype, LPSTR data, int data_len, LANGID lang)
> +{
> +    WCHAR buffW[12];
> +    INT len = 0;
> +
> +    TRACE("%d %d %p %d %d\n", geoid, geotype, data, data_len, lang);
> +
> +    if (!data || !data_len)
> +        return GetGeoInfoW(geoid, geotype, NULL, 0, lang);

You can't just return the W length.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list