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
9cd67d2a
Commit
9cd67d2a
authored
Feb 10, 2016
by
Stefan Leichter
Committed by
Alexandre Julliard
Feb 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Return a dummy value in GetSystemPreferredUILanguages.
Signed-off-by:
Stefan Leichter
<
Stefan.Leichter@camLine.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
997e2046
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
13 deletions
+40
-13
locale.c
dlls/kernel32/locale.c
+40
-3
locale.c
dlls/kernel32/tests/locale.c
+0
-10
No files found.
dlls/kernel32/locale.c
View file @
9cd67d2a
...
@@ -1053,6 +1053,8 @@ INT WINAPI GetSystemDefaultLocaleName(LPWSTR localename, INT len)
...
@@ -1053,6 +1053,8 @@ INT WINAPI GetSystemDefaultLocaleName(LPWSTR localename, INT len)
*/
*/
BOOL
WINAPI
GetSystemPreferredUILanguages
(
DWORD
flags
,
ULONG
*
count
,
WCHAR
*
buffer
,
ULONG
*
size
)
BOOL
WINAPI
GetSystemPreferredUILanguages
(
DWORD
flags
,
ULONG
*
count
,
WCHAR
*
buffer
,
ULONG
*
size
)
{
{
LCTYPE
type
;
int
lsize
;
if
(
flags
&
~
(
MUI_LANGUAGE_NAME
|
MUI_LANGUAGE_ID
|
MUI_MACHINE_LANGUAGE_SETTINGS
))
if
(
flags
&
~
(
MUI_LANGUAGE_NAME
|
MUI_LANGUAGE_ID
|
MUI_MACHINE_LANGUAGE_SETTINGS
))
{
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
...
@@ -1069,9 +1071,44 @@ BOOL WINAPI GetSystemPreferredUILanguages(DWORD flags, ULONG* count, WCHAR* buff
...
@@ -1069,9 +1071,44 @@ BOOL WINAPI GetSystemPreferredUILanguages(DWORD flags, ULONG* count, WCHAR* buff
return
FALSE
;
return
FALSE
;
}
}
FIXME
(
"(0x%x %p %p %p) stub
\n
"
,
flags
,
count
,
buffer
,
size
);
FIXME
(
"(0x%x %p %p %p) returning a dummy value (current locale)
\n
"
,
flags
,
count
,
buffer
,
size
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
FALSE
;
if
(
flags
&
MUI_LANGUAGE_ID
)
type
=
LOCALE_ILANGUAGE
;
else
type
=
LOCALE_SNAME
;
lsize
=
GetLocaleInfoW
(
LOCALE_SYSTEM_DEFAULT
,
type
,
NULL
,
0
);
if
(
!
lsize
)
{
/* keep last error from callee */
return
FALSE
;
}
lsize
++
;
if
(
!*
size
)
{
*
size
=
lsize
;
*
count
=
1
;
return
TRUE
;
}
if
(
lsize
>
*
size
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
FALSE
;
}
if
(
!
GetLocaleInfoW
(
LOCALE_SYSTEM_DEFAULT
,
type
,
buffer
,
*
size
))
{
/* keep last error from callee */
return
FALSE
;
}
buffer
[
lsize
-
1
]
=
0
;
*
size
=
lsize
;
*
count
=
1
;
TRACE
(
"returned variable content: %d,
\"
%s
\"
, %d
\n
"
,
*
count
,
debugstr_w
(
buffer
),
*
size
);
return
TRUE
;
}
}
/***********************************************************************
/***********************************************************************
...
...
dlls/kernel32/tests/locale.c
View file @
9cd67d2a
...
@@ -4623,10 +4623,8 @@ static void test_GetSystemPreferredUILanguages(void)
...
@@ -4623,10 +4623,8 @@ static void test_GetSystemPreferredUILanguages(void)
size
=
0
;
size
=
0
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetSystemPreferredUILanguages
(
0
,
&
count
,
NULL
,
&
size
);
ret
=
pGetSystemPreferredUILanguages
(
0
,
&
count
,
NULL
,
&
size
);
todo_wine
ok
(
ret
,
"Expected GetSystemPreferredUILanguages to succeed
\n
"
);
ok
(
ret
,
"Expected GetSystemPreferredUILanguages to succeed
\n
"
);
ok
(
count
,
"Expected count > 0
\n
"
);
ok
(
count
,
"Expected count > 0
\n
"
);
todo_wine
ok
(
size
%
6
==
1
,
"Expected size (%d) %% 6 == 1
\n
"
,
size
);
ok
(
size
%
6
==
1
,
"Expected size (%d) %% 6 == 1
\n
"
,
size
);
count
=
0xdeadbeef
;
count
=
0xdeadbeef
;
...
@@ -4657,20 +4655,16 @@ static void test_GetSystemPreferredUILanguages(void)
...
@@ -4657,20 +4655,16 @@ static void test_GetSystemPreferredUILanguages(void)
size
=
0
;
size
=
0
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetSystemPreferredUILanguages
(
MUI_LANGUAGE_ID
|
MUI_MACHINE_LANGUAGE_SETTINGS
,
&
count
,
NULL
,
&
size
);
ret
=
pGetSystemPreferredUILanguages
(
MUI_LANGUAGE_ID
|
MUI_MACHINE_LANGUAGE_SETTINGS
,
&
count
,
NULL
,
&
size
);
todo_wine
ok
(
ret
,
"Expected GetSystemPreferredUILanguages to succeed
\n
"
);
ok
(
ret
,
"Expected GetSystemPreferredUILanguages to succeed
\n
"
);
ok
(
count
,
"Expected count > 0
\n
"
);
ok
(
count
,
"Expected count > 0
\n
"
);
todo_wine
ok
(
size
%
5
==
1
,
"Expected size (%d) %% 5 == 1
\n
"
,
size
);
ok
(
size
%
5
==
1
,
"Expected size (%d) %% 5 == 1
\n
"
,
size
);
count
=
0xdeadbeef
;
count
=
0xdeadbeef
;
size
=
0
;
size
=
0
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetSystemPreferredUILanguages
(
MUI_LANGUAGE_NAME
|
MUI_MACHINE_LANGUAGE_SETTINGS
,
&
count
,
NULL
,
&
size
);
ret
=
pGetSystemPreferredUILanguages
(
MUI_LANGUAGE_NAME
|
MUI_MACHINE_LANGUAGE_SETTINGS
,
&
count
,
NULL
,
&
size
);
todo_wine
ok
(
ret
,
"Expected GetSystemPreferredUILanguages to succeed
\n
"
);
ok
(
ret
,
"Expected GetSystemPreferredUILanguages to succeed
\n
"
);
ok
(
count
,
"Expected count > 0
\n
"
);
ok
(
count
,
"Expected count > 0
\n
"
);
todo_wine
ok
(
size
%
6
==
1
,
"Expected size (%d) %% 6 == 1
\n
"
,
size
);
ok
(
size
%
6
==
1
,
"Expected size (%d) %% 6 == 1
\n
"
,
size
);
/* second parameter
/* second parameter
...
@@ -4696,20 +4690,16 @@ static void test_GetSystemPreferredUILanguages(void)
...
@@ -4696,20 +4690,16 @@ static void test_GetSystemPreferredUILanguages(void)
size_id
=
0
;
size_id
=
0
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetSystemPreferredUILanguages
(
MUI_LANGUAGE_ID
,
&
count
,
NULL
,
&
size_id
);
ret
=
pGetSystemPreferredUILanguages
(
MUI_LANGUAGE_ID
,
&
count
,
NULL
,
&
size_id
);
todo_wine
ok
(
ret
,
"Expected GetSystemPreferredUILanguages to succeed
\n
"
);
ok
(
ret
,
"Expected GetSystemPreferredUILanguages to succeed
\n
"
);
ok
(
count
,
"Expected count > 0
\n
"
);
ok
(
count
,
"Expected count > 0
\n
"
);
todo_wine
ok
(
size_id
%
5
==
1
,
"Expected size (%d) %% 5 == 1
\n
"
,
size_id
);
ok
(
size_id
%
5
==
1
,
"Expected size (%d) %% 5 == 1
\n
"
,
size_id
);
count
=
0xdeadbeef
;
count
=
0xdeadbeef
;
size_name
=
0
;
size_name
=
0
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetSystemPreferredUILanguages
(
MUI_LANGUAGE_NAME
,
&
count
,
NULL
,
&
size_name
);
ret
=
pGetSystemPreferredUILanguages
(
MUI_LANGUAGE_NAME
,
&
count
,
NULL
,
&
size_name
);
todo_wine
ok
(
ret
,
"Expected GetSystemPreferredUILanguages to succeed
\n
"
);
ok
(
ret
,
"Expected GetSystemPreferredUILanguages to succeed
\n
"
);
ok
(
count
,
"Expected count > 0
\n
"
);
ok
(
count
,
"Expected count > 0
\n
"
);
todo_wine
ok
(
size_name
%
6
==
1
,
"Expected size (%d) %% 6 == 1
\n
"
,
size_name
);
ok
(
size_name
%
6
==
1
,
"Expected size (%d) %% 6 == 1
\n
"
,
size_name
);
size_buffer
=
max
(
size_id
,
size_name
);
size_buffer
=
max
(
size_id
,
size_name
);
...
...
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