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
c90845cf
Commit
c90845cf
authored
Apr 29, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Improve the stub for GetThreadPreferredUILanguages.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
57b7a993
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
42 deletions
+77
-42
locale.c
dlls/kernel32/locale.c
+47
-22
locale.c
dlls/kernel32/tests/locale.c
+29
-0
thread.c
dlls/kernel32/thread.c
+0
-20
winnls.h
include/winnls.h
+1
-0
No files found.
dlls/kernel32/locale.c
View file @
c90845cf
...
@@ -1048,35 +1048,17 @@ INT WINAPI GetSystemDefaultLocaleName(LPWSTR localename, INT len)
...
@@ -1048,35 +1048,17 @@ INT WINAPI GetSystemDefaultLocaleName(LPWSTR localename, INT len)
return
LCIDToLocaleName
(
lcid
,
localename
,
len
,
0
);
return
LCIDToLocaleName
(
lcid
,
localename
,
len
,
0
);
}
}
/***********************************************************************
static
BOOL
get_dummy_preferred_ui_language
(
DWORD
flags
,
ULONG
*
count
,
WCHAR
*
buffer
,
ULONG
*
size
)
* GetSystemPreferredUILanguages (KERNEL32.@)
*/
BOOL
WINAPI
GetSystemPreferredUILanguages
(
DWORD
flags
,
ULONG
*
count
,
WCHAR
*
buffer
,
ULONG
*
size
)
{
{
LCTYPE
type
;
LCTYPE
type
;
int
lsize
;
int
lsize
;
if
(
flags
&
~
(
MUI_LANGUAGE_NAME
|
MUI_LANGUAGE_ID
|
MUI_MACHINE_LANGUAGE_SETTINGS
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
((
flags
&
MUI_LANGUAGE_NAME
)
&&
(
flags
&
MUI_LANGUAGE_ID
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
*
size
&&
!
buffer
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
FIXME
(
"(0x%x %p %p %p) returning a dummy value (current locale)
\n
"
,
flags
,
count
,
buffer
,
size
);
FIXME
(
"(0x%x %p %p %p) returning a dummy value (current locale)
\n
"
,
flags
,
count
,
buffer
,
size
);
if
(
flags
&
MUI_LANGUAGE_ID
)
if
(
flags
&
MUI_LANGUAGE_ID
)
type
=
LOCALE_ILANGUAGE
;
type
=
LOCALE_ILANGUAGE
;
else
else
type
=
LOCALE_SNAME
;
type
=
LOCALE_SNAME
;
lsize
=
GetLocaleInfoW
(
LOCALE_SYSTEM_DEFAULT
,
type
,
NULL
,
0
);
lsize
=
GetLocaleInfoW
(
LOCALE_SYSTEM_DEFAULT
,
type
,
NULL
,
0
);
if
(
!
lsize
)
if
(
!
lsize
)
...
@@ -1109,6 +1091,49 @@ BOOL WINAPI GetSystemPreferredUILanguages(DWORD flags, ULONG* count, WCHAR* buff
...
@@ -1109,6 +1091,49 @@ BOOL WINAPI GetSystemPreferredUILanguages(DWORD flags, ULONG* count, WCHAR* buff
*
count
=
1
;
*
count
=
1
;
TRACE
(
"returned variable content: %d,
\"
%s
\"
, %d
\n
"
,
*
count
,
debugstr_w
(
buffer
),
*
size
);
TRACE
(
"returned variable content: %d,
\"
%s
\"
, %d
\n
"
,
*
count
,
debugstr_w
(
buffer
),
*
size
);
return
TRUE
;
return
TRUE
;
}
/***********************************************************************
* GetSystemPreferredUILanguages (KERNEL32.@)
*/
BOOL
WINAPI
GetSystemPreferredUILanguages
(
DWORD
flags
,
ULONG
*
count
,
WCHAR
*
buffer
,
ULONG
*
size
)
{
if
(
flags
&
~
(
MUI_LANGUAGE_NAME
|
MUI_LANGUAGE_ID
|
MUI_MACHINE_LANGUAGE_SETTINGS
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
((
flags
&
MUI_LANGUAGE_NAME
)
&&
(
flags
&
MUI_LANGUAGE_ID
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
*
size
&&
!
buffer
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
return
get_dummy_preferred_ui_language
(
flags
,
count
,
buffer
,
size
);
}
/***********************************************************************
* SetThreadPreferredUILanguages (KERNEL32.@)
*/
BOOL
WINAPI
SetThreadPreferredUILanguages
(
DWORD
flags
,
PCZZWSTR
buffer
,
PULONG
count
)
{
FIXME
(
"%u, %p, %p
\n
"
,
flags
,
buffer
,
count
);
return
TRUE
;
}
/***********************************************************************
* GetThreadPreferredUILanguages (KERNEL32.@)
*/
BOOL
WINAPI
GetThreadPreferredUILanguages
(
DWORD
flags
,
ULONG
*
count
,
WCHAR
*
buf
,
ULONG
*
size
)
{
FIXME
(
"%08x, %p, %p %p
\n
"
,
flags
,
count
,
buf
,
size
);
return
get_dummy_preferred_ui_language
(
flags
,
count
,
buf
,
size
);
}
}
/***********************************************************************
/***********************************************************************
...
...
dlls/kernel32/tests/locale.c
View file @
c90845cf
...
@@ -98,6 +98,7 @@ static INT (WINAPI *pGetGeoInfoA)(GEOID, GEOTYPE, LPSTR, INT, LANGID);
...
@@ -98,6 +98,7 @@ static INT (WINAPI *pGetGeoInfoA)(GEOID, GEOTYPE, LPSTR, INT, LANGID);
static
INT
(
WINAPI
*
pGetGeoInfoW
)(
GEOID
,
GEOTYPE
,
LPWSTR
,
INT
,
LANGID
);
static
INT
(
WINAPI
*
pGetGeoInfoW
)(
GEOID
,
GEOTYPE
,
LPWSTR
,
INT
,
LANGID
);
static
BOOL
(
WINAPI
*
pEnumSystemGeoID
)(
GEOCLASS
,
GEOID
,
GEO_ENUMPROC
);
static
BOOL
(
WINAPI
*
pEnumSystemGeoID
)(
GEOCLASS
,
GEOID
,
GEO_ENUMPROC
);
static
BOOL
(
WINAPI
*
pGetSystemPreferredUILanguages
)(
DWORD
,
ULONG
*
,
WCHAR
*
,
ULONG
*
);
static
BOOL
(
WINAPI
*
pGetSystemPreferredUILanguages
)(
DWORD
,
ULONG
*
,
WCHAR
*
,
ULONG
*
);
static
BOOL
(
WINAPI
*
pGetThreadPreferredUILanguages
)(
DWORD
,
ULONG
*
,
WCHAR
*
,
ULONG
*
);
static
void
InitFunctionPointers
(
void
)
static
void
InitFunctionPointers
(
void
)
{
{
...
@@ -127,6 +128,7 @@ static void InitFunctionPointers(void)
...
@@ -127,6 +128,7 @@ static void InitFunctionPointers(void)
X
(
GetGeoInfoW
);
X
(
GetGeoInfoW
);
X
(
EnumSystemGeoID
);
X
(
EnumSystemGeoID
);
X
(
GetSystemPreferredUILanguages
);
X
(
GetSystemPreferredUILanguages
);
X
(
GetThreadPreferredUILanguages
);
#undef X
#undef X
}
}
...
@@ -4770,6 +4772,32 @@ static void test_GetSystemPreferredUILanguages(void)
...
@@ -4770,6 +4772,32 @@ static void test_GetSystemPreferredUILanguages(void)
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
}
}
static
void
test_GetThreadPreferredUILanguages
(
void
)
{
BOOL
ret
;
ULONG
count
,
size
;
WCHAR
*
buf
;
if
(
!
pGetThreadPreferredUILanguages
)
{
win_skip
(
"GetThreadPreferredUILanguages is not available.
\n
"
);
return
;
}
size
=
count
=
0
;
ret
=
pGetThreadPreferredUILanguages
(
MUI_LANGUAGE_ID
|
MUI_UI_FALLBACK
,
&
count
,
NULL
,
&
size
);
ok
(
ret
,
"got %u
\n
"
,
GetLastError
());
ok
(
count
,
"expected count > 0
\n
"
);
ok
(
size
,
"expected size > 0
\n
"
);
count
=
0
;
buf
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
*
sizeof
(
WCHAR
));
ret
=
pGetThreadPreferredUILanguages
(
MUI_LANGUAGE_ID
|
MUI_UI_FALLBACK
,
&
count
,
buf
,
&
size
);
ok
(
ret
,
"got %u
\n
"
,
GetLastError
());
ok
(
count
,
"expected count > 0
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
START_TEST
(
locale
)
START_TEST
(
locale
)
{
{
InitFunctionPointers
();
InitFunctionPointers
();
...
@@ -4813,6 +4841,7 @@ START_TEST(locale)
...
@@ -4813,6 +4841,7 @@ START_TEST(locale)
test_EnumSystemGeoID
();
test_EnumSystemGeoID
();
test_invariant
();
test_invariant
();
test_GetSystemPreferredUILanguages
();
test_GetSystemPreferredUILanguages
();
test_GetThreadPreferredUILanguages
();
/* this requires collation table patch to make it MS compatible */
/* this requires collation table patch to make it MS compatible */
if
(
0
)
test_sorting
();
if
(
0
)
test_sorting
();
}
}
dlls/kernel32/thread.c
View file @
c90845cf
...
@@ -888,26 +888,6 @@ BOOL WINAPI GetThreadIOPendingFlag( HANDLE thread, PBOOL io_pending )
...
@@ -888,26 +888,6 @@ BOOL WINAPI GetThreadIOPendingFlag( HANDLE thread, PBOOL io_pending )
}
}
/***********************************************************************
/***********************************************************************
* SetThreadPreferredUILanguages (KERNEL32.@)
*/
BOOL
WINAPI
SetThreadPreferredUILanguages
(
DWORD
flags
,
PCZZWSTR
buffer
,
PULONG
count
)
{
FIXME
(
"%u, %p, %p
\n
"
,
flags
,
buffer
,
count
);
return
TRUE
;
}
/***********************************************************************
* GetThreadPreferredUILanguages (KERNEL32.@)
*/
BOOL
WINAPI
GetThreadPreferredUILanguages
(
DWORD
flags
,
PULONG
count
,
PCZZWSTR
buffer
,
PULONG
buffersize
)
{
FIXME
(
"%u, %p, %p %p
\n
"
,
flags
,
count
,
buffer
,
buffersize
);
*
count
=
0
;
*
buffersize
=
0
;
return
TRUE
;
}
/***********************************************************************
* CallbackMayRunLong (KERNEL32.@)
* CallbackMayRunLong (KERNEL32.@)
*/
*/
BOOL
WINAPI
CallbackMayRunLong
(
TP_CALLBACK_INSTANCE
*
instance
)
BOOL
WINAPI
CallbackMayRunLong
(
TP_CALLBACK_INSTANCE
*
instance
)
...
...
include/winnls.h
View file @
c90845cf
...
@@ -909,6 +909,7 @@ WINBASEAPI LCID WINAPI GetSystemDefaultLCID(void);
...
@@ -909,6 +909,7 @@ WINBASEAPI LCID WINAPI GetSystemDefaultLCID(void);
WINBASEAPI
LANGID
WINAPI
GetSystemDefaultUILanguage
(
void
);
WINBASEAPI
LANGID
WINAPI
GetSystemDefaultUILanguage
(
void
);
WINBASEAPI
BOOL
WINAPI
GetSystemPreferredUILanguages
(
DWORD
,
ULONG
*
,
WCHAR
*
,
ULONG
*
);
WINBASEAPI
BOOL
WINAPI
GetSystemPreferredUILanguages
(
DWORD
,
ULONG
*
,
WCHAR
*
,
ULONG
*
);
WINBASEAPI
LCID
WINAPI
GetThreadLocale
(
void
);
WINBASEAPI
LCID
WINAPI
GetThreadLocale
(
void
);
WINBASEAPI
BOOL
WINAPI
GetThreadPreferredUILanguages
(
DWORD
,
ULONG
*
,
WCHAR
*
,
ULONG
*
);
WINBASEAPI
INT
WINAPI
GetTimeFormatA
(
LCID
,
DWORD
,
const
SYSTEMTIME
*
,
LPCSTR
,
LPSTR
,
INT
);
WINBASEAPI
INT
WINAPI
GetTimeFormatA
(
LCID
,
DWORD
,
const
SYSTEMTIME
*
,
LPCSTR
,
LPSTR
,
INT
);
WINBASEAPI
INT
WINAPI
GetTimeFormatEx
(
LPCWSTR
,
DWORD
,
const
SYSTEMTIME
*
,
LPCWSTR
,
LPWSTR
,
INT
);
WINBASEAPI
INT
WINAPI
GetTimeFormatEx
(
LPCWSTR
,
DWORD
,
const
SYSTEMTIME
*
,
LPCWSTR
,
LPWSTR
,
INT
);
WINBASEAPI
INT
WINAPI
GetTimeFormatW
(
LCID
,
DWORD
,
const
SYSTEMTIME
*
,
LPCWSTR
,
LPWSTR
,
INT
);
WINBASEAPI
INT
WINAPI
GetTimeFormatW
(
LCID
,
DWORD
,
const
SYSTEMTIME
*
,
LPCWSTR
,
LPWSTR
,
INT
);
...
...
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