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

Unified Diff: snapshot/win/pe_image_reader.h

Issue 1352323002: win: Make reading NT_IMAGE_HEADERS work cross-bitness (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@cleanup-crashpad-info
Patch Set: fixes2 Created 5 years, 3 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') | 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 2273a8e6ac8bdbf0fed8d28440abb4a6dd2c5b79..716d47fb3e8ba6489e32af72e9719137af73ec6a 100644
--- a/snapshot/win/pe_image_reader.h
+++ b/snapshot/win/pe_image_reader.h
@@ -102,14 +102,25 @@ class PEImageReader {
//! \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);
+ bool DebugDirectoryInformation(UUID* uuid,
+ DWORD* age,
+ std::string* pdbname) const;
private:
+ //! \brief Implementation helper for DebugDirectoryInformation() templated by
+ //! `IMAGE_NT_HEADERS` type for different bitnesses.
+ template <class NtHeadersType>
+ bool ReadDebugDirectoryInformation(UUID* uuid,
+ DWORD* age,
+ std::string* pdbname) const;
+
//! \brief Reads the `IMAGE_NT_HEADERS` from the beginning of the image.
+ template <class NtHeadersType>
bool ReadNtHeaders(WinVMAddress* nt_header_address,
- IMAGE_NT_HEADERS* nt_headers) const;
+ NtHeadersType* nt_headers) const;
//! \brief Finds a given section by name in the image.
+ template <class NtHeadersType>
bool GetSectionByName(const std::string& name,
IMAGE_SECTION_HEADER* section) const;
« no previous file with comments | « snapshot/win/module_snapshot_win.h ('k') | snapshot/win/pe_image_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698