dlls/user32/edit.c -- remove superflous check (RESEND)
Gerald Pfeifer
gerald at pfeifer.com
Mon Feb 18 20:54:28 CST 2008
A second one which Marcus ended up reinventing, but at least the
underlying problem is solved now. :-/
Gerald
On Wed, 26 Dec 2007, Gerald Pfeifer wrote:
> Okay. In that case, to account for possible future enhancements of
> ImmGetCompositionStringW(), we'll need a patch like the following. The
> current error handling code in EDIT_GetCompositionStr() simply doesn't
> work due to the unsignedness of dwBufLen.
>
> Gerald
>
> ChangeLog:
> Fix error handling in EDIT_GetCompositionStr().
>
> Index: dlls/user32/edit.c
> ===================================================================
> RCS file: /home/wine/wine/dlls/user32/edit.c,v
> retrieving revision 1.16
> diff -u -3 -p -r1.16 edit.c
> --- dlls/user32/edit.c 20 Nov 2007 16:56:17 -0000 1.16
> +++ dlls/user32/edit.c 26 Dec 2007 21:29:33 -0000
> @@ -5360,6 +5348,7 @@ static void EDIT_UpdateText(EDITSTATE *e
>
> static void EDIT_GetCompositionStr(HWND hwnd, LPARAM CompFlag, EDITSTATE *es)
> {
> + LONG l;
> DWORD dwBufLen;
> LPWSTR lpCompStr = NULL;
> HIMC hIMC;
> @@ -5369,9 +5358,9 @@ static void EDIT_GetCompositionStr(HWND
> if (!(hIMC = ImmGetContext(hwnd)))
> return;
>
> - dwBufLen = ImmGetCompositionStringW(hIMC, GCS_COMPSTR, NULL, 0);
> + dwBufLen = l = ImmGetCompositionStringW(hIMC, GCS_COMPSTR, NULL, 0);
>
> - if (dwBufLen < 0)
> + if (l < 0)
> {
> ImmReleaseContext(hwnd, hIMC);
> return;
More information about the wine-devel
mailing list