Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: base/win/pe_image.cc

Issue 5236002: Add infrastructure enabling tests of installer upgrade scenarios.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/chrome.gyp » ('j') | chrome/installer/upgrade_test.gyp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file implements PEImage, a generic class to manipulate PE files. 5 // This file implements PEImage, a generic class to manipulate PE files.
6 // This file was adapted from GreenBorder's Code. 6 // This file was adapted from GreenBorder's Code.
7 7
8 #include "base/win/pe_image.h" 8 #include "base/win/pe_image.h"
9 9
10 namespace base { 10 namespace base {
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 return NULL; 551 return NULL;
552 552
553 return reinterpret_cast<char*>(module_) + rva; 553 return reinterpret_cast<char*>(module_) + rva;
554 } 554 }
555 555
556 PVOID PEImageAsData::RVAToAddr(DWORD rva) const { 556 PVOID PEImageAsData::RVAToAddr(DWORD rva) const {
557 if (rva == 0) 557 if (rva == 0)
558 return NULL; 558 return NULL;
559 559
560 PVOID in_memory = PEImage::RVAToAddr(rva); 560 PVOID in_memory = PEImage::RVAToAddr(rva);
561 DWORD dummy; 561 DWORD disk_offset;
562 562
563 if (!ImageAddrToOnDiskOffset(in_memory, &dummy)) 563 if (!ImageAddrToOnDiskOffset(in_memory, &disk_offset))
564 return NULL; 564 return NULL;
565 565
566 return in_memory; 566 return PEImage::RVAToAddr(disk_offset);
567 } 567 }
568 568
569 } // namespace win 569 } // namespace win
570 } // namespace base 570 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | chrome/chrome.gyp » ('j') | chrome/installer/upgrade_test.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698