Chromium Code Reviews| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 // Get the size of a struct up to and including the specified member. | 150 // Get the size of a struct up to and including the specified member. |
| 151 // This is necessary to set compatible struct sizes for different versions | 151 // This is necessary to set compatible struct sizes for different versions |
| 152 // of certain Windows APIs (e.g. SystemParametersInfo). | 152 // of certain Windows APIs (e.g. SystemParametersInfo). |
| 153 #define SIZEOF_STRUCT_WITH_SPECIFIED_LAST_MEMBER(struct_name, member) \ | 153 #define SIZEOF_STRUCT_WITH_SPECIFIED_LAST_MEMBER(struct_name, member) \ |
| 154 offsetof(struct_name, member) + \ | 154 offsetof(struct_name, member) + \ |
| 155 (sizeof static_cast<struct_name*>(NULL)->member) | 155 (sizeof static_cast<struct_name*>(NULL)->member) |
| 156 | 156 |
| 157 // Returns true if the machine is enrolled to a domain. | 157 // Returns true if the machine is enrolled to a domain. |
| 158 BASE_EXPORT bool IsEnrolledToDomain(); | 158 BASE_EXPORT bool IsEnrolledToDomain(); |
| 159 | 159 |
| 160 // Returns true if the machine is being managed by an MDM system. | |
| 161 // The caller of this function must be running as an elevated process. | |
|
Georges Khalil
2017/02/09 14:59:57
No need for elevated permission after all, correct
Roger Tawa OOO till Jul 10th
2017/02/09 16:06:43
Good catch! Removed sentence.
| |
| 162 BASE_EXPORT bool IsDeviceRegisteredWithMdm(); | |
| 163 | |
| 164 // Returns true if the current user is considered an enterprise user. | |
| 165 // An enterprise user is either domain enrolled or registered with an MDM. | |
| 166 BASE_EXPORT bool IsEnterpriseUser(); | |
| 167 | |
| 160 // Used by tests to mock any wanted state. Call with |state| set to true to | 168 // Used by tests to mock any wanted state. Call with |state| set to true to |
| 161 // simulate being in a domain and false otherwise. | 169 // simulate being in a domain and false otherwise. |
| 162 BASE_EXPORT void SetDomainStateForTesting(bool state); | 170 BASE_EXPORT void SetDomainStateForTesting(bool state); |
| 163 | 171 |
| 164 // Returns true if the current process can make USER32 or GDI32 calls such as | 172 // Returns true if the current process can make USER32 or GDI32 calls such as |
| 165 // CreateWindow and CreateDC. Windows 8 and above allow the kernel component | 173 // CreateWindow and CreateDC. Windows 8 and above allow the kernel component |
| 166 // of these calls to be disabled which can cause undefined behaviour such as | 174 // of these calls to be disabled which can cause undefined behaviour such as |
| 167 // crashes. This function can be used to guard areas of code using these calls | 175 // crashes. This function can be used to guard areas of code using these calls |
| 168 // and provide a fallback path if necessary. | 176 // and provide a fallback path if necessary. |
| 169 BASE_EXPORT bool IsUser32AndGdi32Available(); | 177 BASE_EXPORT bool IsUser32AndGdi32Available(); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 181 BASE_EXPORT void EnableFlicks(HWND hwnd); | 189 BASE_EXPORT void EnableFlicks(HWND hwnd); |
| 182 BASE_EXPORT void DisableFlicks(HWND hwnd); | 190 BASE_EXPORT void DisableFlicks(HWND hwnd); |
| 183 | 191 |
| 184 // Returns true if the process is per monitor DPI aware. | 192 // Returns true if the process is per monitor DPI aware. |
| 185 BASE_EXPORT bool IsProcessPerMonitorDpiAware(); | 193 BASE_EXPORT bool IsProcessPerMonitorDpiAware(); |
| 186 | 194 |
| 187 } // namespace win | 195 } // namespace win |
| 188 } // namespace base | 196 } // namespace base |
| 189 | 197 |
| 190 #endif // BASE_WIN_WIN_UTIL_H_ | 198 #endif // BASE_WIN_WIN_UTIL_H_ |
| OLD | NEW |