| 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 | 10 |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "sandbox/win/src/internal_types.h" | 14 #include "sandbox/win/src/internal_types.h" |
| 15 #include "sandbox/win/src/sandbox_types.h" | 15 #include "sandbox/win/src/sandbox_types.h" |
| 16 | 16 |
| 17 namespace { | |
| 18 | |
| 19 // Increases |value| until there is no need for padding given an int64 | 17 // Increases |value| until there is no need for padding given an int64 |
| 20 // alignment. Returns the increased value. | 18 // alignment. Returns the increased value. |
| 21 uint32 Align(uint32 value) { | 19 inline uint32 Align(uint32 value) { |
| 22 uint32 alignment = sizeof(int64); | 20 uint32 alignment = sizeof(int64); |
| 23 return ((value + alignment - 1) / alignment) * alignment; | 21 return ((value + alignment - 1) / alignment) * alignment; |
| 24 } | 22 } |
| 25 | 23 |
| 26 } | |
| 27 // This header is part of CrossCall: the sandbox inter-process communication. | 24 // This header is part of CrossCall: the sandbox inter-process communication. |
| 28 // This header defines the basic types used both in the client IPC and in the | 25 // This header defines the basic types used both in the client IPC and in the |
| 29 // server IPC code. CrossCallParams and ActualCallParams model the input | 26 // server IPC code. CrossCallParams and ActualCallParams model the input |
| 30 // parameters of an IPC call and CrossCallReturn models the output params and | 27 // parameters of an IPC call and CrossCallReturn models the output params and |
| 31 // the return value. | 28 // the return value. |
| 32 // | 29 // |
| 33 // An IPC call is defined by its 'tag' which is a (uint32) unique identifier | 30 // An IPC call is defined by its 'tag' which is a (uint32) unique identifier |
| 34 // that is used to route the IPC call to the proper server. Every tag implies | 31 // that is used to route the IPC call to the proper server. Every tag implies |
| 35 // a complete call signature including the order and type of each parameter. | 32 // a complete call signature including the order and type of each parameter. |
| 36 // | 33 // |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 DISALLOW_COPY_AND_ASSIGN(ActualCallParams); | 281 DISALLOW_COPY_AND_ASSIGN(ActualCallParams); |
| 285 }; | 282 }; |
| 286 | 283 |
| 287 static_assert(sizeof(ActualCallParams<1, 1024>) == 1024, "bad size buffer"); | 284 static_assert(sizeof(ActualCallParams<1, 1024>) == 1024, "bad size buffer"); |
| 288 static_assert(sizeof(ActualCallParams<2, 1024>) == 1024, "bad size buffer"); | 285 static_assert(sizeof(ActualCallParams<2, 1024>) == 1024, "bad size buffer"); |
| 289 static_assert(sizeof(ActualCallParams<3, 1024>) == 1024, "bad size buffer"); | 286 static_assert(sizeof(ActualCallParams<3, 1024>) == 1024, "bad size buffer"); |
| 290 | 287 |
| 291 } // namespace sandbox | 288 } // namespace sandbox |
| 292 | 289 |
| 293 #endif // SANDBOX_SRC_CROSSCALL_PARAMS_H__ | 290 #endif // SANDBOX_SRC_CROSSCALL_PARAMS_H__ |
| OLD | NEW |