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 INITIALIZATION_STATE_SET_VALID(initialized_); | 79 INITIALIZATION_STATE_SET_VALID(initialized_); |
80 return true; | 80 return true; |
81 } | 81 } |
82 | 82 |
83 template <class Traits> | 83 template <class Traits> |
84 bool PEImageReader::GetCrashpadInfo( | 84 bool PEImageReader::GetCrashpadInfo( |
85 process_types::CrashpadInfo<Traits>* crashpad_info) const { | 85 process_types::CrashpadInfo<Traits>* crashpad_info) const { |
86 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 86 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
87 | 87 |
88 IMAGE_SECTION_HEADER section; | 88 IMAGE_SECTION_HEADER section; |
89 if (!GetSectionByName<NtHeadersForTraits<Traits>::type>("CPADinfo", §ion)) | 89 if (!GetSectionByName<typename NtHeadersForTraits<Traits>::type>("CPADinfo", |
| 90 §ion)) { |
90 return false; | 91 return false; |
| 92 } |
91 | 93 |
92 if (section.Misc.VirtualSize < sizeof(process_types::CrashpadInfo<Traits>)) { | 94 if (section.Misc.VirtualSize < sizeof(process_types::CrashpadInfo<Traits>)) { |
93 LOG(WARNING) << "small crashpad info section size " | 95 LOG(WARNING) << "small crashpad info section size " |
94 << section.Misc.VirtualSize << ", " << module_name_; | 96 << section.Misc.VirtualSize << ", " << module_name_; |
95 return false; | 97 return false; |
96 } | 98 } |
97 | 99 |
98 WinVMAddress crashpad_info_address = Address() + section.VirtualAddress; | 100 WinVMAddress crashpad_info_address = Address() + section.VirtualAddress; |
99 CheckedWinAddressRange crashpad_info_range(process_reader_->Is64Bit(), | 101 CheckedWinAddressRange crashpad_info_range(process_reader_->Is64Bit(), |
100 crashpad_info_address, | 102 crashpad_info_address, |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 // Explicit instantiations with the only 2 valid template arguments to avoid | 303 // Explicit instantiations with the only 2 valid template arguments to avoid |
302 // putting the body of the function in the header. | 304 // putting the body of the function in the header. |
303 template bool PEImageReader::GetCrashpadInfo<process_types::internal::Traits32>( | 305 template bool PEImageReader::GetCrashpadInfo<process_types::internal::Traits32>( |
304 process_types::CrashpadInfo<process_types::internal::Traits32>* | 306 process_types::CrashpadInfo<process_types::internal::Traits32>* |
305 crashpad_info) const; | 307 crashpad_info) const; |
306 template bool PEImageReader::GetCrashpadInfo<process_types::internal::Traits64>( | 308 template bool PEImageReader::GetCrashpadInfo<process_types::internal::Traits64>( |
307 process_types::CrashpadInfo<process_types::internal::Traits64>* | 309 process_types::CrashpadInfo<process_types::internal::Traits64>* |
308 crashpad_info) const; | 310 crashpad_info) const; |
309 | 311 |
310 } // namespace crashpad | 312 } // namespace crashpad |
OLD | NEW |