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
982c3ede
Commit
982c3ede
authored
Nov 10, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 11, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: GetLocaleInfoA() doesn't support LOCALE_SSHORTTIME.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
beeeb2a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
1 deletion
+64
-1
locale.c
dlls/kernel32/locale.c
+2
-1
locale.c
dlls/kernel32/tests/locale.c
+62
-0
No files found.
dlls/kernel32/locale.c
View file @
982c3ede
...
...
@@ -1295,7 +1295,8 @@ INT WINAPI GetLocaleInfoA( LCID lcid, LCTYPE lctype, LPSTR buffer, INT len )
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
if
(
lctype
&
LOCALE_RETURN_GENITIVE_NAMES
)
if
(((
lctype
&
~
LOCALE_LOCALEINFOFLAGSMASK
)
==
LOCALE_SSHORTTIME
)
||
(
lctype
&
LOCALE_RETURN_GENITIVE_NAMES
))
{
SetLastError
(
ERROR_INVALID_FLAGS
);
return
0
;
...
...
dlls/kernel32/tests/locale.c
View file @
982c3ede
...
...
@@ -3358,6 +3358,7 @@ static void test_EnumUILanguageA(void)
}
static
char
date_fmt_buf
[
1024
];
static
WCHAR
date_fmt_bufW
[
1024
];
static
BOOL
CALLBACK
enum_datetime_procA
(
LPSTR
fmt
)
{
...
...
@@ -3366,6 +3367,12 @@ static BOOL CALLBACK enum_datetime_procA(LPSTR fmt)
return
TRUE
;
}
static
BOOL
CALLBACK
enum_datetime_procW
(
WCHAR
*
fmt
)
{
lstrcatW
(
date_fmt_bufW
,
fmt
);
return
FALSE
;
}
static
void
test_EnumDateFormatsA
(
void
)
{
char
*
p
,
buf
[
256
];
...
...
@@ -3473,6 +3480,60 @@ static void test_EnumTimeFormatsA(void)
ok
(
!
lstrcmpA
(
date_fmt_buf
,
buf
),
"expected
\"
%s
\"
got
\"
%s
\"\n
"
,
date_fmt_buf
,
buf
);
}
static
void
test_EnumTimeFormatsW
(
void
)
{
LCID
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
),
SORT_DEFAULT
);
WCHAR
bufW
[
256
];
BOOL
ret
;
date_fmt_bufW
[
0
]
=
0
;
ret
=
EnumTimeFormatsW
(
enum_datetime_procW
,
lcid
,
0
);
ok
(
ret
,
"EnumTimeFormatsW(0) error %d
\n
"
,
GetLastError
());
ret
=
GetLocaleInfoW
(
lcid
,
LOCALE_STIMEFORMAT
,
bufW
,
sizeof
(
bufW
)
/
sizeof
(
bufW
[
0
]));
ok
(
ret
,
"GetLocaleInfoW(LOCALE_STIMEFORMAT) error %d
\n
"
,
GetLastError
());
ok
(
!
lstrcmpW
(
date_fmt_bufW
,
bufW
),
"expected
\"
%s
\"
got
\"
%s
\"\n
"
,
wine_dbgstr_w
(
date_fmt_bufW
),
wine_dbgstr_w
(
bufW
));
date_fmt_bufW
[
0
]
=
0
;
ret
=
EnumTimeFormatsW
(
enum_datetime_procW
,
lcid
,
LOCALE_USE_CP_ACP
);
ok
(
ret
,
"EnumTimeFormatsW(LOCALE_USE_CP_ACP) error %d
\n
"
,
GetLastError
());
ret
=
GetLocaleInfoW
(
lcid
,
LOCALE_STIMEFORMAT
,
bufW
,
sizeof
(
bufW
)
/
sizeof
(
bufW
[
0
]));
ok
(
ret
,
"GetLocaleInfoW(LOCALE_STIMEFORMAT) error %d
\n
"
,
GetLastError
());
ok
(
!
lstrcmpW
(
date_fmt_bufW
,
bufW
),
"expected
\"
%s
\"
got
\"
%s
\"\n
"
,
wine_dbgstr_w
(
date_fmt_bufW
),
wine_dbgstr_w
(
bufW
));
/* TIME_NOSECONDS is Win7+ feature */
date_fmt_bufW
[
0
]
=
0
;
ret
=
EnumTimeFormatsW
(
enum_datetime_procW
,
lcid
,
TIME_NOSECONDS
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_FLAGS
)
skip
(
"EnumTimeFormatsW doesn't support TIME_NOSECONDS
\n
"
);
else
{
char
buf
[
256
];
todo_wine
ok
(
ret
,
"EnumTimeFormatsW(TIME_NOSECONDS) error %d
\n
"
,
GetLastError
());
ret
=
GetLocaleInfoW
(
lcid
,
LOCALE_SSHORTTIME
,
bufW
,
sizeof
(
bufW
)
/
sizeof
(
bufW
[
0
]));
ok
(
ret
,
"GetLocaleInfoW(LOCALE_SSHORTTIME) error %d
\n
"
,
GetLastError
());
todo_wine
ok
(
!
lstrcmpW
(
date_fmt_bufW
,
bufW
),
"expected
\"
%s
\"
got
\"
%s
\"\n
"
,
wine_dbgstr_w
(
date_fmt_bufW
),
wine_dbgstr_w
(
bufW
));
/* EnumTimeFormatsA doesn't support this flag */
ret
=
EnumTimeFormatsA
(
enum_datetime_procA
,
lcid
,
TIME_NOSECONDS
);
todo_wine
{
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_FLAGS
,
"EnumTimeFormatsA(TIME_NOSECONDS) ret %d, error %d
\n
"
,
ret
,
GetLastError
());
ret
=
EnumTimeFormatsA
(
NULL
,
lcid
,
TIME_NOSECONDS
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_FLAGS
,
"EnumTimeFormatsA(TIME_NOSECONDS) ret %d, error %d
\n
"
,
ret
,
GetLastError
());
}
/* And it's not supported by GetLocaleInfoA either */
ret
=
GetLocaleInfoA
(
lcid
,
LOCALE_SSHORTTIME
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]));
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_FLAGS
,
"GetLocaleInfoA(LOCALE_SSHORTTIME) ret %d, error %d
\n
"
,
ret
,
GetLastError
());
}
}
static
void
test_GetCPInfo
(
void
)
{
BOOL
ret
;
...
...
@@ -4506,6 +4567,7 @@ START_TEST(locale)
InitFunctionPointers
();
test_EnumTimeFormatsA
();
test_EnumTimeFormatsW
();
test_EnumDateFormatsA
();
test_GetLocaleInfoA
();
test_GetLocaleInfoW
();
...
...
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