summaryrefslogtreecommitdiffstats
path: root/sandbox/src/interception.h
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/src/interception.h')
-rw-r--r--sandbox/src/interception.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/sandbox/src/interception.h b/sandbox/src/interception.h
index 83169f9..7859883 100644
--- a/sandbox/src/interception.h
+++ b/sandbox/src/interception.h
@@ -6,8 +6,8 @@
// for the sandboxed process. For more datails see
// http://wiki/Main/ChromeSandboxInterceptionDesign
-#ifndef SANDBOX_SRC_INTERCEPTION_H__
-#define SANDBOX_SRC_INTERCEPTION_H__
+#ifndef SANDBOX_SRC_INTERCEPTION_H_
+#define SANDBOX_SRC_INTERCEPTION_H_
#include <list>
#include <string>
@@ -59,7 +59,8 @@ struct DllInterceptionData;
//
class InterceptionManager {
// The unit test will access private members.
- FRIEND_TEST(InterceptionManagerTest, BufferLayout);
+ FRIEND_TEST(InterceptionManagerTest, BufferLayout1);
+ FRIEND_TEST(InterceptionManagerTest, BufferLayout2);
public:
// An interception manager performs interceptions on a given child process.
@@ -99,11 +100,14 @@ class InterceptionManager {
InterceptionType interception_type,
const char* replacement_function_name);
+ // The interception agent will unload the dll with dll_name.
+ bool AddToUnloadModules(const wchar_t* dll_name);
+
// Initializes all interceptions on the client.
// Returns true on success.
//
// The child process must be created suspended, and cannot be resumed until
- // after this method returns. In addition, no action should be perfomed on
+ // after this method returns. In addition, no action should be performed on
// the child that may cause it to resume momentarily, such as injecting
// threads or APCs.
//
@@ -114,11 +118,11 @@ class InterceptionManager {
private:
// Used to store the interception information until the actual set-up.
struct InterceptionData {
- InterceptionType type; // Interception type
- std::wstring dll; // Name of dll to intercept
- std::string function; // Name of function to intercept
- std::string interceptor; // Name of interceptor function
- const void* interceptor_address; // Interceptor's entry point
+ InterceptionType type; // Interception type.
+ std::wstring dll; // Name of dll to intercept.
+ std::string function; // Name of function to intercept.
+ std::string interceptor; // Name of interceptor function.
+ const void* interceptor_address; // Interceptor's entry point.
};
// Calculates the size of the required configuration buffer.
@@ -169,10 +173,10 @@ class InterceptionManager {
bool CopyDataToChild(const void* local_buffer, size_t buffer_bytes,
void** remote_buffer) const;
- // Performs the cold patch (from the parent) of ntdll.dll.
+ // Performs the cold patch (from the parent) of ntdll.
// Returns true on success.
//
- // This method will inser aditional interceptions to launch the interceptor
+ // This method will insert additional interceptions to launch the interceptor
// agent on the child process, if there are additional interceptions to do.
bool PatchNtdll(bool hot_patch_needed);
@@ -196,10 +200,10 @@ class InterceptionManager {
// true if we are allowed to patch already-patched functions.
bool relaxed_;
- DISALLOW_EVIL_CONSTRUCTORS(InterceptionManager);
+ DISALLOW_COPY_AND_ASSIGN(InterceptionManager);
};
} // namespace sandbox
-#endif // SANDBOX_SRC_INTERCEPTION_H__
+#endif // SANDBOX_SRC_INTERCEPTION_H_