[PATCH 11/12] kernel32: Handle GEOCLASS_ALL in EnumSystemGeoID().
João Diogo Ferreira
devilj at outlook.pt
Tue Oct 22 12:43:40 CDT 2019
Signed-off-by: João Diogo Craveiro Ferreira <devilj at outlook.pt>
---
dlls/kernel32/locale.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
index 752136be07..fd0c283790 100644
--- a/dlls/kernel32/locale.c
+++ b/dlls/kernel32/locale.c
@@ -4611,21 +4611,24 @@ int WINAPI GetGeoInfoEx(PWSTR location, GEOTYPE geotype, PWSTR geoData, int geoD
/******************************************************************************
* EnumSystemGeoID (KERNEL32.@)
*
- * Call a users function for every location available on the system.
+ * Call a user's function for every location available on the system.
*
* PARAMS
- * geoclass [I] Type of information desired (SYSGEOTYPE enum from "winnls.h")
+ * geoclass [I] Type of location desired (SYSGEOTYPE enum from "winnls.h")
* parent [I] GEOID for the parent
* enumproc [I] Callback function to call for each location
*
* RETURNS
* Success: TRUE.
* Failure: FALSE. Use GetLastError() to determine the cause.
+ *
+ * NOTES
+ * On failure, GetLastError() will return one of the following values:
+ * - ERROR_INVALID_PARAMETER: enumproc was NULL;
+ * - ERROR_INVALID_FLAGS: The geoclass argument was invalid.
*/
BOOL WINAPI EnumSystemGeoID(GEOCLASS geoclass, GEOID parent, GEO_ENUMPROC enumproc)
{
- INT i;
-
TRACE("(%d, %d, %p)\n", geoclass, parent, enumproc);
if (!enumproc) {
@@ -4633,15 +4636,15 @@ BOOL WINAPI EnumSystemGeoID(GEOCLASS geoclass, GEOID parent, GEO_ENUMPROC enumpr
return FALSE;
}
- if (geoclass != GEOCLASS_NATION && geoclass != GEOCLASS_REGION) {
+ if (geoclass != GEOCLASS_NATION && geoclass != GEOCLASS_REGION && geoclass != GEOCLASS_ALL) {
SetLastError(ERROR_INVALID_FLAGS);
return FALSE;
}
- for (i = 0; i < ARRAY_SIZE(geoinfodata); i++) {
+ for (int i = 0; i < ARRAY_SIZE(geoinfodata); i++) {
const struct geoinfo_t *ptr = &geoinfodata[i];
- if (geoclass == GEOCLASS_NATION && (ptr->kind == LOCATION_REGION))
+ if (geoclass == GEOCLASS_NATION && (ptr->kind != LOCATION_NATION))
continue;
if (geoclass == GEOCLASS_REGION && (ptr->kind == LOCATION_NATION))
--
2.23.0
More information about the wine-devel
mailing list