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 #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(NERR_Success != ::NetGetJoinInformation(NULL, &domain, &join_status)) { | |
|
gab
2014/01/21 15:04:53
nit: remove {}
gab
2014/01/21 15:04:53
nit: Put constant on RHS of !=
pastarmovj
2014/01/21 15:30:31
Right. This used to be longer in the UMA version :
| |
| 363 return false; | |
| 364 } | |
| 365 ::NetApiBufferFree(domain); | |
| 366 | |
| 367 return join_status == NetSetupDomainName; | |
|
gab
2014/01/21 15:04:53
Would ::NetSetupDomainName compile? It would look
pastarmovj
2014/01/21 15:30:31
Done.
| |
| 368 } | |
| 369 | |
| 358 } // namespace win | 370 } // namespace win |
| 359 } // namespace base | 371 } // namespace base |
| 360 | 372 |
| 361 #ifdef _MSC_VER | 373 #ifdef _MSC_VER |
| 362 | 374 |
| 363 // There are optimizer bugs in x86 VS2012 pre-Update 1. | 375 // There are optimizer bugs in x86 VS2012 pre-Update 1. |
| 364 #if _MSC_VER == 1700 && defined _M_IX86 && _MSC_FULL_VER < 170051106 | 376 #if _MSC_VER == 1700 && defined _M_IX86 && _MSC_FULL_VER < 170051106 |
| 365 | 377 |
| 366 #pragma message("Relevant defines:") | 378 #pragma message("Relevant defines:") |
| 367 #define __STR2__(x) #x | 379 #define __STR2__(x) #x |
| 368 #define __STR1__(x) __STR2__(x) | 380 #define __STR1__(x) __STR2__(x) |
| 369 #define __PPOUT__(x) "#define " #x " " __STR1__(x) | 381 #define __PPOUT__(x) "#define " #x " " __STR1__(x) |
| 370 #if defined(_M_IX86) | 382 #if defined(_M_IX86) |
| 371 #pragma message(__PPOUT__(_M_IX86)) | 383 #pragma message(__PPOUT__(_M_IX86)) |
| 372 #endif | 384 #endif |
| 373 #if defined(_M_X64) | 385 #if defined(_M_X64) |
| 374 #pragma message(__PPOUT__(_M_X64)) | 386 #pragma message(__PPOUT__(_M_X64)) |
| 375 #endif | 387 #endif |
| 376 #if defined(_MSC_FULL_VER) | 388 #if defined(_MSC_FULL_VER) |
| 377 #pragma message(__PPOUT__(_MSC_FULL_VER)) | 389 #pragma message(__PPOUT__(_MSC_FULL_VER)) |
| 378 #endif | 390 #endif |
| 379 | 391 |
| 380 #pragma message("Visual Studio 2012 x86 must be updated to at least Update 1") | 392 #pragma message("Visual Studio 2012 x86 must be updated to at least Update 1") |
| 381 #error Must install Update 1 to Visual Studio 2012. | 393 #error Must install Update 1 to Visual Studio 2012. |
| 382 #endif | 394 #endif |
| 383 | 395 |
| 384 #endif // _MSC_VER | 396 #endif // _MSC_VER |
| 385 | 397 |
| OLD | NEW |