Hello,
Welcome to Microsoft Q&A!
According to the Doc: IPortableDeviceContent::CreateObjectWithPropertiesOnly method
[in, out] ppszObjectID An optional string pointer to receive the name of the new object.
The SDK allocates this memory; the caller must release it using CoTaskMemFree.
I suggest you could try to use CoTaskMemFree function to release it. And then re-create a new one with the same name.
Thank you.
Jeanine
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.