| 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> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 DllRedirector::~DllRedirector() { | 39 DllRedirector::~DllRedirector() { |
| 40 if (first_module_handle_) { | 40 if (first_module_handle_) { |
| 41 if (first_module_handle_ != reinterpret_cast<HMODULE>(&__ImageBase)) { | 41 if (first_module_handle_ != reinterpret_cast<HMODULE>(&__ImageBase)) { |
| 42 FreeLibrary(first_module_handle_); | 42 FreeLibrary(first_module_handle_); |
| 43 } | 43 } |
| 44 first_module_handle_ = NULL; | 44 first_module_handle_ = NULL; |
| 45 } | 45 } |
| 46 UnregisterAsFirstCFModule(); | 46 UnregisterAsFirstCFModule(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 // static |
| 50 DllRedirector* DllRedirector::GetInstance() { |
| 51 return Singleton<DllRedirector>::get(); |
| 52 } |
| 53 |
| 49 bool DllRedirector::BuildSecurityAttributesForLock( | 54 bool DllRedirector::BuildSecurityAttributesForLock( |
| 50 CSecurityAttributes* sec_attr) { | 55 CSecurityAttributes* sec_attr) { |
| 51 DCHECK(sec_attr); | 56 DCHECK(sec_attr); |
| 52 int32 major_version, minor_version, fix_version; | 57 int32 major_version, minor_version, fix_version; |
| 53 base::SysInfo::OperatingSystemVersionNumbers(&major_version, | 58 base::SysInfo::OperatingSystemVersionNumbers(&major_version, |
| 54 &minor_version, | 59 &minor_version, |
| 55 &fix_version); | 60 &fix_version); |
| 56 if (major_version < 6) { | 61 if (major_version < 6) { |
| 57 // Don't bother with changing ACLs on pre-vista. | 62 // Don't bother with changing ACLs on pre-vista. |
| 58 return false; | 63 return false; |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 .Append(module_name); | 281 .Append(module_name); |
| 277 | 282 |
| 278 HMODULE hmodule = LoadLibrary(module_path.value().c_str()); | 283 HMODULE hmodule = LoadLibrary(module_path.value().c_str()); |
| 279 if (hmodule == NULL) { | 284 if (hmodule == NULL) { |
| 280 DPLOG(ERROR) << "Could not load reported module version " | 285 DPLOG(ERROR) << "Could not load reported module version " |
| 281 << version->GetString(); | 286 << version->GetString(); |
| 282 } | 287 } |
| 283 | 288 |
| 284 return hmodule; | 289 return hmodule; |
| 285 } | 290 } |
| OLD | NEW |