[PATCH] imm32: Don't generate context unless the window handle is valid.
Fixes https://bugs.winehq.org/show_bug.cgi?id=28861 If a context does not exist in the local storage already, it is automatically generated and returned to the application. If the handle is not owned by the process however, 'ImmGetContext()' should return 'NULL'. Thanks to: Mike Tedder Signed-off-by: Jimi Huotari <chiitoo(a)gentoo.org> --- dlls/imm32/imm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index 685eb018c4..46bf5b45c8 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -1509,7 +1509,7 @@ HIMC WINAPI ImmGetContext(HWND hWnd) rc = GetPropW(hWnd,szwWineIMCProperty); if (rc == (HIMC)-1) rc = NULL; - else if (rc == NULL) + else if (rc == NULL && IMM_IsCrossThreadAccess(hWnd, rc)) rc = get_default_context( hWnd ); if (rc) -- 2.17.0
This is completely inspired by comment 14 in the mentioned bug [1], but I'm unsure if this is a correct use of 'IMM_IsCrossThreadAccess()' at all, and as such, any comments on that will be appreciated! I imagine it is very possible that this works simply due to the 'else if' not being true due to this change, resulting into 'NULL' just as well as forcing it in some other way. Thanks! 1. https://bugs.winehq.org/show_bug.cgi?id=28861#c14
Jimi Huotari <chiitoo(a)gentoo.org> writes:
This is completely inspired by comment 14 in the mentioned bug [1], but I'm unsure if this is a correct use of 'IMM_IsCrossThreadAccess()' at all, and as such, any comments on that will be appreciated!
I imagine it is very possible that this works simply due to the 'else if' not being true due to this change, resulting into 'NULL' just as well as forcing it in some other way.
Yes, the patch would simply force it to NULL always, so it's most likely only hiding the real bug. -- Alexandre Julliard julliard(a)winehq.org
participants (2)
-
Alexandre Julliard -
Jimi Huotari