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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 //! | 167 //! |
168 //! If the kernel is the message’s sender, a process ID of `0` will be returned. | 168 //! If the kernel is the message’s sender, a process ID of `0` will be returned. |
169 //! | 169 //! |
170 //! \param[in] trailer The trailer received with a Mach message. | 170 //! \param[in] trailer The trailer received with a Mach message. |
171 //! | 171 //! |
172 //! \return The process ID of the message’s sender, or `-1` on failure with a | 172 //! \return The process ID of the message’s sender, or `-1` on failure with a |
173 //! message logged. It is considered a failure for \a trailer to not contain | 173 //! message logged. It is considered a failure for \a trailer to not contain |
174 //! audit information. | 174 //! audit information. |
175 pid_t AuditPIDFromMachMessageTrailer(const mach_msg_trailer_t* trailer); | 175 pid_t AuditPIDFromMachMessageTrailer(const mach_msg_trailer_t* trailer); |
176 | 176 |
| 177 //! \brief Destroys or deallocates a Mach port received in a Mach message. |
| 178 //! |
| 179 //! This function disposes of port rights received in a Mach message. Receive |
| 180 //! rights will be destroyed with `mach_port_mod_refs()`. Send and send-once |
| 181 //! rights will be deallocated with `mach_port_deallocate()`. |
| 182 //! |
| 183 //! \param[in] port The port to destroy or deallocate. |
| 184 //! \param[in] port_right_type The right type held for \a port: |
| 185 //! `MACH_MSG_TYPE_PORT_RECEIVE`, `MACH_MSG_TYPE_PORT_SEND`, or |
| 186 //! `MACH_MSG_TYPE_PORT_SEND_ONCE`. |
| 187 //! |
| 188 //! \return `true` on success, or `false` on failure with a message logged. |
| 189 bool MachMessageDestroyReceivedPort(mach_port_t port, |
| 190 mach_msg_type_name_t port_right_type); |
| 191 |
177 } // namespace crashpad | 192 } // namespace crashpad |
178 | 193 |
179 #endif // CRASHPAD_UTIL_MACH_MACH_MESSAGE_H_ | 194 #endif // CRASHPAD_UTIL_MACH_MACH_MESSAGE_H_ |
OLD | NEW |