DWORD *ptr = HeapReAlloc(GetProcessHeap(),0,((DWORD*)*old)-1,newbytelen+sizeof(WCHAR)+sizeof(DWORD));
*old = (BSTR)(ptr+1);
*ptr = newbytelen;
- if (str) {
- memmove(*old, str, newbytelen);
- (*old)[len] = 0;
- } else {
- /* Subtle hidden feature: The old string data is still there
- * when 'in' is NULL!
- * Some Microsoft program needs it.
- */
- }
+ /* Subtle hidden feature: The old string data is still there
+ * when 'in' is NULL!
+ * Some Microsoft program needs it.
+ */
+ if (str) memmove(*old, str, newbytelen);
+ (*old)[len] = 0;
} else {
/*
* Allocate the new string
if (str)
{
ok (str == oldstr, "Expected reuse of the old string memory\n");
- todo_wine ok (str[STRING_SIZE] == 0,
+ ok (str[STRING_SIZE] == 0,
"Expected null terminator, got 0x%04X\n", str[STRING_SIZE]);
SysFreeString(str);
}