diff options
author | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-18 00:26:01 +0000 |
---|---|---|
committer | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-18 00:26:01 +0000 |
commit | 9cd0144cccf979ecce9f193f77e50c05544bc4a7 (patch) | |
tree | 548283eb1965017d2f1c46e9bb63aa8cbc7816d5 /sandbox/src/interception_agent.h | |
parent | 35aa85ac00fbfa16bd9f52b05e47eb09a3b6a0ce (diff) | |
download | chromium_src-9cd0144cccf979ecce9f193f77e50c05544bc4a7.zip chromium_src-9cd0144cccf979ecce9f193f77e50c05544bc4a7.tar.gz chromium_src-9cd0144cccf979ecce9f193f77e50c05544bc4a7.tar.bz2 |
Add an interface to the sandbox to block dll from loading in the target process
- new interface is TargetPolicy::AddDllToUnload
- Added integration tests and unit tests.
Review URL: http://codereview.chromium.org/2413
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2348 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/src/interception_agent.h')
-rw-r--r-- | sandbox/src/interception_agent.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sandbox/src/interception_agent.h b/sandbox/src/interception_agent.h index 5fd9f1f..b33d6d3 100644 --- a/sandbox/src/interception_agent.h +++ b/sandbox/src/interception_agent.h @@ -23,10 +23,12 @@ struct DllPatchInfo; class ResolverThunk; // The InterceptionAgent executes on the target application, and it is in charge -// of setting up the desired interceptions. +// of setting up the desired interceptions or indicating what module needs to +// be unloaded. // -// The exposed API consists of two methods: GetInterceptionAgent to retrieve the -// single class instance, and OnDllLoad to process a dll being loaded. +// The exposed API consists of three methods: GetInterceptionAgent to retrieve +// the single class instance, OnDllLoad and OnDllUnload to process a dll being +// loaded and unloaded respectively. // // This class assumes that it will get called for every dll being loaded, // starting with kernel32, so the singleton will be instantiated from within the @@ -37,12 +39,14 @@ class InterceptionAgent { static InterceptionAgent* GetInterceptionAgent(); // This method should be invoked whenever a new dll is loaded to perform the - // required patches. + // required patches. If the return value is false, this dll should not be + // allowed to load. + // // full_path is the (optional) full name of the module being loaded and name // is the internal module name. If full_path is provided, it will be used // before the internal name to determine if we care about this dll. - void OnDllLoad(const UNICODE_STRING* full_path, const UNICODE_STRING* name, - void* base_address); + bool OnDllLoad(const UNICODE_STRING* full_path, const UNICODE_STRING* name, + uint32 image_flags, void* base_address); // Performs cleanup when a dll is unloaded. void OnDllUnload(void* base_address); |