ReactOS  0.4.14-dev-593-g1793dcc
imm32.c File Reference
#include <stdio.h>
#include "wine/test.h"
#include "winuser.h"
#include "wingdi.h"
#include "imm.h"
#include "ddk/imm.h"
Include dependency graph for imm32.c:

Go to the source code of this file.

Classes

struct  _msgs
 
struct  _msg_spy
 
struct  TEST_INPUT
 
struct  _tagTRANSMSG
 
struct  _igc_threadinfo
 
struct  testcase_ime_window
 

Typedefs

typedef struct _msgs imm_msgs
 
typedef struct _tagTRANSMSG TRANSMSG
 
typedef struct _tagTRANSMSGLPTRANSMSG
 
typedef struct _igc_threadinfo igc_threadinfo
 

Enumerations

enum  {
  PHASE_UNKNOWN, FIRST_WINDOW, SECOND_WINDOW, CREATE_CANCEL,
  NCCREATE_CANCEL, IME_DISABLED
}
 

Functions

static BOOL (WINAPI *pImmAssociateContextEx)(HWND
 
static UINT (WINAPI *pSendInput)(UINT
 
static LRESULT CALLBACK get_msg_filter (int nCode, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK call_wnd_proc_filter (int nCode, WPARAM wParam, LPARAM lParam)
 
static void msg_spy_pump_msg_queue (void)
 
static void msg_spy_flush_msgs (void)
 
static imm_msgsmsg_spy_find_next_msg (UINT message, UINT *start)
 
static imm_msgsmsg_spy_find_msg (UINT message)
 
static void msg_spy_init (HWND hwnd)
 
static void msg_spy_cleanup (void)
 
static HWND get_ime_window (void)
 
static LRESULT WINAPI wndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static BOOL init (void)
 
static void cleanup (void)
 
static void test_ImmNotifyIME (void)
 
static LRESULT WINAPI test_ime_wnd_proc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void test_ImmGetCompositionString (void)
 
static void test_ImmSetCompositionString (void)
 
static void test_ImmIME (void)
 
static void test_ImmAssociateContextEx (void)
 
static DWORD WINAPI ImmGetContextThreadFunc (LPVOID lpParam)
 
static void test_ImmThreads (void)
 
static void test_ImmIsUIMessage (void)
 
static void test_ImmGetContext (void)
 
static void test_ImmGetDescription (void)
 
static LRESULT (WINAPI *old_imm_wnd_proc)(HWND
 
static LRESULT WINAPI imm_wnd_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static DWORD WINAPI test_ImmGetDefaultIMEWnd_thread (void *arg)
 
static void test_ImmDefaultHwnd (void)
 
static BOOL CALLBACK is_ime_window_proc (HWND hWnd, LPARAM param)
 
static DWORD WINAPI test_default_ime_window_cb (void *arg)
 
static DWORD WINAPI test_default_ime_window_cancel_cb (void *arg)
 
static DWORD WINAPI test_default_ime_disabled_cb (void *arg)
 
static DWORD WINAPI test_default_ime_with_message_only_window_cb (void *arg)
 
static void test_default_ime_window_creation (void)
 
static void test_ImmGetIMCLockCount (void)
 
static void test_ImmGetIMCCLockCount (void)
 
static void test_ImmDestroyContext (void)
 
static void test_ImmDestroyIMCC (void)
 
static void test_ImmMessages (void)
 
static LRESULT CALLBACK processkey_wnd_proc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void test_ime_processkey (void)
 
static void test_InvalidIMC (void)
 
 START_TEST (imm32)
 

Variables

static HIMC
 
static DWORD
 
static UINT
 
static WPARAM
 
static LPARAM
 
static INPUT size_t
 
static struct _msg_spy msg_spy
 
static const char wndcls [] = "winetest_imm32_wndcls"
 
static enum { ... }  test_phase
 
static HWND hwnd
 
struct {
   WNDPROC   old_wnd_proc
 
   BOOL   catch_result_str
 
   BOOL   catch_ime_char
 
   DWORD   start
 
   DWORD   timer_id
 
ime_composition_test
 
static HWND thread_ime_wnd
 

Typedef Documentation

◆ igc_threadinfo

◆ imm_msgs

◆ LPTRANSMSG

◆ TRANSMSG

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PHASE_UNKNOWN 
FIRST_WINDOW 
SECOND_WINDOW 
CREATE_CANCEL 
NCCREATE_CANCEL 
IME_DISABLED 

Definition at line 173 of file imm32.c.

Function Documentation

◆ BOOL()

static BOOL ( WINAPI pImmAssociateContextEx)
static

◆ call_wnd_proc_filter()

static LRESULT CALLBACK call_wnd_proc_filter ( int  nCode,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 88 of file imm32.c.

90 {
91  if (HC_ACTION == nCode) {
92  CWPSTRUCT *cwp = (CWPSTRUCT*)lParam;
93 
94  if (((cwp->hwnd == msg_spy.hwnd || msg_spy.hwnd == NULL)) &&
95  (msg_spy.i_msg < ARRAY_SIZE(msg_spy.msgs)))
96  {
97  memcpy(&msg_spy.msgs[msg_spy.i_msg].msg, cwp, sizeof(msg_spy.msgs[0].msg));
98  msg_spy.msgs[msg_spy.i_msg].post = FALSE;
99  msg_spy.i_msg++;
100  }
101  }
102 
103  return CallNextHookEx(msg_spy.call_wnd_proc_hook, nCode, wParam, lParam);
104 }
WPARAM wParam
Definition: combotst.c:138
smooth NULL
Definition: ftsmooth.c:416
static struct _msg_spy msg_spy
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
#define ARRAY_SIZE(a)
Definition: main.h:24
#define HC_ACTION
Definition: winuser.h:48
LPARAM lParam
Definition: combotst.c:139

Referenced by msg_spy_init().

◆ cleanup()

static void cleanup ( void  )
static

Definition at line 288 of file imm32.c.

288  {
289  msg_spy_cleanup();
290  if (hwnd)
293 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI DestroyWindow(_In_ HWND)
static void msg_spy_cleanup(void)
Definition: imm32.c:160
static const char wndcls[]
Definition: imm32.c:172
smooth NULL
Definition: ftsmooth.c:416
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
BOOL WINAPI UnregisterClassA(_In_ LPCSTR, HINSTANCE)

Referenced by START_TEST().

◆ get_ime_window()

static HWND get_ime_window ( void  )
static

Definition at line 1113 of file imm32.c.

1114 {
1115  HWND ime_window = NULL;
1117  return ime_window;
1118 }
BOOL WINAPI EnumThreadWindows(_In_ DWORD, _In_ WNDENUMPROC, _In_ LPARAM)
static BOOL CALLBACK is_ime_window_proc(HWND hWnd, LPARAM param)
Definition: imm32.c:1100
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458

Referenced by test_default_ime_disabled_cb(), test_default_ime_window_cancel_cb(), test_default_ime_window_cb(), and wndProc().

◆ get_msg_filter()

static LRESULT CALLBACK get_msg_filter ( int  nCode,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 68 of file imm32.c.

69 {
70  if (HC_ACTION == nCode) {
71  MSG *msg = (MSG*)lParam;
72 
73  if ((msg->hwnd == msg_spy.hwnd || msg_spy.hwnd == NULL) &&
74  (msg_spy.i_msg < ARRAY_SIZE(msg_spy.msgs)))
75  {
76  msg_spy.msgs[msg_spy.i_msg].msg.hwnd = msg->hwnd;
77  msg_spy.msgs[msg_spy.i_msg].msg.message = msg->message;
78  msg_spy.msgs[msg_spy.i_msg].msg.wParam = msg->wParam;
79  msg_spy.msgs[msg_spy.i_msg].msg.lParam = msg->lParam;
80  msg_spy.msgs[msg_spy.i_msg].post = TRUE;
81  msg_spy.i_msg++;
82  }
83  }
84 
85  return CallNextHookEx(msg_spy.get_msg_hook, nCode, wParam, lParam);
86 }
#define TRUE
Definition: types.h:120
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
WPARAM wParam
Definition: combotst.c:138
smooth NULL
Definition: ftsmooth.c:416
static struct _msg_spy msg_spy
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
#define ARRAY_SIZE(a)
Definition: main.h:24
#define HC_ACTION
Definition: winuser.h:48
#define msg(x)
Definition: auth_time.c:54
LPARAM lParam
Definition: combotst.c:139

Referenced by msg_spy_init().

◆ imm_wnd_proc()

static LRESULT WINAPI imm_wnd_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 1030 of file imm32.c.

1031 {
1032  ok(msg != WM_DESTROY, "got WM_DESTROY message\n");
1033  return old_imm_wnd_proc(hwnd, msg, wparam, lparam);
1034 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define WM_DESTROY
Definition: winuser.h:1591
#define ok(value,...)
Definition: atltest.h:57
#define msg(x)
Definition: auth_time.c:54
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by test_ImmGetDefaultIMEWnd_thread().

◆ ImmGetContextThreadFunc()

static DWORD WINAPI ImmGetContextThreadFunc ( LPVOID  lpParam)
static

Definition at line 664 of file imm32.c.

665 {
666  HIMC h1,h2;
667  HWND hwnd2;
669  CANDIDATEFORM cdf;
670  POINT pt;
671  MSG msg;
672 
673  igc_threadinfo *info= (igc_threadinfo*)lpParam;
674  info->hwnd = CreateWindowExA(WS_EX_CLIENTEDGE, wndcls, "Wine imm32.dll test",
676  240, 120, NULL, NULL, GetModuleHandleW(NULL), NULL);
677 
678  h1 = ImmGetContext(hwnd);
679  ok(info->himc == h1, "hwnd context changed in new thread\n");
680  h2 = ImmGetContext(info->hwnd);
681  ok(h2 != h1, "new hwnd in new thread should have different context\n");
682  info->himc = h2;
684 
685  hwnd2 = CreateWindowExA(WS_EX_CLIENTEDGE, wndcls, "Wine imm32.dll test",
687  240, 120, NULL, NULL, GetModuleHandleW(NULL), NULL);
688  h1 = ImmGetContext(hwnd2);
689 
690  ok(h1 == h2, "Windows in same thread should have same default context\n");
691  ImmReleaseContext(hwnd2,h1);
692  ImmReleaseContext(info->hwnd,h2);
693  DestroyWindow(hwnd2);
694 
695  /* priming for later tests */
698  info->u_himc = ImmCreateContext();
699  ImmSetOpenStatus(info->u_himc, TRUE);
700  cdf.dwIndex = 0;
702  cdf.ptCurrentPos.x = 0;
703  cdf.ptCurrentPos.y = 0;
704  ImmSetCandidateWindow(info->u_himc, &cdf);
705 
706  SetEvent(info->event);
707 
708  while(GetMessageW(&msg, 0, 0, 0))
709  {
712  }
713  return 1;
714 }
static IClassFactory * cf
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define TRUE
Definition: types.h:120
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define pt(x, y)
Definition: drawing.c:79
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
DWORD dwStyle
Definition: dimm.idl:80
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI ImmSetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
Definition: imm.c:2632
BOOL WINAPI ImmSetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
Definition: imm.c:2514
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
static const char wndcls[]
Definition: imm32.c:172
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
DWORD HIMC
Definition: dimm.idl:75
HIMC WINAPI ImmCreateContext(void)
Definition: imm.c:746
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1518
#define CFS_CANDIDATEPOS
Definition: imm.h:467
POINT ptCurrentPos
Definition: dimm.idl:81
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:2275
BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
Definition: imm.c:2593
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
DWORD dwIndex
Definition: dimm.idl:79
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
BOOL WINAPI ImmSetCandidateWindow(HIMC hIMC, LPCANDIDATEFORM lpCandidate)
Definition: imm.c:2319
#define msg(x)
Definition: auth_time.c:54
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847

Referenced by test_ImmThreads().

◆ init()

static BOOL init ( void  )
static

Definition at line 239 of file imm32.c.

239  {
240  WNDCLASSEXA wc;
241  HIMC imc;
242  HMODULE hmod,huser;
243 
244  hmod = GetModuleHandleA("imm32.dll");
245  huser = GetModuleHandleA("user32");
246  pImmAssociateContextEx = (void*)GetProcAddress(hmod, "ImmAssociateContextEx");
247  pImmIsUIMessageA = (void*)GetProcAddress(hmod, "ImmIsUIMessageA");
248  pSendInput = (void*)GetProcAddress(huser, "SendInput");
249 
250  wc.cbSize = sizeof(WNDCLASSEXA);
251  wc.style = 0;
252  wc.lpfnWndProc = wndProc;
253  wc.cbClsExtra = 0;
254  wc.cbWndExtra = 0;
258  wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
259  wc.lpszMenuName = NULL;
260  wc.lpszClassName = wndcls;
262 
263  if (!RegisterClassExA(&wc))
264  return FALSE;
265 
266  hwnd = CreateWindowExA(WS_EX_CLIENTEDGE, wndcls, "Wine imm32.dll test",
268  240, 120, NULL, NULL, GetModuleHandleW(NULL), NULL);
269  if (!hwnd)
270  return FALSE;
271 
272  imc = ImmGetContext(hwnd);
273  if (!imc)
274  {
275  win_skip("IME support not implemented\n");
276  return FALSE;
277  }
278  ImmReleaseContext(hwnd, imc);
279 
282 
284 
285  return TRUE;
286 }
struct _WNDCLASSEXA WNDCLASSEXA
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
UINT style
Definition: winuser.h:3177
static void msg_spy_init(HWND hwnd)
Definition: imm32.c:147
LPCSTR lpszMenuName
Definition: winuser.h:3185
#define TRUE
Definition: types.h:120
HCURSOR hCursor
Definition: winuser.h:3183
WNDPROC lpfnWndProc
Definition: winuser.h:3178
static LRESULT WINAPI wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: imm32.c:179
LPCSTR lpszClassName
Definition: winuser.h:3186
BOOL WINAPI UpdateWindow(_In_ HWND)
#define IDI_APPLICATION
Definition: winuser.h:699
HICON hIconSm
Definition: winuser.h:3187
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define COLOR_WINDOW
Definition: winuser.h:908
HICON WINAPI LoadIconA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2029
HINSTANCE hInstance
Definition: winuser.h:3181
static const char wndcls[]
Definition: imm32.c:172
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
UINT cbSize
Definition: winuser.h:3176
const char * LPCSTR
Definition: xmlstorage.h:183
DWORD HIMC
Definition: dimm.idl:75
HBRUSH hbrBackground
Definition: winuser.h:3184
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1518
int cbWndExtra
Definition: winuser.h:3180
HICON hIcon
Definition: winuser.h:3182
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
ATOM WINAPI RegisterClassExA(_In_ CONST WNDCLASSEXA *)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
static PEXPLICIT_ACCESSW *static HMODULE hmod
Definition: security.c:141
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:2275
#define SW_SHOWNORMAL
Definition: winuser.h:764
int cbClsExtra
Definition: winuser.h:3179
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define IDC_ARROW
Definition: winuser.h:682
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
#define GetProcAddress(x, y)
Definition: compat.h:418
#define win_skip
Definition: test.h:150

Referenced by START_TEST().

◆ is_ime_window_proc()

static BOOL CALLBACK is_ime_window_proc ( HWND  hWnd,
LPARAM  param 
)
static

Definition at line 1100 of file imm32.c.

1101 {
1102  static const WCHAR imeW[] = {'I','M','E',0};
1103  WCHAR class_nameW[16];
1104  HWND *ime_window = (HWND *)param;
1105  if (GetClassNameW(hWnd, class_nameW, ARRAY_SIZE(class_nameW)) && !lstrcmpW(class_nameW, imeW))
1106  {
1107  *ime_window = hWnd;
1108  return FALSE;
1109  }
1110  return TRUE;
1111 }
#define TRUE
Definition: types.h:120
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
HWND hWnd
Definition: settings.c:17
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
static const WCHAR imeW[]
Definition: imm.c:309
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLfloat param
Definition: glext.h:5796
#define ARRAY_SIZE(a)
Definition: main.h:24

Referenced by get_ime_window().

◆ LRESULT()

static LRESULT ( WINAPI old_imm_wnd_proc)
static

◆ msg_spy_cleanup()

static void msg_spy_cleanup ( void  )
static

Definition at line 160 of file imm32.c.

160  {
161  if (msg_spy.get_msg_hook)
162  UnhookWindowsHookEx(msg_spy.get_msg_hook);
163  if (msg_spy.call_wnd_proc_hook)
164  UnhookWindowsHookEx(msg_spy.call_wnd_proc_hook);
165  memset(&msg_spy, 0, sizeof(msg_spy));
166 }
static struct _msg_spy msg_spy
BOOL WINAPI UnhookWindowsHookEx(_In_ HHOOK)
#define memset(x, y, z)
Definition: compat.h:39

Referenced by cleanup(), and START_TEST().

◆ msg_spy_find_msg()

static imm_msgs* msg_spy_find_msg ( UINT  message)
static

Definition at line 141 of file imm32.c.

141  {
142  UINT i = 0;
143 
144  return msg_spy_find_next_msg(message, &i);
145 }
Definition: tftpd.h:59
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static imm_msgs * msg_spy_find_next_msg(UINT message, UINT *start)
Definition: imm32.c:122
unsigned int UINT
Definition: ndis.h:50

Referenced by test_ImmIsUIMessage(), and test_ImmNotifyIME().

◆ msg_spy_find_next_msg()

static imm_msgs* msg_spy_find_next_msg ( UINT  message,
UINT start 
)
static

Definition at line 122 of file imm32.c.

122  {
123  UINT i;
124 
126 
127  if (msg_spy.i_msg >= ARRAY_SIZE(msg_spy.msgs))
128  fprintf(stdout, "%s:%d: msg_spy: message buffer overflow!\n",
129  __FILE__, __LINE__);
130 
131  for (i = *start; i < msg_spy.i_msg; i++)
132  if (msg_spy.msgs[i].msg.message == message)
133  {
134  *start = i+1;
135  return &msg_spy.msgs[i];
136  }
137 
138  return NULL;
139 }
Definition: tftpd.h:59
static void msg_spy_pump_msg_queue(void)
Definition: imm32.c:106
FILE * stdout
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
smooth NULL
Definition: ftsmooth.c:416
static struct _msg_spy msg_spy
GLuint start
Definition: gl.h:1545
#define ARRAY_SIZE(a)
Definition: main.h:24
unsigned int UINT
Definition: ndis.h:50

Referenced by msg_spy_find_msg(), and test_ImmMessages().

◆ msg_spy_flush_msgs()

static void msg_spy_flush_msgs ( void  )
static

Definition at line 117 of file imm32.c.

117  {
119  msg_spy.i_msg = 0;
120 }
static void msg_spy_pump_msg_queue(void)
Definition: imm32.c:106
static struct _msg_spy msg_spy

Referenced by msg_spy_init(), test_ImmGetCompositionString(), test_ImmIsUIMessage(), test_ImmMessages(), and test_ImmNotifyIME().

◆ msg_spy_init()

static void msg_spy_init ( HWND  hwnd)
static

Definition at line 147 of file imm32.c.

147  {
148  msg_spy.hwnd = hwnd;
149  msg_spy.get_msg_hook =
152  msg_spy.call_wnd_proc_hook =
155  msg_spy.i_msg = 0;
156 
158 }
#define WH_GETMESSAGE
Definition: winuser.h:33
static void msg_spy_flush_msgs(void)
Definition: imm32.c:117
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
static LRESULT CALLBACK get_msg_filter(int nCode, WPARAM wParam, LPARAM lParam)
Definition: imm32.c:68
static struct _msg_spy msg_spy
#define WH_CALLWNDPROC
Definition: winuser.h:34
static LRESULT CALLBACK call_wnd_proc_filter(int nCode, WPARAM wParam, LPARAM lParam)
Definition: imm32.c:88
static HWND hwnd
Definition: imm32.c:175
HHOOK WINAPI SetWindowsHookExW(_In_ int, _In_ HOOKPROC, _In_opt_ HINSTANCE, _In_ DWORD)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847

Referenced by init(), and START_TEST().

◆ msg_spy_pump_msg_queue()

static void msg_spy_pump_msg_queue ( void  )
static

Definition at line 106 of file imm32.c.

106  {
107  MSG msg;
108 
109  while(PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) {
112  }
113 
114  return;
115 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
smooth NULL
Definition: ftsmooth.c:416
#define msg(x)
Definition: auth_time.c:54
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1182

Referenced by msg_spy_find_next_msg(), and msg_spy_flush_msgs().

◆ processkey_wnd_proc()

static LRESULT CALLBACK processkey_wnd_proc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1557 of file imm32.c.

1559 {
1560  return DefWindowProcW(hWnd, msg, wParam, lParam);
1561 }
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define msg(x)
Definition: auth_time.c:54
LPARAM lParam
Definition: combotst.c:139

Referenced by test_ime_processkey().

◆ START_TEST()

START_TEST ( imm32  )

Definition at line 2030 of file imm32.c.

2030  {
2031  if (init())
2032  {
2036  test_ImmIME();
2038  test_ImmThreads();
2048  test_InvalidIMC();
2049  msg_spy_cleanup();
2050  /* Reinitialize the hooks to capture all windows */
2051  msg_spy_init(NULL);
2052  test_ImmMessages();
2053  msg_spy_cleanup();
2054  if (pSendInput)
2056  else win_skip("SendInput is not available\n");
2057  }
2058  cleanup();
2059 }
static void test_ImmSetCompositionString(void)
Definition: imm32.c:566
static void test_ImmGetIMCLockCount(void)
Definition: imm32.c:1302
static void msg_spy_init(HWND hwnd)
Definition: imm32.c:147
static void test_ImmAssociateContextEx(void)
Definition: imm32.c:617
static BOOL init(void)
Definition: imm32.c:239
static void test_ImmIME(void)
Definition: imm32.c:601
static void test_ImmGetIMCCLockCount(void)
Definition: imm32.c:1360
static void msg_spy_cleanup(void)
Definition: imm32.c:160
static void test_default_ime_window_creation(void)
Definition: imm32.c:1255
static void test_ImmThreads(void)
Definition: imm32.c:716
smooth NULL
Definition: ftsmooth.c:416
static void test_InvalidIMC(void)
Definition: imm32.c:1673
static void test_ImmDestroyIMCC(void)
Definition: imm32.c:1434
static void test_ImmIsUIMessage(void)
Definition: imm32.c:887
static void test_ImmGetDescription(void)
Definition: imm32.c:974
static void test_ImmNotifyIME(void)
Definition: imm32.c:295
static void test_ImmGetContext(void)
Definition: imm32.c:958
static void cleanup(void)
Definition: imm32.c:288
static void test_ImmDestroyContext(void)
Definition: imm32.c:1406
static void test_ime_processkey(void)
Definition: imm32.c:1563
static void test_ImmMessages(void)
Definition: imm32.c:1466
#define win_skip
Definition: test.h:150
static void test_ImmGetCompositionString(void)
Definition: imm32.c:422
static void test_ImmDefaultHwnd(void)
Definition: imm32.c:1047

◆ test_default_ime_disabled_cb()

static DWORD WINAPI test_default_ime_disabled_cb ( void arg)
static

Definition at line 1203 of file imm32.c.

1204 {
1205  HWND hWnd, default_ime_wnd;
1206 
1207  ok(!get_ime_window(), "Expected no IME windows\n");
1210  hWnd = CreateWindowExA(WS_EX_CLIENTEDGE, wndcls, "Wine imm32.dll test",
1213  240, 120, NULL, NULL, GetModuleHandleW(NULL), NULL);
1214  default_ime_wnd = ImmGetDefaultIMEWnd(hWnd);
1215  ok(!default_ime_wnd, "Expected no IME windows\n");
1217  return 1;
1218 }
static enum @1614 test_phase
HWND hWnd
Definition: settings.c:17
BOOL WINAPI DestroyWindow(_In_ HWND)
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: imm.c:1738
static const char wndcls[]
Definition: imm32.c:172
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
BOOL WINAPI ImmDisableIME(DWORD idThread)
Definition: imm.c:843
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define ok(value,...)
Definition: atltest.h:57
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
static HWND get_ime_window(void)
Definition: imm32.c:1113
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by test_default_ime_window_creation().

◆ test_default_ime_window_cancel_cb()

static DWORD WINAPI test_default_ime_window_cancel_cb ( void arg)
static

Definition at line 1165 of file imm32.c.

1166 {
1167  struct testcase_ime_window *testcase = (struct testcase_ime_window *)arg;
1168  DWORD visible = testcase->visible ? WS_VISIBLE : 0;
1169  HWND hwnd1, hwnd2, default_ime_wnd, ime_wnd;
1170 
1171  ok(!get_ime_window(), "Expected no IME windows\n");
1173  hwnd1 = CreateWindowExA(WS_EX_CLIENTEDGE, wndcls, "Wine imm32.dll test",
1176  240, 120, NULL, NULL, GetModuleHandleW(NULL), NULL);
1177  ok(hwnd1 == NULL, "creation succeeded, got %p\n", hwnd1);
1178  ok(!get_ime_window(), "Expected no IME windows\n");
1179 
1181  hwnd1 = CreateWindowExA(WS_EX_CLIENTEDGE, wndcls, "Wine imm32.dll test",
1184  240, 120, NULL, NULL, GetModuleHandleW(NULL), NULL);
1185  ok(hwnd1 == NULL, "creation succeeded, got %p\n", hwnd1);
1186  ok(!get_ime_window(), "Expected no IME windows\n");
1187 
1189  hwnd2 = CreateWindowExA(WS_EX_CLIENTEDGE, wndcls, "Wine imm32.dll test",
1192  240, 120, NULL, NULL, GetModuleHandleW(NULL), NULL);
1193  ime_wnd = get_ime_window();
1194  ok(ime_wnd != NULL, "Expected IME window existence\n");
1195  default_ime_wnd = ImmGetDefaultIMEWnd(hwnd2);
1196  ok(ime_wnd == default_ime_wnd, "Expected %p, got %p\n", ime_wnd, default_ime_wnd);
1197 
1198  DestroyWindow(hwnd2);
1199  ok(!IsWindow(ime_wnd), "Expected no IME windows\n");
1200  return 1;
1201 }
BOOL WINAPI IsWindow(_In_opt_ HWND)
static enum @1614 test_phase
BOOL WINAPI DestroyWindow(_In_ HWND)
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: imm.c:1738
static const char wndcls[]
Definition: imm32.c:172
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define ok(value,...)
Definition: atltest.h:57
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
static HWND get_ime_window(void)
Definition: imm32.c:1113
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by test_default_ime_window_creation().

◆ test_default_ime_window_cb()

static DWORD WINAPI test_default_ime_window_cb ( void arg)
static

Definition at line 1125 of file imm32.c.

1126 {
1127  struct testcase_ime_window *testcase = (struct testcase_ime_window *)arg;
1128  DWORD visible = testcase->visible ? WS_VISIBLE : 0;
1129  HWND hwnd1, hwnd2, default_ime_wnd, ime_wnd;
1130 
1131  ok(!get_ime_window(), "Expected no IME windows\n");
1132  if (testcase->top_level_window) {
1134  hwnd1 = CreateWindowExA(WS_EX_CLIENTEDGE, wndcls, "Wine imm32.dll test",
1137  240, 120, NULL, NULL, GetModuleHandleW(NULL), NULL);
1138  }
1139  else {
1140  hwnd1 = CreateWindowExA(WS_EX_CLIENTEDGE, "EDIT", "Wine imm32.dll test",
1141  WS_CHILD | visible,
1143  240, 24, hwnd, NULL, GetModuleHandleW(NULL), NULL);
1144  }
1145  ime_wnd = get_ime_window();
1146  ok(ime_wnd != NULL, "Expected IME window existence\n");
1147  default_ime_wnd = ImmGetDefaultIMEWnd(hwnd1);
1148  ok(ime_wnd == default_ime_wnd, "Expected %p, got %p\n", ime_wnd, default_ime_wnd);
1149 
1151  hwnd2 = CreateWindowExA(WS_EX_CLIENTEDGE, wndcls, "Wine imm32.dll test",
1154  240, 120, NULL, NULL, GetModuleHandleW(NULL), NULL);
1155  DestroyWindow(hwnd2);
1156  ok(IsWindow(ime_wnd) ||
1157  broken(!testcase->visible /* Vista */) ||
1158  broken(!testcase->top_level_window /* Vista */) ,
1159  "Expected IME window existence\n");
1160  DestroyWindow(hwnd1);
1161  ok(!IsWindow(ime_wnd), "Expected no IME windows\n");
1162  return 1;
1163 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI IsWindow(_In_opt_ HWND)
static enum @1614 test_phase
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI DestroyWindow(_In_ HWND)
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: imm.c:1738
static const char wndcls[]
Definition: imm32.c:172
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL top_level_window
Definition: imm32.c:1122
#define broken(x)
Definition: _sntprintf.h:21
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define ok(value,...)
Definition: atltest.h:57
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
static HWND get_ime_window(void)
Definition: imm32.c:1113
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by test_default_ime_window_creation().

◆ test_default_ime_window_creation()

static void test_default_ime_window_creation ( void  )
static

Definition at line 1255 of file imm32.c.

1256 {
1257  HANDLE thread;
1258  size_t i;
1259  struct testcase_ime_window testcases[] = {
1260  /* visible, top-level window */
1261  { TRUE, TRUE },
1262  { FALSE, TRUE },
1263  { TRUE, FALSE },
1264  { FALSE, FALSE }
1265  };
1266 
1267  for (i = 0; i < ARRAY_SIZE(testcases); i++)
1268  {
1269  thread = CreateThread(NULL, 0, test_default_ime_window_cb, &testcases[i], 0, NULL);
1270  ok(thread != NULL, "CreateThread failed with error %u\n", GetLastError());
1272  {
1273  MSG msg;
1274  while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
1275  {
1278  }
1279  }
1281 
1282  if (testcases[i].top_level_window)
1283  {
1285  ok(thread != NULL, "CreateThread failed with error %u\n", GetLastError());
1288  }
1289  }
1290 
1294 
1298 
1300 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
static enum @1614 test_phase
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
static DWORD WINAPI test_default_ime_disabled_cb(void *arg)
Definition: imm32.c:1203
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static DWORD WINAPI test_default_ime_window_cancel_cb(void *arg)
Definition: imm32.c:1165
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
#define WAIT_OBJECT_0
Definition: winbase.h:387
BOOL top_level_window
Definition: imm32.c:1122
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
static HANDLE thread
Definition: service.c:33
static DWORD WINAPI test_default_ime_window_cb(void *arg)
Definition: imm32.c:1125
#define ARRAY_SIZE(a)
Definition: main.h:24
#define QS_ALLINPUT
Definition: winuser.h:874
#define ok(value,...)
Definition: atltest.h:57
#define msg(x)
Definition: auth_time.c:54
#define PM_REMOVE
Definition: winuser.h:1182
#define INFINITE
Definition: serial.h:102
static DWORD WINAPI test_default_ime_with_message_only_window_cb(void *arg)
Definition: imm32.c:1220

Referenced by START_TEST().

◆ test_default_ime_with_message_only_window_cb()

static DWORD WINAPI test_default_ime_with_message_only_window_cb ( void arg)
static

Definition at line 1220 of file imm32.c.

1221 {
1222  HWND hwnd1, hwnd2, default_ime_wnd;
1223 
1225  hwnd1 = CreateWindowA(wndcls, "Wine imm32.dll test",
1228  240, 120, HWND_MESSAGE, NULL, GetModuleHandleW(NULL), NULL);
1229  default_ime_wnd = ImmGetDefaultIMEWnd(hwnd1);
1230  ok(!IsWindow(default_ime_wnd), "Expected no IME windows, got %p\n", default_ime_wnd);
1231 
1232  hwnd2 = CreateWindowA(wndcls, "Wine imm32.dll test",
1235  240, 120, hwnd1, NULL, GetModuleHandleW(NULL), NULL);
1236  default_ime_wnd = ImmGetDefaultIMEWnd(hwnd2);
1237  ok(IsWindow(default_ime_wnd), "Expected IME window existence\n");
1238 
1239  DestroyWindow(hwnd2);
1240  DestroyWindow(hwnd1);
1241 
1242  hwnd1 = CreateWindowA(wndcls, "Wine imm32.dll test",
1245  240, 120, NULL, NULL, GetModuleHandleW(NULL), NULL);
1246  default_ime_wnd = ImmGetDefaultIMEWnd(hwnd1);
1247  ok(IsWindow(default_ime_wnd), "Expected IME window existence\n");
1248  SetParent(hwnd1, HWND_MESSAGE);
1249  default_ime_wnd = ImmGetDefaultIMEWnd(hwnd1);
1250  ok(IsWindow(default_ime_wnd), "Expected IME window existence\n");
1251  DestroyWindow(hwnd1);
1252  return 1;
1253 }
BOOL WINAPI IsWindow(_In_opt_ HWND)
static enum @1614 test_phase
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
#define HWND_MESSAGE
Definition: winuser.h:1196
BOOL WINAPI DestroyWindow(_In_ HWND)
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: imm.c:1738
static const char wndcls[]
Definition: imm32.c:172
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4290
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
#define ok(value,...)
Definition: atltest.h:57
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847

Referenced by test_default_ime_window_creation().

◆ test_ime_processkey()

static void test_ime_processkey ( void  )
static

Definition at line 1563 of file imm32.c.

1564 {
1565  WCHAR classNameW[] = {'P','r','o','c','e','s','s', 'K','e','y','T','e','s','t','C','l','a','s','s',0};
1566  WCHAR windowNameW[] = {'P','r','o','c','e','s','s', 'K','e','y',0};
1567 
1568  MSG msg;
1569  WNDCLASSW wclass;
1571  TEST_INPUT inputs[2];
1572  HIMC imc;
1573  INT rc;
1574  HWND hWndTest;
1575 
1576  wclass.lpszClassName = classNameW;
1577  wclass.style = CS_HREDRAW | CS_VREDRAW;
1579  wclass.hInstance = hInstance;
1580  wclass.hIcon = LoadIconW(0, (LPCWSTR)IDI_APPLICATION);
1581  wclass.hCursor = LoadCursorW( NULL, (LPCWSTR)IDC_ARROW);
1582  wclass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
1583  wclass.lpszMenuName = 0;
1584  wclass.cbClsExtra = 0;
1585  wclass.cbWndExtra = 0;
1586  if(!RegisterClassW(&wclass)){
1587  win_skip("Failed to register window.\n");
1588  return;
1589  }
1590 
1591  /* create the test window that will receive the keystrokes */
1592  hWndTest = CreateWindowW(wclass.lpszClassName, windowNameW,
1593  WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, 100, 100,
1594  NULL, NULL, hInstance, NULL);
1595 
1600 
1601  imc = ImmGetContext(hWndTest);
1602  if (!imc)
1603  {
1604  win_skip("IME not supported\n");
1606  return;
1607  }
1608 
1609  rc = ImmSetOpenStatus(imc, TRUE);
1610  if (rc != TRUE)
1611  {
1612  win_skip("Unable to open IME\n");
1615  return;
1616  }
1617 
1618  /* flush pending messages */
1619  while (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageW(&msg);
1620 
1621  SetFocus(hWndTest);
1622 
1623  /* init input data that never changes */
1624  inputs[1].type = inputs[0].type = INPUT_KEYBOARD;
1625  inputs[1].u.ki.dwExtraInfo = inputs[0].u.ki.dwExtraInfo = 0;
1626  inputs[1].u.ki.time = inputs[0].u.ki.time = 0;
1627 
1628  /* Pressing a key */
1629  inputs[0].u.ki.wVk = 0x41;
1630  inputs[0].u.ki.wScan = 0x1e;
1631  inputs[0].u.ki.dwFlags = 0x0;
1632 
1633  pSendInput(1, (INPUT*)inputs, sizeof(INPUT));
1634 
1635  while(PeekMessageW(&msg, hWndTest, 0, 0, PM_NOREMOVE)) {
1636  if(msg.message != WM_KEYDOWN)
1637  PeekMessageW(&msg, hWndTest, 0, 0, PM_REMOVE);
1638  else
1639  {
1640  ok(msg.wParam != VK_PROCESSKEY,"Incorrect ProcessKey Found\n");
1641  PeekMessageW(&msg, hWndTest, 0, 0, PM_REMOVE);
1642  if(msg.wParam == VK_PROCESSKEY)
1643  trace("ProcessKey was correctly found\n");
1644  }
1647  }
1648 
1649  inputs[0].u.ki.wVk = 0x41;
1650  inputs[0].u.ki.wScan = 0x1e;
1651  inputs[0].u.ki.dwFlags = KEYEVENTF_KEYUP;
1652 
1653  pSendInput(1, (INPUT*)inputs, sizeof(INPUT));
1654 
1655  while(PeekMessageW(&msg, hWndTest, 0, 0, PM_NOREMOVE)) {
1656  if(msg.message != WM_KEYUP)
1657  PeekMessageW(&msg, hWndTest, 0, 0, PM_REMOVE);
1658  else
1659  {
1660  ok(msg.wParam != VK_PROCESSKEY,"Incorrect ProcessKey Found\n");
1661  PeekMessageW(&msg, hWndTest, 0, 0, PM_REMOVE);
1662  ok(msg.wParam != VK_PROCESSKEY,"ProcessKey should still not be Found\n");
1663  }
1666  }
1667 
1669  ImmSetOpenStatus(imc, FALSE);
1671 }
DWORD type
Definition: imm32.c:51
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define TRUE
Definition: types.h:120
#define VK_PROCESSKEY
Definition: winuser.h:2302
UINT style
Definition: winuser.h:3151
LPCWSTR lpszMenuName
Definition: winuser.h:3159
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define KEYEVENTF_KEYUP
Definition: winuser.h:1092
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
BOOL WINAPI UpdateWindow(_In_ HWND)
DWORD time
Definition: winable.h:50
#define CS_HREDRAW
Definition: winuser.h:648
#define HWND_TOPMOST
Definition: winuser.h:1194
int cbClsExtra
Definition: winuser.h:3153
HWND WINAPI SetFocus(_In_opt_ HWND)
#define IDI_APPLICATION
Definition: winuser.h:699
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4291
#define COLOR_WINDOW
Definition: winuser.h:908
int32_t INT
Definition: typedefs.h:56
#define PM_NOREMOVE
Definition: winuser.h:1181
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
HINSTANCE hInstance
Definition: charmap.c:20
#define INPUT_KEYBOARD
Definition: winable.h:10
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
WNDPROC lpfnWndProc
Definition: winuser.h:3152
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
#define WM_KEYDOWN
Definition: winuser.h:1697
LPCWSTR lpszClassName
Definition: winuser.h:3160
#define SW_SHOW
Definition: winuser.h:769
DWORD HIMC
Definition: dimm.idl:75
static HWND hWndTest
Definition: input.c:68
DWORD dwFlags
Definition: winable.h:49
#define CS_VREDRAW
Definition: winuser.h:653
static LRESULT CALLBACK processkey_wnd_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: imm32.c:1557
#define trace
Definition: atltest.h:70
int cbWndExtra
Definition: winuser.h:3154
__wchar_t WCHAR
Definition: xmlstorage.h:180
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1518
#define WM_KEYUP
Definition: winuser.h:1698
HICON hIcon
Definition: winuser.h:3156
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:2275
#define SWP_NOSIZE
Definition: winuser.h:1230
HCURSOR hCursor
Definition: winuser.h:3157
union TEST_INPUT::@1616 u
BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
Definition: imm.c:2593
WORD wScan
Definition: winable.h:48
HBRUSH hbrBackground
Definition: winuser.h:3158
#define ok(value,...)
Definition: atltest.h:57
HINSTANCE hInstance
Definition: winuser.h:3155
#define msg(x)
Definition: auth_time.c:54
#define IDC_ARROW
Definition: winuser.h:682
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
BOOL WINAPI SetForegroundWindow(_In_ HWND)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
ULONG_PTR dwExtraInfo
Definition: winable.h:51
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1182
KEYBDINPUT ki
Definition: imm32.c:55
#define win_skip
Definition: test.h:150
WORD wVk
Definition: winable.h:47
KEYBDINPUT ki
Definition: winable.h:62

Referenced by START_TEST().

◆ test_ime_wnd_proc()

static LRESULT WINAPI test_ime_wnd_proc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 364 of file imm32.c.

365 {
366  switch (msg)
367  {
368  case WM_IME_COMPOSITION:
369  if ((lParam & GCS_RESULTSTR) && !ime_composition_test.catch_result_str) {
370  HWND hwndIme;
371  WCHAR wstring[20];
372  HIMC imc;
373  LONG size;
374  LRESULT ret;
375 
376  hwndIme = ImmGetDefaultIMEWnd(hWnd);
377  ok(hwndIme != NULL, "expected IME window existence\n");
378 
379  ok(!ime_composition_test.catch_ime_char, "WM_IME_CHAR is sent\n");
381  hWnd, msg, wParam, lParam);
382  ok(ime_composition_test.catch_ime_char, "WM_IME_CHAR isn't sent\n");
383 
384  ime_composition_test.catch_ime_char = FALSE;
385  SendMessageA(hwndIme, msg, wParam, lParam);
386  ok(!ime_composition_test.catch_ime_char, "WM_IME_CHAR is sent\n");
387 
388  imc = ImmGetContext(hWnd);
390  wstring, sizeof(wstring));
391  ok(size > 0, "ImmGetCompositionString(GCS_RESULTSTR) is %d\n", size);
392  ImmReleaseContext(hwnd, imc);
393 
394  ime_composition_test.catch_result_str = TRUE;
395  return ret;
396  }
397  break;
398  case WM_IME_CHAR:
399  if (!ime_composition_test.catch_result_str)
400  ime_composition_test.catch_ime_char = TRUE;
401  break;
402  case WM_TIMER:
403  if (wParam == ime_composition_test.timer_id) {
405  char title[64];
406  int left = 20 - (GetTickCount() - ime_composition_test.start) / 1000;
407  wsprintfA(title, "%sLeft %d sec. - IME composition test",
408  ime_composition_test.catch_result_str ? "[*] " : "", left);
410  if (left <= 0)
412  else
413  SetTimer(hWnd, wParam, 100, NULL);
414  return TRUE;
415  }
416  break;
417  }
418  return CallWindowProcA(ime_composition_test.old_wnd_proc,
419  hWnd, msg, wParam, lParam);
420 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
static struct @1615 ime_composition_test
#define WM_IME_CHAR
Definition: winuser.h:1816
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND hWnd
Definition: settings.c:17
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
BOOL WINAPI DestroyWindow(_In_ HWND)
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: imm.c:1738
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define GCS_RESULTSTR
Definition: imm.h:366
DWORD HIMC
Definition: dimm.idl:75
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
GLsizeiptr size
Definition: glext.h:5919
r parent
Definition: btrfs.c:2869
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI SetWindowTextA(_In_ HWND, _In_opt_ LPCSTR)
LONG WINAPI ImmGetCompositionStringW(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
Definition: imm.c:1491
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1518
#define WM_TIMER
Definition: winuser.h:1724
GLint left
Definition: glext.h:7726
int ret
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:2275
HWND WINAPI GetParent(_In_ HWND)
int WINAPIV wsprintfA(_Out_ LPSTR, _In_ _Printf_format_string_ LPCSTR,...)
#define ok(value,...)
Definition: atltest.h:57
#define msg(x)
Definition: auth_time.c:54
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139
static char title[]
Definition: ps.c:92

Referenced by test_ImmGetCompositionString().

◆ test_ImmAssociateContextEx()

static void test_ImmAssociateContextEx ( void  )
static

Definition at line 617 of file imm32.c.

618 {
619  HIMC imc;
620  BOOL rc;
621 
622  if (!pImmAssociateContextEx) return;
623 
624  imc = ImmGetContext(hwnd);
625  if (imc)
626  {
627  HIMC retimc, newimc;
628 
629  newimc = ImmCreateContext();
630  ok(newimc != imc, "handles should not be the same\n");
631  rc = pImmAssociateContextEx(NULL, NULL, 0);
632  ok(!rc, "ImmAssociateContextEx succeeded\n");
633  rc = pImmAssociateContextEx(hwnd, NULL, 0);
634  ok(rc, "ImmAssociateContextEx failed\n");
635  rc = pImmAssociateContextEx(NULL, imc, 0);
636  ok(!rc, "ImmAssociateContextEx succeeded\n");
637 
638  rc = pImmAssociateContextEx(hwnd, imc, 0);
639  ok(rc, "ImmAssociateContextEx failed\n");
640  retimc = ImmGetContext(hwnd);
641  ok(retimc == imc, "handles should be the same\n");
642  ImmReleaseContext(hwnd,retimc);
643 
644  rc = pImmAssociateContextEx(hwnd, newimc, 0);
645  ok(rc, "ImmAssociateContextEx failed\n");
646  retimc = ImmGetContext(hwnd);
647  ok(retimc == newimc, "handles should be the same\n");
648  ImmReleaseContext(hwnd,retimc);
649 
650  rc = pImmAssociateContextEx(hwnd, NULL, IACE_DEFAULT);
651  ok(rc, "ImmAssociateContextEx failed\n");
652  }
653  ImmReleaseContext(hwnd,imc);
654 }
#define IACE_DEFAULT
Definition: imm.h:576
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
DWORD HIMC
Definition: dimm.idl:75
HIMC WINAPI ImmCreateContext(void)
Definition: imm.c:746
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1518
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:2275
#define ok(value,...)
Definition: atltest.h:57

Referenced by START_TEST().

◆ test_ImmDefaultHwnd()

static void test_ImmDefaultHwnd ( void  )
static

Definition at line 1047 of file imm32.c.

1048 {
1049  HIMC imc1, imc2, imc3;
1050  HWND def1, def3;
1051  HANDLE thread;
1052  HWND hwnd;
1053  char title[16];
1054  LONG style;
1055 
1056  hwnd = CreateWindowExA(WS_EX_CLIENTEDGE, "EDIT", "Wine imm32.dll test",
1058  240, 120, NULL, NULL, GetModuleHandleW(NULL), NULL);
1059 
1061 
1062  imc1 = ImmGetContext(hwnd);
1063  if (!imc1)
1064  {
1065  win_skip("IME support not implemented\n");
1066  return;
1067  }
1068 
1069  def1 = ImmGetDefaultIMEWnd(hwnd);
1070 
1071  GetWindowTextA(def1, title, sizeof(title));
1072  ok(!strcmp(title, "Default IME"), "got %s\n", title);
1073  style = GetWindowLongA(def1, GWL_STYLE);
1074  ok(style == (WS_DISABLED | WS_POPUP | WS_CLIPSIBLINGS), "got %08x\n", style);
1075  style = GetWindowLongA(def1, GWL_EXSTYLE);
1076  ok(style == 0, "got %08x\n", style);
1077 
1078  imc2 = ImmCreateContext();
1079  ImmSetOpenStatus(imc2, TRUE);
1080 
1081  imc3 = ImmGetContext(hwnd);
1082  def3 = ImmGetDefaultIMEWnd(hwnd);
1083 
1084  ok(def3 == def1, "Default IME window should not change\n");
1085  ok(imc1 == imc3, "IME context should not change\n");
1086  ImmSetOpenStatus(imc2, FALSE);
1087 
1090  ok(thread_ime_wnd != def1, "thread_ime_wnd == def1\n");
1091  ok(!IsWindow(thread_ime_wnd), "thread_ime_wnd was not destroyed\n");
1093 
1094  ImmReleaseContext(hwnd, imc1);
1095  ImmReleaseContext(hwnd, imc3);
1096  ImmDestroyContext(imc2);
1098 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_DISABLED
Definition: pedump.c:621
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
int WINAPI GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
Definition: window.c:1326
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define GWL_EXSTYLE
Definition: winuser.h:845
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI ImmDestroyContext(HIMC hIMC)
Definition: imm.c:832
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: imm.c:1738
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
long LONG
Definition: pedump.c:60
#define CW_USEDEFAULT
Definition: winuser.h:225
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
static HWND thread_ime_wnd
Definition: imm32.c:1036
DWORD HIMC
Definition: dimm.idl:75
HIMC WINAPI ImmCreateContext(void)
Definition: imm.c:746
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1518
static HANDLE thread
Definition: service.c:33
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:2275
#define GWL_STYLE
Definition: winuser.h:846
#define SW_SHOWNORMAL
Definition: winuser.h:764
BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
Definition: imm.c:2593
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define ok(value,...)
Definition: atltest.h:57
#define WS_POPUP
Definition: pedump.c:616
static HWND hwnd
Definition: imm32.c:175
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define INFINITE
Definition: serial.h:102
Arabic default style
Definition: afstyles.h:93
#define win_skip
Definition: test.h:150
static char title[]
Definition: ps.c:92
static DWORD WINAPI test_ImmGetDefaultIMEWnd_thread(void *arg)
Definition: imm32.c:1037

Referenced by START_TEST().

◆ test_ImmDestroyContext()

static void test_ImmDestroyContext ( void  )
static

Definition at line 1406 of file imm32.c.

1407 {
1408  HIMC imc;
1409  DWORD ret, count;
1410  INPUTCONTEXT *ic;
1411 
1412  imc = ImmCreateContext();
1413  count = ImmGetIMCLockCount(imc);
1414  ok(count == 0, "expect 0, returned %d\n", count);
1415  ic = ImmLockIMC(imc);
1416  ok(ic != NULL, "ImmLockIMC failed!\n");
1417  count = ImmGetIMCLockCount(imc);
1418  ok(count == 1, "expect 1, returned %d\n", count);
1419  ret = ImmDestroyContext(imc);
1420  ok(ret == TRUE, "Destroy a locked IMC should success!\n");
1421  ic = ImmLockIMC(imc);
1422  ok(ic == NULL, "Lock a destroyed IMC should fail!\n");
1423  ret = ImmUnlockIMC(imc);
1424  ok(ret == FALSE, "Unlock a destroyed IMC should fail!\n");
1425  count = ImmGetIMCLockCount(imc);
1426  ok(count == 0, "Get lock count of a destroyed IMC should return 0!\n");
1427  SetLastError(0xdeadbeef);
1428  ret = ImmDestroyContext(imc);
1429  ok(ret == FALSE, "Destroy a destroyed IMC should fail!\n");
1430  ret = GetLastError();
1431  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1432 }
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:2899
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
BOOL WINAPI ImmDestroyContext(HIMC hIMC)
Definition: imm.c:832
DWORD WINAPI ImmGetIMCLockCount(HIMC hIMC)
Definition: imm.c:2926
smooth NULL
Definition: ftsmooth.c:416
DWORD HIMC
Definition: dimm.idl:75
HIMC WINAPI ImmCreateContext(void)
Definition: imm.c:746
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
int ret
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:2912

Referenced by START_TEST().

◆ test_ImmDestroyIMCC()

static void test_ImmDestroyIMCC ( void  )
static

Definition at line 1434 of file imm32.c.

1435 {
1436  HIMCC imcc;
1437  DWORD ret, count, size;
1438  VOID *p;
1439 
1440  imcc = ImmCreateIMCC(sizeof(CANDIDATEINFO));
1441  count = ImmGetIMCCLockCount(imcc);
1442  ok(count == 0, "expect 0, returned %d\n", count);
1443  p = ImmLockIMCC(imcc);
1444  ok(p != NULL, "ImmLockIMCC failed!\n");
1445  count = ImmGetIMCCLockCount(imcc);
1446  ok(count == 1, "expect 1, returned %d\n", count);
1447  size = ImmGetIMCCSize(imcc);
1448  ok(size == sizeof(CANDIDATEINFO), "returned %d\n", size);
1449  p = ImmDestroyIMCC(imcc);
1450  ok(p == NULL, "Destroy a locked IMCC should success!\n");
1451  p = ImmLockIMCC(imcc);
1452  ok(p == NULL, "Lock a destroyed IMCC should fail!\n");
1453  ret = ImmUnlockIMCC(imcc);
1454  ok(ret == FALSE, "Unlock a destroyed IMCC should return FALSE!\n");
1455  count = ImmGetIMCCLockCount(imcc);
1456  ok(count == 0, "Get lock count of a destroyed IMCC should return 0!\n");
1457  size = ImmGetIMCCSize(imcc);
1458  ok(size == 0, "Get size of a destroyed IMCC should return 0!\n");
1459  SetLastError(0xdeadbeef);
1460  p = ImmDestroyIMCC(imcc);
1461  ok(p != NULL, "returned NULL\n");
1462  ret = GetLastError();
1463  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1464 }
DWORD HIMCC
Definition: dimm.idl:76
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
HIMCC WINAPI ImmDestroyIMCC(HIMCC block)
Definition: imm.c:2945
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD WINAPI ImmGetIMCCSize(HIMCC imcc)
Definition: imm.c:2985
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2953
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2961
int ret
#define ok(value,...)
Definition: atltest.h:57
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: imm.c:2937
DWORD WINAPI ImmGetIMCCLockCount(HIMCC imcc)
Definition: imm.c:2969
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by START_TEST().

◆ test_ImmGetCompositionString()

static void test_ImmGetCompositionString ( void  )
static

Definition at line 422 of file imm32.c.

423 {
424  HIMC imc;
425  static const WCHAR string[] = {'w','i','n','e',0x65e5,0x672c,0x8a9e};
426  char cstring[20];
427  WCHAR wstring[20];
428  LONG len;
429  LONG alen,wlen;
430  BOOL ret;
431  DWORD prop;
432 
433  imc = ImmGetContext(hwnd);
434  ret = ImmSetCompositionStringW(imc, SCS_SETSTR, string, sizeof(string), NULL,0);
435  if (!ret) {
436  win_skip("Composition isn't supported\n");
437  ImmReleaseContext(hwnd, imc);
438  return;
439  }
441 
442  alen = ImmGetCompositionStringA(imc, GCS_COMPSTR, cstring, 20);
443  wlen = ImmGetCompositionStringW(imc, GCS_COMPSTR, wstring, 20);
444  /* windows machines without any IME installed just return 0 above */
445  if( alen && wlen)
446  {
448  ok(len*sizeof(WCHAR)==wlen,"GCS_COMPATTR(W) not returning correct count\n");
450  ok(len==alen,"GCS_COMPATTR(A) not returning correct count\n");
451 
452  /* Get strings with exactly matching buffer sizes. */
453  memset(wstring, 0x1a, sizeof(wstring));
454  memset(cstring, 0x1a, sizeof(cstring));
455 
456  len = ImmGetCompositionStringA(imc, GCS_COMPSTR, cstring, alen);
457  ok(len == alen, "Unexpected length %d.\n", len);
458  ok(cstring[alen] == 0x1a, "Unexpected buffer contents.\n");
459 
460  len = ImmGetCompositionStringW(imc, GCS_COMPSTR, wstring, wlen);
461  ok(len == wlen, "Unexpected length %d.\n", len);
462  ok(wstring[wlen/sizeof(WCHAR)] == 0x1a1a, "Unexpected buffer contents.\n");
463 
464  /* Get strings with exactly smaller buffer sizes. */
465  memset(wstring, 0x1a, sizeof(wstring));
466  memset(cstring, 0x1a, sizeof(cstring));
467 
468  /* Returns 0 but still fills buffer. */
469  len = ImmGetCompositionStringA(imc, GCS_COMPSTR, cstring, alen - 1);
470  ok(!len, "Unexpected length %d.\n", len);
471  ok(cstring[0] == 'w', "Unexpected buffer contents %s.\n", cstring);
472 
473  len = ImmGetCompositionStringW(imc, GCS_COMPSTR, wstring, wlen - 1);
474  ok(len == wlen - 1, "Unexpected length %d.\n", len);
475  ok(!memcmp(wstring, string, wlen - 1), "Unexpected buffer contents.\n");
476 
477  /* Get the size of the required output buffer. */
478  memset(wstring, 0x1a, sizeof(wstring));
479  memset(cstring, 0x1a, sizeof(cstring));
480 
481  len = ImmGetCompositionStringA(imc, GCS_COMPSTR, cstring, 0);
482  ok(len == alen, "Unexpected length %d.\n", len);
483  ok(cstring[0] == 0x1a, "Unexpected buffer contents %s.\n", cstring);
484 
485  len = ImmGetCompositionStringW(imc, GCS_COMPSTR, wstring, 0);
486  ok(len == wlen, "Unexpected length %d.\n", len);
487  ok(wstring[0] == 0x1a1a, "Unexpected buffer contents.\n");
488  }
489  else
490  win_skip("Composition string isn't available\n");
491 
492  ImmReleaseContext(hwnd, imc);
493 
494  /* Test composition results input by IMM API */
496  if (!(prop & SCS_CAP_COMPSTR)) {
497  /* Wine's IME doesn't support SCS_SETSTR in ImmSetCompositionString */
498  skip("This IME doesn't support SCS_SETSTR\n");
499  }
500  else {
501  ime_composition_test.old_wnd_proc =
504  imc = ImmGetContext(hwnd);
506 
508  string, sizeof(string), NULL,0);
509  ok(ret, "ImmSetCompositionStringW failed\n");
511  wstring, sizeof(wstring));
512  if (wlen > 0) {
514  ok(ret, "ImmNotifyIME(CPS_COMPLETE) failed\n");
516  ok(ime_composition_test.catch_result_str,
517  "WM_IME_COMPOSITION(GCS_RESULTSTR) isn't sent\n");
518  }
519  else
520  win_skip("Composition string isn't available\n");
521  ImmReleaseContext(hwnd, imc);
523  (LONG_PTR)ime_composition_test.old_wnd_proc);
525  }
526 
527  /* Test composition results input by hand */
529  if (winetest_interactive) {
530  HWND hwndMain, hwndChild;
531  MSG msg;
532  const DWORD MY_TIMER = 0xcaffe;
533 
535  "IME composition test",
537  CW_USEDEFAULT, CW_USEDEFAULT, 320, 160,
539  hwndChild = CreateWindowExA(0, "static",
540  "Input a DBCS character here using IME.",
542  0, 0, 320, 100, hwndMain, NULL,
544 
545  ime_composition_test.old_wnd_proc =
548 
549  SetFocus(hwndChild);
550 
551  ime_composition_test.timer_id = MY_TIMER;
553  SetTimer(hwndChild, ime_composition_test.timer_id, 100, NULL);
554  while (GetMessageA(&msg, NULL, 0, 0)) {
557  if (!IsWindow(hwndMain))
558  break;
559  }
560  if (!ime_composition_test.catch_result_str)
561  skip("WM_IME_COMPOSITION(GCS_RESULTSTR) isn't tested\n");
563  }
564 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI TranslateMessage(_In_ const MSG *)
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
static struct @1615 ime_composition_test
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define CPS_COMPLETE
Definition: imm.h:304
#define SCS_SETSTR
Definition: imm.h:447
BOOL WINAPI IsWindow(_In_opt_ HWND)
HWND hwndMain
Definition: solitaire.cpp:12
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
HWND WINAPI SetFocus(_In_opt_ HWND)
#define WS_CHILD
Definition: pedump.c:617
int winetest_interactive
LONG WINAPI ImmGetCompositionStringA(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
Definition: imm.c:1481
#define SCS_CAP_COMPSTR
Definition: imm.h:395
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
static void msg_spy_flush_msgs(void)
Definition: imm32.c:117
static const char wndcls[]
Definition: imm32.c:172
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
DWORD HIMC
Definition: dimm.idl:75
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define IGP_SETCOMPSTR
Definition: imm.h:442
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG WINAPI ImmGetCompositionStringW(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
Definition: imm.c:1491
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1518
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI ImmSetCompositionStringW(HIMC hIMC, DWORD dwIndex, LPCVOID lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen)
Definition: imm.c:2455
int ret
static LRESULT WINAPI test_ime_wnd_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: imm32.c:364
GLenum GLsizei len
Definition: glext.h:6722
#define SetWindowLongPtrA
Definition: winuser.h:5320
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
#define GCS_COMPATTR
Definition: imm.h:360
#define GWLP_WNDPROC
Definition: treelist.c:66
DWORD WINAPI ImmGetProperty(HKL hKL, DWORD fdwIndex)
Definition: imm.c:1927
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:2275
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define ok(value,...)
Definition: atltest.h:57
PKEYBOARD_LAYOUT GetKeyboardLayout()
Definition: utils.c:194
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define skip(...)
Definition: atltest.h:64
#define msg(x)
Definition: auth_time.c:54
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
BOOL WINAPI ImmNotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
Definition: imm.c:2190
#define NI_COMPOSITIONSTR
Definition: imm.h:290
#define WS_VISIBLE
Definition: pedump.c:620
#define memset(x, y, z)
Definition: compat.h:39
#define GCS_COMPSTR
Definition: imm.h:359
#define win_skip
Definition: test.h:150

Referenced by START_TEST().

◆ test_ImmGetContext()

static void test_ImmGetContext ( void  )
static

Definition at line 958 of file imm32.c.

959 {
960  HIMC himc;
961  DWORD err;
962 
963  SetLastError(0xdeadbeef);
964  himc = ImmGetContext((HWND)0xffffffff);
965  err = GetLastError();
966  ok(himc == NULL, "ImmGetContext succeeded\n");
967  ok(err == ERROR_INVALID_WINDOW_HANDLE, "got %u\n", err);
968 
969  himc = ImmGetContext(hwnd);
970  ok(himc != NULL, "ImmGetContext failed\n");
971  ok(ImmReleaseContext(hwnd, himc), "ImmReleaseContext failed\n");
972 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
smooth NULL
Definition: ftsmooth.c:416
DWORD HIMC
Definition: dimm.idl:75
#define ERROR_INVALID_WINDOW_HANDLE
Definition: winerror.h:881
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1518
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
#define err(...)
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:2275
#define ok(value,...)
Definition: atltest.h:57

Referenced by START_TEST().

◆ test_ImmGetDefaultIMEWnd_thread()

static DWORD WINAPI test_ImmGetDefaultIMEWnd_thread ( void arg)
static

Definition at line 1037 of file imm32.c.

1038 {
1039  CreateWindowA("static", "static", WS_POPUP, 0, 0, 1, 1, NULL, NULL, NULL, NULL);
1040 
1042  ok(thread_ime_wnd != 0, "ImmGetDefaultIMEWnd returned NULL\n");
1043  old_imm_wnd_proc = (void*)SetWindowLongPtrW(thread_ime_wnd, GWLP_WNDPROC, (LONG_PTR)imm_wnd_proc);
1044  return 0;
1045 }
static LRESULT WINAPI imm_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: imm32.c:1030
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: imm.c:1738
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4290
smooth NULL
Definition: ftsmooth.c:416
static HWND thread_ime_wnd
Definition: imm32.c:1036
#define GWLP_WNDPROC
Definition: treelist.c:66
#define ok(value,...)
Definition: atltest.h:57
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WS_POPUP
Definition: pedump.c:616
#define SetWindowLongPtrW
Definition: winuser.h:5321

Referenced by test_ImmDefaultHwnd().

◆ test_ImmGetDescription()

static void test_ImmGetDescription ( void  )
static

Definition at line 974 of file imm32.c.

975 {
976  HKL hkl;
977  WCHAR descW[100];
978  CHAR descA[100];
979  UINT ret, lret;
980 
981  /* FIXME: invalid keyboard layouts should not pass */
983  ok(!ret, "ImmGetDescriptionW failed, expected 0 received %d.\n", ret);
985  ok(!ret, "ImmGetDescriptionA failed, expected 0 received %d.\n", ret);
986 
987  /* load a language with valid IMM descriptions */
988  hkl = GetKeyboardLayout(0);
989  ok(hkl != 0, "GetKeyboardLayout failed, expected != 0.\n");
990 
992  if(!ret)
993  {
994  win_skip("ImmGetDescriptionW is not working for current loaded keyboard.\n");
995  return;
996  }
997 
998  SetLastError(0xdeadcafe);
999  ret = ImmGetDescriptionW(0, NULL, 100);
1000  ok (ret == 0, "ImmGetDescriptionW with 0 hkl should return 0\n");
1001  ret = GetLastError();
1002  ok (ret == 0xdeadcafe, "Last Error should remain unchanged\n");
1003 
1004  ret = ImmGetDescriptionW(hkl, descW, 0);
1005  ok(ret, "ImmGetDescriptionW failed, expected != 0 received 0.\n");
1006 
1007  lret = ImmGetDescriptionW(hkl, descW, ret + 1);
1008  ok(lret, "ImmGetDescriptionW failed, expected != 0 received 0.\n");
1009  ok(lret == ret, "ImmGetDescriptionW failed to return the correct amount of data. Expected %d, got %d.\n", ret, lret);
1010 
1011  lret = ImmGetDescriptionA(hkl, descA, ret + 1);
1012  ok(lret, "ImmGetDescriptionA failed, expected != 0 received 0.\n");
1013  ok(lret == ret, "ImmGetDescriptionA failed to return the correct amount of data. Expected %d, got %d.\n", ret, lret);
1014 
1015  ret /= 2; /* try to copy partially */
1016  lret = ImmGetDescriptionW(hkl, descW, ret + 1);
1017  ok(lret, "ImmGetDescriptionW failed, expected != 0 received 0.\n");
1018  ok(lret == ret, "ImmGetDescriptionW failed to return the correct amount of data. Expected %d, got %d.\n", ret, lret);
1019 
1020  lret = ImmGetDescriptionA(hkl, descA, ret + 1);
1021  ok(!lret, "ImmGetDescriptionA should fail\n");
1022 
1023  ret = ImmGetDescriptionW(hkl, descW, 1);
1024  ok(!ret, "ImmGetDescriptionW failed, expected 0 received %d.\n", ret);
1025 
1027 }
char CHAR
Definition: xmlstorage.h:175
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
UINT WINAPI ImmGetDescriptionA(HKL hKL, LPSTR lpszDescription, UINT uBufLen)
Definition: imm.c:1753
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI UnloadKeyboardLayout(_In_ HKL)
#define SetLastError(x)
Definition: compat.h:417
int ret
UINT_PTR HKL
Definition: msctf.idl:101
HKL hkl
Definition: msctf.idl:611
UINT WINAPI ImmGetDescriptionW(HKL hKL, LPWSTR lpszDescription, UINT uBufLen)
Definition: imm.c:1789
#define ok(value,...)
Definition: atltest.h:57
PKEYBOARD_LAYOUT GetKeyboardLayout()
Definition: utils.c:194
unsigned int UINT
Definition: ndis.h:50
#define win_skip
Definition: test.h:150

Referenced by START_TEST().

◆ test_ImmGetIMCCLockCount()

static void test_ImmGetIMCCLockCount ( void  )
static

Definition at line 1360 of file imm32.c.

1361 {
1362  HIMCC imcc;
1363  DWORD count, g_count, i;
1364  BOOL ret;
1365  VOID *p;
1366 
1367  imcc = ImmCreateIMCC(sizeof(CANDIDATEINFO));
1368  count = ImmGetIMCCLockCount(imcc);
1369  ok(count == 0, "expect 0, returned %d\n", count);
1370  ImmLockIMCC(imcc);
1371  count = ImmGetIMCCLockCount(imcc);
1372  ok(count == 1, "expect 1, returned %d\n", count);
1373  ret = ImmUnlockIMCC(imcc);
1374  ok(ret == FALSE, "expect FALSE, ret %d\n", ret);
1375  count = ImmGetIMCCLockCount(imcc);
1376  ok(count == 0, "expect 0, returned %d\n", count);
1377  ret = ImmUnlockIMCC(imcc);
1378  ok(ret == FALSE, "expect FALSE, ret %d\n", ret);
1379  count = ImmGetIMCCLockCount(imcc);
1380  ok(count == 0, "expect 0, returned %d\n", count);
1381 
1382  p = ImmLockIMCC(imcc);
1383  ok(GlobalHandle(p) == imcc, "expect %p, returned %p\n", imcc, GlobalHandle(p));
1384 
1385  for (i = 0; i < GMEM_LOCKCOUNT * 2; i++)
1386  {
1387  ImmLockIMCC(imcc);
1388  count = ImmGetIMCCLockCount(imcc);
1389  g_count = GlobalFlags(imcc) & GMEM_LOCKCOUNT;
1390  ok(count == g_count, "count %d, g_count %d\n", count, g_count);
1391  }
1392  count = ImmGetIMCCLockCount(imcc);
1393  ok(count == GMEM_LOCKCOUNT, "expect GMEM_LOCKCOUNT, returned %d\n", count);
1394 
1395  for (i = 0; i < GMEM_LOCKCOUNT - 1; i++)
1396  GlobalUnlock(imcc);
1397  count = ImmGetIMCCLockCount(imcc);
1398  ok(count == 1, "expect 1, returned %d\n", count);
1399  GlobalUnlock(imcc);
1400  count = ImmGetIMCCLockCount(imcc);
1401  ok(count == 0, "expect 0, returned %d\n", count);
1402 
1403  ImmDestroyIMCC(imcc);
1404 }
DWORD HIMCC
Definition: dimm.idl:76
GLuint GLuint GLsizei count
Definition: gl.h:1545
UINT NTAPI GlobalFlags(HGLOBAL hMem)
Definition: heapmem.c:520
HIMCC WINAPI ImmDestroyIMCC(HIMCC block)
Definition: imm.c:2945
HGLOBAL NTAPI GlobalHandle(LPCVOID pMem)
Definition: heapmem.c:705
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2953
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2961
int ret
#define ok(value,...)
Definition: atltest.h:57
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: imm.c:2937
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
DWORD WINAPI ImmGetIMCCLockCount(HIMCC imcc)
Definition: imm.c:2969
GLfloat GLfloat p
Definition: glext.h:8902
#define GMEM_LOCKCOUNT
Definition: winbase.h:306

Referenced by START_TEST().

◆ test_ImmGetIMCLockCount()

static void test_ImmGetIMCLockCount ( void  )
static

Definition at line 1302 of file imm32.c.

1303 {
1304  HIMC imc;
1305  DWORD count, ret, i;
1306  INPUTCONTEXT *ic;
1307 
1308  imc = ImmCreateContext();
1309  ImmDestroyContext(imc);
1310  SetLastError(0xdeadbeef);
1311  count = ImmGetIMCLockCount((HIMC)0xdeadcafe);
1312  ok(count == 0, "Invalid IMC should return 0\n");
1313  ret = GetLastError();
1314  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1315  SetLastError(0xdeadbeef);
1316  count = ImmGetIMCLockCount(0x00000000);
1317  ok(count == 0, "NULL IMC should return 0\n");
1318  ret = GetLastError();
1319  ok(ret == 0xdeadbeef, "Last Error should remain unchanged: %08x\n",ret);
1320  count = ImmGetIMCLockCount(imc);
1321  ok(count == 0, "Destroyed IMC should return 0\n");
1322  ret = GetLastError();
1323  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1324 
1325  imc = ImmCreateContext();
1326  count = ImmGetIMCLockCount(imc);
1327  ok(count == 0, "expect 0, returned %d\n", count);
1328  ic = ImmLockIMC(imc);
1329  ok(ic != NULL, "ImmLockIMC failed!\n");
1330  count = ImmGetIMCLockCount(imc);
1331  ok(count == 1, "expect 1, returned %d\n", count);
1332  ret = ImmUnlockIMC(imc);
1333  ok(ret == TRUE, "expect TRUE, ret %d\n", ret);
1334  count = ImmGetIMCLockCount(imc);
1335  ok(count == 0, "expect 0, returned %d\n", count);
1336  ret = ImmUnlockIMC(imc);
1337  ok(ret == TRUE, "expect TRUE, ret %d\n", ret);
1338  count = ImmGetIMCLockCount(imc);
1339  ok(count == 0, "expect 0, returned %d\n", count);
1340 
1341  for (i = 0; i < GMEM_LOCKCOUNT * 2; i++)
1342  {
1343  ic = ImmLockIMC(imc);
1344  ok(ic != NULL, "ImmLockIMC failed!\n");
1345  }
1346  count = ImmGetIMCLockCount(imc);
1347  todo_wine ok(count == GMEM_LOCKCOUNT, "expect GMEM_LOCKCOUNT, returned %d\n", count);
1348 
1349  for (i = 0; i < GMEM_LOCKCOUNT - 1; i++)
1350  ImmUnlockIMC(imc);
1351  count = ImmGetIMCLockCount(imc);
1352  todo_wine ok(count == 1, "expect 1, returned %d\n", count);
1353  ImmUnlockIMC(imc);
1354  count = ImmGetIMCLockCount(imc);
1355  todo_wine ok(count == 0, "expect 0, returned %d\n", count);
1356 
1357  ImmDestroyContext(imc);
1358 }
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:2899
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
BOOL WINAPI ImmDestroyContext(HIMC hIMC)
Definition: imm.c:832
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
DWORD WINAPI ImmGetIMCLockCount(HIMC hIMC)
Definition: imm.c:2926
smooth NULL
Definition: ftsmooth.c:416
DWORD HIMC
Definition: dimm.idl:75
HIMC WINAPI ImmCreateContext(void)
Definition: imm.c:746
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
int ret
#define todo_wine
Definition: test.h:163
#define ok(value,...)
Definition: atltest.h:57
#define GMEM_LOCKCOUNT
Definition: winbase.h:306
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:2912

Referenced by START_TEST().

◆ test_ImmIME()

static void test_ImmIME ( void  )
static

Definition at line 601 of file imm32.c.

602 {
603  HIMC imc;
604 
605  imc = ImmGetContext(hwnd);
606  if (imc)
607  {
608  BOOL rc;
610  ok (rc == 0, "ImmConfigureIMEA did not fail\n");
612  ok (rc == 0, "ImmConfigureIMEW did not fail\n");
613  }
614  ImmReleaseContext(hwnd,imc);
615 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI ImmConfigureIMEW(HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
Definition: imm.c:711
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
DWORD HIMC
Definition: dimm.idl:75
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1518
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:2275
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI ImmConfigureIMEA(HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
Definition: imm.c:676
#define IME_CONFIG_REGISTERWORD
Definition: imm.h:547

Referenced by START_TEST().

◆ test_ImmIsUIMessage()

static void test_ImmIsUIMessage ( void  )
static

Definition at line 887 of file imm32.c.

888 {
889  struct test
890  {
891  UINT msg;
892  BOOL ret;
893  };
894 
895  static const struct test tests[] =
896  {
897  { WM_MOUSEMOVE, FALSE },
898  { WM_IME_STARTCOMPOSITION, TRUE },
899  { WM_IME_ENDCOMPOSITION, TRUE },
900  { WM_IME_COMPOSITION, TRUE },
901  { WM_IME_SETCONTEXT, TRUE },
902  { WM_IME_NOTIFY, TRUE },
903  { WM_IME_CONTROL, FALSE },
905  { WM_IME_SELECT, TRUE },
906  { WM_IME_CHAR, FALSE },
907  { 0x287 /* FIXME */, TRUE },
908  { WM_IME_REQUEST, FALSE },
909  { WM_IME_KEYDOWN, FALSE },
910  { WM_IME_KEYUP, FALSE },
911  { 0, FALSE } /* mark the end */
912  };
913 
914  UINT WM_MSIME_SERVICE = RegisterWindowMessageA("MSIMEService");
915  UINT WM_MSIME_RECONVERTOPTIONS = RegisterWindowMessageA("MSIMEReconvertOptions");
916  UINT WM_MSIME_MOUSE = RegisterWindowMessageA("MSIMEMouseOperation");
917  UINT WM_MSIME_RECONVERTREQUEST = RegisterWindowMessageA("MSIMEReconvertRequest");
918  UINT WM_MSIME_RECONVERT = RegisterWindowMessageA("MSIMEReconvert");
919  UINT WM_MSIME_QUERYPOSITION = RegisterWindowMessageA("MSIMEQueryPosition");
920  UINT WM_MSIME_DOCUMENTFEED = RegisterWindowMessageA("MSIMEDocumentFeed");
921 
922  const struct test *test;
923  BOOL ret;
924 
925  if (!pImmIsUIMessageA) return;
926 
927  for (test = tests; test->msg; test++)
928  {
930  ret = pImmIsUIMessageA(NULL, test->msg, 0, 0);
931  ok(ret == test->ret, "ImmIsUIMessageA returned %x for %x\n", ret, test->msg);
932  ok(!msg_spy_find_msg(test->msg), "Windows does not send 0x%x for NULL hwnd\n", test->msg);
933 
934  ret = pImmIsUIMessageA(hwnd, test->msg, 0, 0);
935  ok(ret == test->ret, "ImmIsUIMessageA returned %x for %x\n", ret, test->msg);
936  if (ret)
937  ok(msg_spy_find_msg(test->msg) != NULL, "Windows does send 0x%x\n", test->msg);
938  else
939  ok(!msg_spy_find_msg(test->msg), "Windows does not send 0x%x\n", test->msg);
940  }
941 
942  ret = pImmIsUIMessageA(NULL, WM_MSIME_SERVICE, 0, 0);
943  ok(!ret, "ImmIsUIMessageA returned TRUE for WM_MSIME_SERVICE\n");
944  ret = pImmIsUIMessageA(NULL, WM_MSIME_RECONVERTOPTIONS, 0, 0);
945  ok(!ret, "ImmIsUIMessageA returned TRUE for WM_MSIME_RECONVERTOPTIONS\n");
946  ret = pImmIsUIMessageA(NULL, WM_MSIME_MOUSE, 0, 0);
947  ok(!ret, "ImmIsUIMessageA returned TRUE for WM_MSIME_MOUSE\n");
948  ret = pImmIsUIMessageA(NULL, WM_MSIME_RECONVERTREQUEST, 0, 0);
949  ok(!ret, "ImmIsUIMessageA returned TRUE for WM_MSIME_RECONVERTREQUEST\n");
950  ret = pImmIsUIMessageA(NULL, WM_MSIME_RECONVERT, 0, 0);
951  ok(!ret, "ImmIsUIMessageA returned TRUE for WM_MSIME_RECONVERT\n");
952  ret = pImmIsUIMessageA(NULL, WM_MSIME_QUERYPOSITION, 0, 0);
953  ok(!ret, "ImmIsUIMessageA returned TRUE for WM_MSIME_QUERYPOSITION\n");
954  ret = pImmIsUIMessageA(NULL, WM_MSIME_DOCUMENTFEED, 0, 0);
955  ok(!ret, "ImmIsUIMessageA returned TRUE for WM_MSIME_DOCUMENTFEED\n");
956 }
#define WM_IME_KEYUP
Definition: winuser.h:1821
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define WM_IME_NOTIFY
Definition: winuser.h:1812
struct param_test tests[]
#define TRUE
Definition: types.h:120
#define WM_IME_KEYDOWN
Definition: winuser.h:1820
#define WM_IME_CHAR
Definition: winuser.h:1816
#define WM_IME_SELECT
Definition: winuser.h:1815
#define test
Definition: rosglue.h:37
#define WM_IME_COMPOSITIONFULL
Definition: winuser.h:1814
unsigned int BOOL
Definition: ntddk_ex.h:94
static void msg_spy_flush_msgs(void)
Definition: imm32.c:117
static imm_msgs * msg_spy_find_msg(UINT message)
Definition: imm32.c:141
smooth NULL
Definition: ftsmooth.c:416
#define WM_IME_REQUEST
Definition: winuser.h:1818
#define WM_IME_SETCONTEXT
Definition: winuser.h:1811
#define WM_IME_CONTROL
Definition: winuser.h:1813
int ret
#define ok(value,...)
Definition: atltest.h:57
unsigned int UINT
Definition: ndis.h:50
#define WM_MOUSEMOVE
Definition: winuser.h:1757
#define msg(x)
Definition: auth_time.c:54
UINT WINAPI RegisterWindowMessageA(_In_ LPCSTR)

Referenced by START_TEST().

◆ test_ImmMessages()

static void test_ImmMessages ( void  )
static

Definition at line 1466 of file imm32.c.

1467 {
1468  CANDIDATEFORM cf;
1469  imm_msgs *msg;
1470  HWND defwnd;
1471  HIMC imc;
1472  UINT idx = 0;
1473 
1474  LPINPUTCONTEXT lpIMC;
1475  LPTRANSMSG lpTransMsg;
1476 
1477  HWND hwnd = CreateWindowExA(WS_EX_CLIENTEDGE, "EDIT", "Wine imm32.dll test",
1479  240, 120, NULL, NULL, GetModuleHandleA(NULL), NULL);
1480 
1482  defwnd = ImmGetDefaultIMEWnd(hwnd);
1483  imc = ImmGetContext(hwnd);
1484 
1485  ImmSetOpenStatus(imc, TRUE);
1488  do
1489  {
1491  if (msg) ok(!msg->post, "Message should not be posted\n");
1492  } while (msg);
1494 
1495  lpIMC = ImmLockIMC(imc);
1496  lpIMC->hMsgBuf = ImmReSizeIMCC(lpIMC->hMsgBuf, (lpIMC->dwNumMsgBuf + 1) * sizeof(TRANSMSG));
1497  lpTransMsg = ImmLockIMCC(lpIMC->hMsgBuf);
1498  lpTransMsg += lpIMC->dwNumMsgBuf;
1499  lpTransMsg->message = WM_IME_STARTCOMPOSITION;
1500  lpTransMsg->wParam = 0;
1501  lpTransMsg->lParam = 0;
1502  ImmUnlockIMCC(lpIMC->hMsgBuf);
1503  lpIMC->dwNumMsgBuf++;
1504  ImmUnlockIMC(imc);
1505  ImmGenerateMessage(imc);
1506  idx = 0;
1507  do
1508  {
1509  msg = msg_spy_find_next_msg(WM_IME_STARTCOMPOSITION, &idx);
1510  if (msg) ok(!msg->post, "Message should not be posted\n");
1511  } while (msg);
1513 
1514  lpIMC = ImmLockIMC(imc);
1515  lpIMC->hMsgBuf = ImmReSizeIMCC(lpIMC->hMsgBuf, (lpIMC->dwNumMsgBuf + 1) * sizeof(TRANSMSG));
1516  lpTransMsg = ImmLockIMCC(lpIMC->hMsgBuf);
1517  lpTransMsg += lpIMC->dwNumMsgBuf;
1518  lpTransMsg->message = WM_IME_COMPOSITION;
1519  lpTransMsg->wParam = 0;
1520  lpTransMsg->lParam = 0;
1521  ImmUnlockIMCC(lpIMC->hMsgBuf);
1522  lpIMC->dwNumMsgBuf++;
1523  ImmUnlockIMC(imc);
1524  ImmGenerateMessage(imc);
1525  idx = 0;
1526  do
1527  {
1528  msg = msg_spy_find_next_msg(WM_IME_COMPOSITION, &idx);
1529  if (msg) ok(!msg->post, "Message should not be posted\n");
1530  } while (msg);
1532 
1533  lpIMC = ImmLockIMC(imc);
1534  lpIMC->hMsgBuf = ImmReSizeIMCC(lpIMC->hMsgBuf, (lpIMC->dwNumMsgBuf + 1) * sizeof(TRANSMSG));
1535  lpTransMsg = ImmLockIMCC(lpIMC->hMsgBuf);
1536  lpTransMsg += lpIMC->dwNumMsgBuf;
1537  lpTransMsg->message = WM_IME_ENDCOMPOSITION;
1538  lpTransMsg->wParam = 0;
1539  lpTransMsg->lParam = 0;
1540  ImmUnlockIMCC(lpIMC->hMsgBuf);
1541  lpIMC->dwNumMsgBuf++;
1542  ImmUnlockIMC(imc);
1543  ImmGenerateMessage(imc);
1544  idx = 0;
1545  do
1546  {
1547  msg = msg_spy_find_next_msg(WM_IME_ENDCOMPOSITION, &idx);
1548  if (msg) ok(!msg->post, "Message should not be posted\n");
1549  } while (msg);
1551 
1552  ImmSetOpenStatus(imc, FALSE);
1553  ImmReleaseContext(hwnd, imc);
1555 }
static IClassFactory * cf
#define IMC_GETCANDIDATEPOS
Definition: imm.h:270
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
LPARAM lParam
Definition: imm.c:87
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:2899
Definition: imm32.c:36
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
UINT message
Definition: imm.c:85
BOOL WINAPI DestroyWindow(_In_ HWND)
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: imm.c:1738
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2953
static void msg_spy_flush_msgs(void)
Definition: imm32.c:117
unsigned int idx
Definition: utils.c:41
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
DWORD HIMC
Definition: dimm.idl:75
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1518
#define WM_IME_CONTROL
Definition: winuser.h:1813
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2961
HIMCC hMsgBuf
Definition: imm.h:45
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:2275
#define SW_SHOWNORMAL
Definition: winuser.h:764
WPARAM wParam
Definition: imm.c:86
BOOL WINAPI ImmGenerateMessage(HIMC hIMC)
Definition: imm.c:2993
BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
Definition: imm.c:2593
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
static imm_msgs * msg_spy_find_next_msg(UINT message, UINT *start)
Definition: imm32.c:122
#define ok(value,...)
Definition: atltest.h:57
DWORD dwNumMsgBuf
Definition: imm.h:44
unsigned int UINT
Definition: ndis.h:50
#define msg(x)
Definition: auth_time.c:54
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
HIMCC WINAPI ImmReSizeIMCC(HIMCC imcc, DWORD size)
Definition: imm.c:2977
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:2912

Referenced by START_TEST().

◆ test_ImmNotifyIME()

static void test_ImmNotifyIME ( void  )
static

Definition at line 295 of file imm32.c.

295  {
296  static const char string[] = "wine";
297  char resstr[16] = "";
298  HIMC imc;
299  BOOL ret;
300 
301  imc = ImmGetContext(hwnd);
303 
305  ok(broken(!ret) ||
306  ret, /* Vista+ */
307  "Canceling an empty composition string should succeed.\n");
308  ok(!msg_spy_find_msg(WM_IME_COMPOSITION), "Windows does not post "
309  "WM_IME_COMPOSITION in response to NI_COMPOSITIONSTR / CPS_CANCEL, if "
310  "the composition string being canceled is empty.\n");
311 
312  ImmSetCompositionStringA(imc, SCS_SETSTR, string, sizeof(string), NULL, 0);
314 
317 
318  /* behavior differs between win9x and NT */
319  ret = ImmGetCompositionStringA(imc, GCS_COMPSTR, resstr, sizeof(resstr));
320  ok(!ret, "After being cancelled the composition string is empty.\n");
321 
323 
325  ok(broken(!ret) ||
326  ret, /* Vista+ */
327  "Canceling an empty composition string should succeed.\n");
328  ok(!msg_spy_find_msg(WM_IME_COMPOSITION), "Windows does not post "
329  "WM_IME_COMPOSITION in response to NI_COMPOSITIONSTR / CPS_CANCEL, if "
330  "the composition string being canceled is empty.\n");
331 
333  ImmReleaseContext(hwnd, imc);
334 
335  imc = ImmCreateContext();
336  ImmDestroyContext(imc);
337 
338  SetLastError(0xdeadbeef);
339  ret = ImmNotifyIME((HIMC)0xdeadcafe, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
340  ok (ret == 0, "Bad IME should return 0\n");
341  ret = GetLastError();
342  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
343  SetLastError(0xdeadbeef);
344  ret = ImmNotifyIME(0x00000000, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
345  ok (ret == 0, "NULL IME should return 0\n");
346  ret = GetLastError();
347  ok(ret == ERROR_SUCCESS, "wrong last error %08x!\n", ret);
348  SetLastError(0xdeadbeef);
350  ok (ret == 0, "Destroyed IME should return 0\n");
351  ret = GetLastError();
352  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
353 
354 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ERROR_SUCCESS
Definition: deptool.c:10
#define SCS_SETSTR
Definition: imm.h:447
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
LONG WINAPI ImmGetCompositionStringA(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
Definition: imm.c:1481
BOOL WINAPI ImmDestroyContext(HIMC hIMC)
Definition: imm.c:832
unsigned int BOOL
Definition: ntddk_ex.h:94
static void msg_spy_flush_msgs(void)
Definition: imm32.c:117
static imm_msgs * msg_spy_find_msg(UINT message)
Definition: imm32.c:141
smooth NULL
Definition: ftsmooth.c:416
DWORD HIMC
Definition: dimm.idl:75
HIMC WINAPI ImmCreateContext(void)
Definition: imm.c:746
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1518
#define SetLastError(x)
Definition: compat.h:417
int ret
#define CPS_CANCEL
Definition: imm.h:307
#define broken(x)
Definition: _sntprintf.h:21
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:2275
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI ImmSetCompositionStringA(HIMC hIMC, DWORD dwIndex, LPCVOID lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen)
Definition: imm.c:2400
BOOL WINAPI ImmNotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
Definition: imm.c:2190
#define NI_COMPOSITIONSTR
Definition: imm.h:290
#define GCS_COMPSTR
Definition: imm.h:359

Referenced by START_TEST().

◆ test_ImmSetCompositionString()

static void test_ImmSetCompositionString ( void  )
static

Definition at line 566 of file imm32.c.

567 {
568  HIMC imc;
569  BOOL ret;
570 
571  SetLastError(0xdeadbeef);
572  imc = ImmGetContext(hwnd);
573  ok(imc != 0, "ImmGetContext() failed. Last error: %u\n", GetLastError());
574  if (!imc)
575  return;
576 
578  ok(broken(!ret) ||
579  ret, /* Vista+ */
580  "ImmSetCompositionStringW() failed.\n");
581 
583  NULL, 0, NULL, 0);
584  ok(!ret, "ImmSetCompositionStringW() succeeded.\n");
585 
587  NULL, 0, NULL, 0);
588  ok(!ret, "ImmSetCompositionStringW() succeeded.\n");
589 
591  NULL, 0, NULL, 0);
592  ok(!ret, "ImmSetCompositionStringW() succeeded.\n");
593 
595  NULL, 0, NULL, 0);
596  ok(!ret, "ImmSetCompositionStringW() succeeded.\n");
597 
598  ImmReleaseContext(hwnd, imc);
599 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define SCS_SETSTR
Definition: imm.h:447
#define SCS_CHANGEATTR
Definition: imm.h:448
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
DWORD HIMC
Definition: dimm.idl:75
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1518
BOOL WINAPI ImmSetCompositionStringW(HIMC hIMC, DWORD dwIndex, LPCVOID lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen)
Definition: imm.c:2455
#define SCS_CHANGECLAUSE
Definition: imm.h:449
#define SetLastError(x)
Definition: compat.h:417
int ret
#define broken(x)
Definition: _sntprintf.h:21
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:2275
#define ok(value,...)
Definition: atltest.h:57

Referenced by START_TEST().

◆ test_ImmThreads()

static void test_ImmThreads ( void  )
static

Definition at line 716 of file imm32.c.

717 {
718  HIMC himc, otherHimc, h1;
719  igc_threadinfo threadinfo;
720  HANDLE hThread;
722  BOOL rc;
723  LOGFONTA lf;
725  CANDIDATEFORM cdf;
726  DWORD status, sentence;
727  POINT pt;
728 
729  himc = ImmGetContext(hwnd);
730  threadinfo.event = CreateEventA(NULL, TRUE, FALSE, NULL);
731  threadinfo.himc = himc;
732  hThread = CreateThread(NULL, 0, ImmGetContextThreadFunc, &threadinfo, 0, &dwThreadId );
733  WaitForSingleObject(threadinfo.event, INFINITE);
734 
735  otherHimc = ImmGetContext(threadinfo.hwnd);
736 
737  ok(himc != otherHimc, "Windows from other threads should have different himc\n");
738  ok(otherHimc == threadinfo.himc, "Context from other thread should not change in main thread\n");
739 
740  h1 = ImmAssociateContext(hwnd,otherHimc);
741  ok(h1 == NULL, "Should fail to be able to Associate a default context from a different thread\n");
742  h1 = ImmGetContext(hwnd);
743  ok(h1 == himc, "Context for window should remain unchanged\n");
745 
746  h1 = ImmAssociateContext(hwnd, threadinfo.u_himc);
747  ok (h1 == NULL, "Should fail to associate a context from a different thread\n");
748  h1 = ImmGetContext(hwnd);
749  ok(h1 == himc, "Context for window should remain unchanged\n");
751 
752  h1 = ImmAssociateContext(threadinfo.hwnd, threadinfo.u_himc);
753  ok (h1 == NULL, "Should fail to associate a context from a different thread into a window from that thread.\n");
754  h1 = ImmGetContext(threadinfo.hwnd);
755  ok(h1 == threadinfo.himc, "Context for window should remain unchanged\n");
756  ImmReleaseContext(threadinfo.hwnd,h1);
757 
758  /* OpenStatus */
759  rc = ImmSetOpenStatus(himc, TRUE);
760  ok(rc != 0, "ImmSetOpenStatus failed\n");
761  rc = ImmGetOpenStatus(himc);
762  ok(rc != 0, "ImmGetOpenStatus failed\n");
763  rc = ImmSetOpenStatus(himc, FALSE);
764  ok(rc != 0, "ImmSetOpenStatus failed\n");
765  rc = ImmGetOpenStatus(himc);
766  ok(rc == 0, "ImmGetOpenStatus failed\n");
767 
768  rc = ImmSetOpenStatus(otherHimc, TRUE);
769  ok(rc == 0, "ImmSetOpenStatus should fail\n");
770  rc = ImmSetOpenStatus(threadinfo.u_himc, TRUE);
771  ok(rc == 0, "ImmSetOpenStatus should fail\n");
772  rc = ImmGetOpenStatus(otherHimc);
773  ok(rc == 0, "ImmGetOpenStatus failed\n");
774  rc = ImmGetOpenStatus(threadinfo.u_himc);
775  ok (rc == 1 || broken(rc == 0), "ImmGetOpenStatus should return 1\n");
776  rc = ImmSetOpenStatus(otherHimc, FALSE);
777  ok(rc == 0, "ImmSetOpenStatus should fail\n");
778  rc = ImmGetOpenStatus(otherHimc);
779  ok(rc == 0, "ImmGetOpenStatus failed\n");
780 
781  /* CompositionFont */
782  rc = ImmGetCompositionFontA(himc, &lf);
783  ok(rc != 0, "ImmGetCompositionFont failed\n");
784  rc = ImmSetCompositionFontA(himc, &lf);
785  ok(rc != 0, "ImmSetCompositionFont failed\n");
786 
787  rc = ImmGetCompositionFontA(otherHimc, &lf);
788  ok(rc != 0 || broken(rc == 0), "ImmGetCompositionFont failed\n");
789  rc = ImmGetCompositionFontA(threadinfo.u_himc, &lf);
790  ok(rc != 0 || broken(rc == 0), "ImmGetCompositionFont user himc failed\n");
791  rc = ImmSetCompositionFontA(otherHimc, &lf);
792  ok(rc == 0, "ImmSetCompositionFont should fail\n");
793  rc = ImmSetCompositionFontA(threadinfo.u_himc, &lf);
794  ok(rc == 0, "ImmSetCompositionFont should fail\n");
795 
796  /* CompositionWindow */
797  rc = ImmSetCompositionWindow(himc, &cf);
798  ok(rc != 0, "ImmSetCompositionWindow failed\n");
799  rc = ImmGetCompositionWindow(himc, &cf);
800  ok(rc != 0, "ImmGetCompositionWindow failed\n");
801 
802  rc = ImmSetCompositionWindow(otherHimc, &cf);
803  ok(rc == 0, "ImmSetCompositionWindow should fail\n");
804  rc = ImmSetCompositionWindow(threadinfo.u_himc, &cf);
805  ok(rc == 0, "ImmSetCompositionWindow should fail\n");
806  rc = ImmGetCompositionWindow(otherHimc, &cf);
807  ok(rc != 0 || broken(rc == 0), "ImmGetCompositionWindow failed\n");
808  rc = ImmGetCompositionWindow(threadinfo.u_himc, &cf);
809  ok(rc != 0 || broken(rc == 0), "ImmGetCompositionWindow failed\n");
810 
811  /* ConversionStatus */
812  rc = ImmGetConversionStatus(himc, &status, &sentence);
813  ok(rc != 0, "ImmGetConversionStatus failed\n");
814  rc = ImmSetConversionStatus(himc, status, sentence);
815  ok(rc != 0, "ImmSetConversionStatus failed\n");
816 
817  rc = ImmGetConversionStatus(otherHimc, &status, &sentence);
818  ok(rc != 0 || broken(rc == 0), "ImmGetConversionStatus failed\n");
819  rc = ImmGetConversionStatus(threadinfo.u_himc, &status, &sentence);
820  ok(rc != 0 || broken(rc == 0), "ImmGetConversionStatus failed\n");
821  rc = ImmSetConversionStatus(otherHimc, status, sentence);
822  ok(rc == 0, "ImmSetConversionStatus should fail\n");
823  rc = ImmSetConversionStatus(threadinfo.u_himc, status, sentence);
824  ok(rc == 0, "ImmSetConversionStatus should fail\n");
825 
826  /* StatusWindowPos */
827  rc = ImmSetStatusWindowPos(himc, &pt);
828  ok(rc != 0, "ImmSetStatusWindowPos failed\n");
829  rc = ImmGetStatusWindowPos(himc, &pt);
830  ok(rc != 0, "ImmGetStatusWindowPos failed\n");
831 
832  rc = ImmSetStatusWindowPos(otherHimc, &pt);
833  ok(rc == 0, "ImmSetStatusWindowPos should fail\n");
834  rc = ImmSetStatusWindowPos(threadinfo.u_himc, &pt);
835  ok(rc == 0, "ImmSetStatusWindowPos should fail\n");
836  rc = ImmGetStatusWindowPos(otherHimc, &pt);
837  ok(rc != 0 || broken(rc == 0), "ImmGetStatusWindowPos failed\n");
838  rc = ImmGetStatusWindowPos(threadinfo.u_himc, &pt);
839  ok(rc != 0 || broken(rc == 0), "ImmGetStatusWindowPos failed\n");
840 
841  h1 = ImmAssociateContext(threadinfo.hwnd, NULL);
842  ok (h1 == otherHimc, "ImmAssociateContext cross thread with NULL should work\n");
843  h1 = ImmGetContext(threadinfo.hwnd);
844  ok (h1 == NULL, "CrossThread window context should be NULL\n");
845  h1 = ImmAssociateContext(threadinfo.hwnd, h1);
846  ok (h1 == NULL, "Resetting cross thread context should fail\n");
847  h1 = ImmGetContext(threadinfo.hwnd);
848  ok (h1 == NULL, "CrossThread window context should still be NULL\n");
849 
850  rc = ImmDestroyContext(threadinfo.u_himc);
851  ok (rc == 0, "ImmDestroyContext Cross Thread should fail\n");
852 
853  /* Candidate Window */
854  rc = ImmGetCandidateWindow(himc, 0, &cdf);
855  ok (rc == 0, "ImmGetCandidateWindow should fail\n");
856  cdf.dwIndex = 0;
858  cdf.ptCurrentPos.x = 0;
859  cdf.ptCurrentPos.y = 0;
860  rc = ImmSetCandidateWindow(himc, &cdf);
861  ok (rc == 1, "ImmSetCandidateWindow should succeed\n");
862  rc = ImmGetCandidateWindow(himc, 0, &cdf);
863  ok (rc == 1, "ImmGetCandidateWindow should succeed\n");
864 
865  rc = ImmGetCandidateWindow(otherHimc, 0, &cdf);
866  ok (rc == 0, "ImmGetCandidateWindow should fail\n");
867  rc = ImmSetCandidateWindow(otherHimc, &cdf);
868  ok (rc == 0, "ImmSetCandidateWindow should fail\n");
869  rc = ImmGetCandidateWindow(threadinfo.u_himc, 0, &cdf);
870  ok (rc == 1 || broken( rc == 0), "ImmGetCandidateWindow should succeed\n");
871  rc = ImmSetCandidateWindow(threadinfo.u_himc, &cdf);
872  ok (rc == 0, "ImmSetCandidateWindow should fail\n");
873 
874  ImmReleaseContext(threadinfo.hwnd,otherHimc);
875  ImmReleaseContext(hwnd,himc);
876 
877  SendMessageA(threadinfo.hwnd, WM_CLOSE, 0, 0);
879  ok(rc == 1, "PostThreadMessage should succeed\n");
882 
884  ok(himc == NULL, "Should not be able to get himc from other process window\n");
885 }
static IClassFactory * cf
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
long y
Definition: polytest.cpp:48
static DWORD WINAPI ImmGetContextThreadFunc(LPVOID lpParam)
Definition: imm32.c:664
long x
Definition: polytest.cpp:48
#define pt(x, y)
Definition: drawing.c:79
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HANDLE event
Definition: imm32.c:658
#define WM_QUIT
Definition: winuser.h:1605
BOOL WINAPI PostThreadMessageA(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
DWORD dwStyle
Definition: dimm.idl:80
BOOL WINAPI ImmGetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
Definition: imm.c:2011
BOOL WINAPI ImmSetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
Definition: imm.c:2632
BOOL WINAPI ImmDestroyContext(HIMC hIMC)
Definition: imm.c:832
BOOL WINAPI ImmSetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
Definition: imm.c:2514
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
BOOL WINAPI ImmGetConversionStatus(HIMC hIMC, LPDWORD lpfdwConversion, LPDWORD lpfdwSentence)
Definition: imm.c:1626
unsigned int BOOL
Definition: ntddk_ex.h:94
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:652
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)
Definition: synch.c:637
DWORD HIMC
Definition: dimm.idl:75
BOOL WINAPI ImmGetOpenStatus(HIMC hIMC)
Definition: imm.c:1908
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1518
#define WM_CLOSE
Definition: winuser.h:1603
#define CFS_CANDIDATEPOS
Definition: imm.h:467
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwThreadId
Definition: fdebug.c:31
POINT ptCurrentPos
Definition: dimm.idl:81
HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:569
BOOL WINAPI ImmSetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
Definition: imm.c:2350
#define broken(x)
Definition: _sntprintf.h:21
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:2275
BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
Definition: imm.c:2593
BOOL WINAPI ImmGetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
Definition: imm.c:1174
DWORD dwIndex
Definition: dimm.idl:79
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI ImmGetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
Definition: imm.c:1501
HANDLE hThread
Definition: wizard.c:27
BOOL WINAPI ImmSetCandidateWindow(HIMC hIMC, LPCANDIDATEFORM lpCandidate)
Definition: imm.c:2319
BOOL WINAPI ImmGetCandidateWindow(HIMC hIMC, DWORD dwIndex, LPCANDIDATEFORM lpCandidate)
Definition: imm.c:1150
HIMC u_himc
Definition: imm32.c:660
BOOL WINAPI ImmSetConversionStatus(HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
Definition: imm.c:2555
#define INFINITE
Definition: serial.h:102
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by START_TEST().

◆ test_InvalidIMC()

static void test_InvalidIMC ( void  )
static

Definition at line 1673 of file imm32.c.

1674 {
1675  HIMC imc_destroy;
1676  HIMC imc_null = 0x00000000;
1677  HIMC imc_bad = (HIMC)0xdeadcafe;
1678 
1679  HIMC imc1, imc2, oldimc;
1680  DWORD ret;
1681  DWORD count;
1682  CHAR buffer[1000];
1683  INPUTCONTEXT *ic;
1684  LOGFONTA lf;
1685 
1686  memset(&lf, 0, sizeof(lf));
1687 
1688  imc_destroy = ImmCreateContext();
1689  ret = ImmDestroyContext(imc_destroy);
1690  ok(ret == TRUE, "Destroy an IMC should success!\n");
1691 
1692  /* Test associating destroyed imc */
1693  imc1 = ImmGetContext(hwnd);
1694  SetLastError(0xdeadbeef);
1695  oldimc = ImmAssociateContext(hwnd, imc_destroy);
1696  ok(!oldimc, "Associating to a destroyed imc should fail!\n");
1697  ret = GetLastError();
1698  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1699  imc2 = ImmGetContext(hwnd);
1700  ok(imc1 == imc2, "imc should not changed! imc1 %p, imc2 %p\n", imc1, imc2);
1701 
1702  /* Test associating NULL imc, which is different from an invalid imc */
1703  oldimc = ImmAssociateContext(hwnd, imc_null);
1704  ok(oldimc != NULL, "Associating to NULL imc should success!\n");
1705  imc2 = ImmGetContext(hwnd);
1706  ok(!imc2, "expect NULL, returned %p\n", imc2);
1707  oldimc = ImmAssociateContext(hwnd, imc1);
1708  ok(!oldimc, "expect NULL, returned %p\n", oldimc);
1709  imc2 = ImmGetContext(hwnd);
1710  ok(imc2 == imc1, "imc should not changed! imc2 %p, imc1 %p\n", imc2, imc1);
1711 
1712  /* Test associating invalid imc */
1713  imc1 = ImmGetContext(hwnd);
1714  SetLastError(0xdeadbeef);
1715  oldimc = ImmAssociateContext(hwnd, imc_bad);
1716  ok(!oldimc, "Associating to a destroyed imc should fail!\n");
1717  ret = GetLastError();
1718  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1719  imc2 = ImmGetContext(hwnd);
1720  ok(imc1 == imc2, "imc should not changed! imc1 %p, imc2 %p\n", imc1, imc2);
1721 
1722 
1723  /* Test ImmGetCandidateListA */
1724  SetLastError(0xdeadbeef);
1725  ret = ImmGetCandidateListA(imc_bad, 0, NULL, 0);
1726  ok(ret == 0, "Bad IME should return 0\n");
1727  ret = GetLastError();
1728  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1729  SetLastError(0xdeadbeef);
1730  ret = ImmGetCandidateListA(imc_null, 0, NULL, 0);
1731  ok(ret == 0, "NULL IME should return 0\n");
1732  ret = GetLastError();
1733  ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret);
1734  SetLastError(0xdeadbeef);
1735  ret = ImmGetCandidateListA(imc_destroy, 0, NULL, 0);
1736  ok(ret == 0, "Destroyed IME should return 0\n");
1737  ret = GetLastError();
1738  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1739 
1740  /* Test ImmGetCandidateListCountA*/
1741  SetLastError(0xdeadbeef);
1742  ret = ImmGetCandidateListCountA(imc_bad,&count);
1743  ok(ret == 0, "Bad IME should return 0\n");
1744  ret = GetLastError();
1745  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1746  SetLastError(0xdeadbeef);
1747  ret = ImmGetCandidateListCountA(imc_null,&count);
1748  ok(ret == 0, "NULL IME should return 0\n");
1749  ret = GetLastError();
1750  ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret);
1751  SetLastError(0xdeadbeef);
1752  ret = ImmGetCandidateListCountA(imc_destroy,&count);
1753  ok(ret == 0, "Destroyed IME should return 0\n");
1754  ret = GetLastError();
1755  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1756 
1757  /* Test ImmGetCandidateWindow */
1758  SetLastError(0xdeadbeef);
1760  ok(ret == 0, "Bad IME should return 0\n");
1761  ret = GetLastError();
1762  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1763  SetLastError(0xdeadbeef);
1765  ok(ret == 0, "NULL IME should return 0\n");
1766  ret = GetLastError();
1767  ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret);
1768  SetLastError(0xdeadbeef);
1769  ret = ImmGetCandidateWindow(imc_destroy, 0, (LPCANDIDATEFORM)buffer);
1770  ok(ret == 0, "Destroyed IME should return 0\n");
1771  ret = GetLastError();
1772  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1773 
1774  /* Test ImmGetCompositionFontA */
1775  SetLastError(0xdeadbeef);
1777  ok(ret == 0, "Bad IME should return 0\n");
1778  ret = GetLastError();
1779  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1780  SetLastError(0xdeadbeef);
1782  ok(ret == 0, "NULL IME should return 0\n");
1783  ret = GetLastError();
1784  ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret);
1785  SetLastError(0xdeadbeef);
1786  ret = ImmGetCompositionFontA(imc_destroy, (LPLOGFONTA)buffer);
1787  ok(ret == 0, "Destroyed IME should return 0\n");
1788  ret = GetLastError();
1789  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1790 
1791  /* Test ImmGetCompositionWindow */
1792  SetLastError(0xdeadbeef);
1794  ok(ret == 0, "Bad IME should return 0\n");
1795  ret = GetLastError();
1796  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1797  SetLastError(0xdeadbeef);
1799  ok(ret == 0, "NULL IME should return 0\n");
1800  ret = GetLastError();
1801  ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret);
1802  SetLastError(0xdeadbeef);
1804  ok(ret == 0, "Destroyed IME should return 0\n");
1805  ret = GetLastError();
1806  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1807 
1808  /* Test ImmGetCompositionStringA */
1809  SetLastError(0xdeadbeef);
1810  ret = ImmGetCompositionStringA(imc_bad, GCS_COMPSTR, NULL, 0);
1811  ok(ret == 0, "Bad IME should return 0\n");
1812  ret = GetLastError();
1813  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1814  SetLastError(0xdeadbeef);
1815  ret = ImmGetCompositionStringA(imc_null, GCS_COMPSTR, NULL, 0);
1816  ok(ret == 0, "NULL IME should return 0\n");
1817  ret = GetLastError();
1818  ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret);
1819  SetLastError(0xdeadbeef);
1820  ret = ImmGetCompositionStringA(imc_destroy, GCS_COMPSTR, NULL, 0);
1821  ok(ret == 0, "Destroyed IME should return 0\n");
1822  ret = GetLastError();
1823  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1824 
1825  /* Test ImmSetOpenStatus */
1826  SetLastError(0xdeadbeef);
1827  ret = ImmSetOpenStatus(imc_bad, 1);
1828  ok(ret == 0, "Bad IME should return 0\n");
1829  ret = GetLastError();
1830  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1831  SetLastError(0xdeadbeef);
1832  ret = ImmSetOpenStatus(imc_null, 1);
1833  ok(ret == 0, "NULL IME should return 0\n");
1834  ret = GetLastError();
1835  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1836  SetLastError(0xdeadbeef);
1837  ret = ImmSetOpenStatus(imc_destroy, 1);
1838  ok(ret == 0, "Destroyed IME should return 0\n");
1839  ret = GetLastError();
1840  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1841 
1842  /* Test ImmGetOpenStatus */
1843  SetLastError(0xdeadbeef);
1844  ret = ImmGetOpenStatus(imc_bad);
1845  ok(ret == 0, "Bad IME should return 0\n");
1846  ret = GetLastError();
1847  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1848  SetLastError(0xdeadbeef);
1849  ret = ImmGetOpenStatus(imc_null);
1850  ok(ret == 0, "NULL IME should return 0\n");
1851  ret = GetLastError();
1852  ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret);
1853  SetLastError(0xdeadbeef);
1854  ret = ImmGetOpenStatus(imc_destroy);
1855  ok(ret == 0, "Destroyed IME should return 0\n");
1856  ret = GetLastError();
1857  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1858 
1859  /* Test ImmGetStatusWindowPos */
1860  SetLastError(0xdeadbeef);
1861  ret = ImmGetStatusWindowPos(imc_bad, NULL);
1862  ok(ret == 0, "Bad IME should return 0\n");
1863  ret = GetLastError();
1864  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1865  SetLastError(0xdeadbeef);
1866  ret = ImmGetStatusWindowPos(imc_null, NULL);
1867  ok(ret == 0, "NULL IME should return 0\n");
1868  ret = GetLastError();
1869  ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret);
1870  SetLastError(0xdeadbeef);
1871  ret = ImmGetStatusWindowPos(imc_destroy, NULL);
1872  ok(ret == 0, "Destroyed IME should return 0\n");
1873  ret = GetLastError();
1874  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1875 
1876  /* Test ImmRequestMessageA */
1877  SetLastError(0xdeadbeef);
1878  ret = ImmRequestMessageA(imc_bad, WM_CHAR, 0);
1879  ok(ret == 0, "Bad IME should return 0\n");
1880  ret = GetLastError();
1881  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1882  SetLastError(0xdeadbeef);
1883  ret = ImmRequestMessageA(imc_null, WM_CHAR, 0);
1884  ok(ret == 0, "NULL IME should return 0\n");
1885  ret = GetLastError();
1886  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1887  SetLastError(0xdeadbeef);
1888  ret = ImmRequestMessageA(imc_destroy, WM_CHAR, 0);
1889  ok(ret == 0, "Destroyed IME should return 0\n");
1890  ret = GetLastError();
1891  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1892 
1893  /* Test ImmSetCompositionFontA */
1894  SetLastError(0xdeadbeef);
1895  ret = ImmSetCompositionFontA(imc_bad, &lf);
1896  ok(ret == 0, "Bad IME should return 0\n");
1897  ret = GetLastError();
1898  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1899  SetLastError(0xdeadbeef);
1900  ret = ImmSetCompositionFontA(imc_null, &lf);
1901  ok(ret == 0, "NULL IME should return 0\n");
1902  ret = GetLastError();
1903  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1904  SetLastError(0xdeadbeef);
1905  ret = ImmSetCompositionFontA(imc_destroy, &lf);
1906  ok(ret == 0, "Destroyed IME should return 0\n");
1907  ret = GetLastError();
1908  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1909 
1910  /* Test ImmSetCompositionWindow */
1911  SetLastError(0xdeadbeef);
1912  ret = ImmSetCompositionWindow(imc_bad, NULL);
1913  ok(ret == 0, "Bad IME should return 0\n");
1914  ret = GetLastError();
1915  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1916  SetLastError(0xdeadbeef);
1917  ret = ImmSetCompositionWindow(imc_null, NULL);
1918  ok(ret == 0, "NULL IME should return 0\n");
1919  ret = GetLastError();
1920  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1921  SetLastError(0xdeadbeef);
1922  ret = ImmSetCompositionWindow(imc_destroy, NULL);
1923  ok(ret == 0, "Destroyed IME should return 0\n");
1924  ret = GetLastError();
1925  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1926 
1927  /* Test ImmSetConversionStatus */
1928  SetLastError(0xdeadbeef);
1929  ret = ImmSetConversionStatus(imc_bad, 0, 0);
1930  ok(ret == 0, "Bad IME should return 0\n");
1931  ret = GetLastError();
1932  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1933  SetLastError(0xdeadbeef);
1934  ret = ImmSetConversionStatus(imc_null, 0, 0);
1935  ok(ret == 0, "NULL IME should return 0\n");
1936  ret = GetLastError();
1937  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1938  SetLastError(0xdeadbeef);
1939  ret = ImmSetConversionStatus(imc_destroy, 0, 0);
1940  ok(ret == 0, "Destroyed IME should return 0\n");
1941  ret = GetLastError();
1942  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1943 
1944  /* Test ImmSetStatusWindowPos */
1945  SetLastError(0xdeadbeef);
1946  ret = ImmSetStatusWindowPos(imc_bad, 0);
1947  ok(ret == 0, "Bad IME should return 0\n");
1948  ret = GetLastError();
1949  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1950  SetLastError(0xdeadbeef);
1951  ret = ImmSetStatusWindowPos(imc_null, 0);
1952  ok(ret == 0, "NULL IME should return 0\n");
1953  ret = GetLastError();
1954  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1955  SetLastError(0xdeadbeef);
1956  ret = ImmSetStatusWindowPos(imc_destroy, 0);
1957  ok(ret == 0, "Destroyed IME should return 0\n");
1958  ret = GetLastError();
1959  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1960 
1961  /* Test ImmGetImeMenuItemsA */
1962  SetLastError(0xdeadbeef);
1963  ret = ImmGetImeMenuItemsA(imc_bad, 0, 0, NULL, NULL, 0);
1964  ok(ret == 0, "Bad IME should return 0\n");
1965  ret = GetLastError();
1966  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1967  SetLastError(0xdeadbeef);
1968  ret = ImmGetImeMenuItemsA(imc_null, 0, 0, NULL, NULL, 0);
1969  ok(ret == 0, "NULL IME should return 0\n");
1970  ret = GetLastError();
1971  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1972  SetLastError(0xdeadbeef);
1973  ret = ImmGetImeMenuItemsA(imc_destroy, 0, 0, NULL, NULL, 0);
1974  ok(ret == 0, "Destroyed IME should return 0\n");
1975  ret = GetLastError();
1976  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1977 
1978  /* Test ImmLockIMC */
1979  SetLastError(0xdeadbeef);
1980  ic = ImmLockIMC(imc_bad);
1981  ok(ic == 0, "Bad IME should return 0\n");
1982  ret = GetLastError();
1983  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1984  SetLastError(0xdeadbeef);
1985  ic = ImmLockIMC(imc_null);
1986  ok(ic == 0, "NULL IME should return 0\n");
1987  ret = GetLastError();
1988  ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret);
1989  SetLastError(0xdeadbeef);
1990  ic = ImmLockIMC(imc_destroy);
1991  ok(ic == 0, "Destroyed IME should return 0\n");
1992  ret = GetLastError();
1993  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
1994 
1995  /* Test ImmUnlockIMC */
1996  SetLastError(0xdeadbeef);
1997  ret = ImmUnlockIMC(imc_bad);
1998  ok(ret == 0, "Bad IME should return 0\n");
1999  ret = GetLastError();
2000  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
2001  SetLastError(0xdeadbeef);
2002  ret = ImmUnlockIMC(imc_null);
2003  ok(ret == 0, "NULL IME should return 0\n");
2004  ret = GetLastError();
2005  ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret);
2006  SetLastError(0xdeadbeef);
2007  ret = ImmUnlockIMC(imc_destroy);
2008  ok(ret == 0, "Destroyed IME should return 0\n");
2009  ret = GetLastError();
2010  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
2011 
2012  /* Test ImmGenerateMessage */
2013  SetLastError(0xdeadbeef);
2014  ret = ImmGenerateMessage(imc_bad);
2015  ok(ret == 0, "Bad IME should return 0\n");
2016  ret = GetLastError();
2017  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
2018  SetLastError(0xdeadbeef);
2019  ret = ImmGenerateMessage(imc_null);
2020  ok(ret == 0, "NULL IME should return 0\n");
2021  ret = GetLastError();
2022  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
2023  SetLastError(0xdeadbeef);
2024  ret = ImmGenerateMessage(imc_destroy);
2025  ok(ret == 0, "Destroyed IME should return 0\n");
2026  ret = GetLastError();
2027  ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret);
2028 }
DWORD WINAPI ImmGetCandidateListCountA(HIMC hIMC, LPDWORD lpdwListCount)
Definition: imm.c:1047
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define WM_CHAR
Definition: winuser.h:1699
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:2899
GLuint GLuint GLsizei count
Definition: gl.h:1545
char CHAR
Definition: xmlstorage.h:175
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
GLuint buffer
Definition: glext.h:5915
BOOL WINAPI ImmGetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
Definition: imm.c:2011
LONG WINAPI ImmGetCompositionStringA(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
Definition: imm.c:1481
BOOL WINAPI ImmSetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
Definition: imm.c:2632
BOOL WINAPI ImmDestroyContext(HIMC hIMC)
Definition: imm.c:832
BOOL WINAPI ImmSetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
Definition: imm.c:2514
smooth NULL
Definition: ftsmooth.c:416
DWORD HIMC
Definition: dimm.idl:75
HIMC WINAPI ImmCreateContext(void)
Definition: imm.c:746
BOOL WINAPI ImmGetOpenStatus(HIMC hIMC)
Definition: imm.c:1908
LRESULT WINAPI ImmRequestMessageA(HIMC hIMC, WPARAM wParam, LPARAM lParam)
Definition: imm.c:2289
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1518
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
int ret
DWORD WINAPI ImmGetImeMenuItemsA(HIMC hIMC, DWORD dwFlags, DWORD dwType, LPIMEMENUITEMINFOA lpImeParentMenu, LPIMEMENUITEMINFOA lpImeMenu, DWORD dwSize)
Definition: imm.c:2759
HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:569
static HIMC
Definition: imm32.c:29
BOOL WINAPI ImmSetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
Definition: imm.c:2350
BOOL WINAPI ImmGenerateMessage(HIMC hIMC)
Definition: imm.c:2993
BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
Definition: imm.c:2593
BOOL WINAPI ImmGetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
Definition: imm.c:1174
DWORD WINAPI ImmGetCandidateListA(HIMC hIMC, DWORD dwIndex, LPCANDIDATELIST lpCandList, DWORD dwBufLen)
Definition: imm.c:1008
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI ImmGetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
Definition: imm.c:1501
BOOL WINAPI ImmGetCandidateWindow(HIMC hIMC, DWORD dwIndex, LPCANDIDATEFORM lpCandidate)
Definition: imm.c:1150
BOOL WINAPI ImmSetConversionStatus(HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
Definition: imm.c:2555
#define memset(x, y, z)
Definition: compat.h:39
#define GCS_COMPSTR
Definition: imm.h:359
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:2912

Referenced by START_TEST().

◆ UINT()

static UINT ( WINAPI pSendInput)
static

◆ wndProc()

static LRESULT WINAPI wndProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 179 of file imm32.c.

180 {
181  HWND default_ime_wnd;
182  switch (msg)
183  {
184  case WM_IME_SETCONTEXT:
185  return TRUE;
186  case WM_NCCREATE:
187  default_ime_wnd = get_ime_window();
188  switch(test_phase) {
189  case FIRST_WINDOW:
190  case IME_DISABLED:
191  ok(!default_ime_wnd, "expected no IME windows\n");
192  break;
193  case SECOND_WINDOW:
194  ok(default_ime_wnd != NULL, "expected IME window existence\n");
195  break;
196  default:
197  break; /* do nothing */
198  }
200  return FALSE;
201  return TRUE;
202  case WM_NCCALCSIZE:
203  default_ime_wnd = get_ime_window();
204  switch(test_phase) {
205  case FIRST_WINDOW:
206  case SECOND_WINDOW:
207  case CREATE_CANCEL:
208  ok(default_ime_wnd != NULL, "expected IME window existence\n");
209  break;
210  case IME_DISABLED:
211  ok(!default_ime_wnd, "expected no IME windows\n");
212  break;
213  default:
214  break; /* do nothing */
215  }
216  break;
217  case WM_CREATE:
218  default_ime_wnd = get_ime_window();
219  switch(test_phase) {
220  case FIRST_WINDOW:
221  case SECOND_WINDOW:
222  case CREATE_CANCEL:
223  ok(default_ime_wnd != NULL, "expected IME window existence\n");
224  break;
225  case IME_DISABLED:
226  ok(!default_ime_wnd, "expected no IME windows\n");
227  break;
228  default:
229  break; /* do nothing */
230  }
231  if (test_phase == CREATE_CANCEL)
232  return -1;
233  return TRUE;
234  }
235 
237 }
#define TRUE
Definition: types.h:120
static enum @1614 test_phase
#define WM_NCCALCSIZE
Definition: winuser.h:1667
HWND hWnd
Definition: settings.c:17
#define WM_NCCREATE
Definition: winuser.h:1665
WPARAM wParam
Definition: combotst.c:138
smooth NULL
Definition: ftsmooth.c:416
#define WM_IME_SETCONTEXT
Definition: winuser.h:1811
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ok(value,...)
Definition: atltest.h:57
#define msg(x)
Definition: auth_time.c:54
#define WM_CREATE
Definition: winuser.h:1590
static HWND get_ime_window(void)
Definition: imm32.c:1113
LPARAM lParam
Definition: combotst.c:139

Referenced by init(), SHCreateWorkerWindowA(), SHCreateWorkerWindowW(), and test_setinfo().

Variable Documentation

◆ catch_ime_char

BOOL catch_ime_char

Definition at line 359 of file imm32.c.

◆ catch_result_str

BOOL catch_result_str

Definition at line 358 of file imm32.c.

◆ DWORD

Definition at line 29 of file imm32.c.

◆ HIMC

Definition at line 29 of file imm32.c.

Referenced by test_InvalidIMC().

◆ hwnd

HWND hwnd
static

Definition at line 175 of file imm32.c.

Referenced by msg_spy_init(), and test_ImmDefaultHwnd().

◆ ime_composition_test

struct { ... } ime_composition_test

◆ LPARAM

Definition at line 30 of file imm32.c.

◆ msg_spy

◆ old_wnd_proc

WNDPROC old_wnd_proc

Definition at line 357 of file imm32.c.

Referenced by test_SetFocus().

◆ size_t

Definition at line 31 of file imm32.c.

◆ start

Definition at line 360 of file imm32.c.

◆ test_phase

◆ thread_ime_wnd

HWND thread_ime_wnd
static

Definition at line 1036 of file imm32.c.

Referenced by test_ImmDefaultHwnd(), and test_ImmGetDefaultIMEWnd_thread().

◆ timer_id

DWORD timer_id

Definition at line 361 of file imm32.c.

Referenced by window_set_timer().

◆ UINT

Definition at line 30 of file imm32.c.

◆ wndcls

◆ WPARAM

Definition at line 30 of file imm32.c.