Index: base/win/win_util.h |
diff --git a/base/win/win_util.h b/base/win/win_util.h |
index 384db80567bf6d319df487fabae6948ce5aeb93f..efd3f07e8bf0236c3e3b92662e071663432b5c51 100644 |
--- a/base/win/win_util.h |
+++ b/base/win/win_util.h |
@@ -56,6 +56,12 @@ 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. |
danakj
2015/11/14 00:34:59
Can you point to some documentation verifying this
|
+ 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. |