| 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, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 //! \return `true` on success, indicating that this object will respond | 79 //! \return `true` on success, indicating that this object will respond |
| 80 //! validly to further method calls. `false` on failure. On failure, no | 80 //! validly to further method calls. `false` on failure. On failure, no |
| 81 //! further method calls should be made. | 81 //! further method calls should be made. |
| 82 //! | 82 //! |
| 83 //! \sa ScopedProcessSuspend | 83 //! \sa ScopedProcessSuspend |
| 84 bool Initialize(HANDLE process, ProcessSuspensionState suspension_state); | 84 bool Initialize(HANDLE process, ProcessSuspensionState suspension_state); |
| 85 | 85 |
| 86 //! \return `true` if the target task is a 64-bit process. | 86 //! \return `true` if the target task is a 64-bit process. |
| 87 bool Is64Bit() const { return process_info_.Is64Bit(); } | 87 bool Is64Bit() const { return process_info_.Is64Bit(); } |
| 88 | 88 |
| 89 //! \brief Attempts to read \a num_bytes bytes from the target process |
| 90 //! starting at address \a at into \a into. |
| 91 //! |
| 92 //! \return `true` if the entire region could be read, or `false` with an |
| 93 //! error logged. |
| 94 //! |
| 95 //! \sa ReadAvailableMemory |
| 89 bool ReadMemory(WinVMAddress at, WinVMSize num_bytes, void* into) const; | 96 bool ReadMemory(WinVMAddress at, WinVMSize num_bytes, void* into) const; |
| 90 | 97 |
| 98 //! \brief Attempts to read \a num_bytes bytes from the target process |
| 99 //! starting at address \a at into \a into. If some of the specified range |
| 100 //! is not accessible, reads up to the first inaccessible byte. |
| 101 //! |
| 102 //! \return The actual number of bytes read. |
| 103 //! |
| 104 //! \sa ReadMemory |
| 105 WinVMSize ReadAvailableMemory(WinVMAddress at, |
| 106 WinVMSize num_bytes, |
| 107 void* into) const; |
| 108 |
| 91 //! \brief Determines the target process' start time. | 109 //! \brief Determines the target process' start time. |
| 92 //! | 110 //! |
| 93 //! \param[out] start_time The time that the process started. | 111 //! \param[out] start_time The time that the process started. |
| 94 //! | 112 //! |
| 95 //! \return `true` on success, `false` on failure, with a warning logged. | 113 //! \return `true` on success, `false` on failure, with a warning logged. |
| 96 bool StartTime(timeval* start_time) const; | 114 bool StartTime(timeval* start_time) const; |
| 97 | 115 |
| 98 //! \brief Determines the target process' execution time. | 116 //! \brief Determines the target process' execution time. |
| 99 //! | 117 //! |
| 100 //! \param[out] user_time The amount of time the process has executed code in | 118 //! \param[out] user_time The amount of time the process has executed code in |
| (...skipping 26 matching lines...) Expand all Loading... |
| 127 ProcessSuspensionState suspension_state_; | 145 ProcessSuspensionState suspension_state_; |
| 128 bool initialized_threads_; | 146 bool initialized_threads_; |
| 129 InitializationStateDcheck initialized_; | 147 InitializationStateDcheck initialized_; |
| 130 | 148 |
| 131 DISALLOW_COPY_AND_ASSIGN(ProcessReaderWin); | 149 DISALLOW_COPY_AND_ASSIGN(ProcessReaderWin); |
| 132 }; | 150 }; |
| 133 | 151 |
| 134 } // namespace crashpad | 152 } // namespace crashpad |
| 135 | 153 |
| 136 #endif // CRASHPAD_SNAPSHOT_WIN_PROCESS_READER_WIN_H_ | 154 #endif // CRASHPAD_SNAPSHOT_WIN_PROCESS_READER_WIN_H_ |
| OLD | NEW |