Quantcast
Channel: The Old New Thing
Viewing all articles
Browse latest Browse all 24428

re: Why do BackupRead and BackupWrite require synchronous file handles?

$
0
0

Hmmm. BackupRead and BackupWrite when called with an async handle sometimes finish sync and sometimes async, so any caller calling async who managed to deal with the stack corruption must be capable of receiving a sync complete.

This makes for a solution.

If the underlying call returns ERROR_IO_PENDING, immediately call WaitForSingleObject(handle, INFINITE), followed by GetOverlappedResult(), which has the effect of converting the async call to sync.

[Unless the application was relying on the async behavior. For example, calling Wait­For­Single­Object on the handle blocks APCs, including the oplock release request which is preventing the Backup­Read from completing! -Raymond]

Viewing all articles
Browse latest Browse all 24428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>