Chromium Code Reviews| Index: base/file_version_info_win.cc |
| =================================================================== |
| --- base/file_version_info_win.cc (revision 82561) |
| +++ base/file_version_info_win.cc (working copy) |
| @@ -31,11 +31,16 @@ |
| } LanguageAndCodePage; |
| // static |
| -FileVersionInfo* FileVersionInfo::CreateFileVersionInfoForCurrentModule() { |
| - FilePath app_path; |
| - if (!PathService::Get(base::FILE_MODULE, &app_path)) |
| - return NULL; |
| +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)) |
| + system_buffer[0] = 0; |
|
wtc
2011/04/22 22:15:04
Should we just return NULL here, as the original c
rvargas (doing something else)
2011/04/22 23:08:23
Sure... the effect was the same because the next c
|
| + FilePath app_path(system_buffer); |
| return CreateFileVersionInfo(app_path); |
| } |