Handle NULL string lparam when translating messages A->W.
This commit is contained in:
parent
4a0a099c11
commit
b26ae86b58
|
@ -664,10 +664,12 @@ INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plpara
|
||||||
case LB_DIR:
|
case LB_DIR:
|
||||||
case LB_ADDFILE:
|
case LB_ADDFILE:
|
||||||
case EM_REPLACESEL:
|
case EM_REPLACESEL:
|
||||||
|
if (!*plparam) return 0;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
DWORD len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)*plparam, -1, NULL, 0);
|
DWORD len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)*plparam, -1, NULL, 0);
|
||||||
WCHAR *buf = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
WCHAR *buf = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
||||||
len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)*plparam, -1, buf, len);
|
MultiByteToWideChar(CP_ACP, 0, (LPCSTR)*plparam, -1, buf, len);
|
||||||
*plparam = (LPARAM)buf;
|
*plparam = (LPARAM)buf;
|
||||||
return (*plparam ? 1 : -1);
|
return (*plparam ? 1 : -1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue