Changeset 21303 for trunk/src/user32/windowmsg.cpp
- Timestamp:
- Jun 18, 2009, 12:04:13 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/windowmsg.cpp
r10607 r21303 34 34 #define INCL_TIMERWIN32 35 35 #include "timer.h" 36 #include "callwrap.h" 36 37 37 38 #define DBG_LOCALLOG DBG_windowmsg … … 326 327 * @author knut st. osmundsen <bird-srcspam@anduin.net> 327 328 * @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) 328 332 * @todo Not sure if all this is 100% ok according to the windows reality. 329 333 * I'm sure some error cases aren't caught. … … 562 566 case WM_IME_CHAR: 563 567 { 568 // always DBCS char 564 569 CHAR charA[ 2 ]; 565 INT lenA = 1; 566 567 if( IsDBCSLeadByte(( CHAR )( *pwparam >> 8 ))) 568 { 570 569 571 charA[ 0 ] = ( CHAR )( *pwparam >> 8 ); 570 572 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); 577 575 578 576 return 0; … … 859 857 #ifdef __WIN32OS2__ 860 858 case WM_IME_CHAR: 861 { 859 { // always DBCS char 862 860 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 ); 867 863 *pwparam = ( charA[ 0 ] << 8 ) | charA[ 1 ]; 868 else869 *pwparam = charA[ 0 ];870 864 871 865 return 0; … … 1009 1003 { 1010 1004 LRESULT result; 1011 LPARAM old = lParam;1012 1005 1013 1006 if (WINPROC_MapMsg32ATo32W( hwnd, msg, &wParam, &lParam ) == -1) return 0; 1014 1007 1015 result = func(hwnd, msg, wParam, lParam );1008 result = WrapCallback4(func, hwnd, msg, wParam, lParam ); 1016 1009 WINPROC_UnmapMsg32ATo32W( hwnd, msg, wParam, lParam ); 1017 1010 … … 1024 1017 { 1025 1018 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 ); 1027 1020 result = lstrlenWtoA( ustr, result ); 1028 1021 HeapFree( GetProcessHeap(), 0, ustr ); … … 1033 1026 { 1034 1027 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 ); 1036 1029 if( result != LB_ERR ) 1037 1030 result = lstrlenWtoA( ustr, result ); … … 1045 1038 { 1046 1039 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 ); 1048 1041 if( result != CB_ERR ) 1049 1042 result = lstrlenWtoA( ustr, result ); … … 1071 1064 if (WINPROC_MapMsg32WTo32A( hwnd, msg, &wParam, &lParam ) == -1) return 0; 1072 1065 1073 result = func(hwnd, msg, wParam, lParam );1066 result = WrapCallback4(func, hwnd, msg, wParam, lParam ); 1074 1067 WINPROC_UnmapMsg32WTo32A( hwnd, msg, wParam, lParam ); 1075 1068 … … 1082 1075 { 1083 1076 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 ); 1085 1078 result = lstrlenAtoW( astr, result ); 1086 1079 HeapFree( GetProcessHeap(), 0, astr ); … … 1091 1084 { 1092 1085 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 ); 1094 1087 if( result != LB_ERR ) 1095 1088 result = lstrlenAtoW( astr, result ); … … 1103 1096 { 1104 1097 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 ); 1106 1099 if( result != CB_ERR ) 1107 1100 result = lstrlenAtoW( astr, result );
Note:
See TracChangeset
for help on using the changeset viewer.