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 <cfgmgr32.h> | 8 #include <cfgmgr32.h> |
9 #include <lm.h> | 9 #include <lm.h> |
10 #include <powrprof.h> | 10 #include <powrprof.h> |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 UNKNOWN); | 549 UNKNOWN); |
550 } | 550 } |
551 | 551 |
552 return g_domain_state == ENROLLED; | 552 return g_domain_state == ENROLLED; |
553 } | 553 } |
554 | 554 |
555 void SetDomainStateForTesting(bool state) { | 555 void SetDomainStateForTesting(bool state) { |
556 g_domain_state = state ? ENROLLED : NOT_ENROLLED; | 556 g_domain_state = state ? ENROLLED : NOT_ENROLLED; |
557 } | 557 } |
558 | 558 |
559 bool MaybeHasSHA256Support() { | |
560 const OSInfo* os_info = OSInfo::GetInstance(); | |
561 | |
562 if (os_info->version() == VERSION_PRE_XP) | |
563 return false; // Too old to have it and this OS is not supported anyway. | |
564 | |
565 if (os_info->version() == VERSION_XP) | |
566 return os_info->service_pack().major >= 3; // Windows XP SP3 has it. | |
567 | |
568 // Assume it is missing in this case, although it may not be. This category | |
569 // includes Windows XP x64, and Windows Server, where a hotfix could be | |
570 // deployed. | |
571 if (os_info->version() == VERSION_SERVER_2003) | |
572 return false; | |
573 | |
574 DCHECK(os_info->version() >= VERSION_VISTA); | |
575 return true; // New enough to have SHA-256 support. | |
576 } | |
577 | |
578 bool IsUser32AndGdi32Available() { | 559 bool IsUser32AndGdi32Available() { |
579 static base::LazyInstance<LazyIsUser32AndGdi32Available>::Leaky available = | 560 static base::LazyInstance<LazyIsUser32AndGdi32Available>::Leaky available = |
580 LAZY_INSTANCE_INITIALIZER; | 561 LAZY_INSTANCE_INITIALIZER; |
581 return available.Get().value(); | 562 return available.Get().value(); |
582 } | 563 } |
583 | 564 |
584 } // namespace win | 565 } // namespace win |
585 } // namespace base | 566 } // namespace base |
OLD | NEW |