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
c3023a12
Commit
c3023a12
authored
Mar 22, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use RtlLcidToLocaleName() in the preferred UI language stub.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a2d44e89
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
29 deletions
+12
-29
loader.c
dlls/ntdll/loader.c
+2
-5
locale.c
dlls/ntdll/locale.c
+10
-23
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+0
-1
No files found.
dlls/ntdll/loader.c
View file @
c3023a12
...
...
@@ -81,8 +81,6 @@ const WCHAR windows_dir[] = L"C:\\windows";
/* system directory with trailing backslash */
const
WCHAR
system_dir
[]
=
L"C:
\\
windows
\\
system32
\\
"
;
HMODULE
kernel32_handle
=
0
;
/* system search path */
static
const
WCHAR
system_path
[]
=
L"C:
\\
windows
\\
system32;C:
\\
windows
\\
system;C:
\\
windows"
;
...
...
@@ -4117,17 +4115,16 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
MESSAGE
(
"wine: could not load kernel32.dll, status %x
\n
"
,
status
);
NtTerminateProcess
(
GetCurrentProcess
(),
status
);
}
kernel32_handle
=
kernel32
->
ldr
.
DllBase
;
node_kernel32
=
kernel32
->
ldr
.
DdagNode
;
RtlInitAnsiString
(
&
func_name
,
"BaseThreadInitThunk"
);
if
((
status
=
LdrGetProcedureAddress
(
kernel32
_handl
e
,
&
func_name
,
if
((
status
=
LdrGetProcedureAddress
(
kernel32
->
ldr
.
DllBas
e
,
&
func_name
,
0
,
(
void
**
)
&
pBaseThreadInitThunk
))
!=
STATUS_SUCCESS
)
{
MESSAGE
(
"wine: could not find BaseThreadInitThunk in kernel32.dll, status %x
\n
"
,
status
);
NtTerminateProcess
(
GetCurrentProcess
(),
status
);
}
RtlInitAnsiString
(
&
func_name
,
"CtrlRoutine"
);
LdrGetProcedureAddress
(
kernel32
_handl
e
,
&
func_name
,
0
,
(
void
**
)
&
pCtrlRoutine
);
LdrGetProcedureAddress
(
kernel32
->
ldr
.
DllBas
e
,
&
func_name
,
0
,
(
void
**
)
&
pCtrlRoutine
);
locale_init
();
actctx_init
();
...
...
dlls/ntdll/locale.c
View file @
c3023a12
...
...
@@ -107,26 +107,6 @@ static const NLS_LOCALE_LCID_INDEX *lcids_index;
static
const
NLS_LOCALE_LCNAME_INDEX
*
lcnames_index
;
static
const
NLS_LOCALE_HEADER
*
locale_table
;
static
NTSTATUS
load_string
(
ULONG
id
,
LANGID
lang
,
WCHAR
*
buffer
,
ULONG
len
)
{
const
IMAGE_RESOURCE_DATA_ENTRY
*
data
;
LDR_RESOURCE_INFO
info
;
NTSTATUS
status
;
WCHAR
*
p
;
int
i
;
info
.
Type
=
6
;
/* RT_STRING */
info
.
Name
=
(
id
>>
4
)
+
1
;
info
.
Language
=
lang
;
if
((
status
=
LdrFindResource_U
(
kernel32_handle
,
&
info
,
3
,
&
data
)))
return
status
;
p
=
(
WCHAR
*
)((
char
*
)
kernel32_handle
+
data
->
OffsetToData
);
for
(
i
=
0
;
i
<
(
id
&
0x0f
);
i
++
)
p
+=
*
p
+
1
;
if
(
*
p
>=
len
)
return
STATUS_BUFFER_TOO_SMALL
;
memcpy
(
buffer
,
p
+
1
,
*
p
*
sizeof
(
WCHAR
)
);
buffer
[
*
p
]
=
0
;
return
STATUS_SUCCESS
;
}
static
DWORD
mbtowc_size
(
const
CPTABLEINFO
*
info
,
LPCSTR
str
,
UINT
len
)
{
...
...
@@ -625,9 +605,16 @@ static NTSTATUS get_dummy_preferred_ui_language( DWORD flags, LANGID lang, ULONG
FIXME
(
"(0x%x %p %p %p) returning a dummy value (current locale)
\n
"
,
flags
,
count
,
buffer
,
size
);
status
=
load_string
(
(
flags
&
MUI_LANGUAGE_ID
)
?
LOCALE_ILANGUAGE
:
LOCALE_SNAME
,
lang
,
name
,
ARRAY_SIZE
(
name
)
);
if
(
status
)
return
status
;
if
(
flags
&
MUI_LANGUAGE_ID
)
swprintf
(
name
,
ARRAY_SIZE
(
name
),
L"%04lx"
,
lang
);
else
{
UNICODE_STRING
str
;
str
.
Buffer
=
name
;
str
.
MaximumLength
=
sizeof
(
name
);
status
=
RtlLcidToLocaleName
(
lang
,
&
str
,
0
,
FALSE
);
if
(
status
)
return
status
;
}
len
=
wcslen
(
name
)
+
2
;
name
[
len
-
1
]
=
0
;
...
...
dlls/ntdll/ntdll_misc.h
View file @
c3023a12
...
...
@@ -80,7 +80,6 @@ extern void RELAY_SetupDLL( HMODULE hmod ) DECLSPEC_HIDDEN;
extern
void
SNOOP_SetupDLL
(
HMODULE
hmod
)
DECLSPEC_HIDDEN
;
extern
const
WCHAR
windows_dir
[]
DECLSPEC_HIDDEN
;
extern
const
WCHAR
system_dir
[]
DECLSPEC_HIDDEN
;
extern
HMODULE
kernel32_handle
DECLSPEC_HIDDEN
;
extern
void
(
FASTCALL
*
pBaseThreadInitThunk
)(
DWORD
,
LPTHREAD_START_ROUTINE
,
void
*
)
DECLSPEC_HIDDEN
;
extern
const
struct
unix_funcs
*
unix_funcs
DECLSPEC_HIDDEN
;
...
...
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