diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index f0850802bc1..6f9744872b6 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -2130,6 +2130,13 @@ BOOL WINAPI ImmSetCompositionStringA( if (!data) return FALSE; + if (!(dwIndex == SCS_SETSTR || + dwIndex == SCS_CHANGEATTR || + dwIndex == SCS_CHANGECLAUSE || + dwIndex == SCS_SETRECONVERTSTRING || + dwIndex == SCS_QUERYRECONVERTSTRING)) + return FALSE; + if (!is_himc_ime_unicode(data)) return data->immKbd->pImeSetCompositionString(hIMC, dwIndex, lpComp, dwCompLen, lpRead, dwReadLen); @@ -2178,6 +2185,13 @@ BOOL WINAPI ImmSetCompositionStringW( if (!data) return FALSE; + if (!(dwIndex == SCS_SETSTR || + dwIndex == SCS_CHANGEATTR || + dwIndex == SCS_CHANGECLAUSE || + dwIndex == SCS_SETRECONVERTSTRING || + dwIndex == SCS_QUERYRECONVERTSTRING)) + return FALSE; + if (is_himc_ime_unicode(data)) return data->immKbd->pImeSetCompositionString(hIMC, dwIndex, lpComp, dwCompLen, lpRead, dwReadLen); diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c index 97a72014b92..7b76226eb11 100644 --- a/dlls/imm32/tests/imm32.c +++ b/dlls/imm32/tests/imm32.c @@ -274,22 +274,18 @@ static void test_ImmSetCompositionString(void) ret = ImmSetCompositionStringW(imc, SCS_SETSTR | SCS_CHANGEATTR, NULL, 0, NULL, 0); - todo_wine ok(!ret, "ImmSetCompositionStringW() succeeded.\n"); ret = ImmSetCompositionStringW(imc, SCS_SETSTR | SCS_CHANGECLAUSE, NULL, 0, NULL, 0); - todo_wine ok(!ret, "ImmSetCompositionStringW() succeeded.\n"); ret = ImmSetCompositionStringW(imc, SCS_CHANGEATTR | SCS_CHANGECLAUSE, NULL, 0, NULL, 0); - todo_wine ok(!ret, "ImmSetCompositionStringW() succeeded.\n"); ret = ImmSetCompositionStringW(imc, SCS_SETSTR | SCS_CHANGEATTR | SCS_CHANGECLAUSE, NULL, 0, NULL, 0); - todo_wine ok(!ret, "ImmSetCompositionStringW() succeeded.\n"); ImmReleaseContext(hwnd, imc);