Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9def213d
Commit
9def213d
authored
Jul 20, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move the locale system calls to the Unix library.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0e45f7b4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
71 deletions
+86
-71
locale.c
dlls/ntdll/locale.c
+18
-61
ntdll.spec
dlls/ntdll/ntdll.spec
+10
-10
env.c
dlls/ntdll/unix/env.c
+58
-0
No files found.
dlls/ntdll/locale.c
View file @
9def213d
...
...
@@ -102,7 +102,6 @@ struct norm_table
LCID
user_lcid
=
0
,
system_lcid
=
0
;
static
LANGID
user_ui_language
,
system_ui_language
;
static
NLSTABLEINFO
nls_info
;
static
HMODULE
kernel32_handle
;
static
CPTABLEINFO
unix_table
;
...
...
@@ -721,7 +720,6 @@ void init_locale( HMODULE module )
{
WCHAR
system_locale
[
LOCALE_NAME_MAX_LENGTH
];
WCHAR
user_locale
[
LOCALE_NAME_MAX_LENGTH
];
LCID
system_lcid
,
user_lcid
;
kernel32_handle
=
module
;
...
...
@@ -814,61 +812,6 @@ UINT CDECL __wine_get_unix_codepage(void)
}
/**********************************************************************
* NtQueryDefaultLocale (NTDLL.@)
*/
NTSTATUS
WINAPI
NtQueryDefaultLocale
(
BOOLEAN
user
,
LCID
*
lcid
)
{
*
lcid
=
user
?
user_lcid
:
system_lcid
;
return
STATUS_SUCCESS
;
}
/**********************************************************************
* NtSetDefaultLocale (NTDLL.@)
*/
NTSTATUS
WINAPI
NtSetDefaultLocale
(
BOOLEAN
user
,
LCID
lcid
)
{
if
(
user
)
user_lcid
=
lcid
;
else
{
system_lcid
=
lcid
;
system_ui_language
=
LANGIDFROMLCID
(
lcid
);
/* there is no separate call to set it */
}
return
STATUS_SUCCESS
;
}
/**********************************************************************
* NtQueryDefaultUILanguage (NTDLL.@)
*/
NTSTATUS
WINAPI
NtQueryDefaultUILanguage
(
LANGID
*
lang
)
{
*
lang
=
user_ui_language
;
return
STATUS_SUCCESS
;
}
/**********************************************************************
* NtSetDefaultUILanguage (NTDLL.@)
*/
NTSTATUS
WINAPI
NtSetDefaultUILanguage
(
LANGID
lang
)
{
user_ui_language
=
lang
;
return
STATUS_SUCCESS
;
}
/**********************************************************************
* NtQueryInstallUILanguage (NTDLL.@)
*/
NTSTATUS
WINAPI
NtQueryInstallUILanguage
(
LANGID
*
lang
)
{
*
lang
=
system_ui_language
;
return
STATUS_SUCCESS
;
}
static
NTSTATUS
get_dummy_preferred_ui_language
(
DWORD
flags
,
LANGID
lang
,
ULONG
*
count
,
WCHAR
*
buffer
,
ULONG
*
size
)
{
...
...
@@ -905,8 +848,12 @@ static NTSTATUS get_dummy_preferred_ui_language( DWORD flags, LANGID lang, ULONG
*/
NTSTATUS
WINAPI
RtlGetProcessPreferredUILanguages
(
DWORD
flags
,
ULONG
*
count
,
WCHAR
*
buffer
,
ULONG
*
size
)
{
LANGID
ui_language
;
FIXME
(
"%08x, %p, %p %p
\n
"
,
flags
,
count
,
buffer
,
size
);
return
get_dummy_preferred_ui_language
(
flags
,
user_ui_language
,
count
,
buffer
,
size
);
NtQueryDefaultUILanguage
(
&
ui_language
);
return
get_dummy_preferred_ui_language
(
flags
,
ui_language
,
count
,
buffer
,
size
);
}
...
...
@@ -916,11 +863,14 @@ NTSTATUS WINAPI RtlGetProcessPreferredUILanguages( DWORD flags, ULONG *count, WC
NTSTATUS
WINAPI
RtlGetSystemPreferredUILanguages
(
DWORD
flags
,
ULONG
unknown
,
ULONG
*
count
,
WCHAR
*
buffer
,
ULONG
*
size
)
{
LANGID
ui_language
;
if
(
flags
&
~
(
MUI_LANGUAGE_NAME
|
MUI_LANGUAGE_ID
|
MUI_MACHINE_LANGUAGE_SETTINGS
))
return
STATUS_INVALID_PARAMETER
;
if
((
flags
&
MUI_LANGUAGE_NAME
)
&&
(
flags
&
MUI_LANGUAGE_ID
))
return
STATUS_INVALID_PARAMETER
;
if
(
*
size
&&
!
buffer
)
return
STATUS_INVALID_PARAMETER
;
return
get_dummy_preferred_ui_language
(
flags
,
system_ui_language
,
count
,
buffer
,
size
);
NtQueryInstallUILanguage
(
&
ui_language
);
return
get_dummy_preferred_ui_language
(
flags
,
ui_language
,
count
,
buffer
,
size
);
}
...
...
@@ -929,8 +879,12 @@ NTSTATUS WINAPI RtlGetSystemPreferredUILanguages( DWORD flags, ULONG unknown, UL
*/
NTSTATUS
WINAPI
RtlGetThreadPreferredUILanguages
(
DWORD
flags
,
ULONG
*
count
,
WCHAR
*
buffer
,
ULONG
*
size
)
{
LANGID
ui_language
;
FIXME
(
"%08x, %p, %p %p
\n
"
,
flags
,
count
,
buffer
,
size
);
return
get_dummy_preferred_ui_language
(
flags
,
user_ui_language
,
count
,
buffer
,
size
);
NtQueryDefaultUILanguage
(
&
ui_language
);
return
get_dummy_preferred_ui_language
(
flags
,
ui_language
,
count
,
buffer
,
size
);
}
...
...
@@ -940,11 +894,14 @@ NTSTATUS WINAPI RtlGetThreadPreferredUILanguages( DWORD flags, ULONG *count, WCH
NTSTATUS
WINAPI
RtlGetUserPreferredUILanguages
(
DWORD
flags
,
ULONG
unknown
,
ULONG
*
count
,
WCHAR
*
buffer
,
ULONG
*
size
)
{
LANGID
ui_language
;
if
(
flags
&
~
(
MUI_LANGUAGE_NAME
|
MUI_LANGUAGE_ID
))
return
STATUS_INVALID_PARAMETER
;
if
((
flags
&
MUI_LANGUAGE_NAME
)
&&
(
flags
&
MUI_LANGUAGE_ID
))
return
STATUS_INVALID_PARAMETER
;
if
(
*
size
&&
!
buffer
)
return
STATUS_INVALID_PARAMETER
;
return
get_dummy_preferred_ui_language
(
flags
,
user_ui_language
,
count
,
buffer
,
size
);
NtQueryDefaultUILanguage
(
&
ui_language
);
return
get_dummy_preferred_ui_language
(
flags
,
ui_language
,
count
,
buffer
,
size
);
}
...
...
dlls/ntdll/ntdll.spec
View file @
9def213d
...
...
@@ -284,8 +284,8 @@
# @ stub NtQueryBootEntryOrder
# @ stub NtQueryBootOptions
# @ stub NtQueryDebugFilterState
@ stdcall NtQueryDefaultLocale(long ptr)
@ stdcall NtQueryDefaultUILanguage(ptr)
@ stdcall
-syscall
NtQueryDefaultLocale(long ptr)
@ stdcall
-syscall
NtQueryDefaultUILanguage(ptr)
@ stdcall -syscall NtQueryDirectoryFile(long long ptr ptr ptr ptr long long long ptr long)
@ stdcall -syscall NtQueryDirectoryObject(long ptr long long long ptr ptr)
@ stdcall -syscall NtQueryEaFile(long ptr ptr long long ptr long ptr long)
...
...
@@ -298,7 +298,7 @@
@ stdcall -syscall NtQueryInformationProcess(long long ptr long ptr)
@ stdcall -syscall NtQueryInformationThread(long long ptr long ptr)
@ stdcall -syscall NtQueryInformationToken(long long ptr long ptr)
@ stdcall NtQueryInstallUILanguage(ptr)
@ stdcall
-syscall
NtQueryInstallUILanguage(ptr)
@ stub NtQueryIntervalProfile
@ stdcall -syscall NtQueryIoCompletion(long long ptr long ptr)
@ stdcall -syscall NtQueryKey(long long ptr long ptr)
...
...
@@ -364,8 +364,8 @@
@ stdcall -syscall NtSetContextThread(long ptr)
@ stub NtSetDebugFilterState
@ stub NtSetDefaultHardErrorPort
@ stdcall NtSetDefaultLocale(long long)
@ stdcall NtSetDefaultUILanguage(long)
@ stdcall
-syscall
NtSetDefaultLocale(long long)
@ stdcall
-syscall
NtSetDefaultUILanguage(long)
@ stdcall -syscall NtSetEaFile(long ptr ptr long)
@ stdcall -syscall NtSetEvent(long ptr)
# @ stub NtSetEventBoostPriority
...
...
@@ -1272,8 +1272,8 @@
# @ stub ZwQueryBootEntryOrder
# @ stub ZwQueryBootOptions
# @ stub ZwQueryDebugFilterState
@ stdcall -private ZwQueryDefaultLocale(long ptr) NtQueryDefaultLocale
@ stdcall -private ZwQueryDefaultUILanguage(ptr) NtQueryDefaultUILanguage
@ stdcall -private
-syscall
ZwQueryDefaultLocale(long ptr) NtQueryDefaultLocale
@ stdcall -private
-syscall
ZwQueryDefaultUILanguage(ptr) NtQueryDefaultUILanguage
@ stdcall -private -syscall ZwQueryDirectoryFile(long long ptr ptr ptr ptr long long long ptr long) NtQueryDirectoryFile
@ stdcall -private -syscall ZwQueryDirectoryObject(long ptr long long long ptr ptr) NtQueryDirectoryObject
@ stdcall -private -syscall ZwQueryEaFile(long ptr ptr long long ptr long ptr long) NtQueryEaFile
...
...
@@ -1286,7 +1286,7 @@
@ stdcall -private -syscall ZwQueryInformationProcess(long long ptr long ptr) NtQueryInformationProcess
@ stdcall -private -syscall ZwQueryInformationThread(long long ptr long ptr) NtQueryInformationThread
@ stdcall -private -syscall ZwQueryInformationToken(long long ptr long ptr) NtQueryInformationToken
@ stdcall -private ZwQueryInstallUILanguage(ptr) NtQueryInstallUILanguage
@ stdcall -private
-syscall
ZwQueryInstallUILanguage(ptr) NtQueryInstallUILanguage
@ stub ZwQueryIntervalProfile
@ stdcall -private -syscall ZwQueryIoCompletion(long long ptr long ptr) NtQueryIoCompletion
@ stdcall -private -syscall ZwQueryKey(long long ptr long ptr) NtQueryKey
...
...
@@ -1352,8 +1352,8 @@
@ stdcall -private -syscall ZwSetContextThread(long ptr) NtSetContextThread
@ stub ZwSetDebugFilterState
@ stub ZwSetDefaultHardErrorPort
@ stdcall -private ZwSetDefaultLocale(long long) NtSetDefaultLocale
@ stdcall -private ZwSetDefaultUILanguage(long) NtSetDefaultUILanguage
@ stdcall -private
-syscall
ZwSetDefaultLocale(long long) NtSetDefaultLocale
@ stdcall -private
-syscall
ZwSetDefaultUILanguage(long) NtSetDefaultUILanguage
@ stdcall -private -syscall ZwSetEaFile(long ptr ptr long) NtSetEaFile
@ stdcall -private -syscall ZwSetEvent(long ptr) NtSetEvent
# @ stub ZwSetEventBoostPriority
...
...
dlls/ntdll/unix/env.c
View file @
9def213d
...
...
@@ -73,6 +73,9 @@ char **main_argv = NULL;
char
**
main_envp
=
NULL
;
static
WCHAR
**
main_wargv
;
static
LCID
user_lcid
,
system_lcid
;
static
LANGID
user_ui_language
,
system_ui_language
;
static
char
system_locale
[
LOCALE_NAME_MAX_LENGTH
];
static
char
user_locale
[
LOCALE_NAME_MAX_LENGTH
];
...
...
@@ -1251,3 +1254,58 @@ void CDECL get_locales( WCHAR *sys, WCHAR *user )
ntdll_umbstowcs
(
system_locale
,
strlen
(
system_locale
)
+
1
,
sys
,
LOCALE_NAME_MAX_LENGTH
);
ntdll_umbstowcs
(
user_locale
,
strlen
(
user_locale
)
+
1
,
user
,
LOCALE_NAME_MAX_LENGTH
);
}
/**********************************************************************
* NtQueryDefaultLocale (NTDLL.@)
*/
NTSTATUS
WINAPI
NtQueryDefaultLocale
(
BOOLEAN
user
,
LCID
*
lcid
)
{
*
lcid
=
user
?
user_lcid
:
system_lcid
;
return
STATUS_SUCCESS
;
}
/**********************************************************************
* NtSetDefaultLocale (NTDLL.@)
*/
NTSTATUS
WINAPI
NtSetDefaultLocale
(
BOOLEAN
user
,
LCID
lcid
)
{
if
(
user
)
user_lcid
=
lcid
;
else
{
system_lcid
=
lcid
;
system_ui_language
=
LANGIDFROMLCID
(
lcid
);
/* there is no separate call to set it */
}
return
STATUS_SUCCESS
;
}
/**********************************************************************
* NtQueryDefaultUILanguage (NTDLL.@)
*/
NTSTATUS
WINAPI
NtQueryDefaultUILanguage
(
LANGID
*
lang
)
{
*
lang
=
user_ui_language
;
return
STATUS_SUCCESS
;
}
/**********************************************************************
* NtSetDefaultUILanguage (NTDLL.@)
*/
NTSTATUS
WINAPI
NtSetDefaultUILanguage
(
LANGID
lang
)
{
user_ui_language
=
lang
;
return
STATUS_SUCCESS
;
}
/**********************************************************************
* NtQueryInstallUILanguage (NTDLL.@)
*/
NTSTATUS
WINAPI
NtQueryInstallUILanguage
(
LANGID
*
lang
)
{
*
lang
=
system_ui_language
;
return
STATUS_SUCCESS
;
}
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