OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Crashpad Authors. All rights reserved. |
| 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (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 |
| 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. |
| 14 |
| 15 #ifndef CRASHPAD_SNAPSHOT_WIN_PROCESS_READER_WIN_H_ |
| 16 #define CRASHPAD_SNAPSHOT_WIN_PROCESS_READER_WIN_H_ |
| 17 |
| 18 #include <windows.h> |
| 19 |
| 20 #include "util/misc/initialization_state_dcheck.h" |
| 21 |
| 22 namespace crashpad { |
| 23 |
| 24 //! \brief Accesses information about another process, identified by a HANDLE. |
| 25 class ProcessReaderWin { |
| 26 public: |
| 27 ProcessReaderWin(); |
| 28 ~ProcessReaderWin(); |
| 29 |
| 30 //! \brief Initializes this object. This method must be called before any |
| 31 //! other. |
| 32 //! |
| 33 //! \param[in] process Process handle, must have PROCESS_QUERY_INFORMATION, |
| 34 //! PROCESS_VM_READ, and PROCESS_DUP_HANDLE access. |
| 35 //! |
| 36 //! \return `true` on success, indicating that this object will respond |
| 37 //! validly to further method calls. `false` on failure. On failure, no |
| 38 //! further method calls should be made. |
| 39 bool Initialize(HANDLE process); |
| 40 |
| 41 //! \return `true` if the target task is a 64-bit process. |
| 42 bool Is64Bit() const { return is_64_bit_; } |
| 43 |
| 44 private: |
| 45 bool is_64_bit_; |
| 46 InitializationStateDcheck initialized_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(ProcessReaderWin); |
| 49 }; |
| 50 |
| 51 } // namespace crashpad |
| 52 |
| 53 #endif // CRASHPAD_SNAPSHOT_WIN_PROCESS_READER_WIN_H_ |
OLD | NEW |