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
8c08ffcd
Commit
8c08ffcd
authored
May 11, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
May 12, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Write the IME strings to the COMPOSITIONSTRING in ImeToAsciiEx.
parent
4870a9df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
6 deletions
+52
-6
event.c
dlls/winemac.drv/event.c
+52
-6
No files found.
dlls/winemac.drv/event.c
View file @
8c08ffcd
...
...
@@ -36,6 +36,7 @@ WINE_DECLARE_DEBUG_CHANNEL(imm);
struct
ime_update
{
DWORD
cursor_pos
;
WCHAR
*
comp_str
;
WCHAR
*
result_str
;
struct
ime_set_text_params
*
comp_params
;
...
...
@@ -199,6 +200,7 @@ static void macdrv_im_set_text(const macdrv_event *event)
ime_update
.
comp_params
=
params
;
ime_update
.
comp_size
=
size
;
ime_update
.
comp_str
=
params
->
text
;
ime_update
.
cursor_pos
=
event
->
im_set_text
.
cursor_pos
;
}
}
...
...
@@ -219,6 +221,7 @@ UINT macdrv_ImeToAsciiEx(UINT vkey, UINT vsc, const BYTE *state, COMPOSITIONSTRI
{
UINT
needed
=
sizeof
(
COMPOSITIONSTRING
),
comp_len
,
result_len
;
struct
ime_update
*
update
=
&
ime_update
;
void
*
dst
;
TRACE_
(
imm
)(
"vkey %#x, vsc %#x, state %p, compstr %p, himc %p
\n
"
,
vkey
,
vsc
,
state
,
compstr
,
himc
);
...
...
@@ -239,6 +242,55 @@ UINT macdrv_ImeToAsciiEx(UINT vkey, UINT vsc, const BYTE *state, COMPOSITIONSTRI
needed
+=
2
*
sizeof
(
DWORD
);
/* GCS_RESULTCLAUSE */
}
if
(
compstr
->
dwSize
<
needed
)
{
compstr
->
dwSize
=
needed
;
return
STATUS_BUFFER_TOO_SMALL
;
}
memset
(
compstr
,
0
,
sizeof
(
*
compstr
)
);
compstr
->
dwSize
=
sizeof
(
*
compstr
);
if
(
update
->
comp_str
)
{
compstr
->
dwCursorPos
=
update
->
cursor_pos
;
compstr
->
dwCompStrLen
=
comp_len
;
compstr
->
dwCompStrOffset
=
compstr
->
dwSize
;
dst
=
(
BYTE
*
)
compstr
+
compstr
->
dwCompStrOffset
;
memcpy
(
dst
,
update
->
comp_str
,
compstr
->
dwCompStrLen
*
sizeof
(
WCHAR
));
compstr
->
dwSize
+=
compstr
->
dwCompStrLen
*
sizeof
(
WCHAR
);
compstr
->
dwCompClauseLen
=
2
*
sizeof
(
DWORD
);
compstr
->
dwCompClauseOffset
=
compstr
->
dwSize
;
dst
=
(
BYTE
*
)
compstr
+
compstr
->
dwCompClauseOffset
;
*
((
DWORD
*
)
dst
+
0
)
=
0
;
*
((
DWORD
*
)
dst
+
1
)
=
compstr
->
dwCompStrLen
;
compstr
->
dwSize
+=
compstr
->
dwCompClauseLen
;
compstr
->
dwCompAttrLen
=
compstr
->
dwCompStrLen
;
compstr
->
dwCompAttrOffset
=
compstr
->
dwSize
;
dst
=
(
BYTE
*
)
compstr
+
compstr
->
dwCompAttrOffset
;
memset
(
dst
,
ATTR_INPUT
,
compstr
->
dwCompAttrLen
);
compstr
->
dwSize
+=
compstr
->
dwCompAttrLen
;
}
if
(
update
->
result_str
)
{
compstr
->
dwResultStrLen
=
result_len
;
compstr
->
dwResultStrOffset
=
compstr
->
dwSize
;
dst
=
(
BYTE
*
)
compstr
+
compstr
->
dwResultStrOffset
;
memcpy
(
dst
,
update
->
result_str
,
compstr
->
dwResultStrLen
*
sizeof
(
WCHAR
));
compstr
->
dwSize
+=
compstr
->
dwResultStrLen
*
sizeof
(
WCHAR
);
compstr
->
dwResultClauseLen
=
2
*
sizeof
(
DWORD
);
compstr
->
dwResultClauseOffset
=
compstr
->
dwSize
;
dst
=
(
BYTE
*
)
compstr
+
compstr
->
dwResultClauseOffset
;
*
((
DWORD
*
)
dst
+
0
)
=
0
;
*
((
DWORD
*
)
dst
+
1
)
=
compstr
->
dwResultStrLen
;
compstr
->
dwSize
+=
compstr
->
dwResultClauseLen
;
}
if
(
ime_update
.
result_params
)
{
macdrv_client_func
(
client_func_ime_set_text
,
ime_update
.
result_params
,
ime_update
.
result_size
);
...
...
@@ -254,12 +306,6 @@ UINT macdrv_ImeToAsciiEx(UINT vkey, UINT vsc, const BYTE *state, COMPOSITIONSTRI
ime_update
.
comp_str
=
NULL
;
}
if
(
compstr
->
dwSize
<
needed
)
{
compstr
->
dwSize
=
needed
;
return
STATUS_BUFFER_TOO_SMALL
;
}
return
0
;
}
...
...
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