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

Unified Diff: base/win/win_util.h

Issue 1422773008: Fixing remaining VC++ 2015 64-bit build breaks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing unneeded include Created 5 years 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 | « no previous file | build/common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/win_util.h
diff --git a/base/win/win_util.h b/base/win/win_util.h
index 384db80567bf6d319df487fabae6948ce5aeb93f..c1249d9126d53ef90dff45574c478cfbfe03a25f 100644
--- a/base/win/win_util.h
+++ b/base/win/win_util.h
@@ -56,6 +56,14 @@ struct NONCLIENTMETRICS_XP {
namespace base {
namespace win {
+inline uint32_t HandleToUint32(HANDLE h) {
+ // Cast through uintptr_t and then unsigned int to make the truncation to
+ // 32 bits explicit. Handles are size of-pointer but are always 32-bit values.
+ // https://msdn.microsoft.com/en-us/library/aa384203(VS.85).aspx says:
+ // 64-bit versions of Windows use 32-bit handles for interoperability.
+ return static_cast<uint32_t>(reinterpret_cast<uintptr_t>(h));
+}
+
BASE_EXPORT void GetNonClientMetrics(NONCLIENTMETRICS_XP* metrics);
// Returns the string representing the current user sid.
« no previous file with comments | « no previous file | build/common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698