| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 //! \return The target process's process ID. | 71 //! \return The target process's process ID. |
| 72 pid_t ProcessID() const; | 72 pid_t ProcessID() const; |
| 73 | 73 |
| 74 //! \return The target process's parent process ID. | 74 //! \return The target process's parent process ID. |
| 75 pid_t ParentProcessID() const; | 75 pid_t ParentProcessID() const; |
| 76 | 76 |
| 77 //! \return The command line from the target process's Process Environment | 77 //! \return The command line from the target process's Process Environment |
| 78 //! Block. | 78 //! Block. |
| 79 bool CommandLine(std::wstring* command_line) const; | 79 bool CommandLine(std::wstring* command_line) const; |
| 80 | 80 |
| 81 //! \brief Gets the address and size of the process's Process Environment |
| 82 //! Block. |
| 83 //! |
| 84 //! \param[out] peb_address The address of the Process Environment Block. |
| 85 //! \param[out] peb_size The size of the Process Environment Block. |
| 86 void Peb(WinVMAddress* peb_address, WinVMSize* peb_size) const; |
| 87 |
| 81 //! \brief Retrieves the modules loaded into the target process. | 88 //! \brief Retrieves the modules loaded into the target process. |
| 82 //! | 89 //! |
| 83 //! The modules are enumerated in initialization order as detailed in the | 90 //! The modules are enumerated in initialization order as detailed in the |
| 84 //! Process Environment Block. The main executable will always be the | 91 //! Process Environment Block. The main executable will always be the |
| 85 //! first element. | 92 //! first element. |
| 86 bool Modules(std::vector<Module>* modules) const; | 93 bool Modules(std::vector<Module>* modules) const; |
| 87 | 94 |
| 88 private: | 95 private: |
| 89 template <class Traits> | 96 template <class Traits> |
| 90 friend bool GetProcessBasicInformation(HANDLE process, | 97 friend bool GetProcessBasicInformation(HANDLE process, |
| 91 bool is_wow64, | 98 bool is_wow64, |
| 92 ProcessInfo* process_info, | 99 ProcessInfo* process_info, |
| 93 WinVMAddress* peb_address); | 100 WinVMAddress* peb_address, |
| 101 WinVMSize* peb_size); |
| 94 template <class Traits> | 102 template <class Traits> |
| 95 friend bool ReadProcessData(HANDLE process, | 103 friend bool ReadProcessData(HANDLE process, |
| 96 WinVMAddress peb_address_vmaddr, | 104 WinVMAddress peb_address_vmaddr, |
| 97 ProcessInfo* process_info); | 105 ProcessInfo* process_info); |
| 98 | 106 |
| 99 pid_t process_id_; | 107 pid_t process_id_; |
| 100 pid_t inherited_from_process_id_; | 108 pid_t inherited_from_process_id_; |
| 101 std::wstring command_line_; | 109 std::wstring command_line_; |
| 110 WinVMAddress peb_address_; |
| 111 WinVMSize peb_size_; |
| 102 std::vector<Module> modules_; | 112 std::vector<Module> modules_; |
| 103 bool is_64_bit_; | 113 bool is_64_bit_; |
| 104 bool is_wow64_; | 114 bool is_wow64_; |
| 105 InitializationStateDcheck initialized_; | 115 InitializationStateDcheck initialized_; |
| 106 | 116 |
| 107 DISALLOW_COPY_AND_ASSIGN(ProcessInfo); | 117 DISALLOW_COPY_AND_ASSIGN(ProcessInfo); |
| 108 }; | 118 }; |
| 109 | 119 |
| 110 } // namespace crashpad | 120 } // namespace crashpad |
| 111 | 121 |
| 112 #endif // CRASHPAD_UTIL_WIN_PROCESS_INFO_H_ | 122 #endif // CRASHPAD_UTIL_WIN_PROCESS_INFO_H_ |
| OLD | NEW |