| 383 | } |
| 384 | |
| 385 | Status NewSequentialFile(const std::string& filename, |
| 386 | SequentialFile** result) override { |
| 387 | *result = nullptr; |
| 388 | DWORD desired_access = GENERIC_READ; |
| 389 | DWORD share_mode = FILE_SHARE_READ; |
| 390 | auto wFilename = toUtf16(filename); |
| 391 | ScopedHandle handle = ::CreateFileW( |
| 392 | wFilename.c_str(), desired_access, share_mode, |
| 393 | /*lpSecurityAttributes=*/nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, |
| 394 | /*hTemplateFile=*/nullptr); |
| 395 | if (!handle.is_valid()) { |
| 396 | return WindowsError(filename, ::GetLastError()); |
| 397 | } |
| 398 | |
| 399 | *result = new WindowsSequentialFile(filename, std::move(handle)); |
| 400 | return Status::OK(); |
| 401 | } |
| 402 | |
| 403 | Status NewRandomAccessFile(const std::string& filename, |
| 404 | RandomAccessFile** result) override { |
nothing calls this directly
no test coverage detected