[PATCH 1/3] oleaut32: Use the helper to access bstr_t.

Huw Davies huw at codeweavers.com
Thu Jan 21 04:29:49 CST 2016


Signed-off-by: Huw Davies <huw at codeweavers.com>
---
 dlls/oleaut32/oleaut.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/oleaut32/oleaut.c b/dlls/oleaut32/oleaut.c
index 214421c..8a22c2e 100644
--- a/dlls/oleaut32/oleaut.c
+++ b/dlls/oleaut32/oleaut.c
@@ -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
-- 
2.7.0




More information about the wine-patches mailing list