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

Side by Side Diff: sandbox/win/wow_helper/service64_resolver.h

Issue 1851213002: Remove sandbox on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nacl compile issues Created 4 years, 8 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
« no previous file with comments | « sandbox/win/wow_helper.sln ('k') | sandbox/win/wow_helper/service64_resolver.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SANDBOX_WOW_HELPER_SERVICE64_RESOLVER_H__
6 #define SANDBOX_WOW_HELPER_SERVICE64_RESOLVER_H__
7
8 #include <stddef.h>
9
10 #include "base/macros.h"
11 #include "sandbox/win/src/nt_internals.h"
12 #include "sandbox/win/src/resolver.h"
13
14 namespace sandbox {
15
16 // This is the concrete resolver used to perform service-call type functions
17 // inside ntdll.dll (64-bit).
18 class Service64ResolverThunk : public ResolverThunk {
19 public:
20 // The service resolver needs a child process to write to.
21 explicit Service64ResolverThunk(HANDLE process)
22 : process_(process), ntdll_base_(NULL) {}
23 virtual ~Service64ResolverThunk() {}
24
25 // Implementation of Resolver::Setup.
26 virtual NTSTATUS Setup(const void* target_module,
27 const void* interceptor_module,
28 const char* target_name,
29 const char* interceptor_name,
30 const void* interceptor_entry_point,
31 void* thunk_storage,
32 size_t storage_bytes,
33 size_t* storage_used);
34
35 // Implementation of Resolver::ResolveInterceptor.
36 virtual NTSTATUS ResolveInterceptor(const void* module,
37 const char* function_name,
38 const void** address);
39
40 // Implementation of Resolver::ResolveTarget.
41 virtual NTSTATUS ResolveTarget(const void* module,
42 const char* function_name,
43 void** address);
44
45 // Implementation of Resolver::GetThunkSize.
46 virtual size_t GetThunkSize() const;
47
48 protected:
49 // The unit test will use this member to allow local patch on a buffer.
50 HMODULE ntdll_base_;
51
52 // Handle of the child process.
53 HANDLE process_;
54
55 private:
56 // Returns true if the code pointer by target_ corresponds to the expected
57 // type of function. Saves that code on the first part of the thunk pointed
58 // by local_thunk (should be directly accessible from the parent).
59 virtual bool IsFunctionAService(void* local_thunk) const;
60
61 // Performs the actual patch of target_.
62 // local_thunk must be already fully initialized, and the first part must
63 // contain the original code. The real type of this buffer is ServiceFullThunk
64 // (yes, private). remote_thunk (real type ServiceFullThunk), must be
65 // allocated on the child, and will contain the thunk data, after this call.
66 // Returns the apropriate status code.
67 virtual NTSTATUS PerformPatch(void* local_thunk, void* remote_thunk);
68
69 DISALLOW_COPY_AND_ASSIGN(Service64ResolverThunk);
70 };
71
72 } // namespace sandbox
73
74
75 #endif // SANDBOX_WOW_HELPER_SERVICE64_RESOLVER_H__
OLDNEW
« no previous file with comments | « sandbox/win/wow_helper.sln ('k') | sandbox/win/wow_helper/service64_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698