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

This commit is contained in:
Uwe Bonnes 2004-06-30 18:17:07 +00:00 committed by Alexandre Julliard
parent 4679e78432
commit 0e42073cd7
3 changed files with 4 additions and 4 deletions

View file

@ -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 );

View file

@ -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);
}

View file

@ -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)
{