OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "sandbox/src/registry_policy.h" | 7 #include "sandbox/win/src/registry_policy.h" |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "sandbox/src/ipc_tags.h" | 10 #include "sandbox/win/src/ipc_tags.h" |
11 #include "sandbox/src/policy_engine_opcodes.h" | 11 #include "sandbox/win/src/policy_engine_opcodes.h" |
12 #include "sandbox/src/policy_params.h" | 12 #include "sandbox/win/src/policy_params.h" |
13 #include "sandbox/src/sandbox_utils.h" | 13 #include "sandbox/win/src/sandbox_utils.h" |
14 #include "sandbox/src/sandbox_types.h" | 14 #include "sandbox/win/src/sandbox_types.h" |
15 #include "sandbox/src/win_utils.h" | 15 #include "sandbox/win/src/win_utils.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 static const DWORD kAllowedRegFlags = KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS | | 19 static const DWORD kAllowedRegFlags = KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS | |
20 KEY_NOTIFY | KEY_READ | GENERIC_READ | | 20 KEY_NOTIFY | KEY_READ | GENERIC_READ | |
21 GENERIC_EXECUTE | READ_CONTROL; | 21 GENERIC_EXECUTE | READ_CONTROL; |
22 | 22 |
23 // Opens the key referenced by |obj_attributes| with |access| and | 23 // Opens the key referenced by |obj_attributes| with |access| and |
24 // checks what permission was given. Remove the WRITE flags and update | 24 // checks what permission was given. Remove the WRITE flags and update |
25 // |access| with the new value. | 25 // |access| with the new value. |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 UNICODE_STRING uni_name = {0}; | 218 UNICODE_STRING uni_name = {0}; |
219 OBJECT_ATTRIBUTES obj_attributes = {0}; | 219 OBJECT_ATTRIBUTES obj_attributes = {0}; |
220 InitObjectAttribs(key, attributes, root_directory, &obj_attributes, | 220 InitObjectAttribs(key, attributes, root_directory, &obj_attributes, |
221 &uni_name); | 221 &uni_name); |
222 *nt_status = NtOpenKeyInTarget(handle, desired_access, &obj_attributes, | 222 *nt_status = NtOpenKeyInTarget(handle, desired_access, &obj_attributes, |
223 client_info.process); | 223 client_info.process); |
224 return true; | 224 return true; |
225 } | 225 } |
226 | 226 |
227 } // namespace sandbox | 227 } // namespace sandbox |
OLD | NEW |