BSTR newID_x = SysAllocString(L"newID");
BSTR newX_x = SysAllocString(L"newX");
functionA(&newID_x);
//Func A does some operation on newID_x, we have that value in newID_x now
functionA(&newX_x);
//After Func A is called for the second time, both newID_x and newX_x become the same
//i.e, both are pointing to same locations and hence values too
My question is that, is it a correct behavior for BSTR
s, do we need to save the newX_x
in some new BSTR
after calling functionA
the first time?
Or is it wrong on part of functionA
that it may be wrongly allocating/de-allocating the passed BSTR
s.