diff options
author | zturner@chromium.org <zturner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-21 22:40:14 +0000 |
---|---|---|
committer | zturner@chromium.org <zturner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-21 22:40:14 +0000 |
commit | e1d8f26ddb2c6d5a562f87dc1d7fe15288592465 (patch) | |
tree | 3e6880c14a4321430ac1e96ac5be422ffdf22785 /sandbox/win/src/interception.h | |
parent | 7041dce98ee6a0d4838a059619c1dac233aab247 (diff) | |
download | chromium_src-e1d8f26ddb2c6d5a562f87dc1d7fe15288592465.zip chromium_src-e1d8f26ddb2c6d5a562f87dc1d7fe15288592465.tar.gz chromium_src-e1d8f26ddb2c6d5a562f87dc1d7fe15288592465.tar.bz2 |
This patch addresses two issues:
1) Some functions were using the wrong signatures, which
only happened to work by coincidence since the wrong
signatures had the same number of arguments as the right
signatures.
2) Don't use imported functions from system libraries in
patched functions until after TargetServices::InitCalled()
has been called, which guarantees that our IAT has been
initialized.
BUG=305815
Review URL: https://codereview.chromium.org/29573002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229943 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/win/src/interception.h')
-rw-r--r-- | sandbox/win/src/interception.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sandbox/win/src/interception.h b/sandbox/win/src/interception.h index 02fc592..c73b597 100644 --- a/sandbox/win/src/interception.h +++ b/sandbox/win/src/interception.h @@ -241,6 +241,10 @@ class InterceptionManager { ((&Target##service) ? \ manager->ADD_NT_INTERCEPTION(service, id, num_params) : false) +// When intercepting the EAT it is important that the patched version of the +// function not call any functions imported from system libraries unless +// |TargetServices::InitCalled()| returns true, because it is only then that +// we are guaranteed that our IAT has been initialized. #define INTERCEPT_EAT(manager, dll, function, id, num_params) \ ((&Target##function) ? \ manager->AddToPatchedFunctions(dll, #function, sandbox::INTERCEPTION_EAT, \ @@ -262,6 +266,10 @@ class InterceptionManager { #define INTERCEPT_NT(manager, service, id, num_params) \ manager->ADD_NT_INTERCEPTION(service, id, num_params) +// When intercepting the EAT it is important that the patched version of the +// function not call any functions imported from system libraries unless +// |TargetServices::InitCalled()| returns true, because it is only then that +// we are guaranteed that our IAT has been initialized. #define INTERCEPT_EAT(manager, dll, function, id, num_params) \ manager->AddToPatchedFunctions(dll, #function, sandbox::INTERCEPTION_EAT, \ MAKE_SERVICE_NAME(function), id) |