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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 if (ffi.dwFileType == VFT_APP) | 128 if (ffi.dwFileType == VFT_APP) |
129 return ModuleSnapshot::kModuleTypeExecutable; | 129 return ModuleSnapshot::kModuleTypeExecutable; |
130 if (ffi.dwFileType == VFT_DLL) | 130 if (ffi.dwFileType == VFT_DLL) |
131 return ModuleSnapshot::kModuleTypeSharedLibrary; | 131 return ModuleSnapshot::kModuleTypeSharedLibrary; |
132 if (ffi.dwFileType == VFT_DRV || ffi.dwFileType == VFT_VXD) | 132 if (ffi.dwFileType == VFT_DRV || ffi.dwFileType == VFT_VXD) |
133 return ModuleSnapshot::kModuleTypeLoadableModule; | 133 return ModuleSnapshot::kModuleTypeLoadableModule; |
134 } | 134 } |
135 return ModuleSnapshot::kModuleTypeUnknown; | 135 return ModuleSnapshot::kModuleTypeUnknown; |
136 } | 136 } |
137 | 137 |
138 void ModuleSnapshotWin::UUID(crashpad::UUID* uuid) const { | 138 void ModuleSnapshotWin::UUIDAndAge(crashpad::UUID* uuid, uint32_t* age) const { |
139 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 139 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
140 // TODO(scottmg): Also pass the age and pdbname through to snapshot? | 140 // TODO(scottmg): Consider passing pdbname through to snapshot. |
141 DWORD age; | |
142 std::string pdbname; | 141 std::string pdbname; |
143 if (!pe_image_reader_->DebugDirectoryInformation(uuid, &age, &pdbname)) | 142 DWORD age_dword; |
| 143 if (!pe_image_reader_->DebugDirectoryInformation( |
| 144 uuid, &age_dword, &pdbname)) { |
144 *uuid = crashpad::UUID(); | 145 *uuid = crashpad::UUID(); |
| 146 *age = 0; |
| 147 } |
| 148 static_assert(sizeof(DWORD) == sizeof(uint32_t), "unexpected age size"); |
| 149 *age = age_dword; |
145 } | 150 } |
146 | 151 |
147 std::vector<std::string> ModuleSnapshotWin::AnnotationsVector() const { | 152 std::vector<std::string> ModuleSnapshotWin::AnnotationsVector() const { |
148 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 153 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
149 // These correspond to system-logged things on Mac. We don't currently track | 154 // These correspond to system-logged things on Mac. We don't currently track |
150 // any of these on Windows, but could in the future. | 155 // any of these on Windows, but could in the future. |
151 // See https://code.google.com/p/crashpad/issues/detail?id=38. | 156 // See https://code.google.com/p/crashpad/issues/detail?id=38. |
152 return std::vector<std::string>(); | 157 return std::vector<std::string>(); |
153 } | 158 } |
154 | 159 |
(...skipping 19 matching lines...) Expand all Loading... |
174 CrashpadInfoClientOptions::TriStateFromCrashpadInfo( | 179 CrashpadInfoClientOptions::TriStateFromCrashpadInfo( |
175 crashpad_info.crashpad_handler_behavior); | 180 crashpad_info.crashpad_handler_behavior); |
176 | 181 |
177 options->system_crash_reporter_forwarding = | 182 options->system_crash_reporter_forwarding = |
178 CrashpadInfoClientOptions::TriStateFromCrashpadInfo( | 183 CrashpadInfoClientOptions::TriStateFromCrashpadInfo( |
179 crashpad_info.system_crash_reporter_forwarding); | 184 crashpad_info.system_crash_reporter_forwarding); |
180 } | 185 } |
181 | 186 |
182 } // namespace internal | 187 } // namespace internal |
183 } // namespace crashpad | 188 } // namespace crashpad |
OLD | NEW |