Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Side by Side Diff: sandbox/win/src/service_resolver.h

Issue 183833004: Make chrome_elf use thunks instead of function pointers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments, add scoped ptr Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome_elf/thunk_getter.cc ('k') | sandbox/win/src/service_resolver_32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SANDBOX_SRC_SERVICE_RESOLVER_H__ 5 #ifndef SANDBOX_SRC_SERVICE_RESOLVER_H__
6 #define SANDBOX_SRC_SERVICE_RESOLVER_H__ 6 #define SANDBOX_SRC_SERVICE_RESOLVER_H__
7 7
8 #include "sandbox/win/src/nt_internals.h" 8 #include "sandbox/win/src/nt_internals.h"
9 #include "sandbox/win/src/resolver.h" 9 #include "sandbox/win/src/resolver.h"
10 10
(...skipping 28 matching lines...) Expand all
39 virtual NTSTATUS ResolveTarget(const void* module, 39 virtual NTSTATUS ResolveTarget(const void* module,
40 const char* function_name, 40 const char* function_name,
41 void** address); 41 void** address);
42 42
43 // Implementation of Resolver::GetThunkSize. 43 // Implementation of Resolver::GetThunkSize.
44 virtual size_t GetThunkSize() const; 44 virtual size_t GetThunkSize() const;
45 45
46 // Call this to set up ntdll_base_ which will allow for local patches. 46 // Call this to set up ntdll_base_ which will allow for local patches.
47 virtual void AllowLocalPatches(); 47 virtual void AllowLocalPatches();
48 48
49 // Verifies that the function specified by |target_name| in |target_module| is
50 // a service and copies the data from that function into |thunk_storage|. If
51 // |storage_bytes| is too small, then the method fails.
52 virtual NTSTATUS CopyThunk(const void* target_module,
53 const char* target_name,
54 BYTE* thunk_storage,
55 size_t storage_bytes,
56 size_t* storage_used);
57
49 protected: 58 protected:
50 // The unit test will use this member to allow local patch on a buffer. 59 // The unit test will use this member to allow local patch on a buffer.
51 HMODULE ntdll_base_; 60 HMODULE ntdll_base_;
52 61
53 // Handle of the child process. 62 // Handle of the child process.
54 HANDLE process_; 63 HANDLE process_;
55 64
56 protected: 65 protected:
57 // Keeps track of a Windows 2000 resolver. 66 // Keeps track of a Windows 2000 resolver.
58 bool win2k_; 67 bool win2k_;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 private: 151 private:
143 virtual bool IsFunctionAService(void* local_thunk) const; 152 virtual bool IsFunctionAService(void* local_thunk) const;
144 153
145 DISALLOW_COPY_AND_ASSIGN(Win8ResolverThunk); 154 DISALLOW_COPY_AND_ASSIGN(Win8ResolverThunk);
146 }; 155 };
147 156
148 } // namespace sandbox 157 } // namespace sandbox
149 158
150 159
151 #endif // SANDBOX_SRC_SERVICE_RESOLVER_H__ 160 #endif // SANDBOX_SRC_SERVICE_RESOLVER_H__
OLDNEW
« no previous file with comments | « chrome_elf/thunk_getter.cc ('k') | sandbox/win/src/service_resolver_32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698