Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1881)

Unified Diff: snapshot/win/module_snapshot_win.cc

Issue 1418613013: Capture UUID age field on Windows (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: fixes Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « snapshot/win/module_snapshot_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/win/module_snapshot_win.cc
diff --git a/snapshot/win/module_snapshot_win.cc b/snapshot/win/module_snapshot_win.cc
index 6c583092a27a12875d967dc6fbe5892ba9d044a6..86aae48f2e7cc0881feb3ddb3d1f346da1dba2c2 100644
--- a/snapshot/win/module_snapshot_win.cc
+++ b/snapshot/win/module_snapshot_win.cc
@@ -135,13 +135,18 @@ ModuleSnapshot::ModuleType ModuleSnapshotWin::GetModuleType() const {
return ModuleSnapshot::kModuleTypeUnknown;
}
-void ModuleSnapshotWin::UUID(crashpad::UUID* uuid) const {
+void ModuleSnapshotWin::UUIDAndAge(crashpad::UUID* uuid, uint32_t* age) const {
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
- // TODO(scottmg): Also pass the age and pdbname through to snapshot?
- DWORD age;
+ // TODO(scottmg): Consider passing pdbname through to snapshot.
std::string pdbname;
- if (!pe_image_reader_->DebugDirectoryInformation(uuid, &age, &pdbname))
+ DWORD age_dword;
+ if (!pe_image_reader_->DebugDirectoryInformation(
+ uuid, &age_dword, &pdbname)) {
*uuid = crashpad::UUID();
+ *age = 0;
+ }
+ static_assert(sizeof(DWORD) == sizeof(uint32_t), "unexpected age size");
+ *age = age_dword;
}
std::vector<std::string> ModuleSnapshotWin::AnnotationsVector() const {
« no previous file with comments | « snapshot/win/module_snapshot_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698