Muneyuki Noguchi : winex11.drv: Make X11DRV_XIMLookupChars handle a long string properly.
Alexandre Julliard
julliard at winehq.org
Mon Sep 15 06:54:58 CDT 2008
Module: wine
Branch: master
Commit: f8446f260651739f8374bcd969e5643c13dce596
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f8446f260651739f8374bcd969e5643c13dce596
Author: Muneyuki Noguchi <nogu.dev at gmail.com>
Date: Sat Sep 13 15:01:40 2008 +0900
winex11.drv: Make X11DRV_XIMLookupChars handle a long string properly.
---
dlls/winex11.drv/xim.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c
index 252dacd..5e413f0 100644
--- a/dlls/winex11.drv/xim.c
+++ b/dlls/winex11.drv/xim.c
@@ -177,15 +177,20 @@ static BOOL X11DRV_ImmSetInternalString(DWORD dwIndex, DWORD dwOffset,
void X11DRV_XIMLookupChars( const char *str, DWORD count )
{
DWORD dwOutput;
- WCHAR wcOutput[64];
+ WCHAR *wcOutput;
HWND focus;
- dwOutput = MultiByteToWideChar(CP_UNIXCP, 0, str, count, wcOutput, sizeof(wcOutput)/sizeof(WCHAR));
+ dwOutput = MultiByteToWideChar(CP_UNIXCP, 0, str, count, NULL, 0);
+ wcOutput = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * dwOutput);
+ if (wcOutput == NULL)
+ return;
+ MultiByteToWideChar(CP_UNIXCP, 0, str, count, wcOutput, dwOutput);
if ((focus = GetFocus()))
IME_UpdateAssociation(focus);
X11DRV_ImmSetInternalString(GCS_RESULTSTR,0,0,wcOutput,dwOutput);
+ HeapFree(GetProcessHeap(), 0, wcOutput);
}
static void X11DRV_ImmSetOpenStatus(BOOL fOpen)
More information about the wine-cvs
mailing list