Commit 0e42073c authored by Uwe Bonnes's avatar Uwe Bonnes Committed by Alexandre Julliard

HeapAlloc for WSTR must allocate len* sizeof(WCHARS).

parent 4679e784
......@@ -47,7 +47,7 @@ HWND WINAPI HtmlHelpA(HWND caller, LPCSTR filename, UINT command, DWORD data)
DWORD len = MultiByteToWideChar( CP_ACP, 0, filename, -1, NULL, 0 );
HWND result;
wfile = HeapAlloc( GetProcessHeap(), 0, len );
wfile = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR));
MultiByteToWideChar( CP_ACP, 0, filename, -1, wfile, len );
result = HtmlHelpW( caller, wfile, command, data );
......
......@@ -1265,14 +1265,14 @@ BOOL WINAPI ImmSetCompositionStringA(
comp_len = MultiByteToWideChar(CP_ACP, 0, lpComp, dwCompLen, NULL, 0);
if (comp_len)
{
CompBuffer = (WCHAR*)HeapAlloc(GetProcessHeap(),0,comp_len);
CompBuffer = (WCHAR*)HeapAlloc(GetProcessHeap(),0,comp_len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpComp, dwCompLen, CompBuffer, comp_len);
}
read_len = MultiByteToWideChar(CP_ACP, 0, lpRead, dwReadLen, NULL, 0);
if (read_len)
{
ReadBuffer = (WCHAR*)HeapAlloc(GetProcessHeap(),0,read_len);
ReadBuffer = (WCHAR*)HeapAlloc(GetProcessHeap(),0,read_len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpRead, dwReadLen, ReadBuffer, read_len);
}
......
......@@ -1540,7 +1540,7 @@ DWORD WINAPI WNetGetConnectionA( LPCSTR lpLocalName,
if (len)
{
PWSTR wideLocalName = (PWSTR)HeapAlloc(GetProcessHeap(), 0, len);
PWSTR wideLocalName = (PWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (wideLocalName)
{
......
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