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. |
danakj
2015/11/14 00:34:59
This reads a lot like the base/OWNERS comment. Thi
| |
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 |
11 // location in or near that one place. It's nice you want people to be able | 11 // location in or near that one place. It's nice you want people to be able |
12 // to re-use your function, but realistically, if it hasn't been necessary | 12 // to re-use your function, but realistically, if it hasn't been necessary |
13 // before after so many years of development, it's probably not going to be | 13 // before after so many years of development, it's probably not going to be |
14 // used in other places in the future unless you know of them now. | 14 // used in other places in the future unless you know of them now. |
15 // | 15 // |
16 // - If your thing is used by multiple callers and is UI-related, it should | 16 // - If your thing is used by multiple callers and is UI-related, it should |
17 // probably be in app/win/ instead. Try to put it in the most specific file | 17 // probably be in app/win/ instead. Try to put it in the most specific file |
18 // possible (avoiding the *_util files when practical). | 18 // possible (avoiding the *_util files when practical). |
(...skipping 30 matching lines...) Expand all 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. | |
danakj
2015/11/14 00:34:59
Can you point to some documentation verifying this
| |
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 |