summaryrefslogtreecommitdiffstats
path: root/security/sandbox/chromium-shim/sandbox/win/src/sidestep_resolver.h
blob: fe38484b0eeea9b1ef396b3eaa5a6e3da14cfe98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */

// This is a dummy version of the Chromium source file
// sandbox/win/src/sidestep_resolver.h, which contains classes that are never
// actually used. We crash in the member functions to ensure this.
// Formatting and guards closely match original file for easy comparison.

#ifndef SANDBOX_SRC_SIDESTEP_RESOLVER_H__
#define SANDBOX_SRC_SIDESTEP_RESOLVER_H__

#include <stddef.h>

#include "base/macros.h"
#include "sandbox/win/src/nt_internals.h"
#include "sandbox/win/src/resolver.h"

#include "mozilla/Assertions.h"

namespace sandbox {

class SidestepResolverThunk : public ResolverThunk {
 public:
  SidestepResolverThunk() {}
  ~SidestepResolverThunk() override {}

  // Implementation of Resolver::Setup.
  NTSTATUS Setup(const void* target_module,
                 const void* interceptor_module,
                 const char* target_name,
                 const char* interceptor_name,
                 const void* interceptor_entry_point,
                 void* thunk_storage,
                 size_t storage_bytes,
                 size_t* storage_used) override { MOZ_CRASH(); }

  size_t GetThunkSize() const override { MOZ_CRASH(); }

 private:
  DISALLOW_COPY_AND_ASSIGN(SidestepResolverThunk);
};

class SmartSidestepResolverThunk : public SidestepResolverThunk {
 public:
  SmartSidestepResolverThunk() {}
  ~SmartSidestepResolverThunk() override {}

 private:
  DISALLOW_COPY_AND_ASSIGN(SmartSidestepResolverThunk);
};

}  // namespace sandbox


#endif  // SANDBOX_SRC_SIDESTEP_RESOLVER_H__