Commit 8e92e536 authored by Alexandre Julliard's avatar Alexandre Julliard

user: Added fast 32->16 mapping for WM_GETTEXT, WM_SETTEXT and similar messages.

parent 1d2f9004
...@@ -964,16 +964,6 @@ static INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32, ...@@ -964,16 +964,6 @@ static INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32,
*plparam = MAKELPARAM( (HWND16)*plparam, *plparam = MAKELPARAM( (HWND16)*plparam,
(WORD)msg32 - WM_CTLCOLORMSGBOX ); (WORD)msg32 - WM_CTLCOLORMSGBOX );
return 0; return 0;
case WM_GETTEXT:
case WM_ASKCBFORMATNAME:
{
LPARAM *str; /* store LPARAM, then *pwparam16 char space */
*pwparam16 = (WPARAM16)min( wParam32, 0xff80 ); /* Must be < 64K */
if (!(str = HeapAlloc( GetProcessHeap(), 0, *pwparam16 + sizeof(LPARAM)))) return -1;
*str++ = *plparam; /* Store the previous lParam */
*plparam = MapLS( str );
}
return 1;
case WM_MENUSELECT: case WM_MENUSELECT:
if(HIWORD(wParam32) & MF_POPUP) if(HIWORD(wParam32) & MF_POPUP)
{ {
...@@ -993,14 +983,6 @@ static INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32, ...@@ -993,14 +983,6 @@ static INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32,
*plparam = MAKELPARAM( (HWND16)*plparam, HIWORD(wParam32)); *plparam = MAKELPARAM( (HWND16)*plparam, HIWORD(wParam32));
/* else nothing to do */ /* else nothing to do */
return 0; return 0;
case WM_NOTIFY:
*plparam = MapLS( (NMHDR *)*plparam ); /* NMHDR is already 32-bit */
return 1;
case WM_SETTEXT:
case WM_WININICHANGE:
case WM_DEVMODECHANGE:
*plparam = MapLS( (LPSTR)*plparam );
return 1;
case WM_ACTIVATEAPP: case WM_ACTIVATEAPP:
if (*plparam) *plparam = HTASK_16( (HANDLE)*plparam ); if (*plparam) *plparam = HTASK_16( (HANDLE)*plparam );
return 0; return 0;
...@@ -1062,9 +1044,6 @@ static void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM ...@@ -1062,9 +1044,6 @@ static void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case CB_SELECTSTRING: case CB_SELECTSTRING:
case CB_DIR: case CB_DIR:
case CB_GETLBTEXT: case CB_GETLBTEXT:
case WM_SETTEXT:
case WM_WININICHANGE:
case WM_DEVMODECHANGE:
UnMapLS( (SEGPTR)lParam16 ); UnMapLS( (SEGPTR)lParam16 );
break; break;
case LB_SETTABSTOPS: case LB_SETTABSTOPS:
...@@ -1106,20 +1085,6 @@ static void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM ...@@ -1106,20 +1085,6 @@ static void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if( lParam ) if( lParam )
*((PUINT)(lParam)) = HIWORD(*result); /* FIXME: substract 1? */ *((PUINT)(lParam)) = HIWORD(*result); /* FIXME: substract 1? */
break; break;
case WM_GETTEXT:
case WM_ASKCBFORMATNAME:
{
LPSTR str = MapSL(lParam16);
UnMapLS( lParam16 );
lParam16 = *((LPARAM *)str - 1);
lstrcpynA( (LPSTR)lParam16, str, wParam16 );
HeapFree( GetProcessHeap(), 0, (LPARAM *)str - 1 );
}
break;
case WM_NOTIFY:
UnMapLS(lParam16);
break;
} }
} }
...@@ -2222,6 +2187,18 @@ LRESULT WINPROC_CallProc32ATo16( winproc_callback16_t callback, HWND hwnd, UINT ...@@ -2222,6 +2187,18 @@ LRESULT WINPROC_CallProc32ATo16( winproc_callback16_t callback, HWND hwnd, UINT
*result = 0; *result = 0;
} }
break; break;
case WM_GETTEXT:
case WM_ASKCBFORMATNAME:
wParam = min( wParam, 0xff80 ); /* Must be < 64K */
/* fall through */
case WM_NOTIFY:
case WM_SETTEXT:
case WM_WININICHANGE:
case WM_DEVMODECHANGE:
lParam = MapLS( (void *)lParam );
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
UnMapLS( lParam );
break;
case WM_DDE_INITIATE: case WM_DDE_INITIATE:
case WM_DDE_TERMINATE: case WM_DDE_TERMINATE:
case WM_DDE_UNADVISE: case WM_DDE_UNADVISE:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment