OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 30 matching lines...) Expand all Loading... |
41 //! \param[inout] out_header The reply message to operate on. \a out_header will | 41 //! \param[inout] out_header The reply message to operate on. \a out_header will |
42 //! be treated as a `mig_reply_error_t*` and its `RetCode` field will be | 42 //! be treated as a `mig_reply_error_t*` and its `RetCode` field will be |
43 //! set. This argument is accepted as a `mach_msg_header_t*` instead of a | 43 //! set. This argument is accepted as a `mach_msg_header_t*` instead of a |
44 //! `mig_reply_error_t*` because that is the type that callers are expected | 44 //! `mig_reply_error_t*` because that is the type that callers are expected |
45 //! to possess in the C API. | 45 //! to possess in the C API. |
46 //! \param[in] error The error code to store in \a out_header. | 46 //! \param[in] error The error code to store in \a out_header. |
47 //! | 47 //! |
48 //! \sa PrepareMIGReplyFromRequest() | 48 //! \sa PrepareMIGReplyFromRequest() |
49 void SetMIGReplyError(mach_msg_header_t* out_header, kern_return_t error); | 49 void SetMIGReplyError(mach_msg_header_t* out_header, kern_return_t error); |
50 | 50 |
| 51 //! \brief Returns a Mach message trailer for a message that has been received. |
| 52 //! |
| 53 //! This function must only be called on Mach messages that have been received |
| 54 //! via the Mach messaging interface, such as `mach_msg()`. Messages constructed |
| 55 //! for sending do not contain trailers. |
| 56 //! |
| 57 //! \param[in] header A pointer to a received Mach message. |
| 58 //! |
| 59 //! \return A pointer to the trailer following the received Mach message’s body. |
| 60 //! The contents of the trailer depend on the options provided to |
| 61 //! `mach_msg()` or a similar function when the message was received. |
| 62 const mach_msg_trailer_t* MachMessageTrailerFromHeader( |
| 63 const mach_msg_header_t* header); |
| 64 |
51 } // namespace crashpad | 65 } // namespace crashpad |
52 | 66 |
53 #endif // CRASHPAD_UTIL_MACH_MACH_MESSAGE_UTIL_H_ | 67 #endif // CRASHPAD_UTIL_MACH_MACH_MESSAGE_UTIL_H_ |
OLD | NEW |