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 "sandbox/win/src/registry_dispatcher.h" | 5 #include "sandbox/win/src/registry_dispatcher.h" |
6 | 6 |
7 #include "base/win/scoped_handle.h" | 7 #include "base/win/scoped_handle.h" |
8 #include "base/win/windows_version.h" | 8 #include "base/win/windows_version.h" |
9 #include "sandbox/win/src/crosscall_client.h" | 9 #include "sandbox/win/src/crosscall_client.h" |
10 #include "sandbox/win/src/interception.h" | 10 #include "sandbox/win/src/interception.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 ipc_calls_.push_back(open_params); | 56 ipc_calls_.push_back(open_params); |
57 } | 57 } |
58 | 58 |
59 bool RegistryDispatcher::SetupService(InterceptionManager* manager, | 59 bool RegistryDispatcher::SetupService(InterceptionManager* manager, |
60 int service) { | 60 int service) { |
61 if (IPC_NTCREATEKEY_TAG == service) | 61 if (IPC_NTCREATEKEY_TAG == service) |
62 return INTERCEPT_NT(manager, NtCreateKey, CREATE_KEY_ID, 32); | 62 return INTERCEPT_NT(manager, NtCreateKey, CREATE_KEY_ID, 32); |
63 | 63 |
64 if (IPC_NTOPENKEY_TAG == service) { | 64 if (IPC_NTOPENKEY_TAG == service) { |
65 bool result = INTERCEPT_NT(manager, NtOpenKey, OPEN_KEY_ID, 16); | 65 bool result = INTERCEPT_NT(manager, NtOpenKey, OPEN_KEY_ID, 16); |
66 if (base::win::GetVersion() >= base::win::VERSION_WIN7) | 66 if (base::win::GetVersion() >= base::win::VERSION_WIN7 || |
| 67 (base::win::GetVersion() == base::win::VERSION_VISTA && |
| 68 base::win::OSInfo::GetInstance()->version_type() == |
| 69 base::win::SUITE_SERVER)) |
67 result &= INTERCEPT_NT(manager, NtOpenKeyEx, OPEN_KEY_EX_ID, 20); | 70 result &= INTERCEPT_NT(manager, NtOpenKeyEx, OPEN_KEY_EX_ID, 20); |
68 return result; | 71 return result; |
69 } | 72 } |
70 | 73 |
71 return false; | 74 return false; |
72 } | 75 } |
73 | 76 |
74 bool RegistryDispatcher::NtCreateKey( | 77 bool RegistryDispatcher::NtCreateKey( |
75 IPCInfo* ipc, base::string16* name, DWORD attributes, HANDLE root, | 78 IPCInfo* ipc, base::string16* name, DWORD attributes, HANDLE root, |
76 DWORD desired_access, DWORD title_index, DWORD create_options) { | 79 DWORD desired_access, DWORD title_index, DWORD create_options) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 return true; | 155 return true; |
153 } | 156 } |
154 | 157 |
155 // Return operation status on the IPC. | 158 // Return operation status on the IPC. |
156 ipc->return_info.nt_status = nt_status; | 159 ipc->return_info.nt_status = nt_status; |
157 ipc->return_info.handle = handle; | 160 ipc->return_info.handle = handle; |
158 return true; | 161 return true; |
159 } | 162 } |
160 | 163 |
161 } // namespace sandbox | 164 } // namespace sandbox |
OLD | NEW |