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
8b0b5337
Commit
8b0b5337
authored
Feb 20, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Transform "Ime File" value in ImmInstallIMEW.
parent
4eba0765
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
35 deletions
+29
-35
imm.c
dlls/imm32/imm.c
+29
-32
imm32.c
dlls/imm32/tests/imm32.c
+0
-3
No files found.
dlls/imm32/imm.c
View file @
8b0b5337
...
...
@@ -2048,34 +2048,30 @@ HKL WINAPI ImmInstallIMEA(
/***********************************************************************
* ImmInstallIMEW (IMM32.@)
*/
HKL
WINAPI
ImmInstallIMEW
(
LPCWSTR
lpszIMEFileName
,
LPCWSTR
lpszLayoutText
)
HKL
WINAPI
ImmInstallIMEW
(
const
WCHAR
*
filename
,
const
WCHAR
*
description
)
{
INT
lcid
=
GetUserDefaultLCID
();
INT
count
;
HKL
hkl
;
DWORD
rc
;
WCHAR
path
[
ARRAY_SIZE
(
layouts_formatW
)
+
8
],
buffer
[
MAX_PATH
];
LCID
lcid
=
GetUserDefaultLCID
();
WORD
count
=
0x20
;
const
WCHAR
*
tmp
;
DWORD
length
;
HKEY
hkey
;
WCHAR
regKey
[
ARRAY_SIZE
(
layouts_formatW
)
+
8
];
TRACE
(
"(%s, %s):
\n
"
,
debugstr_w
(
lpszIMEFileName
),
debugstr_w
(
lpszLayoutText
));
HKL
hkl
;
/* Start with 2. e001 will be blank and so default to the wine internal IME */
count
=
2
;
TRACE
(
"filename %s, description %s
\n
"
,
debugstr_w
(
filename
),
debugstr_w
(
description
)
);
while
(
count
<
0xfff
)
{
DWORD
disposition
=
0
;
hkl
=
(
HKL
)
MAKELPARAM
(
lcid
,
0xe000
|
count
);
wsprintfW
(
regKey
,
layouts_formatW
,
(
ULONG_PTR
)
hkl
);
rc
=
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
regKey
,
0
,
NULL
,
0
,
KEY_WRITE
,
NULL
,
&
hkey
,
&
disposition
);
if
(
rc
==
ERROR_SUCCESS
&&
disposition
==
REG_CREATED_NEW_KEY
)
break
;
else
if
(
rc
==
ERROR_SUCCESS
)
RegCloseKey
(
hkey
);
swprintf
(
path
,
ARRAY_SIZE
(
path
)
,
layouts_formatW
,
(
ULONG_PTR
)
hkl
);
if
(
!
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
path
,
0
,
NULL
,
0
,
KEY_WRITE
,
NULL
,
&
hkey
,
&
disposition
))
{
if
(
disposition
==
REG_CREATED_NEW_KEY
)
break
;
RegCloseKey
(
hkey
);
}
count
++
;
}
...
...
@@ -2086,21 +2082,22 @@ HKL WINAPI ImmInstallIMEW(
return
0
;
}
if
(
rc
==
ERROR_SUCCESS
)
{
rc
=
RegSetValueExW
(
hkey
,
L"Ime File"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
lpszIMEFileName
,
(
lstrlenW
(
lpszIMEFileName
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
rc
==
ERROR_SUCCESS
)
rc
=
RegSetValueExW
(
hkey
,
L"Layout Text"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
lpszLayoutText
,
(
lstrlenW
(
lpszLayoutText
)
+
1
)
*
sizeof
(
WCHAR
));
RegCloseKey
(
hkey
);
return
hkl
;
}
else
if
((
tmp
=
wcsrchr
(
filename
,
'\\'
)))
tmp
++
;
else
tmp
=
filename
;
length
=
LCMapStringW
(
LOCALE_USER_DEFAULT
,
LCMAP_UPPERCASE
,
tmp
,
-
1
,
buffer
,
ARRAY_SIZE
(
buffer
)
);
if
(
RegSetValueExW
(
hkey
,
L"Ime File"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
buffer
,
length
*
sizeof
(
WCHAR
)
)
||
RegSetValueExW
(
hkey
,
L"Layout Text"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
description
,
(
wcslen
(
description
)
+
1
)
*
sizeof
(
WCHAR
)
))
{
WARN
(
"Unable to set IME registry values
\n
"
);
return
0
;
WARN
(
"Unable to write registry to install IME
\n
"
);
hkl
=
0
;
}
RegCloseKey
(
hkey
);
if
(
!
hkl
)
RegDeleteKeyW
(
HKEY_LOCAL_MACHINE
,
path
);
return
hkl
;
}
/***********************************************************************
...
...
dlls/imm32/tests/imm32.c
View file @
8b0b5337
...
...
@@ -2693,7 +2693,6 @@ static HKL ime_install(void)
memset
(
buffer
,
0xcd
,
sizeof
(
buffer
)
);
ret
=
RegQueryValueExW
(
hkey
,
L"Ime File"
,
NULL
,
NULL
,
(
BYTE
*
)
buffer
,
&
len
);
ok
(
!
ret
,
"RegQueryValueExW returned %#lx, error %lu
\n
"
,
ret
,
GetLastError
()
);
todo_wine
ok
(
!
wcsicmp
(
buffer
,
wcsrchr
(
ime_path
,
'\\'
)
+
1
),
"got Ime File %s
\n
"
,
debugstr_w
(
buffer
)
);
len
=
sizeof
(
buffer
);
...
...
@@ -2996,13 +2995,11 @@ static void test_ImmGetIMEFileName(void)
ret
=
ImmGetIMEFileNameW
(
hkl
,
bufferW
,
13
);
todo_wine
ok
(
ret
==
12
,
"ImmGetIMEFileNameW returned %lu
\n
"
,
ret
);
todo_wine
ok
(
!
wcscmp
(
bufferW
,
expectW
),
"got bufferW %s
\n
"
,
debugstr_w
(
bufferW
)
);
memset
(
bufferA
,
0xcd
,
sizeof
(
bufferA
)
);
ret
=
ImmGetIMEFileNameA
(
hkl
,
bufferA
,
13
);
todo_wine
ok
(
ret
==
12
,
"ImmGetIMEFileNameA returned %lu
\n
"
,
ret
);
todo_wine
ok
(
!
strcmp
(
bufferA
,
expectA
),
"got bufferA %s
\n
"
,
debugstr_a
(
bufferA
)
);
ime_cleanup
(
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