blob: 8c722621a6e393f7fbb84311744ff65e5bd8fe11 (
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
|
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SANDBOX_SRC_INTERNAL_TYPES_H__
#define SANDBOX_SRC_INTERNAL_TYPES_H__
namespace sandbox {
const wchar_t kNtdllName[] = L"ntdll.dll";
const wchar_t kKerneldllName[] = L"kernel32.dll";
// Defines the supported C++ types encoding to numeric id. Like a poor's man
// RTTI. Note that true C++ RTTI will not work because the types are not
// polymorphic anyway.
enum ArgType {
INVALID_TYPE = 0,
WCHAR_TYPE,
ULONG_TYPE,
UNISTR_TYPE,
VOIDPTR_TYPE,
INPTR_TYPE,
INOUTPTR_TYPE,
LAST_TYPE
};
// Encapsulates a pointer to a buffer and the size of the buffer.
class CountedBuffer {
public:
CountedBuffer(void* buffer, size_t size) : size_(size), buffer_(buffer) {}
size_t Size() const {
return size_;
}
void* Buffer() const {
return buffer_;
}
private:
size_t size_;
void* buffer_;
};
} // namespace sandbox
#endif // SANDBOX_SRC_INTERNAL_TYPES_H__
|