Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
2a03c095
Commit
2a03c095
authored
Nov 18, 2019
by
João Diogo Ferreira
Committed by
Alexandre Julliard
Nov 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Handle GEOCLASS_ALL in EnumSystemGeoID().
Signed-off-by:
João Diogo Craveiro Ferreira
<
devilj@outlook.pt
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f1b94dc1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
6 deletions
+32
-6
locale.c
dlls/kernel32/locale.c
+19
-6
locale.c
dlls/kernel32/tests/locale.c
+13
-0
No files found.
dlls/kernel32/locale.c
View file @
2a03c095
...
...
@@ -4247,16 +4247,28 @@ INT WINAPI GetGeoInfoA(GEOID geoid, GEOTYPE geotype, LPSTR data, int data_len, L
/******************************************************************************
* EnumSystemGeoID (KERNEL32.@)
*
* Call
a user
s function for every location available on the system.
* Call
s a user'
s function for every location available on the system.
*
* PARAMS
* geoclass [I] Type of
inform
ation desired (SYSGEOTYPE enum from "winnls.h")
* parent [I] G
EO
ID for the parent
* enumproc [I] Callback function to call for each location
* geoclass [I] Type of
loc
ation desired (SYSGEOTYPE enum from "winnls.h")
* parent [I] G
eo
ID for the parent
* enumproc [I] Callback function to call for each location
(prototype in "winnls.h")
*
* RETURNS
* Success: TRUE.
* Failure: FALSE. Use GetLastError() to determine the cause.
*
* NOTES
* The enumproc function returns TRUE to continue enumerating
* or FALSE to interrupt the enumeration.
*
* On failure, GetLastError() returns one of the following values:
* - ERROR_INVALID_PARAMETER: no callback function was provided.
* - ERROR_INVALID_FLAGS: the location type was invalid.
*
* TODO
* On Windows 10, this function filters out those locations which
* simultaneously lack ISO and UN codes (e.g. Johnson Atoll).
*/
BOOL
WINAPI
EnumSystemGeoID
(
GEOCLASS
geoclass
,
GEOID
parent
,
GEO_ENUMPROC
enumproc
)
{
...
...
@@ -4269,7 +4281,7 @@ 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
;
}
...
...
@@ -4277,9 +4289,10 @@ BOOL WINAPI EnumSystemGeoID(GEOCLASS geoclass, GEOID parent, GEO_ENUMPROC enumpr
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
geoinfodata
);
i
++
)
{
const
struct
geoinfo_t
*
ptr
=
&
geoinfodata
[
i
];
if
(
geoclass
==
GEOCLASS_NATION
&&
(
ptr
->
kind
==
LOCATION_REG
ION
))
if
(
geoclass
==
GEOCLASS_NATION
&&
(
ptr
->
kind
!=
LOCATION_NAT
ION
))
continue
;
/* LOCATION_BOTH counts as region. */
if
(
geoclass
==
GEOCLASS_REGION
&&
(
ptr
->
kind
==
LOCATION_NATION
))
continue
;
...
...
dlls/kernel32/tests/locale.c
View file @
2a03c095
...
...
@@ -4981,6 +4981,19 @@ static void test_EnumSystemGeoID(void)
ret
=
pEnumSystemGeoID
(
GEOCLASS_REGION
,
0
,
test_geoid_enumproc2
);
ok
(
ret
&&
geoidenum_count
>
0
,
"got %d, count %d
\n
"
,
ret
,
geoidenum_count
);
}
geoidenum_count
=
0
;
ret
=
pEnumSystemGeoID
(
GEOCLASS_ALL
,
39070
,
test_geoid_enumproc2
);
if
(
ret
==
0
)
win_skip
(
"GEOCLASS_ALL is not supported in EnumSystemGeoID.
\n
"
);
else
{
ok
(
ret
&&
geoidenum_count
>
0
,
"got %d, count %d
\n
"
,
ret
,
geoidenum_count
);
geoidenum_count
=
0
;
ret
=
pEnumSystemGeoID
(
GEOCLASS_ALL
,
0
,
test_geoid_enumproc2
);
ok
(
ret
&&
geoidenum_count
>
0
,
"got %d, count %d
\n
"
,
ret
,
geoidenum_count
);
}
}
struct
invariant_entry
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment