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
20e1b46d
Commit
20e1b46d
authored
Aug 17, 2012
by
André Hentschel
Committed by
Alexandre Julliard
Aug 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Fix LocaleNameToLCID on mismatch.
parent
ca234e3e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
locale.c
dlls/kernel32/locale.c
+6
-2
locale.c
dlls/kernel32/tests/locale.c
+9
-4
No files found.
dlls/kernel32/locale.c
View file @
20e1b46d
...
...
@@ -998,8 +998,12 @@ LCID WINAPI LocaleNameToLCID( LPCWSTR name, DWORD flags )
locale_name
.
lcid
,
debugstr_w
(
name
),
locale_name
.
matches
);
if
(
!
locale_name
.
matches
)
WARN
(
"locale %s not recognized, defaulting to English
\n
"
,
debugstr_w
(
name
)
);
else
if
(
locale_name
.
matches
==
1
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
if
(
locale_name
.
matches
==
1
)
WARN
(
"locale %s not recognized, defaulting to %s
\n
"
,
debugstr_w
(
name
),
debugstr_w
(
locale_name
.
lang
)
);
...
...
dlls/kernel32/tests/locale.c
View file @
20e1b46d
...
...
@@ -1869,22 +1869,25 @@ static void test_LocaleNameToLCID(void)
/* special cases */
buffer
[
0
]
=
0
;
SetLastError
(
0xdeadbeef
);
lcid
=
pLocaleNameToLCID
(
LOCALE_NAME_USER_DEFAULT
,
0
);
ok
(
lcid
==
GetUserDefaultLCID
()
||
broken
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
/* Vista */
),
"Expected lcid == %08x, got %08x, error %d
\n
"
,
lcid
,
GetUserDefaultLCID
()
,
GetLastError
());
"Expected lcid == %08x, got %08x, error %d
\n
"
,
GetUserDefaultLCID
(),
lcid
,
GetLastError
());
ret
=
pLCIDToLocaleName
(
lcid
,
buffer
,
LOCALE_NAME_MAX_LENGTH
,
0
);
ok
(
ret
>
0
,
"Expected ret > 0, got %d, error %d
\n
"
,
ret
,
GetLastError
());
trace
(
"%08x, %s
\n
"
,
lcid
,
wine_dbgstr_w
(
buffer
));
buffer
[
0
]
=
0
;
SetLastError
(
0xdeadbeef
);
lcid
=
pLocaleNameToLCID
(
LOCALE_NAME_SYSTEM_DEFAULT
,
0
);
todo_wine
ok
(
!
lcid
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected lcid !
= 0, got %08x, error %d
\n
"
,
lcid
,
GetLastError
());
ok
(
!
lcid
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected lcid =
= 0, got %08x, error %d
\n
"
,
lcid
,
GetLastError
());
ret
=
pLCIDToLocaleName
(
lcid
,
buffer
,
LOCALE_NAME_MAX_LENGTH
,
0
);
ok
(
ret
>
0
,
"Expected ret > 0, got %d, error %d
\n
"
,
ret
,
GetLastError
());
trace
(
"%08x, %s
\n
"
,
lcid
,
wine_dbgstr_w
(
buffer
));
buffer
[
0
]
=
0
;
SetLastError
(
0xdeadbeef
);
lcid
=
pLocaleNameToLCID
(
LOCALE_NAME_INVARIANT
,
0
);
todo_wine
ok
(
lcid
==
0x7F
,
"Expected lcid = 0x7F, got %08x, error %d
\n
"
,
lcid
,
GetLastError
());
ret
=
pLCIDToLocaleName
(
lcid
,
buffer
,
LOCALE_NAME_MAX_LENGTH
,
0
);
...
...
@@ -1892,8 +1895,10 @@ static void test_LocaleNameToLCID(void)
trace
(
"%08x, %s
\n
"
,
lcid
,
wine_dbgstr_w
(
buffer
));
/* bad name */
SetLastError
(
0xdeadbeef
);
lcid
=
pLocaleNameToLCID
(
fooW
,
0
);
todo_wine
ok
(
lcid
==
0
,
"got 0x%04x
\n
"
,
lcid
);
ok
(
!
lcid
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected lcid == 0, got got %08x, error %d
\n
"
,
lcid
,
GetLastError
());
/* english neutral name */
lcid
=
pLocaleNameToLCID
(
enW
,
0
);
...
...
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