That (specifically, "Send all queued samples to dsound before issuing EC_COMPLETE.") fixes Rigid Force Alpha ending voice lines early (about ~0.2s early but that can be clearly heard during initial cutscene).
Each voice line is an mp3 file played through direct show with dsound renderer. What happens is that upon receiving EOS 'render_thread_run' may still have queued buffers, as well as the data to be played in the dsound buffer (~150ms). When the game receives EC_COMPLETE event it immediately stops the graph (while rendering thread is also not going to play queued samples anyway).
So the right thing to do seems to wait for the currently in-flight sound to be played. A pre-requisite problem I found on the way is what is addressed in the first patch ("Do not limit maximum fill when clearing the buffer with zeroes."). The overall dsound buffer is 1sec long. Regardless of my changes 'send_sample_data(filter, -1, NULL, filter->buf_size);' in render_thread_run() is currently waiting about 1s always. That's because of maximum fill check in get_write_pos() which, once 150ms of zeroes are filled into the buffer, will wait until those are played before moving further. While what we probably want to do here (especially with my patch addressing EC_COMPLETE event timing) is to only wait for the previously submitted data not yet played. That is achieved with the first patch, it will now wait only for the amount of data previously present in the buffer.
The second tests patch (Check for EC_COMPLETE more often in test_eos()) helps to interpret test results, currently 'todo_wine' appear after later calls while EC_COMPLETE was sent from earlier calls. The added todo with "Send all queued samples to dsound before issuing EC_COMPLETE." is not really added, that is essentially pre-existing extra EC_COMPLETE (removed todo before that) which is arriving later after the patch. All the remaining EC_COMPLETE-related todos are fixed in the last patch (which is a separate aspect of handling flush, which is not exactly related to the other parts).