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

Unified Diff: util/win/process_info.cc

Issue 1120383003: Get generate_dump compiling on Windows (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@tools
Patch Set: fix mac; no implicit conversion to std::string for StringPiece Created 5 years, 7 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 | « tools/tools.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/win/process_info.cc
diff --git a/util/win/process_info.cc b/util/win/process_info.cc
index 73c9bf85ad5202e9ea9505c7162649d4322f46a8..ca8277ed0308736ad257a3b5c9ef46deee356cb7 100644
--- a/util/win/process_info.cc
+++ b/util/win/process_info.cc
@@ -259,9 +259,14 @@ bool ProcessInfo::Initialize(HANDLE process) {
LOG(ERROR) << "NtQueryInformationProcess incorrect size";
return false;
}
- process_id_ = process_basic_information.UniqueProcessId;
- inherited_from_process_id_ =
- process_basic_information.InheritedFromUniqueProcessId;
+
+ // See https://msdn.microsoft.com/en-us/library/windows/desktop/aa384203 on
+ // 32 bit being the correct size for HANDLEs for proceses, even on Windows
+ // x64. API functions (e.g. OpenProcess) take only a DWORD, so there's no
+ // sense in maintaining the top bits.
+ process_id_ = static_cast<DWORD>(process_basic_information.UniqueProcessId);
+ inherited_from_process_id_ = static_cast<DWORD>(
+ process_basic_information.InheritedFromUniqueProcessId);
// We now want to read the PEB to gather the rest of our information. The
// PebBaseAddress as returned above is what we want for 64-on-64 and 32-on-32,
« no previous file with comments | « tools/tools.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698