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
afd2e6c8
Commit
afd2e6c8
authored
Feb 28, 2022
by
Eric Pouech
Committed by
Alexandre Julliard
Feb 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32/tests: Enable compilation with long types.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a24f29cd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
104 deletions
+103
-104
Makefile.in
dlls/imm32/tests/Makefile.in
+0
-1
imm32.c
dlls/imm32/tests/imm32.c
+103
-103
No files found.
dlls/imm32/tests/Makefile.in
View file @
afd2e6c8
EXTRADEFS
=
-DWINE_NO_LONG_TYPES
TESTDLL
=
imm32.dll
IMPORTS
=
imm32 ole32 user32
...
...
dlls/imm32/tests/imm32.c
View file @
afd2e6c8
...
...
@@ -219,7 +219,7 @@ static LRESULT WINAPI wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
case
WM_IME_SETCONTEXT
:
if
(
wParam
)
CHECK_EXPECT
(
WM_IME_SETCONTEXT_ACTIVATE
);
else
CHECK_EXPECT
(
WM_IME_SETCONTEXT_DEACTIVATE
);
ok
(
lParam
==
ISC_SHOWUIALL
||
!
lParam
,
"lParam = %
l
x
\n
"
,
lParam
);
ok
(
lParam
==
ISC_SHOWUIALL
||
!
lParam
,
"lParam = %
I
x
\n
"
,
lParam
);
return
TRUE
;
case
WM_NCCREATE
:
default_ime_wnd
=
get_ime_window
();
...
...
@@ -441,7 +441,7 @@ static LRESULT WINAPI test_ime_wnd_proc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
imc
=
ImmGetContext
(
hWnd
);
size
=
ImmGetCompositionStringW
(
imc
,
GCS_RESULTSTR
,
wstring
,
sizeof
(
wstring
));
ok
(
size
>
0
,
"ImmGetCompositionString(GCS_RESULTSTR) is %d
\n
"
,
size
);
ok
(
size
>
0
,
"ImmGetCompositionString(GCS_RESULTSTR) is %
l
d
\n
"
,
size
);
ImmReleaseContext
(
hwnd
,
imc
);
ime_composition_test
.
catch_result_str
=
TRUE
;
...
...
@@ -507,11 +507,11 @@ static void test_ImmGetCompositionString(void)
memset
(
cstring
,
0x1a
,
sizeof
(
cstring
));
len
=
ImmGetCompositionStringA
(
imc
,
GCS_COMPSTR
,
cstring
,
alen
);
ok
(
len
==
alen
,
"Unexpected length %d.
\n
"
,
len
);
ok
(
len
==
alen
,
"Unexpected length %
l
d.
\n
"
,
len
);
ok
(
cstring
[
alen
]
==
0x1a
,
"Unexpected buffer contents.
\n
"
);
len
=
ImmGetCompositionStringW
(
imc
,
GCS_COMPSTR
,
wstring
,
wlen
);
ok
(
len
==
wlen
,
"Unexpected length %d.
\n
"
,
len
);
ok
(
len
==
wlen
,
"Unexpected length %
l
d.
\n
"
,
len
);
ok
(
wstring
[
wlen
/
sizeof
(
WCHAR
)]
==
0x1a1a
,
"Unexpected buffer contents.
\n
"
);
/* Get strings with exactly smaller buffer sizes. */
...
...
@@ -520,11 +520,11 @@ static void test_ImmGetCompositionString(void)
/* Returns 0 but still fills buffer. */
len
=
ImmGetCompositionStringA
(
imc
,
GCS_COMPSTR
,
cstring
,
alen
-
1
);
ok
(
!
len
,
"Unexpected length %d.
\n
"
,
len
);
ok
(
!
len
,
"Unexpected length %
l
d.
\n
"
,
len
);
ok
(
cstring
[
0
]
==
'w'
,
"Unexpected buffer contents %s.
\n
"
,
cstring
);
len
=
ImmGetCompositionStringW
(
imc
,
GCS_COMPSTR
,
wstring
,
wlen
-
1
);
ok
(
len
==
wlen
-
1
,
"Unexpected length %d.
\n
"
,
len
);
ok
(
len
==
wlen
-
1
,
"Unexpected length %
l
d.
\n
"
,
len
);
ok
(
!
memcmp
(
wstring
,
string
,
wlen
-
1
),
"Unexpected buffer contents.
\n
"
);
/* Get the size of the required output buffer. */
...
...
@@ -532,11 +532,11 @@ static void test_ImmGetCompositionString(void)
memset
(
cstring
,
0x1a
,
sizeof
(
cstring
));
len
=
ImmGetCompositionStringA
(
imc
,
GCS_COMPSTR
,
cstring
,
0
);
ok
(
len
==
alen
,
"Unexpected length %d.
\n
"
,
len
);
ok
(
len
==
alen
,
"Unexpected length %
l
d.
\n
"
,
len
);
ok
(
cstring
[
0
]
==
0x1a
,
"Unexpected buffer contents %s.
\n
"
,
cstring
);
len
=
ImmGetCompositionStringW
(
imc
,
GCS_COMPSTR
,
wstring
,
0
);
ok
(
len
==
wlen
,
"Unexpected length %d.
\n
"
,
len
);
ok
(
len
==
wlen
,
"Unexpected length %
l
d.
\n
"
,
len
);
ok
(
wstring
[
0
]
==
0x1a1a
,
"Unexpected buffer contents.
\n
"
);
}
else
...
...
@@ -623,7 +623,7 @@ static void test_ImmSetCompositionString(void)
SetLastError
(
0xdeadbeef
);
imc
=
ImmGetContext
(
hwnd
);
ok
(
imc
!=
0
,
"ImmGetContext() failed. Last error: %u
\n
"
,
GetLastError
());
ok
(
imc
!=
0
,
"ImmGetContext() failed. Last error: %
l
u
\n
"
,
GetLastError
());
if
(
!
imc
)
return
;
...
...
@@ -1077,7 +1077,7 @@ static void test_ImmGetContext(void)
himc
=
ImmGetContext
((
HWND
)
0xffffffff
);
err
=
GetLastError
();
ok
(
himc
==
NULL
,
"ImmGetContext succeeded
\n
"
);
ok
(
err
==
ERROR_INVALID_WINDOW_HANDLE
,
"got %u
\n
"
,
err
);
ok
(
err
==
ERROR_INVALID_WINDOW_HANDLE
,
"got %
l
u
\n
"
,
err
);
himc
=
ImmGetContext
(
hwnd
);
ok
(
himc
!=
NULL
,
"ImmGetContext failed
\n
"
);
...
...
@@ -1184,9 +1184,9 @@ static void test_ImmDefaultHwnd(void)
GetWindowTextA
(
def1
,
title
,
sizeof
(
title
));
ok
(
!
strcmp
(
title
,
"Default IME"
),
"got %s
\n
"
,
title
);
style
=
GetWindowLongA
(
def1
,
GWL_STYLE
);
ok
(
style
==
(
WS_DISABLED
|
WS_POPUP
|
WS_CLIPSIBLINGS
),
"got %08x
\n
"
,
style
);
ok
(
style
==
(
WS_DISABLED
|
WS_POPUP
|
WS_CLIPSIBLINGS
),
"got %08
l
x
\n
"
,
style
);
style
=
GetWindowLongA
(
def1
,
GWL_EXSTYLE
);
ok
(
style
==
0
,
"got %08x
\n
"
,
style
);
ok
(
style
==
0
,
"got %08
l
x
\n
"
,
style
);
imc2
=
ImmCreateContext
();
ImmSetOpenStatus
(
imc2
,
TRUE
);
...
...
@@ -1379,7 +1379,7 @@ static void test_default_ime_window_creation(void)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
testcases
);
i
++
)
{
thread
=
CreateThread
(
NULL
,
0
,
test_default_ime_window_cb
,
&
testcases
[
i
],
0
,
NULL
);
ok
(
thread
!=
NULL
,
"CreateThread failed with error %u
\n
"
,
GetLastError
());
ok
(
thread
!=
NULL
,
"CreateThread failed with error %
l
u
\n
"
,
GetLastError
());
while
(
MsgWaitForMultipleObjects
(
1
,
&
thread
,
FALSE
,
INFINITE
,
QS_ALLINPUT
)
==
WAIT_OBJECT_0
+
1
)
{
MSG
msg
;
...
...
@@ -1394,7 +1394,7 @@ static void test_default_ime_window_creation(void)
if
(
testcases
[
i
].
top_level_window
)
{
thread
=
CreateThread
(
NULL
,
0
,
test_default_ime_window_cancel_cb
,
&
testcases
[
i
],
0
,
NULL
);
ok
(
thread
!=
NULL
,
"CreateThread failed with error %u
\n
"
,
GetLastError
());
ok
(
thread
!=
NULL
,
"CreateThread failed with error %
l
u
\n
"
,
GetLastError
());
WaitForSingleObject
(
thread
,
INFINITE
);
CloseHandle
(
thread
);
}
...
...
@@ -1423,32 +1423,32 @@ static void test_ImmGetIMCLockCount(void)
count
=
ImmGetIMCLockCount
((
HIMC
)
0xdeadcafe
);
ok
(
count
==
0
,
"Invalid IMC should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
count
=
ImmGetIMCLockCount
(
0x00000000
);
ok
(
count
==
0
,
"NULL IMC should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
0xdeadbeef
,
"Last Error should remain unchanged: %08x
\n
"
,
ret
);
ok
(
ret
==
0xdeadbeef
,
"Last Error should remain unchanged: %08
l
x
\n
"
,
ret
);
count
=
ImmGetIMCLockCount
(
imc
);
ok
(
count
==
0
,
"Destroyed IMC should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
imc
=
ImmCreateContext
();
count
=
ImmGetIMCLockCount
(
imc
);
ok
(
count
==
0
,
"expect 0, returned %d
\n
"
,
count
);
ok
(
count
==
0
,
"expect 0, returned %
l
d
\n
"
,
count
);
ic
=
ImmLockIMC
(
imc
);
ok
(
ic
!=
NULL
,
"ImmLockIMC failed!
\n
"
);
count
=
ImmGetIMCLockCount
(
imc
);
ok
(
count
==
1
,
"expect 1, returned %d
\n
"
,
count
);
ok
(
count
==
1
,
"expect 1, returned %
l
d
\n
"
,
count
);
ret
=
ImmUnlockIMC
(
imc
);
ok
(
ret
==
TRUE
,
"expect TRUE, ret %d
\n
"
,
ret
);
ok
(
ret
==
TRUE
,
"expect TRUE, ret %
l
d
\n
"
,
ret
);
count
=
ImmGetIMCLockCount
(
imc
);
ok
(
count
==
0
,
"expect 0, returned %d
\n
"
,
count
);
ok
(
count
==
0
,
"expect 0, returned %
l
d
\n
"
,
count
);
ret
=
ImmUnlockIMC
(
imc
);
ok
(
ret
==
TRUE
,
"expect TRUE, ret %d
\n
"
,
ret
);
ok
(
ret
==
TRUE
,
"expect TRUE, ret %
l
d
\n
"
,
ret
);
count
=
ImmGetIMCLockCount
(
imc
);
ok
(
count
==
0
,
"expect 0, returned %d
\n
"
,
count
);
ok
(
count
==
0
,
"expect 0, returned %
l
d
\n
"
,
count
);
for
(
i
=
0
;
i
<
GMEM_LOCKCOUNT
*
2
;
i
++
)
{
...
...
@@ -1456,15 +1456,15 @@ static void test_ImmGetIMCLockCount(void)
ok
(
ic
!=
NULL
,
"ImmLockIMC failed!
\n
"
);
}
count
=
ImmGetIMCLockCount
(
imc
);
todo_wine
ok
(
count
==
GMEM_LOCKCOUNT
,
"expect GMEM_LOCKCOUNT, returned %d
\n
"
,
count
);
todo_wine
ok
(
count
==
GMEM_LOCKCOUNT
,
"expect GMEM_LOCKCOUNT, returned %
l
d
\n
"
,
count
);
for
(
i
=
0
;
i
<
GMEM_LOCKCOUNT
-
1
;
i
++
)
ImmUnlockIMC
(
imc
);
count
=
ImmGetIMCLockCount
(
imc
);
todo_wine
ok
(
count
==
1
,
"expect 1, returned %d
\n
"
,
count
);
todo_wine
ok
(
count
==
1
,
"expect 1, returned %
l
d
\n
"
,
count
);
ImmUnlockIMC
(
imc
);
count
=
ImmGetIMCLockCount
(
imc
);
todo_wine
ok
(
count
==
0
,
"expect 0, returned %d
\n
"
,
count
);
todo_wine
ok
(
count
==
0
,
"expect 0, returned %
l
d
\n
"
,
count
);
ImmDestroyContext
(
imc
);
}
...
...
@@ -1478,18 +1478,18 @@ static void test_ImmGetIMCCLockCount(void)
imcc
=
ImmCreateIMCC
(
sizeof
(
CANDIDATEINFO
));
count
=
ImmGetIMCCLockCount
(
imcc
);
ok
(
count
==
0
,
"expect 0, returned %d
\n
"
,
count
);
ok
(
count
==
0
,
"expect 0, returned %
l
d
\n
"
,
count
);
ImmLockIMCC
(
imcc
);
count
=
ImmGetIMCCLockCount
(
imcc
);
ok
(
count
==
1
,
"expect 1, returned %d
\n
"
,
count
);
ok
(
count
==
1
,
"expect 1, returned %
l
d
\n
"
,
count
);
ret
=
ImmUnlockIMCC
(
imcc
);
ok
(
ret
==
FALSE
,
"expect FALSE, ret %d
\n
"
,
ret
);
count
=
ImmGetIMCCLockCount
(
imcc
);
ok
(
count
==
0
,
"expect 0, returned %d
\n
"
,
count
);
ok
(
count
==
0
,
"expect 0, returned %
l
d
\n
"
,
count
);
ret
=
ImmUnlockIMCC
(
imcc
);
ok
(
ret
==
FALSE
,
"expect FALSE, ret %d
\n
"
,
ret
);
count
=
ImmGetIMCCLockCount
(
imcc
);
ok
(
count
==
0
,
"expect 0, returned %d
\n
"
,
count
);
ok
(
count
==
0
,
"expect 0, returned %
l
d
\n
"
,
count
);
p
=
ImmLockIMCC
(
imcc
);
ok
(
GlobalHandle
(
p
)
==
imcc
,
"expect %p, returned %p
\n
"
,
imcc
,
GlobalHandle
(
p
));
...
...
@@ -1499,18 +1499,18 @@ static void test_ImmGetIMCCLockCount(void)
ImmLockIMCC
(
imcc
);
count
=
ImmGetIMCCLockCount
(
imcc
);
g_count
=
GlobalFlags
(
imcc
)
&
GMEM_LOCKCOUNT
;
ok
(
count
==
g_count
,
"count %
d, g_count %
d
\n
"
,
count
,
g_count
);
ok
(
count
==
g_count
,
"count %
ld, g_count %l
d
\n
"
,
count
,
g_count
);
}
count
=
ImmGetIMCCLockCount
(
imcc
);
ok
(
count
==
GMEM_LOCKCOUNT
,
"expect GMEM_LOCKCOUNT, returned %d
\n
"
,
count
);
ok
(
count
==
GMEM_LOCKCOUNT
,
"expect GMEM_LOCKCOUNT, returned %
l
d
\n
"
,
count
);
for
(
i
=
0
;
i
<
GMEM_LOCKCOUNT
-
1
;
i
++
)
GlobalUnlock
(
imcc
);
count
=
ImmGetIMCCLockCount
(
imcc
);
ok
(
count
==
1
,
"expect 1, returned %d
\n
"
,
count
);
ok
(
count
==
1
,
"expect 1, returned %
l
d
\n
"
,
count
);
GlobalUnlock
(
imcc
);
count
=
ImmGetIMCCLockCount
(
imcc
);
ok
(
count
==
0
,
"expect 0, returned %d
\n
"
,
count
);
ok
(
count
==
0
,
"expect 0, returned %
l
d
\n
"
,
count
);
ImmDestroyIMCC
(
imcc
);
}
...
...
@@ -1523,11 +1523,11 @@ static void test_ImmDestroyContext(void)
imc
=
ImmCreateContext
();
count
=
ImmGetIMCLockCount
(
imc
);
ok
(
count
==
0
,
"expect 0, returned %d
\n
"
,
count
);
ok
(
count
==
0
,
"expect 0, returned %
l
d
\n
"
,
count
);
ic
=
ImmLockIMC
(
imc
);
ok
(
ic
!=
NULL
,
"ImmLockIMC failed!
\n
"
);
count
=
ImmGetIMCLockCount
(
imc
);
ok
(
count
==
1
,
"expect 1, returned %d
\n
"
,
count
);
ok
(
count
==
1
,
"expect 1, returned %
l
d
\n
"
,
count
);
ret
=
ImmDestroyContext
(
imc
);
ok
(
ret
==
TRUE
,
"Destroy a locked IMC should success!
\n
"
);
ic
=
ImmLockIMC
(
imc
);
...
...
@@ -1540,7 +1540,7 @@ static void test_ImmDestroyContext(void)
ret
=
ImmDestroyContext
(
imc
);
ok
(
ret
==
FALSE
,
"Destroy a destroyed IMC should fail!
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
}
static
void
test_ImmDestroyIMCC
(
void
)
...
...
@@ -1551,13 +1551,13 @@ static void test_ImmDestroyIMCC(void)
imcc
=
ImmCreateIMCC
(
sizeof
(
CANDIDATEINFO
));
count
=
ImmGetIMCCLockCount
(
imcc
);
ok
(
count
==
0
,
"expect 0, returned %d
\n
"
,
count
);
ok
(
count
==
0
,
"expect 0, returned %
l
d
\n
"
,
count
);
p
=
ImmLockIMCC
(
imcc
);
ok
(
p
!=
NULL
,
"ImmLockIMCC failed!
\n
"
);
count
=
ImmGetIMCCLockCount
(
imcc
);
ok
(
count
==
1
,
"expect 1, returned %d
\n
"
,
count
);
ok
(
count
==
1
,
"expect 1, returned %
l
d
\n
"
,
count
);
size
=
ImmGetIMCCSize
(
imcc
);
ok
(
size
==
sizeof
(
CANDIDATEINFO
),
"returned %d
\n
"
,
size
);
ok
(
size
==
sizeof
(
CANDIDATEINFO
),
"returned %
l
d
\n
"
,
size
);
p
=
ImmDestroyIMCC
(
imcc
);
ok
(
p
==
NULL
,
"Destroy a locked IMCC should success!
\n
"
);
p
=
ImmLockIMCC
(
imcc
);
...
...
@@ -1572,7 +1572,7 @@ static void test_ImmDestroyIMCC(void)
p
=
ImmDestroyIMCC
(
imcc
);
ok
(
p
!=
NULL
,
"returned NULL
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
}
static
void
test_ImmMessages
(
void
)
...
...
@@ -1807,7 +1807,7 @@ static void test_InvalidIMC(void)
oldimc
=
ImmAssociateContext
(
hwnd
,
imc_destroy
);
ok
(
!
oldimc
,
"Associating to a destroyed imc should fail!
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
imc2
=
ImmGetContext
(
hwnd
);
ok
(
imc1
==
imc2
,
"imc should not changed! imc1 %p, imc2 %p
\n
"
,
imc1
,
imc2
);
...
...
@@ -1838,7 +1838,7 @@ static void test_InvalidIMC(void)
oldimc
=
ImmAssociateContext
(
hwnd
,
imc_bad
);
ok
(
!
oldimc
,
"Associating to a destroyed imc should fail!
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
imc2
=
ImmGetContext
(
hwnd
);
ok
(
imc1
==
imc2
,
"imc should not changed! imc1 %p, imc2 %p
\n
"
,
imc1
,
imc2
);
...
...
@@ -1848,306 +1848,306 @@ static void test_InvalidIMC(void)
ret
=
ImmGetCandidateListA
(
imc_bad
,
0
,
NULL
,
0
);
ok
(
ret
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetCandidateListA
(
imc_null
,
0
,
NULL
,
0
);
ok
(
ret
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08x!
\n
"
,
ret
);
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetCandidateListA
(
imc_destroy
,
0
,
NULL
,
0
);
ok
(
ret
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
/* Test ImmGetCandidateListCountA*/
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetCandidateListCountA
(
imc_bad
,
&
count
);
ok
(
ret
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetCandidateListCountA
(
imc_null
,
&
count
);
ok
(
ret
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08x!
\n
"
,
ret
);
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetCandidateListCountA
(
imc_destroy
,
&
count
);
ok
(
ret
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
/* Test ImmGetCandidateWindow */
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetCandidateWindow
(
imc_bad
,
0
,
(
LPCANDIDATEFORM
)
buffer
);
ok
(
ret
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetCandidateWindow
(
imc_null
,
0
,
(
LPCANDIDATEFORM
)
buffer
);
ok
(
ret
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08x!
\n
"
,
ret
);
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetCandidateWindow
(
imc_destroy
,
0
,
(
LPCANDIDATEFORM
)
buffer
);
ok
(
ret
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
/* Test ImmGetCompositionFontA */
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetCompositionFontA
(
imc_bad
,
(
LPLOGFONTA
)
buffer
);
ok
(
ret
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetCompositionFontA
(
imc_null
,
(
LPLOGFONTA
)
buffer
);
ok
(
ret
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08x!
\n
"
,
ret
);
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetCompositionFontA
(
imc_destroy
,
(
LPLOGFONTA
)
buffer
);
ok
(
ret
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
/* Test ImmGetCompositionWindow */
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetCompositionWindow
(
imc_bad
,
(
LPCOMPOSITIONFORM
)
buffer
);
ok
(
ret
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetCompositionWindow
(
imc_null
,
(
LPCOMPOSITIONFORM
)
buffer
);
ok
(
ret
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08x!
\n
"
,
ret
);
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetCompositionWindow
(
imc_destroy
,
(
LPCOMPOSITIONFORM
)
buffer
);
ok
(
ret
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
/* Test ImmGetCompositionStringA */
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetCompositionStringA
(
imc_bad
,
GCS_COMPSTR
,
NULL
,
0
);
ok
(
ret
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetCompositionStringA
(
imc_null
,
GCS_COMPSTR
,
NULL
,
0
);
ok
(
ret
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08x!
\n
"
,
ret
);
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetCompositionStringA
(
imc_destroy
,
GCS_COMPSTR
,
NULL
,
0
);
ok
(
ret
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
/* Test ImmSetOpenStatus */
SetLastError
(
0xdeadbeef
);
ret
=
ImmSetOpenStatus
(
imc_bad
,
1
);
ok
(
ret
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmSetOpenStatus
(
imc_null
,
1
);
ok
(
ret
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmSetOpenStatus
(
imc_destroy
,
1
);
ok
(
ret
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
/* Test ImmGetOpenStatus */
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetOpenStatus
(
imc_bad
);
ok
(
ret
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetOpenStatus
(
imc_null
);
ok
(
ret
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08x!
\n
"
,
ret
);
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetOpenStatus
(
imc_destroy
);
ok
(
ret
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
/* Test ImmGetStatusWindowPos */
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetStatusWindowPos
(
imc_bad
,
NULL
);
ok
(
ret
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetStatusWindowPos
(
imc_null
,
NULL
);
ok
(
ret
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08x!
\n
"
,
ret
);
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetStatusWindowPos
(
imc_destroy
,
NULL
);
ok
(
ret
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
/* Test ImmRequestMessageA */
SetLastError
(
0xdeadbeef
);
ret
=
ImmRequestMessageA
(
imc_bad
,
WM_CHAR
,
0
);
ok
(
ret
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmRequestMessageA
(
imc_null
,
WM_CHAR
,
0
);
ok
(
ret
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmRequestMessageA
(
imc_destroy
,
WM_CHAR
,
0
);
ok
(
ret
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
/* Test ImmSetCompositionFontA */
SetLastError
(
0xdeadbeef
);
ret
=
ImmSetCompositionFontA
(
imc_bad
,
&
lf
);
ok
(
ret
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmSetCompositionFontA
(
imc_null
,
&
lf
);
ok
(
ret
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmSetCompositionFontA
(
imc_destroy
,
&
lf
);
ok
(
ret
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
/* Test ImmSetCompositionWindow */
SetLastError
(
0xdeadbeef
);
ret
=
ImmSetCompositionWindow
(
imc_bad
,
NULL
);
ok
(
ret
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmSetCompositionWindow
(
imc_null
,
NULL
);
ok
(
ret
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmSetCompositionWindow
(
imc_destroy
,
NULL
);
ok
(
ret
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
/* Test ImmSetConversionStatus */
SetLastError
(
0xdeadbeef
);
ret
=
ImmSetConversionStatus
(
imc_bad
,
0
,
0
);
ok
(
ret
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmSetConversionStatus
(
imc_null
,
0
,
0
);
ok
(
ret
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmSetConversionStatus
(
imc_destroy
,
0
,
0
);
ok
(
ret
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
/* Test ImmSetStatusWindowPos */
SetLastError
(
0xdeadbeef
);
ret
=
ImmSetStatusWindowPos
(
imc_bad
,
0
);
ok
(
ret
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmSetStatusWindowPos
(
imc_null
,
0
);
ok
(
ret
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmSetStatusWindowPos
(
imc_destroy
,
0
);
ok
(
ret
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
/* Test ImmGetImeMenuItemsA */
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetImeMenuItemsA
(
imc_bad
,
0
,
0
,
NULL
,
NULL
,
0
);
ok
(
ret
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetImeMenuItemsA
(
imc_null
,
0
,
0
,
NULL
,
NULL
,
0
);
ok
(
ret
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGetImeMenuItemsA
(
imc_destroy
,
0
,
0
,
NULL
,
NULL
,
0
);
ok
(
ret
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
/* Test ImmLockIMC */
SetLastError
(
0xdeadbeef
);
ic
=
ImmLockIMC
(
imc_bad
);
ok
(
ic
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ic
=
ImmLockIMC
(
imc_null
);
ok
(
ic
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08x!
\n
"
,
ret
);
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ic
=
ImmLockIMC
(
imc_destroy
);
ok
(
ic
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
/* Test ImmUnlockIMC */
SetLastError
(
0xdeadbeef
);
ret
=
ImmUnlockIMC
(
imc_bad
);
ok
(
ret
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmUnlockIMC
(
imc_null
);
ok
(
ret
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08x!
\n
"
,
ret
);
ok
(
ret
==
0xdeadbeef
,
"last error should remain unchanged %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmUnlockIMC
(
imc_destroy
);
ok
(
ret
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
/* Test ImmGenerateMessage */
SetLastError
(
0xdeadbeef
);
ret
=
ImmGenerateMessage
(
imc_bad
);
ok
(
ret
==
0
,
"Bad IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGenerateMessage
(
imc_null
);
ok
(
ret
==
0
,
"NULL IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
ImmGenerateMessage
(
imc_destroy
);
ok
(
ret
==
0
,
"Destroyed IME should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08
l
x!
\n
"
,
ret
);
}
#define test_apttype(apttype) _test_apttype(apttype, __LINE__)
...
...
@@ -2159,7 +2159,7 @@ static void _test_apttype(APTTYPE apttype, unsigned int line)
hr
=
CoGetApartmentType
(
&
type
,
&
qualifier
);
hr_expected
=
(
apttype
==
-
1
?
CO_E_NOTINITIALIZED
:
S_OK
);
ok_
(
__FILE__
,
line
)(
hr
==
hr_expected
,
"CoGetApartmentType returned %x
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
hr
==
hr_expected
,
"CoGetApartmentType returned %
l
x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
...
...
@@ -2178,7 +2178,7 @@ static DWORD WINAPI com_initialization_thread(void *arg)
ok
(
r
,
"ImmSetActiveContext failed
\n
"
);
test_apttype
(
APTTYPE_MAINSTA
);
hr
=
CoInitialize
(
NULL
);
ok
(
hr
==
S_OK
,
"CoInitialize returned %x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"CoInitialize returned %
l
x
\n
"
,
hr
);
CoUninitialize
();
test_apttype
(
-
1
);
...
...
@@ -2187,7 +2187,7 @@ static DWORD WINAPI com_initialization_thread(void *arg)
ok
(
r
,
"ImmSetActiveContext failed
\n
"
);
test_apttype
(
APTTYPE_MAINSTA
);
hr
=
CoInitializeEx
(
NULL
,
COINIT_MULTITHREADED
);
ok
(
hr
==
S_OK
,
"CoInitialize returned %x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"CoInitialize returned %
l
x
\n
"
,
hr
);
test_apttype
(
APTTYPE_MTA
);
CoUninitialize
();
test_apttype
(
-
1
);
...
...
@@ -2228,7 +2228,7 @@ static void test_com_initialization(void)
ok
(
r
,
"ImmSetActiveContext failed
\n
"
);
test_apttype
(
APTTYPE_MAINSTA
);
hr
=
CoInitialize
(
NULL
);
ok
(
hr
==
S_OK
,
"CoInitialize returned %x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"CoInitialize returned %
l
x
\n
"
,
hr
);
CoUninitialize
();
test_apttype
(
-
1
);
...
...
@@ -2240,7 +2240,7 @@ static void test_com_initialization(void)
ok
(
r
,
"ImmSetActiveContext failed
\n
"
);
test_apttype
(
APTTYPE_MAINSTA
);
hr
=
CoInitialize
(
NULL
);
ok
(
hr
==
S_OK
,
"CoInitialize returned %x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"CoInitialize returned %
l
x
\n
"
,
hr
);
CoUninitialize
();
test_apttype
(
APTTYPE_MAINSTA
);
DestroyWindow
(
wnd
);
...
...
@@ -2251,7 +2251,7 @@ static void test_com_initialization(void)
r
=
ImmSetActiveContext
(
NULL
,
NULL
,
TRUE
);
CoUninitialize
();
hr
=
CoInitializeEx
(
NULL
,
COINIT_MULTITHREADED
);
ok
(
hr
==
S_OK
,
"CoInitialize returned %x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"CoInitialize returned %
l
x
\n
"
,
hr
);
test_apttype
(
APTTYPE_MTA
);
DestroyWindow
(
wnd
);
test_apttype
(
-
1
);
...
...
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