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
3e3706ad
Commit
3e3706ad
authored
Mar 31, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32/tests: Test that ImmSetOpenStatus doesn't set IMMGWL_IMC.
parent
c0884c02
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
31 deletions
+61
-31
imm32.c
dlls/imm32/tests/imm32.c
+61
-31
No files found.
dlls/imm32/tests/imm32.c
View file @
3e3706ad
...
...
@@ -4238,6 +4238,37 @@ cleanup:
winetest_pop_context
();
}
struct
ime_windows
{
HWND
ime_hwnd
;
HWND
ime_ui_hwnd
;
};
static
BOOL
CALLBACK
enum_thread_ime_windows
(
HWND
hwnd
,
LPARAM
lparam
)
{
struct
ime_windows
*
params
=
(
void
*
)
lparam
;
WCHAR
buffer
[
256
];
UINT
ret
;
ime_trace
(
"hwnd %p, lparam %#Ix
\n
"
,
hwnd
,
lparam
);
ret
=
RealGetWindowClassW
(
hwnd
,
buffer
,
ARRAY_SIZE
(
buffer
)
);
ok
(
ret
,
"RealGetWindowClassW returned %#x
\n
"
,
ret
);
if
(
!
wcscmp
(
buffer
,
L"IME"
))
{
ok
(
!
params
->
ime_hwnd
,
"Found extra IME window %p
\n
"
,
hwnd
);
params
->
ime_hwnd
=
hwnd
;
}
if
(
!
wcscmp
(
buffer
,
ime_ui_class
.
lpszClassName
))
{
ok
(
!
params
->
ime_ui_hwnd
,
"Found extra IME UI window %p
\n
"
,
hwnd
);
params
->
ime_ui_hwnd
=
hwnd
;
}
return
TRUE
;
}
static
void
test_ImmSetConversionStatus
(
void
)
{
const
struct
ime_call
set_conversion_status_0_seq
[]
=
...
...
@@ -4473,8 +4504,10 @@ static void test_ImmSetOpenStatus(void)
{
0
},
};
HKL
hkl
;
struct
ime_windows
ime_windows
=
{
0
};
DWORD
old_status
,
status
;
INPUTCONTEXT
*
ctx
;
HIMC
himc
;
ok_ret
(
0
,
ImmGetOpenStatus
(
0
)
);
old_status
=
ImmGetOpenStatus
(
default_himc
);
...
...
@@ -4521,6 +4554,22 @@ static void test_ImmSetOpenStatus(void)
ok_eq
(
0xdeadbeef
,
status
,
UINT
,
"%#x"
);
ok_eq
(
0xdeadbeef
,
ctx
->
fOpen
,
UINT
,
"%#x"
);
himc
=
ImmCreateContext
();
ok_ne
(
NULL
,
himc
,
HIMC
,
"%p"
);
ok_ret
(
1
,
EnumThreadWindows
(
GetCurrentThreadId
(),
enum_thread_ime_windows
,
(
LPARAM
)
&
ime_windows
)
);
ok_ne
(
NULL
,
ime_windows
.
ime_hwnd
,
HWND
,
"%p"
);
ok_ne
(
NULL
,
ime_windows
.
ime_ui_hwnd
,
HWND
,
"%p"
);
ok_eq
(
default_himc
,
(
HIMC
)
GetWindowLongPtrW
(
ime_windows
.
ime_ui_hwnd
,
IMMGWL_IMC
),
HIMC
,
"%p"
);
ok_ret
(
1
,
ImmSetOpenStatus
(
himc
,
TRUE
)
);
todo_wine
ok_eq
(
default_himc
,
(
HIMC
)
GetWindowLongPtrW
(
ime_windows
.
ime_ui_hwnd
,
IMMGWL_IMC
),
HIMC
,
"%p"
);
ok_ret
(
1
,
ImmSetOpenStatus
(
himc
,
FALSE
)
);
todo_wine
ok_eq
(
default_himc
,
(
HIMC
)
GetWindowLongPtrW
(
ime_windows
.
ime_ui_hwnd
,
IMMGWL_IMC
),
HIMC
,
"%p"
);
ok_ret
(
1
,
ImmDestroyContext
(
himc
)
);
memset
(
ime_calls
,
0
,
sizeof
(
ime_calls
)
);
ime_call_count
=
0
;
ok_ret
(
1
,
ImmSetOpenStatus
(
default_himc
,
0xdeadbeef
)
);
ok_seq
(
empty_sequence
);
...
...
@@ -4640,37 +4689,6 @@ cleanup:
ok_ret
(
1
,
DestroyWindow
(
hwnd
)
);
}
struct
ime_windows
{
HWND
ime_hwnd
;
HWND
ime_ui_hwnd
;
};
static
BOOL
CALLBACK
enum_thread_ime_windows
(
HWND
hwnd
,
LPARAM
lparam
)
{
struct
ime_windows
*
params
=
(
void
*
)
lparam
;
WCHAR
buffer
[
256
];
UINT
ret
;
ime_trace
(
"hwnd %p, lparam %#Ix
\n
"
,
hwnd
,
lparam
);
ret
=
RealGetWindowClassW
(
hwnd
,
buffer
,
ARRAY_SIZE
(
buffer
)
);
ok
(
ret
,
"RealGetWindowClassW returned %#x
\n
"
,
ret
);
if
(
!
wcscmp
(
buffer
,
L"IME"
))
{
ok
(
!
params
->
ime_hwnd
,
"Found extra IME window %p
\n
"
,
hwnd
);
params
->
ime_hwnd
=
hwnd
;
}
if
(
!
wcscmp
(
buffer
,
ime_ui_class
.
lpszClassName
))
{
ok
(
!
params
->
ime_ui_hwnd
,
"Found extra IME UI window %p
\n
"
,
hwnd
);
params
->
ime_ui_hwnd
=
hwnd
;
}
return
TRUE
;
}
static
void
test_ImmActivateLayout
(
void
)
{
const
struct
ime_call
activate_seq
[]
=
...
...
@@ -5231,6 +5249,7 @@ static void test_ImmSetActiveContext(void)
{
0
},
};
HKL
hkl
;
struct
ime_windows
ime_windows
=
{
0
};
HIMC
himc
;
ime_info
.
fdwProperty
=
IME_PROP_END_UNLOAD
|
IME_PROP_UNICODE
;
...
...
@@ -5247,6 +5266,10 @@ static void test_ImmSetActiveContext(void)
memset
(
ime_calls
,
0
,
sizeof
(
ime_calls
)
);
ime_call_count
=
0
;
ok_ret
(
1
,
EnumThreadWindows
(
GetCurrentThreadId
(),
enum_thread_ime_windows
,
(
LPARAM
)
&
ime_windows
)
);
ok_ne
(
NULL
,
ime_windows
.
ime_hwnd
,
HWND
,
"%p"
);
ok_ne
(
NULL
,
ime_windows
.
ime_ui_hwnd
,
HWND
,
"%p"
);
SetLastError
(
0xdeadbeef
);
ok_ret
(
1
,
ImmSetActiveContext
(
hwnd
,
default_himc
,
TRUE
)
);
ok_seq
(
activate_0_seq
);
...
...
@@ -5265,6 +5288,13 @@ static void test_ImmSetActiveContext(void)
ok_ret
(
1
,
ImmSetActiveContext
(
hwnd
,
himc
,
TRUE
)
);
activate_1_seq
[
0
].
himc
=
himc
;
ok_seq
(
activate_1_seq
);
ok_eq
(
default_himc
,
(
HIMC
)
GetWindowLongPtrW
(
ime_windows
.
ime_ui_hwnd
,
IMMGWL_IMC
),
HIMC
,
"%p"
);
ok_ret
(
1
,
ImmSetActiveContext
(
hwnd
,
himc
,
TRUE
)
);
ok_eq
(
default_himc
,
(
HIMC
)
GetWindowLongPtrW
(
ime_windows
.
ime_ui_hwnd
,
IMMGWL_IMC
),
HIMC
,
"%p"
);
ok_eq
(
default_himc
,
ImmAssociateContext
(
hwnd
,
himc
),
HIMC
,
"%p"
);
todo_wine
ok_eq
(
himc
,
(
HIMC
)
GetWindowLongPtrW
(
ime_windows
.
ime_ui_hwnd
,
IMMGWL_IMC
),
HIMC
,
"%p"
);
ok_ret
(
1
,
ImmDestroyContext
(
himc
)
);
ok_ret
(
1
,
ImmActivateLayout
(
default_hkl
)
);
...
...
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