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
d71fb722
Commit
d71fb722
authored
Mar 08, 2024
by
Paul Gofman
Committed by
Alexandre Julliard
Mar 11, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Set lengths to 0 for NULL strings in ImmSetCompositionString().
parent
834a88fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
imm.c
dlls/imm32/imm.c
+6
-0
imm32.c
dlls/imm32/tests/imm32.c
+13
-1
No files found.
dlls/imm32/imm.c
View file @
d71fb722
...
...
@@ -2539,6 +2539,9 @@ BOOL WINAPI ImmSetCompositionStringA(
return
FALSE
;
if
(
!
(
ime
=
imc_select_ime
(
data
)))
return
FALSE
;
if
(
!
lpComp
)
dwCompLen
=
0
;
if
(
!
lpRead
)
dwReadLen
=
0
;
if
(
!
ime_is_unicode
(
ime
))
return
ime
->
pImeSetCompositionString
(
hIMC
,
dwIndex
,
lpComp
,
dwCompLen
,
lpRead
,
dwReadLen
);
comp_len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpComp
,
dwCompLen
,
NULL
,
0
);
...
...
@@ -2596,6 +2599,9 @@ BOOL WINAPI ImmSetCompositionStringW(
return
FALSE
;
if
(
!
(
ime
=
imc_select_ime
(
data
)))
return
FALSE
;
if
(
!
lpComp
)
dwCompLen
=
0
;
if
(
!
lpRead
)
dwReadLen
=
0
;
if
(
ime_is_unicode
(
ime
))
return
ime
->
pImeSetCompositionString
(
hIMC
,
dwIndex
,
lpComp
,
dwCompLen
,
lpRead
,
dwReadLen
);
comp_len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
lpComp
,
dwCompLen
,
NULL
,
0
,
NULL
,
...
...
dlls/imm32/tests/imm32.c
View file @
d71fb722
...
...
@@ -1085,12 +1085,24 @@ static void test_SCS_SETSTR(void)
DWORD
prop
;
imc
=
ImmGetContext
(
hwnd
);
ret
=
ImmSetCompositionStringW
(
imc
,
SCS_SETSTR
,
string
,
sizeof
(
string
),
NULL
,
0
);
ret
=
ImmSetCompositionStringW
(
imc
,
SCS_SETSTR
,
string
,
sizeof
(
string
),
NULL
,
0
);
if
(
!
ret
)
{
win_skip
(
"Composition isn't supported
\n
"
);
ImmReleaseContext
(
hwnd
,
imc
);
return
;
}
ret
=
ImmSetCompositionStringW
(
imc
,
SCS_SETSTR
,
NULL
,
128
,
NULL
,
128
);
ok
(
ret
,
"got error %lu.
\n
"
,
GetLastError
());
alen
=
ImmGetCompositionStringA
(
imc
,
GCS_COMPSTR
,
cstring
,
20
);
ok
(
!
alen
,
"got %ld.
\n
"
,
alen
);
wlen
=
ImmGetCompositionStringW
(
imc
,
GCS_COMPSTR
,
wstring
,
20
);
ok
(
!
wlen
,
"got %ld.
\n
"
,
alen
);
ret
=
ImmSetCompositionStringW
(
imc
,
SCS_SETSTR
,
string
,
sizeof
(
string
),
NULL
,
2
);
ok
(
ret
,
"got error %lu.
\n
"
,
GetLastError
());
msg_spy_flush_msgs
();
alen
=
ImmGetCompositionStringA
(
imc
,
GCS_COMPSTR
,
cstring
,
20
);
...
...
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