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
3385cda1
Commit
3385cda1
authored
Apr 03, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Use a stack allocated buffer in ImmTranslateMessage.
parent
8d0e7d8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
imm.c
dlls/imm32/imm.c
+12
-10
No files found.
dlls/imm32/imm.c
View file @
3385cda1
...
...
@@ -3016,12 +3016,19 @@ BOOL WINAPI ImmGenerateMessage(HIMC hIMC)
*/
BOOL
WINAPI
ImmTranslateMessage
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
static
const
DWORD
list_count
=
10
;
union
{
struct
{
UINT
uMsgCount
;
TRANSMSG
TransMsg
[
10
];
};
TRANSMSGLIST
list
;
}
buffer
=
{.
uMsgCount
=
ARRAY_SIZE
(
buffer
.
TransMsg
)};
UINT
scan
,
vkey
,
count
,
i
;
struct
imc
*
data
;
struct
ime
*
ime
;
BYTE
state
[
256
];
TRANSMSGLIST
*
list
=
NULL
;
WCHAR
chr
;
TRACE
(
"hwnd %p, msg %#x, wparam %#Ix, lparam %#Ix
\n
"
,
hwnd
,
msg
,
wparam
,
lparam
);
...
...
@@ -3034,9 +3041,6 @@ BOOL WINAPI ImmTranslateMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar
scan
=
lparam
>>
0x10
&
0xff
;
vkey
=
data
->
lastVK
;
list
=
calloc
(
list_count
,
sizeof
(
TRANSMSG
)
+
sizeof
(
DWORD
)
);
list
->
uMsgCount
=
list_count
;
if
(
ime
->
info
.
fdwProperty
&
IME_PROP_KBD_CHAR_FIRST
)
{
if
(
!
ime_is_unicode
(
ime
))
ToAscii
(
data
->
lastVK
,
scan
,
state
,
&
chr
,
0
);
...
...
@@ -3044,13 +3048,11 @@ BOOL WINAPI ImmTranslateMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar
vkey
=
MAKELONG
(
data
->
lastVK
,
chr
);
}
count
=
ime
->
pImeToAsciiEx
(
vkey
,
scan
,
state
,
list
,
0
,
data
->
handle
);
count
=
ime
->
pImeToAsciiEx
(
vkey
,
scan
,
state
,
&
buffer
.
list
,
0
,
data
->
handle
);
TRACE
(
"%u messages generated
\n
"
,
count
);
if
(
count
>
list_count
)
ImmGenerateMessage
(
data
->
handle
);
else
for
(
i
=
0
;
i
<
count
;
i
++
)
imc_post_message
(
data
,
list
->
TransMsg
+
i
);
free
(
list
);
if
(
count
>
ARRAY_SIZE
(
buffer
.
TransMsg
))
ImmGenerateMessage
(
data
->
handle
);
else
for
(
i
=
0
;
i
<
count
;
i
++
)
imc_post_message
(
data
,
buffer
.
TransMsg
+
i
);
data
->
lastVK
=
VK_PROCESSKEY
;
...
...
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