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
5448acc3
Commit
5448acc3
authored
Feb 25, 2015
by
Aric Stewart
Committed by
Alexandre Julliard
Feb 26, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Limit cross thread access to ImmSet* functions.
parent
fdf37fe7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
14 deletions
+35
-14
imm.c
dlls/imm32/imm.c
+21
-0
imm32.c
dlls/imm32/tests/imm32.c
+14
-14
No files found.
dlls/imm32/imm.c
View file @
5448acc3
...
...
@@ -2249,6 +2249,9 @@ BOOL WINAPI ImmSetCandidateWindow(
if
(
!
data
||
!
lpCandidate
)
return
FALSE
;
if
(
IMM_IsCrossThreadAccess
(
NULL
,
hIMC
))
return
FALSE
;
TRACE
(
"
\t
%x, %x, (%i,%i), (%i,%i - %i,%i)
\n
"
,
lpCandidate
->
dwIndex
,
lpCandidate
->
dwStyle
,
lpCandidate
->
ptCurrentPos
.
x
,
lpCandidate
->
ptCurrentPos
.
y
,
...
...
@@ -2279,6 +2282,9 @@ BOOL WINAPI ImmSetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
return
FALSE
;
}
if
(
IMM_IsCrossThreadAccess
(
NULL
,
hIMC
))
return
FALSE
;
memcpy
(
&
data
->
IMC
.
lfFont
.
W
,
lplf
,
sizeof
(
LOGFONTA
));
MultiByteToWideChar
(
CP_ACP
,
0
,
lplf
->
lfFaceName
,
-
1
,
data
->
IMC
.
lfFont
.
W
.
lfFaceName
,
LF_FACESIZE
);
...
...
@@ -2302,6 +2308,9 @@ BOOL WINAPI ImmSetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
return
FALSE
;
}
if
(
IMM_IsCrossThreadAccess
(
NULL
,
hIMC
))
return
FALSE
;
data
->
IMC
.
lfFont
.
W
=
*
lplf
;
ImmNotifyIME
(
hIMC
,
NI_CONTEXTUPDATED
,
0
,
IMC_SETCOMPOSITIONFONT
);
ImmInternalSendIMENotify
(
data
,
IMN_SETCOMPOSITIONFONT
,
0
);
...
...
@@ -2443,6 +2452,9 @@ BOOL WINAPI ImmSetCompositionWindow(
return
FALSE
;
}
if
(
IMM_IsCrossThreadAccess
(
NULL
,
hIMC
))
return
FALSE
;
data
->
IMC
.
cfCompForm
=
*
lpCompForm
;
if
(
IsWindowVisible
(
data
->
immKbd
->
UIWnd
))
...
...
@@ -2477,6 +2489,9 @@ BOOL WINAPI ImmSetConversionStatus(
return
FALSE
;
}
if
(
IMM_IsCrossThreadAccess
(
NULL
,
hIMC
))
return
FALSE
;
if
(
fdwConversion
!=
data
->
IMC
.
fdwConversion
)
{
oldConversion
=
data
->
IMC
.
fdwConversion
;
...
...
@@ -2510,6 +2525,9 @@ BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
return
FALSE
;
}
if
(
IMM_IsCrossThreadAccess
(
NULL
,
hIMC
))
return
FALSE
;
if
(
data
->
immKbd
->
UIWnd
==
NULL
)
{
/* create the ime window */
...
...
@@ -2546,6 +2564,9 @@ BOOL WINAPI ImmSetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
return
FALSE
;
}
if
(
IMM_IsCrossThreadAccess
(
NULL
,
hIMC
))
return
FALSE
;
TRACE
(
"
\t
(%i,%i)
\n
"
,
lpptPos
->
x
,
lpptPos
->
y
);
data
->
IMC
.
ptStatusWndPos
=
*
lpptPos
;
...
...
dlls/imm32/tests/imm32.c
View file @
5448acc3
...
...
@@ -525,15 +525,15 @@ static void test_ImmThreads(void)
ok
(
rc
==
0
,
"ImmGetOpenStatus failed
\n
"
);
rc
=
ImmSetOpenStatus
(
otherHimc
,
TRUE
);
todo_wine
ok
(
rc
==
0
,
"ImmSetOpenStatus should fail
\n
"
);
ok
(
rc
==
0
,
"ImmSetOpenStatus should fail
\n
"
);
rc
=
ImmSetOpenStatus
(
threadinfo
.
u_himc
,
TRUE
);
todo_wine
ok
(
rc
==
0
,
"ImmSetOpenStatus should fail
\n
"
);
ok
(
rc
==
0
,
"ImmSetOpenStatus should fail
\n
"
);
rc
=
ImmGetOpenStatus
(
otherHimc
);
todo_wine
ok
(
rc
==
0
,
"ImmGetOpenStatus failed
\n
"
);
ok
(
rc
==
0
,
"ImmGetOpenStatus failed
\n
"
);
rc
=
ImmGetOpenStatus
(
threadinfo
.
u_himc
);
ok
(
rc
==
1
||
broken
(
rc
==
0
),
"ImmGetOpenStatus should return 1
\n
"
);
rc
=
ImmSetOpenStatus
(
otherHimc
,
FALSE
);
todo_wine
ok
(
rc
==
0
,
"ImmSetOpenStatus should fail
\n
"
);
ok
(
rc
==
0
,
"ImmSetOpenStatus should fail
\n
"
);
rc
=
ImmGetOpenStatus
(
otherHimc
);
ok
(
rc
==
0
,
"ImmGetOpenStatus failed
\n
"
);
...
...
@@ -548,9 +548,9 @@ static void test_ImmThreads(void)
rc
=
ImmGetCompositionFontA
(
threadinfo
.
u_himc
,
&
lf
);
ok
(
rc
!=
0
||
broken
(
rc
==
0
),
"ImmGetCompositionFont user himc failed
\n
"
);
rc
=
ImmSetCompositionFontA
(
otherHimc
,
&
lf
);
todo_wine
ok
(
rc
==
0
,
"ImmSetCompositionFont should fail
\n
"
);
ok
(
rc
==
0
,
"ImmSetCompositionFont should fail
\n
"
);
rc
=
ImmSetCompositionFontA
(
threadinfo
.
u_himc
,
&
lf
);
todo_wine
ok
(
rc
==
0
,
"ImmSetCompositionFont should fail
\n
"
);
ok
(
rc
==
0
,
"ImmSetCompositionFont should fail
\n
"
);
/* CompositionWindow */
rc
=
ImmSetCompositionWindow
(
himc
,
&
cf
);
...
...
@@ -559,9 +559,9 @@ static void test_ImmThreads(void)
ok
(
rc
!=
0
,
"ImmGetCompositionWindow failed
\n
"
);
rc
=
ImmSetCompositionWindow
(
otherHimc
,
&
cf
);
todo_wine
ok
(
rc
==
0
,
"ImmSetCompositionWindow should fail
\n
"
);
ok
(
rc
==
0
,
"ImmSetCompositionWindow should fail
\n
"
);
rc
=
ImmSetCompositionWindow
(
threadinfo
.
u_himc
,
&
cf
);
todo_wine
ok
(
rc
==
0
,
"ImmSetCompositionWindow should fail
\n
"
);
ok
(
rc
==
0
,
"ImmSetCompositionWindow should fail
\n
"
);
rc
=
ImmGetCompositionWindow
(
otherHimc
,
&
cf
);
ok
(
rc
!=
0
||
broken
(
rc
==
0
),
"ImmGetCompositionWindow failed
\n
"
);
rc
=
ImmGetCompositionWindow
(
threadinfo
.
u_himc
,
&
cf
);
...
...
@@ -578,9 +578,9 @@ static void test_ImmThreads(void)
rc
=
ImmGetConversionStatus
(
threadinfo
.
u_himc
,
&
status
,
&
sentence
);
ok
(
rc
!=
0
||
broken
(
rc
==
0
),
"ImmGetConversionStatus failed
\n
"
);
rc
=
ImmSetConversionStatus
(
otherHimc
,
status
,
sentence
);
todo_wine
ok
(
rc
==
0
,
"ImmSetConversionStatus should fail
\n
"
);
ok
(
rc
==
0
,
"ImmSetConversionStatus should fail
\n
"
);
rc
=
ImmSetConversionStatus
(
threadinfo
.
u_himc
,
status
,
sentence
);
todo_wine
ok
(
rc
==
0
,
"ImmSetConversionStatus should fail
\n
"
);
ok
(
rc
==
0
,
"ImmSetConversionStatus should fail
\n
"
);
/* StatusWindowPos */
rc
=
ImmSetStatusWindowPos
(
himc
,
&
pt
);
...
...
@@ -589,9 +589,9 @@ static void test_ImmThreads(void)
ok
(
rc
!=
0
,
"ImmGetStatusWindowPos failed
\n
"
);
rc
=
ImmSetStatusWindowPos
(
otherHimc
,
&
pt
);
todo_wine
ok
(
rc
==
0
,
"ImmSetStatusWindowPos should fail
\n
"
);
ok
(
rc
==
0
,
"ImmSetStatusWindowPos should fail
\n
"
);
rc
=
ImmSetStatusWindowPos
(
threadinfo
.
u_himc
,
&
pt
);
todo_wine
ok
(
rc
==
0
,
"ImmSetStatusWindowPos should fail
\n
"
);
ok
(
rc
==
0
,
"ImmSetStatusWindowPos should fail
\n
"
);
rc
=
ImmGetStatusWindowPos
(
otherHimc
,
&
pt
);
ok
(
rc
!=
0
||
broken
(
rc
==
0
),
"ImmGetStatusWindowPos failed
\n
"
);
rc
=
ImmGetStatusWindowPos
(
threadinfo
.
u_himc
,
&
pt
);
...
...
@@ -624,11 +624,11 @@ static void test_ImmThreads(void)
rc
=
ImmGetCandidateWindow
(
otherHimc
,
0
,
&
cdf
);
ok
(
rc
==
0
,
"ImmGetCandidateWindow should fail
\n
"
);
rc
=
ImmSetCandidateWindow
(
otherHimc
,
&
cdf
);
todo_wine
ok
(
rc
==
0
,
"ImmSetCandidateWindow should fail
\n
"
);
ok
(
rc
==
0
,
"ImmSetCandidateWindow should fail
\n
"
);
rc
=
ImmGetCandidateWindow
(
threadinfo
.
u_himc
,
0
,
&
cdf
);
ok
(
rc
==
1
||
broken
(
rc
==
0
),
"ImmGetCandidateWindow should succeed
\n
"
);
rc
=
ImmSetCandidateWindow
(
threadinfo
.
u_himc
,
&
cdf
);
todo_wine
ok
(
rc
==
0
,
"ImmSetCandidateWindow should fail
\n
"
);
ok
(
rc
==
0
,
"ImmSetCandidateWindow should fail
\n
"
);
ImmReleaseContext
(
threadinfo
.
hwnd
,
otherHimc
);
ImmReleaseContext
(
hwnd
,
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