Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(859)

Side by Side Diff: sandbox/src/registry_dispatcher.cc

Issue 20287: In windows 7 there is a new Reg call that we need to... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sandbox/src/nt_internals.h ('k') | sandbox/src/registry_interception.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "sandbox/src/registry_dispatcher.h" 5 #include "sandbox/src/registry_dispatcher.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/scoped_handle_win.h" 8 #include "base/scoped_handle_win.h"
9 #include "base/win_util.h"
9 #include "sandbox/src/crosscall_client.h" 10 #include "sandbox/src/crosscall_client.h"
10 #include "sandbox/src/interception.h" 11 #include "sandbox/src/interception.h"
11 #include "sandbox/src/ipc_tags.h" 12 #include "sandbox/src/ipc_tags.h"
12 #include "sandbox/src/sandbox_nt_util.h" 13 #include "sandbox/src/sandbox_nt_util.h"
13 #include "sandbox/src/policy_broker.h" 14 #include "sandbox/src/policy_broker.h"
14 #include "sandbox/src/policy_params.h" 15 #include "sandbox/src/policy_params.h"
15 #include "sandbox/src/sandbox.h" 16 #include "sandbox/src/sandbox.h"
16 #include "sandbox/src/registry_interception.h" 17 #include "sandbox/src/registry_interception.h"
17 #include "sandbox/src/registry_policy.h" 18 #include "sandbox/src/registry_policy.h"
18 19
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 54
54 ipc_calls_.push_back(create_params); 55 ipc_calls_.push_back(create_params);
55 ipc_calls_.push_back(open_params); 56 ipc_calls_.push_back(open_params);
56 } 57 }
57 58
58 bool RegistryDispatcher::SetupService(InterceptionManager* manager, 59 bool RegistryDispatcher::SetupService(InterceptionManager* manager,
59 int service) { 60 int service) {
60 if (IPC_NTCREATEKEY_TAG == service) 61 if (IPC_NTCREATEKEY_TAG == service)
61 return INTERCEPT_NT(manager, NtCreateKey, "_TargetNtCreateKey@32"); 62 return INTERCEPT_NT(manager, NtCreateKey, "_TargetNtCreateKey@32");
62 63
63 if (IPC_NTOPENKEY_TAG == service) 64 if (IPC_NTOPENKEY_TAG == service) {
64 return INTERCEPT_NT(manager, NtOpenKey, "_TargetNtOpenKey@16"); 65 bool result = INTERCEPT_NT(manager, NtOpenKey, "_TargetNtOpenKey@16");
66 if (win_util::GetWinVersion() >= win_util::WINVERSION_WIN7)
67 result &= INTERCEPT_NT(manager, NtOpenKeyEx, "_TargetNtOpenKeyEx@20");
68 return result;
69 }
65 70
66 return false; 71 return false;
67 } 72 }
68 73
69 bool RegistryDispatcher::NtCreateKey( 74 bool RegistryDispatcher::NtCreateKey(
70 IPCInfo* ipc, std::wstring* name, DWORD attributes, DWORD root_directory, 75 IPCInfo* ipc, std::wstring* name, DWORD attributes, DWORD root_directory,
71 DWORD desired_access, DWORD title_index, DWORD create_options) { 76 DWORD desired_access, DWORD title_index, DWORD create_options) {
72 ScopedHandle root_handle; 77 ScopedHandle root_handle;
73 std::wstring real_path = *name; 78 std::wstring real_path = *name;
74 79
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } 159 }
155 160
156 // Return operation status on the IPC. 161 // Return operation status on the IPC.
157 ipc->return_info.nt_status = nt_status; 162 ipc->return_info.nt_status = nt_status;
158 ipc->return_info.handle = handle; 163 ipc->return_info.handle = handle;
159 return true; 164 return true;
160 } 165 }
161 166
162 } // namespace sandbox 167 } // namespace sandbox
163 168
OLDNEW
« no previous file with comments | « sandbox/src/nt_internals.h ('k') | sandbox/src/registry_interception.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698