user: Fix LB_GETTEXT unmapping for A<->W.

This commit is contained in:
Vitaliy Margolen 2005-12-19 18:16:18 +01:00 committed by Alexandre Julliard
parent 278bd29b8d
commit a80d93c5e9
1 changed files with 5 additions and 3 deletions

View File

@ -956,6 +956,7 @@ LRESULT WINPROC_UnmapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
if ( WINPROC_TestLBForStr( hwnd )) if ( WINPROC_TestLBForStr( hwnd ))
{ {
LPARAM *ptr = (LPARAM *)lParam - 1; LPARAM *ptr = (LPARAM *)lParam - 1;
if (result >= 0)
result = WideCharToMultiByte( CP_ACP, 0, (LPWSTR)lParam, -1, result = WideCharToMultiByte( CP_ACP, 0, (LPWSTR)lParam, -1,
(LPSTR)*ptr, 0x7fffffff, NULL, NULL ) - 1; (LPSTR)*ptr, 0x7fffffff, NULL, NULL ) - 1;
HeapFree( GetProcessHeap(), 0, ptr ); HeapFree( GetProcessHeap(), 0, ptr );
@ -1224,6 +1225,7 @@ static LRESULT WINPROC_UnmapMsg32WTo32A( HWND hwnd, UINT msg, WPARAM wParam, LPA
if ( WINPROC_TestLBForStr( hwnd )) if ( WINPROC_TestLBForStr( hwnd ))
{ {
LPARAM *ptr = (LPARAM *)lParam - 1; LPARAM *ptr = (LPARAM *)lParam - 1;
if (result >= 0)
result = MultiByteToWideChar( CP_ACP, 0, (LPSTR)lParam, -1, (LPWSTR)*ptr, 0x7fffffff ) - 1; result = MultiByteToWideChar( CP_ACP, 0, (LPSTR)lParam, -1, (LPWSTR)*ptr, 0x7fffffff ) - 1;
HeapFree( GetProcessHeap(), 0, ptr ); HeapFree( GetProcessHeap(), 0, ptr );
} }