OLD | NEW |
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 #include "chrome_frame/dll_redirector.h" | 5 #include "chrome_frame/dll_redirector.h" |
6 | 6 |
7 #include <aclapi.h> | 7 #include <aclapi.h> |
8 #include <atlbase.h> | 8 #include <atlbase.h> |
9 #include <atlsecurity.h> | 9 #include <atlsecurity.h> |
10 #include <sddl.h> | 10 #include <sddl.h> |
11 | 11 |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/file_version_info.h" | 13 #include "base/file_version_info.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
16 #include "base/shared_memory.h" | 16 #include "base/shared_memory.h" |
| 17 #include "base/string_util.h" |
17 #include "base/sys_info.h" | 18 #include "base/sys_info.h" |
18 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
19 #include "base/version.h" | 20 #include "base/version.h" |
20 #include "chrome_frame/utils.h" | 21 #include "chrome_frame/utils.h" |
21 | 22 |
22 const wchar_t kSharedMemoryName[] = L"ChromeFrameVersionBeacon_"; | 23 const wchar_t kSharedMemoryName[] = L"ChromeFrameVersionBeacon_"; |
23 const uint32 kSharedMemorySize = 128; | 24 const uint32 kSharedMemorySize = 128; |
24 const uint32 kSharedMemoryLockTimeoutMs = 1000; | 25 const uint32 kSharedMemoryLockTimeoutMs = 1000; |
25 | 26 |
26 // static | 27 // static |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 } | 241 } |
241 | 242 |
242 Version* DllRedirector::GetCurrentModuleVersion() { | 243 Version* DllRedirector::GetCurrentModuleVersion() { |
243 scoped_ptr<FileVersionInfo> file_version_info( | 244 scoped_ptr<FileVersionInfo> file_version_info( |
244 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); | 245 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); |
245 DCHECK(file_version_info.get()); | 246 DCHECK(file_version_info.get()); |
246 | 247 |
247 Version* current_version = NULL; | 248 Version* current_version = NULL; |
248 if (file_version_info.get()) { | 249 if (file_version_info.get()) { |
249 current_version = Version::GetVersionFromString( | 250 current_version = Version::GetVersionFromString( |
250 file_version_info->file_version()); | 251 WideToASCII(file_version_info->file_version())); |
251 DCHECK(current_version); | 252 DCHECK(current_version); |
252 } | 253 } |
253 | 254 |
254 return current_version; | 255 return current_version; |
255 } | 256 } |
256 | 257 |
257 HMODULE DllRedirector::GetFirstModule() { | 258 HMODULE DllRedirector::GetFirstModule() { |
258 DCHECK(dll_version_.get()) | 259 DCHECK(dll_version_.get()) |
259 << "Error: Did you call RegisterAsFirstCFModule() first?"; | 260 << "Error: Did you call RegisterAsFirstCFModule() first?"; |
260 | 261 |
(...skipping 20 matching lines...) Expand all Loading... |
281 .Append(module_name); | 282 .Append(module_name); |
282 | 283 |
283 HMODULE hmodule = LoadLibrary(module_path.value().c_str()); | 284 HMODULE hmodule = LoadLibrary(module_path.value().c_str()); |
284 if (hmodule == NULL) { | 285 if (hmodule == NULL) { |
285 DPLOG(ERROR) << "Could not load reported module version " | 286 DPLOG(ERROR) << "Could not load reported module version " |
286 << version->GetString(); | 287 << version->GetString(); |
287 } | 288 } |
288 | 289 |
289 return hmodule; | 290 return hmodule; |
290 } | 291 } |
OLD | NEW |