Nikolay Sivov <nsivov(a)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(a)winehq.org