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
a26fb194
Commit
a26fb194
authored
Nov 23, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.globalization: Implement GeographicRegion_get_CodeTwoLetter.
parent
fe467cf4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
geographic_region.c
dlls/windows.globalization/geographic_region.c
+6
-2
globalization.c
dlls/windows.globalization/tests/globalization.c
+16
-1
No files found.
dlls/windows.globalization/geographic_region.c
View file @
a26fb194
...
...
@@ -95,8 +95,12 @@ static HRESULT WINAPI geographic_region_get_Code( IGeographicRegion *iface, HSTR
static
HRESULT
WINAPI
geographic_region_get_CodeTwoLetter
(
IGeographicRegion
*
iface
,
HSTRING
*
value
)
{
FIXME
(
"iface %p stub!
\n
"
,
iface
);
return
E_NOTIMPL
;
WCHAR
buffer
[
LOCALE_NAME_MAX_LENGTH
];
FIXME
(
"iface %p semi-stub!
\n
"
,
iface
);
if
(
!
GetLocaleInfoEx
(
LOCALE_NAME_USER_DEFAULT
,
LOCALE_SISO3166CTRYNAME
,
buffer
,
ARRAY_SIZE
(
buffer
)
))
return
E_INVALIDARG
;
return
WindowsCreateString
(
buffer
,
wcslen
(
buffer
),
value
);
}
static
HRESULT
WINAPI
geographic_region_get_CodeThreeLetter
(
IGeographicRegion
*
iface
,
HSTRING
*
value
)
...
...
dlls/windows.globalization/tests/globalization.c
View file @
a26fb194
...
...
@@ -317,8 +317,9 @@ static void test_GeographicRegion(void)
IGeographicRegionFactory
*
geographic_region_factory
;
IGeographicRegion
*
geographic_region
;
IActivationFactory
*
factory
;
HSTRING
str
;
HSTRING
str
,
expect_str
;
HRESULT
hr
;
INT32
res
;
LONG
ref
;
hr
=
WindowsCreateString
(
class_name
,
wcslen
(
class_name
),
&
str
);
...
...
@@ -344,6 +345,10 @@ static void test_GeographicRegion(void)
check_interface
(
geographic_region
,
&
IID_IInspectable
);
check_interface
(
geographic_region
,
&
IID_IAgileObject
);
hr
=
IGeographicRegion_get_CodeTwoLetter
(
geographic_region
,
&
str
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
WindowsDeleteString
(
str
);
ref
=
IGeographicRegion_Release
(
geographic_region
);
ok
(
ref
==
0
,
"got ref %ld.
\n
"
,
ref
);
...
...
@@ -358,6 +363,16 @@ static void test_GeographicRegion(void)
if
(
hr
==
S_OK
)
{
hr
=
WindowsCreateString
(
L"US"
,
wcslen
(
L"US"
),
&
expect_str
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
IGeographicRegion_get_CodeTwoLetter
(
geographic_region
,
&
str
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
WindowsCompareStringOrdinal
(
str
,
expect_str
,
&
res
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ok
(
!
res
,
"got unexpected string %s.
\n
"
,
debugstr_hstring
(
str
)
);
WindowsDeleteString
(
str
);
WindowsDeleteString
(
expect_str
);
ref
=
IGeographicRegion_Release
(
geographic_region
);
ok
(
ref
==
0
,
"got ref %ld.
\n
"
,
ref
);
}
...
...
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