kernel32: Partially implement GetGeoInfo() (try2)
Nikolay Sivov
bunglehead at gmail.com
Wed Jul 9 11:40:43 CDT 2014
On Wed, Jul 9, 2014 at 10:36 AM, Alexandre Julliard <julliard at winehq.org>
wrote:
> 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.
>
Ok, I think I understand what you mean.
> > +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.
>
That's true. Length is identical for all types except country names
(potentially, I didn't check that) as it's a character length. But yeah,
this is dirty. I'll need to W -> A + length check for resulting A string I
think.
Thanks for commenting.
>
> --
> Alexandre Julliard
> julliard at winehq.org
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20140709/61f1c52b/attachment.html>
More information about the wine-devel
mailing list