diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-22 23:55:45 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-22 23:55:45 +0000 |
commit | 70910be7c6ef2377240bd3a32d1dcabc31ad0dd3 (patch) | |
tree | c8d7b8db9b973596e3cfe453900cd306d30da3fe /base/file_version_info_win.cc | |
parent | 6b98e52b28fa37b71d4dd80556e936277a85dbc6 (diff) | |
download | chromium_src-70910be7c6ef2377240bd3a32d1dcabc31ad0dd3.zip chromium_src-70910be7c6ef2377240bd3a32d1dcabc31ad0dd3.tar.gz chromium_src-70910be7c6ef2377240bd3a32d1dcabc31ad0dd3.tar.bz2 |
Base: Fix FileVersionInfo::CreateFileVersionInfoForCurrentModule so that
when base is built as a dll, the module that is inspected for the version
info is the one that makes the call instead of base.dll
BUG=76996
TEST=none
Review URL: http://codereview.chromium.org/6897016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82754 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_version_info_win.cc')
-rw-r--r-- | base/file_version_info_win.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/base/file_version_info_win.cc b/base/file_version_info_win.cc index 8c6820e..6528ca3 100644 --- a/base/file_version_info_win.cc +++ b/base/file_version_info_win.cc @@ -31,11 +31,16 @@ typedef struct { } LanguageAndCodePage; // static -FileVersionInfo* FileVersionInfo::CreateFileVersionInfoForCurrentModule() { - FilePath app_path; - if (!PathService::Get(base::FILE_MODULE, &app_path)) +FileVersionInfo* FileVersionInfo::CreateFileVersionInfoForModule( + HMODULE module) { + // Note that the use of MAX_PATH is basically in line with what we do for + // all registered paths (PathProviderWin). + wchar_t system_buffer[MAX_PATH]; + system_buffer[0] = 0; + if (!GetModuleFileName(module, system_buffer, MAX_PATH)) return NULL; + FilePath app_path(system_buffer); return CreateFileVersionInfo(app_path); } |