michael@0: // Copyright (c) 2010 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #ifndef SANDBOX_SRC_EAT_RESOLVER_H__ michael@0: #define SANDBOX_SRC_EAT_RESOLVER_H__ michael@0: michael@0: #include "base/basictypes.h" michael@0: #include "sandbox/win/src/nt_internals.h" michael@0: #include "sandbox/win/src/resolver.h" michael@0: michael@0: namespace sandbox { michael@0: michael@0: // This is the concrete resolver used to perform exports table interceptions. michael@0: class EatResolverThunk : public ResolverThunk { michael@0: public: michael@0: EatResolverThunk() : eat_entry_(NULL) {} michael@0: virtual ~EatResolverThunk() {} michael@0: michael@0: // Implementation of Resolver::Setup. michael@0: virtual NTSTATUS Setup(const void* target_module, michael@0: const void* interceptor_module, michael@0: const char* target_name, michael@0: const char* interceptor_name, michael@0: const void* interceptor_entry_point, michael@0: void* thunk_storage, michael@0: size_t storage_bytes, michael@0: size_t* storage_used); michael@0: michael@0: // Implementation of Resolver::ResolveTarget. michael@0: virtual NTSTATUS ResolveTarget(const void* module, michael@0: const char* function_name, michael@0: void** address); michael@0: michael@0: // Implementation of Resolver::GetThunkSize. michael@0: virtual size_t GetThunkSize() const; michael@0: michael@0: private: michael@0: // The entry to patch. michael@0: DWORD* eat_entry_; michael@0: michael@0: DISALLOW_COPY_AND_ASSIGN(EatResolverThunk); michael@0: }; michael@0: michael@0: } // namespace sandbox michael@0: michael@0: michael@0: #endif // SANDBOX_SRC_EAT_RESOLVER_H__