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 #include "base/win/win_util.h" | 5 #include "base/win/win_util.h" |
6 | 6 |
7 #include <aclapi.h> | 7 #include <aclapi.h> |
| 8 #include <lm.h> |
8 #include <shellapi.h> | 9 #include <shellapi.h> |
9 #include <shlobj.h> | 10 #include <shlobj.h> |
10 #include <shobjidl.h> // Must be before propkey. | 11 #include <shobjidl.h> // Must be before propkey. |
11 #include <initguid.h> | 12 #include <initguid.h> |
12 #include <propkey.h> | 13 #include <propkey.h> |
13 #include <propvarutil.h> | 14 #include <propvarutil.h> |
14 #include <sddl.h> | 15 #include <sddl.h> |
15 #include <signal.h> | 16 #include <signal.h> |
16 #include <stdlib.h> | 17 #include <stdlib.h> |
17 | 18 |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 } | 349 } |
349 root_window = reinterpret_cast<MetroRootWindow>( | 350 root_window = reinterpret_cast<MetroRootWindow>( |
350 ::GetProcAddress(metro, "GetRootWindow")); | 351 ::GetProcAddress(metro, "GetRootWindow")); |
351 } | 352 } |
352 ret = ::GetWindowRect(root_window(), &(mi->rcWork)); | 353 ret = ::GetWindowRect(root_window(), &(mi->rcWork)); |
353 } | 354 } |
354 #endif | 355 #endif |
355 return ret; | 356 return ret; |
356 } | 357 } |
357 | 358 |
| 359 bool IsEnrolledToDomain() { |
| 360 LPWSTR domain; |
| 361 NETSETUP_JOIN_STATUS join_status; |
| 362 if(::NetGetJoinInformation(NULL, &domain, &join_status) != NERR_Success) |
| 363 return false; |
| 364 ::NetApiBufferFree(domain); |
| 365 |
| 366 return join_status == ::NetSetupDomainName; |
| 367 } |
| 368 |
358 } // namespace win | 369 } // namespace win |
359 } // namespace base | 370 } // namespace base |
360 | 371 |
361 #ifdef _MSC_VER | 372 #ifdef _MSC_VER |
362 | 373 |
363 // There are optimizer bugs in x86 VS2012 pre-Update 1. | 374 // There are optimizer bugs in x86 VS2012 pre-Update 1. |
364 #if _MSC_VER == 1700 && defined _M_IX86 && _MSC_FULL_VER < 170051106 | 375 #if _MSC_VER == 1700 && defined _M_IX86 && _MSC_FULL_VER < 170051106 |
365 | 376 |
366 #pragma message("Relevant defines:") | 377 #pragma message("Relevant defines:") |
367 #define __STR2__(x) #x | 378 #define __STR2__(x) #x |
368 #define __STR1__(x) __STR2__(x) | 379 #define __STR1__(x) __STR2__(x) |
369 #define __PPOUT__(x) "#define " #x " " __STR1__(x) | 380 #define __PPOUT__(x) "#define " #x " " __STR1__(x) |
370 #if defined(_M_IX86) | 381 #if defined(_M_IX86) |
371 #pragma message(__PPOUT__(_M_IX86)) | 382 #pragma message(__PPOUT__(_M_IX86)) |
372 #endif | 383 #endif |
373 #if defined(_M_X64) | 384 #if defined(_M_X64) |
374 #pragma message(__PPOUT__(_M_X64)) | 385 #pragma message(__PPOUT__(_M_X64)) |
375 #endif | 386 #endif |
376 #if defined(_MSC_FULL_VER) | 387 #if defined(_MSC_FULL_VER) |
377 #pragma message(__PPOUT__(_MSC_FULL_VER)) | 388 #pragma message(__PPOUT__(_MSC_FULL_VER)) |
378 #endif | 389 #endif |
379 | 390 |
380 #pragma message("Visual Studio 2012 x86 must be updated to at least Update 1") | 391 #pragma message("Visual Studio 2012 x86 must be updated to at least Update 1") |
381 #error Must install Update 1 to Visual Studio 2012. | 392 #error Must install Update 1 to Visual Studio 2012. |
382 #endif | 393 #endif |
383 | 394 |
384 #endif // _MSC_VER | 395 #endif // _MSC_VER |
385 | 396 |
OLD | NEW |