Our own completions looked their call up again by block address: after a
provider's DoWork returned, after a cancel, after a failed begin, and when
queued DoWork ran. A provider usually ends its call itself (XAsyncComplete
from DoWork or Cancel), and once it has, the title may begin a new call on
the same block, from its completion routine or from a thread that polls
the status. The lookup then found that new call:
- the old call's DoWork result (S_OK, size 0) or cancel (E_ABORT) ended
the new call before it had done anything, ran its cleanup and fired the
completion routine a second time;
- DoWork still queued for a canceled call ran the new call's DoWork.
Each queued DoWork now carries the call that scheduled it and runs only
while that call is still the block's, and DoWork, cancel and begin
complete that call. A call that is already over ignores a second
complete, so nothing reaches the next call. XAsyncComplete itself still
goes by block, as providers name their call by its block.
(cherry picked from commit d01b17070dbf5f181e327ee540510cec73facbe9)