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

Unified Diff: sandbox/src/registry_interception.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/src/registry_interception.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/src/registry_interception.cc
===================================================================
--- sandbox/src/registry_interception.cc (revision 9582)
+++ sandbox/src/registry_interception.cc (working copy)
@@ -88,14 +88,9 @@
return status;
}
-NTSTATUS WINAPI TargetNtOpenKey(NtOpenKeyFunction orig_OpenKey, PHANDLE key,
+NTSTATUS WINAPI CommonNtOpenKey(NTSTATUS status, PHANDLE key,
ACCESS_MASK desired_access,
POBJECT_ATTRIBUTES object_attributes) {
- // Check if the process can open it first.
- NTSTATUS status = orig_OpenKey(key, desired_access, object_attributes);
- if (NT_SUCCESS(status))
- return status;
-
// We don't trust that the IPC can work this early.
if (!SandboxFactory::GetTargetServices()->GetState()->InitCalled())
return status;
@@ -146,5 +141,33 @@
return status;
}
+NTSTATUS WINAPI TargetNtOpenKey(NtOpenKeyFunction orig_OpenKey, PHANDLE key,
+ ACCESS_MASK desired_access,
+ POBJECT_ATTRIBUTES object_attributes) {
+ // Check if the process can open it first.
+ NTSTATUS status = orig_OpenKey(key, desired_access, object_attributes);
+ if (NT_SUCCESS(status))
+ return status;
+
+ return CommonNtOpenKey(status, key, desired_access, object_attributes);
+}
+
+NTSTATUS WINAPI TargetNtOpenKeyEx(NtOpenKeyExFunction orig_OpenKeyEx,
+ PHANDLE key, ACCESS_MASK desired_access,
+ POBJECT_ATTRIBUTES object_attributes,
+ DWORD unknown) {
+ // Check if the process can open it first.
+ NTSTATUS status = orig_OpenKeyEx(key, desired_access, object_attributes,
+ unknown);
+
+ // TODO(nsylvain): We don't know what the last parameter is. If it's not
+ // zero, we don't attempt to proxy the call. We need to find out what it is!
+ // See bug 7611
+ if (NT_SUCCESS(status) || unknown != 0)
+ return status;
+
+ return CommonNtOpenKey(status, key, desired_access, object_attributes);
+}
+
} // namespace sandbox
« no previous file with comments | « sandbox/src/registry_interception.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698