On Wed Jun 5 07:56:05 2024 +0000, Huw Davies wrote:
No. We'd use `wcsdup()` / `free()` in the setter and only use `CoTaskMemAlloc()` when we actually need to return something. So that means not using `duplicate_wstr()` in the setters and instead calling `free()` and `wcsdup()` directly.
For some modules we have helpers like "HRESULT return_string();" that will allocate properly, handle null/empty strings, and set return code correctly. Might not be worth it if you need to return such value only once, but still the shorter method body is, less branching it has, the better.