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 BASE_EXPORT bool IsDeviceRegisteredWithManagement(); | |
162 | |
163 // Returns true if the current machine is considered enterprise managed in some | |
164 // fashion. A machine is considered managed if it is either domain enrolled | |
165 // or registered with an MDM. | |
166 BASE_EXPORT bool IsEnterpriseManaged(); | |
167 | |
168 // Used by tests to mock any wanted state. Call with |state| set to true to | 160 // Used by tests to mock any wanted state. Call with |state| set to true to |
169 // simulate being in a domain and false otherwise. | 161 // simulate being in a domain and false otherwise. |
170 BASE_EXPORT void SetDomainStateForTesting(bool state); | 162 BASE_EXPORT void SetDomainStateForTesting(bool state); |
171 | 163 |
172 // Returns true if the current process can make USER32 or GDI32 calls such as | 164 // Returns true if the current process can make USER32 or GDI32 calls such as |
173 // CreateWindow and CreateDC. Windows 8 and above allow the kernel component | 165 // CreateWindow and CreateDC. Windows 8 and above allow the kernel component |
174 // of these calls to be disabled which can cause undefined behaviour such as | 166 // of these calls to be disabled which can cause undefined behaviour such as |
175 // crashes. This function can be used to guard areas of code using these calls | 167 // crashes. This function can be used to guard areas of code using these calls |
176 // and provide a fallback path if necessary. | 168 // and provide a fallback path if necessary. |
177 BASE_EXPORT bool IsUser32AndGdi32Available(); | 169 BASE_EXPORT bool IsUser32AndGdi32Available(); |
(...skipping 11 matching lines...) Expand all Loading... |
189 BASE_EXPORT void EnableFlicks(HWND hwnd); | 181 BASE_EXPORT void EnableFlicks(HWND hwnd); |
190 BASE_EXPORT void DisableFlicks(HWND hwnd); | 182 BASE_EXPORT void DisableFlicks(HWND hwnd); |
191 | 183 |
192 // Returns true if the process is per monitor DPI aware. | 184 // Returns true if the process is per monitor DPI aware. |
193 BASE_EXPORT bool IsProcessPerMonitorDpiAware(); | 185 BASE_EXPORT bool IsProcessPerMonitorDpiAware(); |
194 | 186 |
195 } // namespace win | 187 } // namespace win |
196 } // namespace base | 188 } // namespace base |
197 | 189 |
198 #endif // BASE_WIN_WIN_UTIL_H_ | 190 #endif // BASE_WIN_WIN_UTIL_H_ |
OLD | NEW |