| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "base/file_version_info_win.h" | 5 #include "base/file_version_info_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
| 14 | 14 |
| 15 using base::FilePath; | 15 using base::FilePath; |
| 16 | 16 |
| 17 FileVersionInfoWin::FileVersionInfoWin(void* data, int language, int code_page) | 17 FileVersionInfoWin::FileVersionInfoWin(void* data, |
| 18 WORD language, |
| 19 WORD code_page) |
| 18 : language_(language), code_page_(code_page) { | 20 : language_(language), code_page_(code_page) { |
| 19 base::ThreadRestrictions::AssertIOAllowed(); | 21 base::ThreadRestrictions::AssertIOAllowed(); |
| 20 data_.reset((char*) data); | 22 data_.reset((char*) data); |
| 21 fixed_file_info_ = NULL; | 23 fixed_file_info_ = NULL; |
| 22 UINT size; | 24 UINT size; |
| 23 ::VerQueryValue(data_.get(), L"\\", (LPVOID*)&fixed_file_info_, &size); | 25 ::VerQueryValue(data_.get(), L"\\", (LPVOID*)&fixed_file_info_, &size); |
| 24 } | 26 } |
| 25 | 27 |
| 26 FileVersionInfoWin::~FileVersionInfoWin() { | 28 FileVersionInfoWin::~FileVersionInfoWin() { |
| 27 DCHECK(data_.get()); | 29 DCHECK(data_.get()); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 return false; | 182 return false; |
| 181 } | 183 } |
| 182 | 184 |
| 183 std::wstring FileVersionInfoWin::GetStringValue(const wchar_t* name) { | 185 std::wstring FileVersionInfoWin::GetStringValue(const wchar_t* name) { |
| 184 std::wstring str; | 186 std::wstring str; |
| 185 if (GetValue(name, &str)) | 187 if (GetValue(name, &str)) |
| 186 return str; | 188 return str; |
| 187 else | 189 else |
| 188 return L""; | 190 return L""; |
| 189 } | 191 } |
| OLD | NEW |