OLD | NEW |
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_CROSSCALL_PARAMS_H__ | 5 #ifndef SANDBOX_SRC_CROSSCALL_PARAMS_H__ |
6 #define SANDBOX_SRC_CROSSCALL_PARAMS_H__ | 6 #define SANDBOX_SRC_CROSSCALL_PARAMS_H__ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <lmaccess.h> | 9 #include <lmaccess.h> |
| 10 #include <stddef.h> |
10 #include <stdint.h> | 11 #include <stdint.h> |
11 | 12 |
12 #include <memory> | 13 #include <memory> |
13 | 14 |
14 #include "base/basictypes.h" | 15 #include "base/macros.h" |
15 #include "sandbox/win/src/internal_types.h" | 16 #include "sandbox/win/src/internal_types.h" |
16 #include "sandbox/win/src/sandbox_types.h" | 17 #include "sandbox/win/src/sandbox_types.h" |
17 | 18 |
18 // Increases |value| until there is no need for padding given an int64_t | 19 // Increases |value| until there is no need for padding given an int64_t |
19 // alignment. Returns the increased value. | 20 // alignment. Returns the increased value. |
20 inline uint32_t Align(uint32_t value) { | 21 inline uint32_t Align(uint32_t value) { |
21 uint32_t alignment = sizeof(int64_t); | 22 uint32_t alignment = sizeof(int64_t); |
22 return ((value + alignment - 1) / alignment) * alignment; | 23 return ((value + alignment - 1) / alignment) * alignment; |
23 } | 24 } |
24 | 25 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 DISALLOW_COPY_AND_ASSIGN(ActualCallParams); | 278 DISALLOW_COPY_AND_ASSIGN(ActualCallParams); |
278 }; | 279 }; |
279 | 280 |
280 static_assert(sizeof(ActualCallParams<1, 1024>) == 1024, "bad size buffer"); | 281 static_assert(sizeof(ActualCallParams<1, 1024>) == 1024, "bad size buffer"); |
281 static_assert(sizeof(ActualCallParams<2, 1024>) == 1024, "bad size buffer"); | 282 static_assert(sizeof(ActualCallParams<2, 1024>) == 1024, "bad size buffer"); |
282 static_assert(sizeof(ActualCallParams<3, 1024>) == 1024, "bad size buffer"); | 283 static_assert(sizeof(ActualCallParams<3, 1024>) == 1024, "bad size buffer"); |
283 | 284 |
284 } // namespace sandbox | 285 } // namespace sandbox |
285 | 286 |
286 #endif // SANDBOX_SRC_CROSSCALL_PARAMS_H__ | 287 #endif // SANDBOX_SRC_CROSSCALL_PARAMS_H__ |
OLD | NEW |