Commit 08e200fb authored by Chris Mumford's avatar Chris Mumford

Setting last error if base::File created with bad flags.

If base::File was constructed with incorrect arguments such that
there was no disposition then a caller to Window's ::GetLastError()
could retrieve ERROR_SUCCESS, and also base::File::error_details()
would return Error::FILE_OK. This fixes this, and is also consistent
with the POSIX version of base::File.

Bug: None
Change-Id: Ief0e1de98f132cff28c12ab076f9b18deeaa97b3
Reviewed-on: https://chromium-review.googlesource.com/802190
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520975}
parent d0f4900f
......@@ -348,6 +348,8 @@ void File::DoInitialize(const FilePath& path, uint32_t flags) {
}
if (!disposition) {
::SetLastError(ERROR_INVALID_PARAMETER);
error_details_ = FILE_ERROR_FAILED;
NOTREACHED();
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment