From 4ae16e37eec8e7398ffc2b68170b5dfffd80b369 Mon Sep 17 00:00:00 2001 From: Jeff Zaroyko Date: Fri, 2 Oct 2009 12:51:49 +1000 Subject: [PATCH] imm32: dwIndex flags are mutually exclusive. --- dlls/imm32/imm.c | 14 ++++++++++++++ dlls/imm32/tests/imm32.c | 4 ---- 2 files changed, 14 insertions(+), 4 deletions(-) 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);