OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // ============================================================================= | 5 // ============================================================================= |
6 // PLEASE READ | 6 // PLEASE READ |
7 // | 7 // |
8 // In general, you should not be adding stuff to this file. | 8 // In general, you should not be adding stuff to this file. |
9 // | 9 // |
10 // - If your thing is only used in one place, just put it in a reasonable | 10 // - If your thing is only used in one place, just put it in a reasonable |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 int iMenuWidth; | 49 int iMenuWidth; |
50 int iMenuHeight; | 50 int iMenuHeight; |
51 LOGFONTW lfMenuFont; | 51 LOGFONTW lfMenuFont; |
52 LOGFONTW lfStatusFont; | 52 LOGFONTW lfStatusFont; |
53 LOGFONTW lfMessageFont; | 53 LOGFONTW lfMessageFont; |
54 }; | 54 }; |
55 | 55 |
56 namespace base { | 56 namespace base { |
57 namespace win { | 57 namespace win { |
58 | 58 |
| 59 inline uint32_t HandleToUint32(HANDLE h) { |
| 60 // Cast through uintptr_t and then unsigned int to make the truncation to |
| 61 // 32 bits explicit. Handles are size of-pointer but are always 32-bit values. |
| 62 return static_cast<uint32_t>(reinterpret_cast<uintptr_t>(h)); |
| 63 } |
| 64 |
59 BASE_EXPORT void GetNonClientMetrics(NONCLIENTMETRICS_XP* metrics); | 65 BASE_EXPORT void GetNonClientMetrics(NONCLIENTMETRICS_XP* metrics); |
60 | 66 |
61 // Returns the string representing the current user sid. | 67 // Returns the string representing the current user sid. |
62 BASE_EXPORT bool GetUserSidString(std::wstring* user_sid); | 68 BASE_EXPORT bool GetUserSidString(std::wstring* user_sid); |
63 | 69 |
64 // Returns false if user account control (UAC) has been disabled with the | 70 // Returns false if user account control (UAC) has been disabled with the |
65 // EnableLUA registry flag. Returns true if user account control is enabled. | 71 // EnableLUA registry flag. Returns true if user account control is enabled. |
66 // NOTE: The EnableLUA registry flag, which is ignored on Windows XP | 72 // NOTE: The EnableLUA registry flag, which is ignored on Windows XP |
67 // machines, might still exist and be set to 0 (UAC disabled), in which case | 73 // machines, might still exist and be set to 0 (UAC disabled), in which case |
68 // this function will return false. You should therefore check this flag only | 74 // this function will return false. You should therefore check this flag only |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // CreateWindow and CreateDC. Windows 8 and above allow the kernel component | 162 // CreateWindow and CreateDC. Windows 8 and above allow the kernel component |
157 // of these calls to be disabled which can cause undefined behaviour such as | 163 // of these calls to be disabled which can cause undefined behaviour such as |
158 // crashes. This function can be used to guard areas of code using these calls | 164 // crashes. This function can be used to guard areas of code using these calls |
159 // and provide a fallback path if necessary. | 165 // and provide a fallback path if necessary. |
160 BASE_EXPORT bool IsUser32AndGdi32Available(); | 166 BASE_EXPORT bool IsUser32AndGdi32Available(); |
161 | 167 |
162 } // namespace win | 168 } // namespace win |
163 } // namespace base | 169 } // namespace base |
164 | 170 |
165 #endif // BASE_WIN_WIN_UTIL_H_ | 171 #endif // BASE_WIN_WIN_UTIL_H_ |
OLD | NEW |