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
a117b9b2
Commit
a117b9b2
authored
Apr 30, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
May 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Use INPUTCONTEXT directly in ImmRequestMessage(W|A).
parent
c4187bc4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
17 deletions
+53
-17
imm.c
dlls/imm32/imm.c
+48
-12
imm32.c
dlls/imm32/tests/imm32.c
+5
-5
No files found.
dlls/imm32/imm.c
View file @
a117b9b2
...
...
@@ -2380,31 +2380,67 @@ BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
/***********************************************************************
* ImmRequestMessageA(IMM32.@)
*/
LRESULT
WINAPI
ImmRequestMessageA
(
HIMC
hIMC
,
WPARAM
wParam
,
LPARAM
lParam
)
LRESULT
WINAPI
ImmRequestMessageA
(
HIMC
himc
,
WPARAM
wparam
,
LPARAM
lparam
)
{
struct
imc
*
data
=
get_imc_data
(
hIMC
);
INPUTCONTEXT
*
ctx
;
LRESULT
res
;
TRACE
(
"%p %Id %Id
\n
"
,
hIMC
,
wParam
,
wParam
);
TRACE
(
"himc %p, wparam %#Ix, lparam %#Ix
\n
"
,
himc
,
wparam
,
lparam
);
if
(
data
)
return
SendMessageA
(
data
->
IMC
.
hWnd
,
WM_IME_REQUEST
,
wParam
,
lParam
)
;
if
(
NtUserQueryInputContext
(
himc
,
NtUserInputContextThreadId
)
!=
GetCurrentThreadId
())
return
FALSE
;
SetLastError
(
ERROR_INVALID_HANDLE
);
return
0
;
switch
(
wparam
)
{
case
IMR_CANDIDATEWINDOW
:
case
IMR_COMPOSITIONFONT
:
case
IMR_COMPOSITIONWINDOW
:
case
IMR_CONFIRMRECONVERTSTRING
:
case
IMR_DOCUMENTFEED
:
case
IMR_QUERYCHARPOSITION
:
case
IMR_RECONVERTSTRING
:
break
;
default:
return
FALSE
;
}
if
(
!
(
ctx
=
ImmLockIMC
(
himc
)))
return
FALSE
;
res
=
SendMessageA
(
ctx
->
hWnd
,
WM_IME_REQUEST
,
wparam
,
lparam
);
ImmUnlockIMC
(
himc
);
return
res
;
}
/***********************************************************************
* ImmRequestMessageW(IMM32.@)
*/
LRESULT
WINAPI
ImmRequestMessageW
(
HIMC
hIMC
,
WPARAM
wParam
,
LPARAM
lParam
)
LRESULT
WINAPI
ImmRequestMessageW
(
HIMC
himc
,
WPARAM
wparam
,
LPARAM
lparam
)
{
struct
imc
*
data
=
get_imc_data
(
hIMC
);
INPUTCONTEXT
*
ctx
;
LRESULT
res
;
TRACE
(
"%p %Id %Id
\n
"
,
hIMC
,
wParam
,
wParam
);
TRACE
(
"himc %p, wparam %#Ix, lparam %#Ix
\n
"
,
himc
,
wparam
,
lparam
);
if
(
data
)
return
SendMessageW
(
data
->
IMC
.
hWnd
,
WM_IME_REQUEST
,
wParam
,
lParam
)
;
if
(
NtUserQueryInputContext
(
himc
,
NtUserInputContextThreadId
)
!=
GetCurrentThreadId
())
return
FALSE
;
SetLastError
(
ERROR_INVALID_HANDLE
);
return
0
;
switch
(
wparam
)
{
case
IMR_CANDIDATEWINDOW
:
case
IMR_COMPOSITIONFONT
:
case
IMR_COMPOSITIONWINDOW
:
case
IMR_CONFIRMRECONVERTSTRING
:
case
IMR_DOCUMENTFEED
:
case
IMR_QUERYCHARPOSITION
:
case
IMR_RECONVERTSTRING
:
break
;
default:
return
FALSE
;
}
if
(
!
(
ctx
=
ImmLockIMC
(
himc
)))
return
FALSE
;
res
=
SendMessageW
(
ctx
->
hWnd
,
WM_IME_REQUEST
,
wparam
,
lparam
);
ImmUnlockIMC
(
himc
);
return
res
;
}
/***********************************************************************
...
...
dlls/imm32/tests/imm32.c
View file @
a117b9b2
...
...
@@ -1582,7 +1582,7 @@ static void test_cross_thread_himc(void)
ok_ret
(
0
,
ImmRequestMessageW
(
params
.
himc
[
1
],
IMR_COMPOSITIONFONT
,
(
LPARAM
)
&
fontW
)
);
ok_ret
(
0
,
ImmRequestMessageA
(
params
.
himc
[
1
],
IMR_COMPOSITIONFONT
,
(
LPARAM
)
&
fontA
)
);
todo_wine
ok_seq
(
empty_sequence
);
ok_seq
(
empty_sequence
);
/* ImmSetCompositionString(W|A) should fail with cross thread HIMC */
...
...
@@ -1638,7 +1638,7 @@ static void test_cross_thread_himc(void)
ok_ret
(
0
,
ImmRequestMessageW
(
params
.
himc
[
1
],
IMR_CONFIRMRECONVERTSTRING
,
(
LPARAM
)
&
reconv
)
);
ok_ret
(
0
,
ImmRequestMessageA
(
params
.
himc
[
1
],
IMR_CONFIRMRECONVERTSTRING
,
(
LPARAM
)
&
reconv
)
);
todo_wine
ok_seq
(
empty_sequence
);
ok_seq
(
empty_sequence
);
/* ImmSetCompositionWindow should fail with cross thread HIMC */
...
...
@@ -1660,7 +1660,7 @@ static void test_cross_thread_himc(void)
ok_ret
(
0
,
ImmRequestMessageW
(
params
.
himc
[
1
],
IMR_COMPOSITIONWINDOW
,
(
LPARAM
)
&
composition
)
);
ok_ret
(
0
,
ImmRequestMessageA
(
params
.
himc
[
1
],
IMR_COMPOSITIONWINDOW
,
(
LPARAM
)
&
composition
)
);
todo_wine
ok_seq
(
empty_sequence
);
ok_seq
(
empty_sequence
);
/* ImmSetCandidateWindow should fail with cross thread HIMC */
...
...
@@ -1687,7 +1687,7 @@ static void test_cross_thread_himc(void)
ok_ret
(
0
,
ImmRequestMessageW
(
params
.
himc
[
1
],
IMR_CANDIDATEWINDOW
,
(
LPARAM
)
&
candidate
)
);
ok_ret
(
0
,
ImmRequestMessageA
(
params
.
himc
[
1
],
IMR_CANDIDATEWINDOW
,
(
LPARAM
)
&
candidate
)
);
todo_wine
ok_seq
(
empty_sequence
);
ok_seq
(
empty_sequence
);
/* ImmSetStatusWindowPos should fail with cross thread HIMC */
...
...
@@ -1709,7 +1709,7 @@ static void test_cross_thread_himc(void)
ok_ret
(
0
,
ImmRequestMessageW
(
params
.
himc
[
1
],
IMR_QUERYCHARPOSITION
,
(
LPARAM
)
&
char_pos
)
);
ok_ret
(
0
,
ImmRequestMessageA
(
params
.
himc
[
1
],
IMR_QUERYCHARPOSITION
,
(
LPARAM
)
&
char_pos
)
);
todo_wine
ok_seq
(
empty_sequence
);
ok_seq
(
empty_sequence
);
/* ImmGenerateMessage should fail with cross thread HIMC */
...
...
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