USER32: fix CB_GETLBTEXT and CB_GETLBTEXTLEN ANSI-Unicode calls [Bug:3481]

Vitaliy Margolen wine-patch at kievinfo.com
Tue Oct 18 09:57:50 CDT 2005


This patch has been modified to apply to current cvs.
It fixes the uxtheme problem in combo boxes [Bug:3481]

ChangeLog:
* CB_GETLBTEXT and CB_GETLBTEXTLEN: Return values CB_ERR and CB_ERRSPACE
are not translated.
* CB_GETLBTEXT doesn't translate string to caller's buffer when CB_ERR
is returned.

-- 
Krzysztof

-------------- next part --------------
Index: dlls/user/winproc.c
===================================================================
RCS file: /home/wine/wine/dlls/user/winproc.c,v
retrieving revision 1.10
diff -u -p -r1.10 winproc.c
--- dlls/user/winproc.c	18 Oct 2005 10:45:18 -0000	1.10
+++ dlls/user/winproc.c	18 Oct 2005 14:53:04 -0000
@@ -970,7 +970,12 @@ LRESULT WINPROC_UnmapMsg32ATo32W( HWND h
         break;
 
     case CB_GETLBTEXT:
-        if ( WINPROC_TestCBForStr( hwnd ))
+        if ( result < 0) /* CB_ERR and CB_ERRSPACE */
+        {
+            LPARAM *ptr = (LPARAM *)lParam - 1;
+            HeapFree( GetProcessHeap(), 0, ptr );
+        }
+        else if ( WINPROC_TestCBForStr( hwnd ))
         {
             LPARAM *ptr = (LPARAM *)lParam - 1;
             result = WideCharToMultiByte( CP_ACP, 0, (LPWSTR)lParam, -1,
@@ -1232,7 +1237,12 @@ static LRESULT WINPROC_UnmapMsg32WTo32A(
         break;
 
     case CB_GETLBTEXT:
-        if ( WINPROC_TestCBForStr( hwnd ))
+        if ( result < 0) /* CB_ERR and CB_ERRSPACE */
+        {
+            LPARAM *ptr = (LPARAM *)lParam - 1;
+            HeapFree( GetProcessHeap(), 0, ptr );
+        }
+        else if ( WINPROC_TestCBForStr( hwnd ))
         {
             LPARAM *ptr = (LPARAM *)lParam - 1;
             result = MultiByteToWideChar( CP_ACP, 0, (LPSTR)lParam, -1, (LPWSTR)*ptr, 0x7fffffff ) - 1;


More information about the wine-patches mailing list