Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
ec5d3c9f
Commit
ec5d3c9f
authored
Mar 29, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Reimplement LOCALE_SNATIVEDIGITS in GetLocaleInfoW/Ex using the locale.nls data.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f0d43939
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
6 deletions
+31
-6
locale.c
dlls/kernelbase/locale.c
+31
-2
usp10.c
dlls/usp10/tests/usp10.c
+0
-4
No files found.
dlls/kernelbase/locale.c
View file @
ec5d3c9f
...
...
@@ -896,6 +896,35 @@ static int locale_return_strarray( DWORD pos, WORD idx, LCTYPE type, WCHAR *buff
}
static
int
locale_return_strarray_concat
(
DWORD
pos
,
LCTYPE
type
,
WCHAR
*
buffer
,
int
len
)
{
WORD
i
,
count
=
locale_strings
[
pos
];
const
DWORD
*
array
=
(
const
DWORD
*
)(
locale_strings
+
pos
+
1
);
int
ret
;
if
(
type
&
LOCALE_RETURN_NUMBER
)
{
SetLastError
(
ERROR_INVALID_FLAGS
);
return
0
;
}
for
(
i
=
0
,
ret
=
1
;
i
<
count
;
i
++
)
ret
+=
locale_strings
[
array
[
i
]];
if
(
!
len
)
return
ret
;
if
(
ret
>
len
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
0
;
}
for
(
i
=
0
;
i
<
count
;
i
++
)
{
memcpy
(
buffer
,
locale_strings
+
array
[
i
]
+
1
,
locale_strings
[
array
[
i
]]
*
sizeof
(
WCHAR
)
);
buffer
+=
locale_strings
[
array
[
i
]];
}
*
buffer
=
0
;
return
ret
;
}
/* get locale information from the locale.nls file */
static
int
get_locale_info
(
const
NLS_LOCALE_DATA
*
locale
,
LCID
lcid
,
LCTYPE
type
,
WCHAR
*
buffer
,
int
len
)
...
...
@@ -967,7 +996,7 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ
return
-
1
;
case
LOCALE_SNATIVEDIGITS
:
return
-
1
;
return
locale_return_strarray_concat
(
locale
->
snativedigits
,
type
,
buffer
,
len
)
;
case
LOCALE_SCURRENCY
:
return
locale_return_string
(
locale
->
scurrency
,
type
,
buffer
,
len
);
...
...
@@ -1285,7 +1314,7 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ
return
-
1
;
case
LOCALE_IDIGITSUBSTITUTION
:
return
-
1
;
return
locale_return_number
(
locale
->
idigitsubstitution
,
type
,
buffer
,
len
)
;
}
SetLastError
(
ERROR_INVALID_FLAGS
);
return
0
;
...
...
dlls/usp10/tests/usp10.c
View file @
ec5d3c9f
...
...
@@ -3613,7 +3613,6 @@ static BOOL CALLBACK enum_proc(LGRPID group, LCID lcid, LPSTR locale, LONG_PTR l
SCRIPT_CONTROL
sc
;
SCRIPT_STATE
ss
;
LCID
lcid_old
;
BOOL
todo
;
if
(
!
IsValidLocale
(
lcid
,
LCID_INSTALLED
))
return
TRUE
;
...
...
@@ -3624,10 +3623,7 @@ static BOOL CALLBACK enum_proc(LGRPID group, LCID lcid, LPSTR locale, LONG_PTR l
lcid_old
=
GetThreadLocale
();
if
(
!
SetThreadLocale
(
lcid
))
return
TRUE
;
todo
=
!
GetLocaleInfoW
(
lcid
,
LOCALE_IDIGITSUBSTITUTION
|
LOCALE_RETURN_NUMBER
,
NULL
,
0
);
hr
=
ScriptRecordDigitSubstitution
(
lcid
,
&
sds
);
todo_wine_if
(
todo
)
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
ScriptApplyDigitSubstitution
(
&
sds
,
&
sc
,
&
ss
);
...
...
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