summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-16 00:06:04 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-16 00:06:04 +0000
commit97ff82441b7ab9cf2aae383667ab216c30f2fb03 (patch)
tree0ab945ed17cfc33915bfe7d96b58a0ee86470978 /base
parentdfb189910dc94c31380255cf1f0c91892d7f2c97 (diff)
downloadchromium_src-97ff82441b7ab9cf2aae383667ab216c30f2fb03.zip
chromium_src-97ff82441b7ab9cf2aae383667ab216c30f2fb03.tar.gz
chromium_src-97ff82441b7ab9cf2aae383667ab216c30f2fb03.tar.bz2
Properly check CreateFileMapping's return value.
According to MSDN, NULL is returned on error, not INVALID_FILE_HANDLE. BUG=58056 Review URL: http://codereview.chromium.org/3760008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62824 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/file_util_win.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index 24a4dea..10a6b3b 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -900,7 +900,7 @@ bool MemoryMappedFile::MapFileToMemoryInternal() {
// therefore the cast here is safe.
file_mapping_ = ::CreateFileMapping(file_, NULL, PAGE_READONLY,
0, static_cast<DWORD>(length_), NULL);
- if (file_mapping_ == INVALID_HANDLE_VALUE) {
+ if (!file_mapping_) {
// According to msdn, system error codes are only reserved up to 15999.
// http://msdn.microsoft.com/en-us/library/ms681381(v=VS.85).aspx.
UMA_HISTOGRAM_ENUMERATION("MemoryMappedFile.CreateFileMapping",