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
21a477e1
Commit
21a477e1
authored
Nov 09, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Validate the window handle passed to ImmGetContext.
parent
5d642549
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
imm.c
dlls/imm32/imm.c
+7
-1
imm32.c
dlls/imm32/tests/imm32.c
+17
-0
No files found.
dlls/imm32/imm.c
View file @
21a477e1
...
...
@@ -1360,9 +1360,15 @@ BOOL WINAPI ImmGetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
*/
HIMC
WINAPI
ImmGetContext
(
HWND
hWnd
)
{
HIMC
rc
=
NULL
;
HIMC
rc
;
TRACE
(
"%p
\n
"
,
hWnd
);
if
(
!
IsWindow
(
hWnd
))
{
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
NULL
;
}
if
(
!
IMM_GetThreadData
()
->
defaultContext
)
IMM_GetThreadData
()
->
defaultContext
=
ImmCreateContext
();
...
...
dlls/imm32/tests/imm32.c
View file @
21a477e1
...
...
@@ -557,6 +557,22 @@ static void test_ImmIsUIMessage(void)
}
}
static
void
test_ImmGetContext
(
void
)
{
HIMC
himc
;
DWORD
err
;
SetLastError
(
0xdeadbeef
);
himc
=
ImmGetContext
((
HWND
)
0xffffffff
);
err
=
GetLastError
();
ok
(
himc
==
NULL
,
"ImmGetContext succeeded
\n
"
);
ok
(
err
==
ERROR_INVALID_WINDOW_HANDLE
,
"got %u
\n
"
,
err
);
himc
=
ImmGetContext
(
hwnd
);
ok
(
himc
!=
NULL
,
"ImmGetContext failed
\n
"
);
ok
(
ImmReleaseContext
(
hwnd
,
himc
),
"ImmReleaseContext failed
\n
"
);
}
START_TEST
(
imm32
)
{
if
(
init
())
{
...
...
@@ -567,6 +583,7 @@ START_TEST(imm32) {
test_ImmAssociateContextEx
();
test_ImmThreads
();
test_ImmIsUIMessage
();
test_ImmGetContext
();
}
cleanup
();
}
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