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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/win/scoped_handle.h" | 9 #include "base/win/scoped_handle.h" |
10 #include "base/win/windows_version.h" | 10 #include "base/win/windows_version.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 ipc_calls_.push_back(open_params); | 61 ipc_calls_.push_back(open_params); |
62 } | 62 } |
63 | 63 |
64 bool RegistryDispatcher::SetupService(InterceptionManager* manager, | 64 bool RegistryDispatcher::SetupService(InterceptionManager* manager, |
65 int service) { | 65 int service) { |
66 if (IPC_NTCREATEKEY_TAG == service) | 66 if (IPC_NTCREATEKEY_TAG == service) |
67 return INTERCEPT_NT(manager, NtCreateKey, CREATE_KEY_ID, 32); | 67 return INTERCEPT_NT(manager, NtCreateKey, CREATE_KEY_ID, 32); |
68 | 68 |
69 if (IPC_NTOPENKEY_TAG == service) { | 69 if (IPC_NTOPENKEY_TAG == service) { |
70 bool result = INTERCEPT_NT(manager, NtOpenKey, OPEN_KEY_ID, 16); | 70 bool result = INTERCEPT_NT(manager, NtOpenKey, OPEN_KEY_ID, 16); |
71 if (base::win::GetVersion() >= base::win::VERSION_WIN7 || | 71 result &= INTERCEPT_NT(manager, NtOpenKeyEx, OPEN_KEY_EX_ID, 20); |
72 (base::win::GetVersion() == base::win::VERSION_VISTA && | |
73 base::win::OSInfo::GetInstance()->version_type() == | |
74 base::win::SUITE_SERVER)) | |
75 result &= INTERCEPT_NT(manager, NtOpenKeyEx, OPEN_KEY_EX_ID, 20); | |
76 return result; | 72 return result; |
77 } | 73 } |
78 | 74 |
79 return false; | 75 return false; |
80 } | 76 } |
81 | 77 |
82 bool RegistryDispatcher::NtCreateKey(IPCInfo* ipc, | 78 bool RegistryDispatcher::NtCreateKey(IPCInfo* ipc, |
83 base::string16* name, | 79 base::string16* name, |
84 uint32_t attributes, | 80 uint32_t attributes, |
85 HANDLE root, | 81 HANDLE root, |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 return true; | 162 return true; |
167 } | 163 } |
168 | 164 |
169 // Return operation status on the IPC. | 165 // Return operation status on the IPC. |
170 ipc->return_info.nt_status = nt_status; | 166 ipc->return_info.nt_status = nt_status; |
171 ipc->return_info.handle = handle; | 167 ipc->return_info.handle = handle; |
172 return true; | 168 return true; |
173 } | 169 } |
174 | 170 |
175 } // namespace sandbox | 171 } // namespace sandbox |
OLD | NEW |