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
db5cf9a5
Commit
db5cf9a5
authored
Mar 27, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 28, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Use installed IME language for the created HKL.
parent
4571456e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
6 deletions
+23
-6
Makefile.in
dlls/imm32/Makefile.in
+1
-1
imm.c
dlls/imm32/imm.c
+22
-4
imm32.c
dlls/imm32/tests/imm32.c
+0
-1
No files found.
dlls/imm32/Makefile.in
View file @
db5cf9a5
MODULE
=
imm32.dll
IMPORTLIB
=
imm32
IMPORTS
=
user32 gdi32 advapi32 win32u
IMPORTS
=
user32 gdi32 advapi32
kernelbase
win32u
DELAYIMPORTS
=
ole32
C_SRCS
=
\
...
...
dlls/imm32/imm.c
View file @
db5cf9a5
...
...
@@ -2012,13 +2012,31 @@ HKL WINAPI ImmInstallIMEA( const char *filenameA, const char *descriptionA )
return
hkl
;
}
static
LCID
get_ime_file_lang
(
const
WCHAR
*
filename
)
{
DWORD
*
languages
;
LCID
lcid
=
0
;
void
*
info
;
UINT
len
;
if
(
!
(
len
=
GetFileVersionInfoSizeW
(
filename
,
NULL
)))
return
0
;
if
(
!
(
info
=
malloc
(
len
)))
goto
done
;
if
(
!
GetFileVersionInfoW
(
filename
,
0
,
len
,
info
))
goto
done
;
if
(
!
VerQueryValueW
(
info
,
L"
\\
VarFileInfo
\\
Translation"
,
(
void
**
)
&
languages
,
&
len
)
||
!
len
)
goto
done
;
lcid
=
languages
[
0
];
done:
free
(
info
);
return
lcid
;
}
/***********************************************************************
* ImmInstallIMEW (IMM32.@)
*/
HKL
WINAPI
ImmInstallIMEW
(
const
WCHAR
*
filename
,
const
WCHAR
*
description
)
{
WCHAR
path
[
ARRAY_SIZE
(
layouts_formatW
)
+
8
],
buffer
[
MAX_PATH
];
LCID
lcid
=
GetUserDefaultLCID
()
;
LCID
lcid
;
WORD
count
=
0x20
;
const
WCHAR
*
tmp
;
DWORD
length
;
...
...
@@ -2027,7 +2045,7 @@ HKL WINAPI ImmInstallIMEW( const WCHAR *filename, const WCHAR *description )
TRACE
(
"filename %s, description %s
\n
"
,
debugstr_w
(
filename
),
debugstr_w
(
description
)
);
if
(
!
filename
||
!
description
)
if
(
!
filename
||
!
description
||
!
(
lcid
=
get_ime_file_lang
(
filename
))
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
...
...
@@ -2037,8 +2055,8 @@ HKL WINAPI ImmInstallIMEW( const WCHAR *filename, const WCHAR *description )
{
DWORD
disposition
=
0
;
hkl
=
(
HKL
)
MAKELPARAM
(
lcid
,
0xe000
|
count
);
swprintf
(
path
,
ARRAY_SIZE
(
path
),
layouts_formatW
,
(
ULONG_PTR
)
hkl
);
hkl
=
(
HKL
)
(
UINT_PTR
)
MAKELONG
(
lcid
,
0xe000
|
count
);
swprintf
(
path
,
ARRAY_SIZE
(
path
),
layouts_formatW
,
(
ULONG
)(
ULONG
_PTR
)
hkl
);
if
(
!
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
path
,
0
,
NULL
,
0
,
KEY_WRITE
,
NULL
,
&
hkey
,
&
disposition
))
{
...
...
dlls/imm32/tests/imm32.c
View file @
db5cf9a5
...
...
@@ -2930,7 +2930,6 @@ static HKL ime_install(void)
"MoveFileW failed, error %lu
\n
"
,
GetLastError
()
);
hkl
=
ImmInstallIMEW
(
ime_path
,
L"WineTest IME"
);
todo_wine
ok
(
hkl
==
(
HKL
)(
int
)
0xe020047f
,
"ImmInstallIMEW returned %p, error %lu
\n
"
,
hkl
,
GetLastError
()
);
swprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
L"System
\\
CurrentControlSet
\\
Control
\\
Keyboard Layouts
\\
%08x"
,
hkl
);
...
...
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