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

Unified Diff: snapshot/win/pe_image_reader.h

Issue 1311003003: Implement ModuleSnapshotWin::UUID (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: fixes Created 5 years, 4 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.cc ('k') | snapshot/win/pe_image_reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/win/pe_image_reader.h
diff --git a/snapshot/win/pe_image_reader.h b/snapshot/win/pe_image_reader.h
index 71b4863e8ffdaa0777091bdb87590e3f078d7ffd..2273a8e6ac8bdbf0fed8d28440abb4a6dd2c5b79 100644
--- a/snapshot/win/pe_image_reader.h
+++ b/snapshot/win/pe_image_reader.h
@@ -21,6 +21,7 @@
#include "base/basictypes.h"
#include "util/misc/initialization_state_dcheck.h"
+#include "util/misc/uuid.h"
#include "util/win/address_types.h"
#include "util/win/checked_win_address_range.h"
@@ -93,7 +94,21 @@ class PEImageReader {
//! messages. Other failures will result in messages being logged.
bool GetCrashpadInfo(process_types::CrashpadInfo* crashpad_info) const;
+ //! \brief Obtains information from the module's debug directory, if any.
+ //!
+ //! \param[out] uuid The unique identifier of the executable/PDB.
+ //! \param[out] age The age field for the pdb (the number of times it's been
+ //! relinked).
+ //! \param[out] pdbname Name of the pdb file.
+ //! \return `true` on success, or `false` if the module has no debug directory
+ //! entry.
+ bool DebugDirectoryInformation(UUID* uuid, DWORD* age, std::string* pdbname);
+
private:
+ //! \brief Reads the `IMAGE_NT_HEADERS` from the beginning of the image.
+ bool ReadNtHeaders(WinVMAddress* nt_header_address,
+ IMAGE_NT_HEADERS* nt_headers) const;
+
//! \brief Finds a given section by name in the image.
bool GetSectionByName(const std::string& name,
IMAGE_SECTION_HEADER* section) const;
« no previous file with comments | « snapshot/win/module_snapshot_win.cc ('k') | snapshot/win/pe_image_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698