Ignore:
Timestamp:
Jun 18, 2009, 12:04:13 PM (16 years ago)
Author:
ydario
Message:

User32 updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/windowmsg.cpp

    r10607 r21303  
    3434#define INCL_TIMERWIN32
    3535#include "timer.h"
     36#include "callwrap.h"
    3637
    3738#define DBG_LOCALLOG    DBG_windowmsg
     
    326327 * @author  knut st. osmundsen <bird-srcspam@anduin.net>
    327328 * @remark  One cannot attach a threads input queue to it self.
     329 * @remark  This implemenation requires the thread which input is 'forwarded' to
     330 *          process it's message queue. Window (and wine) will not bother that thread
     331 *          at all with the messages. (DEADLOCK WARNING)
    328332 * @todo    Not sure if all this is 100% ok according to the windows reality.
    329333 *          I'm sure some error cases aren't caught.
     
    562566    case WM_IME_CHAR:
    563567    {
     568        // always DBCS char
    564569        CHAR charA[ 2 ];
    565         INT  lenA = 1;
    566 
    567         if( IsDBCSLeadByte(( CHAR )( *pwparam >> 8 )))
    568         {
     570
    569571            charA[ 0 ] = ( CHAR )( *pwparam >> 8 );
    570572            charA[ 1 ] = ( CHAR )*pwparam;
    571             lenA = 2;
    572         }
    573         else
    574             charA[ 0 ] = ( CHAR )*pwparam;
    575 
    576         MultiByteToWideChar( CP_ACP, 0, ( LPSTR )charA, lenA, ( LPWSTR )pwparam, 1);
     573
     574        MultiByteToWideChar( CP_ACP, 0, ( LPSTR )charA, 2, ( LPWSTR )pwparam, 1);
    577575
    578576        return 0;
     
    859857#ifdef __WIN32OS2__
    860858    case WM_IME_CHAR:
    861     {
     859    {   // always DBCS char
    862860        CHAR charA[ 2 ];
    863         INT  lenA;
    864 
    865         lenA = WideCharToMultiByte( CP_ACP, 0, ( LPWSTR )pwparam, 1, ( LPSTR )charA, 2, 0, 0 );
    866         if( lenA > 1 )
     861
     862        WideCharToMultiByte( CP_ACP, 0, ( LPWSTR )pwparam, 1, ( LPSTR )charA, 2, 0, 0 );
    867863            *pwparam = ( charA[ 0 ] << 8 ) | charA[ 1 ];
    868         else
    869             *pwparam = charA[ 0 ];
    870864
    871865        return 0;
     
    10091003{
    10101004    LRESULT result;
    1011     LPARAM old = lParam;
    10121005
    10131006    if (WINPROC_MapMsg32ATo32W( hwnd, msg, &wParam, &lParam ) == -1) return 0;
    10141007
    1015     result = func( hwnd, msg, wParam, lParam );
     1008    result = WrapCallback4(func, hwnd, msg, wParam, lParam );
    10161009    WINPROC_UnmapMsg32ATo32W( hwnd, msg, wParam, lParam );
    10171010
     
    10241017        {
    10251018            LPWSTR ustr = ( LPWSTR )HeapAlloc( GetProcessHeap(), 0, ( result + 1 ) * sizeof( WCHAR ));
    1026             result = func( hwnd, WM_GETTEXT, ( WPARAM )( result + 1 ), ( LPARAM )ustr );
     1019            result = WrapCallback4(func, hwnd, WM_GETTEXT, ( WPARAM )( result + 1 ), ( LPARAM )ustr );
    10271020            result = lstrlenWtoA( ustr, result );
    10281021            HeapFree( GetProcessHeap(), 0, ustr );
     
    10331026        {
    10341027            LPWSTR ustr = ( LPWSTR )HeapAlloc( GetProcessHeap(), 0, ( result + 1 ) * sizeof( WCHAR ));
    1035             result = func( hwnd, LB_GETTEXT, wParam, ( LPARAM )ustr );
     1028            result = WrapCallback4(func, hwnd, LB_GETTEXT, wParam, ( LPARAM )ustr );
    10361029            if( result != LB_ERR )
    10371030                result = lstrlenWtoA( ustr, result );
     
    10451038        {
    10461039            LPWSTR ustr = ( LPWSTR )HeapAlloc( GetProcessHeap(), 0, ( result + 1 ) * sizeof( WCHAR ));
    1047             result = func( hwnd, CB_GETLBTEXT, wParam, ( LPARAM )ustr );
     1040            result = WrapCallback4(func, hwnd, CB_GETLBTEXT, wParam, ( LPARAM )ustr );
    10481041            if( result != CB_ERR )
    10491042                result = lstrlenWtoA( ustr, result );
     
    10711064    if (WINPROC_MapMsg32WTo32A( hwnd, msg, &wParam, &lParam ) == -1) return 0;
    10721065
    1073     result = func( hwnd, msg, wParam, lParam );
     1066    result = WrapCallback4(func, hwnd, msg, wParam, lParam );
    10741067    WINPROC_UnmapMsg32WTo32A( hwnd, msg, wParam, lParam );
    10751068
     
    10821075        {
    10831076            LPSTR astr = ( LPSTR )HeapAlloc( GetProcessHeap(), 0, result + 1 );
    1084             result = func( hwnd, WM_GETTEXT, ( WPARAM )( result + 1 ), ( LPARAM )astr );
     1077            result = WrapCallback4(func, hwnd, WM_GETTEXT, ( WPARAM )( result + 1 ), ( LPARAM )astr );
    10851078            result = lstrlenAtoW( astr, result );
    10861079            HeapFree( GetProcessHeap(), 0, astr );
     
    10911084        {
    10921085            LPSTR astr = ( LPSTR )HeapAlloc( GetProcessHeap(), 0, result + 1 );
    1093             result = func( hwnd, LB_GETTEXT, wParam, ( LPARAM )astr );
     1086            result = WrapCallback4(func, hwnd, LB_GETTEXT, wParam, ( LPARAM )astr );
    10941087            if( result != LB_ERR )
    10951088                result = lstrlenAtoW( astr, result );
     
    11031096        {
    11041097            LPSTR astr = ( LPSTR )HeapAlloc( GetProcessHeap(), 0, result + 1 );
    1105             result = func( hwnd, CB_GETLBTEXT, wParam, ( LPARAM )astr );
     1098            result = WrapCallback4(func, hwnd, CB_GETLBTEXT, wParam, ( LPARAM )astr );
    11061099            if( result != CB_ERR )
    11071100                result = lstrlenAtoW( astr, result );
Note: See TracChangeset for help on using the changeset viewer.