summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
Diffstat (limited to 'base')
-rw-r--r--base/file_util_win.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index 812a706..9fae6a39 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -805,8 +805,10 @@ bool MemoryMappedFile::MapFileToMemoryInternal() {
if (length_ == INVALID_FILE_SIZE)
return false;
+ // length_ value comes from GetFileSize() above. GetFileSize() returns DWORD,
+ // therefore the cast here is safe.
file_mapping_ = ::CreateFileMapping(file_, NULL, PAGE_READONLY,
- 0, length_, NULL);
+ 0, static_cast<DWORD>(length_), NULL);
if (file_mapping_ == INVALID_HANDLE_VALUE)
return false;