Commit 9bcc90fb authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

imm32: Disable cross thread access for ImmSetCompositionString().

parent 97b836a9
......@@ -2377,6 +2377,9 @@ BOOL WINAPI ImmSetCompositionStringA(
if (!data)
return FALSE;
if (IMM_IsCrossThreadAccess(NULL, hIMC))
return FALSE;
if (!(dwIndex == SCS_SETSTR ||
dwIndex == SCS_CHANGEATTR ||
dwIndex == SCS_CHANGECLAUSE ||
......@@ -2432,6 +2435,9 @@ BOOL WINAPI ImmSetCompositionStringW(
if (!data)
return FALSE;
if (IMM_IsCrossThreadAccess(NULL, hIMC))
return FALSE;
if (!(dwIndex == SCS_SETSTR ||
dwIndex == SCS_CHANGEATTR ||
dwIndex == SCS_CHANGECLAUSE ||
......
......@@ -984,6 +984,14 @@ static void test_ImmThreads(void)
rc = ImmSetCompositionFontA(threadinfo.u_himc, &lf);
ok(rc == 0, "ImmSetCompositionFont should fail\n");
/* CompositionString */
rc = ImmSetCompositionStringA(himc, SCS_SETSTR, "a", 2, NULL, 0);
ok(rc, "failed.\n");
rc = ImmSetCompositionStringA(otherHimc, SCS_SETSTR, "a", 2, NULL, 0);
ok(!rc, "should fail.\n");
rc = ImmSetCompositionStringA(threadinfo.u_himc, SCS_SETSTR, "a", 2, NULL, 0);
ok(!rc, "should fail.\n");
/* CompositionWindow */
rc = ImmSetCompositionWindow(himc, &cf);
ok(rc != 0, "ImmSetCompositionWindow failed\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment