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
e7c00ca7
Commit
e7c00ca7
authored
Apr 07, 2008
by
Aric Stewart
Committed by
Alexandre Julliard
Apr 07, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Properly handle unicode and non unicode IMEs with SetCompositionString.
parent
b72dcd11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
7 deletions
+44
-7
imm.c
dlls/imm32/imm.c
+44
-7
No files found.
dlls/imm32/imm.c
View file @
e7c00ca7
...
...
@@ -1472,10 +1472,18 @@ BOOL WINAPI ImmSetCompositionStringA(
WCHAR
*
CompBuffer
=
NULL
;
WCHAR
*
ReadBuffer
=
NULL
;
BOOL
rc
;
InputContextData
*
data
=
(
InputContextData
*
)
hIMC
;
TRACE
(
"(%p, %d, %p, %d, %p, %d):
\n
"
,
hIMC
,
dwIndex
,
lpComp
,
dwCompLen
,
lpRead
,
dwReadLen
);
if
(
!
data
)
return
FALSE
;
if
(
!
is_himc_ime_unicode
(
data
))
return
data
->
immKbd
->
pImeSetCompositionString
(
hIMC
,
dwIndex
,
lpComp
,
dwCompLen
,
lpRead
,
dwReadLen
);
comp_len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpComp
,
dwCompLen
,
NULL
,
0
);
if
(
comp_len
)
{
...
...
@@ -1507,19 +1515,48 @@ BOOL WINAPI ImmSetCompositionStringW(
LPCVOID
lpComp
,
DWORD
dwCompLen
,
LPCVOID
lpRead
,
DWORD
dwReadLen
)
{
InputContextData
*
data
=
(
InputContextData
*
)
hIMC
;
DWORD
comp_len
;
DWORD
read_len
;
CHAR
*
CompBuffer
=
NULL
;
CHAR
*
ReadBuffer
=
NULL
;
BOOL
rc
;
InputContextData
*
data
=
(
InputContextData
*
)
hIMC
;
TRACE
(
"(%p, %d, %p, %d, %p, %d):
\n
"
,
hIMC
,
dwIndex
,
lpComp
,
dwCompLen
,
lpRead
,
dwReadLen
);
TRACE
(
"(%p, %d, %p, %d, %p, %d):
\n
"
,
hIMC
,
dwIndex
,
lpComp
,
dwCompLen
,
lpRead
,
dwReadLen
);
if
(
!
data
)
if
(
!
data
)
return
FALSE
;
if
(
is_himc_ime_unicode
(
data
))
if
(
is_himc_ime_unicode
(
data
))
return
data
->
immKbd
->
pImeSetCompositionString
(
hIMC
,
dwIndex
,
lpComp
,
dwCompLen
,
lpRead
,
dwReadLen
);
else
return
FALSE
;
comp_len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
lpComp
,
dwCompLen
,
NULL
,
0
,
NULL
,
NULL
);
if
(
comp_len
)
{
CompBuffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
comp_len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
lpComp
,
dwCompLen
,
CompBuffer
,
comp_len
,
NULL
,
NULL
);
}
read_len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
lpRead
,
dwReadLen
,
NULL
,
0
,
NULL
,
NULL
);
if
(
read_len
)
{
ReadBuffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
read_len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
lpRead
,
dwReadLen
,
ReadBuffer
,
read_len
,
NULL
,
NULL
);
}
rc
=
ImmSetCompositionStringA
(
hIMC
,
dwIndex
,
CompBuffer
,
comp_len
,
ReadBuffer
,
read_len
);
HeapFree
(
GetProcessHeap
(),
0
,
CompBuffer
);
HeapFree
(
GetProcessHeap
(),
0
,
ReadBuffer
);
return
rc
;
}
/***********************************************************************
...
...
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