Commit b367a6e6 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

We can't use RtlCreateUnicodeStringFromAsciiz for WM_SETTEXT as the

resulting unicode string may be greater than 0xffff bytes.
parent 83d92d3e
......@@ -594,13 +594,13 @@ INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plpara
case LB_DIR:
case LB_ADDFILE:
case EM_REPLACESEL:
{
UNICODE_STRING usBuffer;
if(!*plparam) return 0;
RtlCreateUnicodeStringFromAsciiz(&usBuffer,(LPCSTR)*plparam);
*plparam = (LPARAM)usBuffer.Buffer;
return (*plparam ? 1 : -1);
}
{
DWORD len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)*plparam, -1, NULL, 0);
WCHAR *buf = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)*plparam, -1, buf, len);
*plparam = (LPARAM)buf;
return (*plparam ? 1 : -1);
}
case WM_GETTEXTLENGTH:
case CB_GETLBTEXTLEN:
case LB_GETTEXTLEN:
......
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