| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/policy/policy_loader_win.h" | 5 #include "chrome/browser/policy/policy_loader_win.h" |
| 6 | 6 |
| 7 #include <rpc.h> // For struct GUID | 7 #include <rpc.h> // For struct GUID |
| 8 #include <shlwapi.h> // For PathIsUNC() | 8 #include <shlwapi.h> // For PathIsUNC() |
| 9 #include <userenv.h> // For GPO functions | 9 #include <userenv.h> // For GPO functions |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 // A helper class encapsulating run-time-linked function calls to Wow64 APIs. | 58 // A helper class encapsulating run-time-linked function calls to Wow64 APIs. |
| 59 class Wow64Functions { | 59 class Wow64Functions { |
| 60 public: | 60 public: |
| 61 Wow64Functions() | 61 Wow64Functions() |
| 62 : kernel32_lib_(base::FilePath(L"kernel32")), | 62 : kernel32_lib_(base::FilePath(L"kernel32")), |
| 63 is_wow_64_process_(NULL), | 63 is_wow_64_process_(NULL), |
| 64 wow_64_disable_wow_64_fs_redirection_(NULL), | 64 wow_64_disable_wow_64_fs_redirection_(NULL), |
| 65 wow_64_revert_wow_64_fs_redirection_(NULL) { | 65 wow_64_revert_wow_64_fs_redirection_(NULL) { |
| 66 if (kernel32_lib_.is_valid()) { | 66 if (kernel32_lib_.is_valid()) { |
| 67 is_wow_64_process_ = static_cast<IsWow64Process>( | 67 is_wow_64_process_ = reinterpret_cast<IsWow64Process>( |
| 68 kernel32_lib_.GetFunctionPointer("IsWow64Process")); | 68 kernel32_lib_.GetFunctionPointer("IsWow64Process")); |
| 69 wow_64_disable_wow_64_fs_redirection_ = | 69 wow_64_disable_wow_64_fs_redirection_ = |
| 70 static_cast<Wow64DisableWow64FSRedirection>( | 70 reinterpret_cast<Wow64DisableWow64FSRedirection>( |
| 71 kernel32_lib_.GetFunctionPointer( | 71 kernel32_lib_.GetFunctionPointer( |
| 72 "Wow64DisableWow64FsRedirection")); | 72 "Wow64DisableWow64FsRedirection")); |
| 73 wow_64_revert_wow_64_fs_redirection_ = | 73 wow_64_revert_wow_64_fs_redirection_ = |
| 74 static_cast<Wow64RevertWow64FSRedirection>( | 74 reinterpret_cast<Wow64RevertWow64FSRedirection>( |
| 75 kernel32_lib_.GetFunctionPointer( | 75 kernel32_lib_.GetFunctionPointer( |
| 76 "Wow64RevertWow64FsRedirection")); | 76 "Wow64RevertWow64FsRedirection")); |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 | 79 |
| 80 bool is_valid() { | 80 bool is_valid() { |
| 81 return is_wow_64_process_ && | 81 return is_wow_64_process_ && |
| 82 wow_64_disable_wow_64_fs_redirection_ && | 82 wow_64_disable_wow_64_fs_redirection_ && |
| 83 wow_64_revert_wow_64_fs_redirection_; | 83 wow_64_revert_wow_64_fs_redirection_; |
| 84 } | 84 } |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 | 770 |
| 771 void PolicyLoaderWin::OnObjectSignaled(HANDLE object) { | 771 void PolicyLoaderWin::OnObjectSignaled(HANDLE object) { |
| 772 DCHECK(object == user_policy_changed_event_.handle() || | 772 DCHECK(object == user_policy_changed_event_.handle() || |
| 773 object == machine_policy_changed_event_.handle()) | 773 object == machine_policy_changed_event_.handle()) |
| 774 << "unexpected object signaled policy reload, obj = " | 774 << "unexpected object signaled policy reload, obj = " |
| 775 << std::showbase << std::hex << object; | 775 << std::showbase << std::hex << object; |
| 776 Reload(false); | 776 Reload(false); |
| 777 } | 777 } |
| 778 | 778 |
| 779 } // namespace policy | 779 } // namespace policy |
| OLD | NEW |