| Index: chrome/utility/image_writer/image_writer_win.cc
|
| diff --git a/chrome/utility/image_writer/image_writer_win.cc b/chrome/utility/image_writer/image_writer_win.cc
|
| index b3cec9507445bc47ec1e83f2869e6abb38dd3b04..1d6542e5e3f030e5659e7ecccd45ff32485203aa 100644
|
| --- a/chrome/utility/image_writer/image_writer_win.cc
|
| +++ b/chrome/utility/image_writer/image_writer_win.cc
|
| @@ -55,7 +55,21 @@ bool ImageWriter::IsValidDevice() {
|
| return device_descriptor->RemovableMedia == TRUE;
|
| }
|
|
|
| -bool ImageWriter::UnmountVolumes() {
|
| +bool ImageWriter::OpenDevice() {
|
| + // Windows requires that device files be opened with FILE_FLAG_NO_BUFFERING
|
| + // and FILE_FLAG_WRITE_THROUGH. These two flags are not part of base::File.
|
| + device_file_ =
|
| + base::File(CreateFile(device_path_.value().c_str(),
|
| + GENERIC_READ | GENERIC_WRITE,
|
| + FILE_SHARE_READ | FILE_SHARE_WRITE,
|
| + NULL,
|
| + OPEN_EXISTING,
|
| + FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH,
|
| + NULL));
|
| + return device_file_.IsValid();
|
| +}
|
| +
|
| +void ImageWriter::UnmountVolumes(const base::Closure& continuation) {
|
| if (!InitializeFiles()) {
|
| return false;
|
| }
|
| @@ -177,7 +191,8 @@ bool ImageWriter::UnmountVolumes() {
|
| FindVolumeClose(volume_finder);
|
| }
|
|
|
| - return success;
|
| + if (success)
|
| + callback.Run();
|
| }
|
|
|
| } // namespace image_writer
|
|
|