Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Crashpad Authors. All rights reserved. | 1 // Copyright 2015 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, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. | 13 // limitations under the License. |
| 14 | 14 |
| 15 #ifndef CRASHPAD_CLIENT_REGISTRATION_PROTOCOL_WIN_H_ | 15 #ifndef CRASHPAD_UTIL_WIN_REGISTRATION_PROTOCOL_WIN_H_ |
| 16 #define CRASHPAD_CLIENT_REGISTRATION_PROTOCOL_WIN_H_ | 16 #define CRASHPAD_UTIL_WIN_REGISTRATION_PROTOCOL_WIN_H_ |
| 17 | 17 |
| 18 #include <windows.h> | 18 #include <windows.h> |
| 19 #include <stdint.h> | 19 #include <stdint.h> |
| 20 | 20 |
| 21 #include "base/strings/string16.h" | |
| 21 #include "util/win/address_types.h" | 22 #include "util/win/address_types.h" |
| 22 | 23 |
| 23 namespace crashpad { | 24 namespace crashpad { |
| 24 | 25 |
| 25 #pragma pack(push, 1) | 26 #pragma pack(push, 1) |
| 27 | |
| 28 //! \brief Structure read out of the client process by the crash handler when an | |
| 29 //! exception occurs. | |
| 30 struct ExceptionInformation { | |
| 31 //! \brief The thread on which the exception happened. | |
| 32 DWORD thread_id; | |
| 33 | |
| 34 //! \brief The address of an EXCEPTION_POINTERS structure in the client | |
| 35 //! process that describes the exception. | |
| 36 WinVMAddress exception_pointers; | |
|
Mark Mentovai
2015/08/26 21:40:28
Packs better if the WinVMAddress comes before the
scottmg
2015/08/27 01:04:38
Done.
| |
| 37 }; | |
| 38 | |
| 26 //! \brief A client registration request. | 39 //! \brief A client registration request. |
| 27 struct RegistrationRequest { | 40 struct RegistrationRequest { |
| 28 //! \brief The PID of the client process. | 41 //! \brief The PID of the client process. |
| 29 DWORD client_process_id; | 42 DWORD client_process_id; |
|
Mark Mentovai
2015/08/26 21:40:28
Can the server determine this from the message wit
scottmg
2015/08/27 01:04:38
Right, I don't think it's possible on XP. (swapped
| |
| 30 //! \brief The address, in the client process address space, of a CrashpadInfo | 43 |
| 31 //! structure. | 44 //! \brief The address, in the client process address space, of an |
| 32 crashpad::WinVMAddress crashpad_info_address; | 45 //! ExceptionInformation structure. |
| 46 WinVMAddress exception_information; | |
| 33 }; | 47 }; |
| 34 #pragma pack(pop) | |
| 35 | 48 |
| 36 #pragma pack(push, 1) | |
| 37 //! \brief A client registration response. | 49 //! \brief A client registration response. |
| 38 //! | 50 //! |
| 39 //! See <a | 51 //! See <a |
| 40 //! href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa384203">Int erprocess | 52 //! href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa384203">Int erprocess |
| 41 //! Communication Between 32-bit and 64-bit Applications</a> for details on | 53 //! Communication Between 32-bit and 64-bit Applications</a> for details on |
| 42 //! communicating handle values between processes of varying bitness. | 54 //! communicating handle values between processes of varying bitness. |
| 43 struct RegistrationResponse { | 55 struct RegistrationResponse { |
| 44 //! \brief An event `HANDLE`, valid in the client process, that should be | 56 //! \brief An event `HANDLE`, valid in the client process, that should be |
| 45 //! signaled to request a crash report. 64-bit clients should convert the | 57 //! signaled to request a crash report. 64-bit clients should convert the |
| 46 //! value to a `HANDLE` using sign-extension. | 58 //! value to a `HANDLE` using sign-extension. |
| 47 uint32_t request_report_event; | 59 uint32_t request_report_event; |
| 48 //! \brief An event `HANDLE`, valid in the client process, that will be | |
| 49 //! signaled when the requested crash report is complete. 64-bit clients | |
| 50 //! should convert the value to a `HANDLE` using sign-extension. | |
| 51 uint32_t report_complete_event; | |
| 52 }; | 60 }; |
| 61 | |
| 53 #pragma pack(pop) | 62 #pragma pack(pop) |
| 54 | 63 |
| 64 namespace internal { | |
| 65 | |
| 66 //! \brief Connect over the given \a pipe_name, passing \a request to the | |
| 67 //! server, and reading its reply into \a response. | |
| 68 //! | |
| 69 //! Typically clients will not use this directly, instead using | |
| 70 //! CrashpadClient::SetHandler(). | |
| 71 //! | |
| 72 //! \sa CrashpadClient::SetHandler() | |
| 73 bool RegisterWithCrashHandlerServer(const base::string16& pipe_name, | |
| 74 const RegistrationRequest& request, | |
| 75 RegistrationResponse* response); | |
| 76 | |
| 77 } // namespace internal | |
| 78 | |
| 55 } // namespace crashpad | 79 } // namespace crashpad |
| 56 | 80 |
| 57 #endif // CRASHPAD_CLIENT_REGISTRATION_PROTOCOL_WIN_H_ | 81 #endif // CRASHPAD_UTIL_WIN_REGISTRATION_PROTOCOL_WIN_H_ |
| OLD | NEW |