oleaut32: Use the helper to access bstr_t.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2016-01-21 10:29:49 +00:00 committed by Alexandre Julliard
parent d15f47412e
commit 13bc86c034
1 changed files with 2 additions and 1 deletions

View File

@ -360,7 +360,8 @@ int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* str, unsigned int len)
if (*old!=NULL) {
BSTR old_copy = *old;
DWORD newbytelen = len*sizeof(WCHAR);
bstr_t *bstr = HeapReAlloc(GetProcessHeap(),0,((DWORD*)*old)-1,bstr_alloc_size(newbytelen));
bstr_t *old_bstr = bstr_from_str(*old);
bstr_t *bstr = HeapReAlloc(GetProcessHeap(), 0, old_bstr, bstr_alloc_size(newbytelen));
*old = bstr->u.str;
bstr->size = newbytelen;
/* Subtle hidden feature: The old string data is still there