On Wed Jan 17 16:33:09 2024 +0000, Yuxuan Shui wrote:
I can't, `!FAILED(hr)` doesn't mean `hr` is `S_OK`. `stream_get_chunk` returns `S_FALSE` for EOF.
I would do something like that, moving the list_add_tail call to the same location where the object ownership is either freed or moved to the list.
``` if (FAILED(hr)) free(pchannel_to_buffer); else list_add_tail(&This->pchannel_to_buffer_entries, &pchannel_to_buffer->entry);
return hr; ```
The called can handle the returned hr the same way up to the topmost level where any FAILED status returned and other success status changed to S_OK.