summaryrefslogtreecommitdiffstats
path: root/sandbox/src/registry_dispatcher.cc
diff options
context:
space:
mode:
authornsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-13 18:07:00 +0000
committernsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-13 18:07:00 +0000
commit8869a5f5c945fd2ce67aea4107c700dda12d150f (patch)
tree43df9e9f9c6fafa9b373394d1f447a56809c59ce /sandbox/src/registry_dispatcher.cc
parent91115469ab00e0c314cf547e91e8b473890a90d2 (diff)
downloadchromium_src-8869a5f5c945fd2ce67aea4107c700dda12d150f.zip
chromium_src-8869a5f5c945fd2ce67aea4107c700dda12d150f.tar.gz
chromium_src-8869a5f5c945fd2ce67aea4107c700dda12d150f.tar.bz2
In windows 7 there is a new Reg call that we need to
hook. NtOpenKeyEx. I don't know what the last parameter is. I suspect it's a reserved flag for "options". (As in RegOpenKeyEx). I do not handle the case where this unknown flag is non-zero. The current unit tests covers this code. bug:7611 Review URL: http://codereview.chromium.org/20287 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9762 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/src/registry_dispatcher.cc')
-rw-r--r--sandbox/src/registry_dispatcher.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sandbox/src/registry_dispatcher.cc b/sandbox/src/registry_dispatcher.cc
index babf455..37d607d 100644
--- a/sandbox/src/registry_dispatcher.cc
+++ b/sandbox/src/registry_dispatcher.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/scoped_handle_win.h"
+#include "base/win_util.h"
#include "sandbox/src/crosscall_client.h"
#include "sandbox/src/interception.h"
#include "sandbox/src/ipc_tags.h"
@@ -60,8 +61,12 @@ bool RegistryDispatcher::SetupService(InterceptionManager* manager,
if (IPC_NTCREATEKEY_TAG == service)
return INTERCEPT_NT(manager, NtCreateKey, "_TargetNtCreateKey@32");
- if (IPC_NTOPENKEY_TAG == service)
- return INTERCEPT_NT(manager, NtOpenKey, "_TargetNtOpenKey@16");
+ if (IPC_NTOPENKEY_TAG == service) {
+ bool result = INTERCEPT_NT(manager, NtOpenKey, "_TargetNtOpenKey@16");
+ if (win_util::GetWinVersion() >= win_util::WINVERSION_WIN7)
+ result &= INTERCEPT_NT(manager, NtOpenKeyEx, "_TargetNtOpenKeyEx@20");
+ return result;
+ }
return false;
}