OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // chrome_tab.cc : Implementation of DLL Exports. | 5 // chrome_tab.cc : Implementation of DLL Exports. |
6 | 6 |
7 // Include without path to make GYP build see it. | 7 // Include without path to make GYP build see it. |
8 #include "chrome_tab.h" // NOLINT | 8 #include "chrome_tab.h" // NOLINT |
9 | 9 |
10 #include <atlsecurity.h> | 10 #include <atlsecurity.h> |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "base/string_piece.h" | 21 #include "base/string_piece.h" |
22 #include "base/string_util.h" | 22 #include "base/string_util.h" |
23 #include "base/sys_string_conversions.h" | 23 #include "base/sys_string_conversions.h" |
24 #include "base/win_util.h" | 24 #include "base/win_util.h" |
25 #include "chrome/common/chrome_constants.h" | 25 #include "chrome/common/chrome_constants.h" |
26 #include "grit/chrome_frame_resources.h" | 26 #include "grit/chrome_frame_resources.h" |
27 #include "chrome_frame/bho.h" | 27 #include "chrome_frame/bho.h" |
28 #include "chrome_frame/chrome_active_document.h" | 28 #include "chrome_frame/chrome_active_document.h" |
29 #include "chrome_frame/chrome_frame_activex.h" | 29 #include "chrome_frame/chrome_frame_activex.h" |
30 #include "chrome_frame/chrome_frame_automation.h" | 30 #include "chrome_frame/chrome_frame_automation.h" |
| 31 #include "chrome_frame/exception_barrier.h" |
31 #include "chrome_frame/chrome_frame_reporting.h" | 32 #include "chrome_frame/chrome_frame_reporting.h" |
32 #include "chrome_frame/chrome_launcher.h" | 33 #include "chrome_frame/chrome_launcher.h" |
33 #include "chrome_frame/chrome_protocol.h" | 34 #include "chrome_frame/chrome_protocol.h" |
34 #include "chrome_frame/module_utils.h" | 35 #include "chrome_frame/module_utils.h" |
35 #include "chrome_frame/resource.h" | 36 #include "chrome_frame/resource.h" |
36 #include "chrome_frame/utils.h" | 37 #include "chrome_frame/utils.h" |
37 #include "googleurl/src/url_util.h" | 38 #include "googleurl/src/url_util.h" |
38 | 39 |
39 namespace { | 40 namespace { |
40 // This function has the side effect of initializing an unprotected | 41 // This function has the side effect of initializing an unprotected |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 hr = E_UNEXPECTED; | 228 hr = E_UNEXPECTED; |
228 } | 229 } |
229 | 230 |
230 return hr; | 231 return hr; |
231 } | 232 } |
232 | 233 |
233 HRESULT RefreshElevationPolicy() { | 234 HRESULT RefreshElevationPolicy() { |
234 const wchar_t kIEFrameDll[] = L"ieframe.dll"; | 235 const wchar_t kIEFrameDll[] = L"ieframe.dll"; |
235 const char kIERefreshPolicy[] = "IERefreshElevationPolicy"; | 236 const char kIERefreshPolicy[] = "IERefreshElevationPolicy"; |
236 HRESULT hr = E_NOTIMPL; | 237 HRESULT hr = E_NOTIMPL; |
| 238 |
| 239 // Stick an SEH in the chain to prevent the VEH from picking up on first |
| 240 // chance exceptions caused by loading ieframe.dll. Use the vanilla |
| 241 // ExceptionBarrier to report any exceptions that do make their way to us |
| 242 // though. |
| 243 ExceptionBarrier barrier; |
| 244 |
237 HMODULE ieframe_module = LoadLibrary(kIEFrameDll); | 245 HMODULE ieframe_module = LoadLibrary(kIEFrameDll); |
238 if (ieframe_module) { | 246 if (ieframe_module) { |
239 typedef HRESULT (__stdcall *IERefreshPolicy)(); | 247 typedef HRESULT (__stdcall *IERefreshPolicy)(); |
240 IERefreshPolicy ie_refresh_policy = reinterpret_cast<IERefreshPolicy>( | 248 IERefreshPolicy ie_refresh_policy = reinterpret_cast<IERefreshPolicy>( |
241 GetProcAddress(ieframe_module, kIERefreshPolicy)); | 249 GetProcAddress(ieframe_module, kIERefreshPolicy)); |
242 | 250 |
243 if (ie_refresh_policy) { | 251 if (ie_refresh_policy) { |
244 hr = ie_refresh_policy(); | 252 hr = ie_refresh_policy(); |
245 } else { | 253 } else { |
246 hr = HRESULT_FROM_WIN32(GetLastError()); | 254 hr = HRESULT_FROM_WIN32(GetLastError()); |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 sd.GetDacl(&new_dacl); | 595 sd.GetDacl(&new_dacl); |
588 new_dacl.AddAllowedAce(token_.GetUser(), GENERIC_WRITE | GENERIC_READ); | 596 new_dacl.AddAllowedAce(token_.GetUser(), GENERIC_WRITE | GENERIC_READ); |
589 if (AtlSetDacl(object_name.c_str(), SE_REGISTRY_KEY, new_dacl)) { | 597 if (AtlSetDacl(object_name.c_str(), SE_REGISTRY_KEY, new_dacl)) { |
590 result = SetOrDeleteMimeHandlerKey(enable); | 598 result = SetOrDeleteMimeHandlerKey(enable); |
591 } | 599 } |
592 } | 600 } |
593 | 601 |
594 backup.RestoreSecurity(object_name.c_str()); | 602 backup.RestoreSecurity(object_name.c_str()); |
595 return result; | 603 return result; |
596 } | 604 } |
OLD | NEW |