diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-10 01:06:31 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-10 01:06:31 +0000 |
commit | 48d7fb37f85d0f03643214105b04d9e123adb1e6 (patch) | |
tree | 9e9ddc3cdbfcab7f2bebe6ba8056dbf72054aa95 /base | |
parent | 8c37a7cddfc0d840a6652559f4e4d8235029ef02 (diff) | |
download | chromium_src-48d7fb37f85d0f03643214105b04d9e123adb1e6.zip chromium_src-48d7fb37f85d0f03643214105b04d9e123adb1e6.tar.gz chromium_src-48d7fb37f85d0f03643214105b04d9e123adb1e6.tar.bz2 |
The code to validate whether plugin dlls are 32 bit failed for some dll's as the attempt
to create a memory mapped section with the size of the file fails with the section too large
error. As per msdn documentation we can safely pass in 0 for the file size for CreateFileMapping
and MapViewOfFile which indicates that the whole file is being mapped.
This caused some plugin dlls like acrobat reader 9 to not load in chrome.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=75351
BUG=75351
TEST=manually as described in the bug.
Review URL: http://codereview.chromium.org/6661010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/file_util_win.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/base/file_util_win.cc b/base/file_util_win.cc index 2c26a16..af989c8 100644 --- a/base/file_util_win.cc +++ b/base/file_util_win.cc @@ -972,10 +972,8 @@ bool MemoryMappedFile::MapFileToMemoryInternalEx(int flags) { 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 | flags, - 0, static_cast<DWORD>(length_), NULL); + 0, 0, NULL); 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. @@ -985,7 +983,7 @@ bool MemoryMappedFile::MapFileToMemoryInternalEx(int flags) { } data_ = static_cast<uint8*>( - ::MapViewOfFile(file_mapping_, FILE_MAP_READ, 0, 0, length_)); + ::MapViewOfFile(file_mapping_, FILE_MAP_READ, 0, 0, 0)); if (!data_) { UMA_HISTOGRAM_ENUMERATION("MemoryMappedFile.MapViewOfFile", logging::GetLastSystemErrorCode(), 16000); |