Index: base/win/win_util.cc |
diff --git a/base/win/win_util.cc b/base/win/win_util.cc |
index e0d0de1b418866d960598d3f983fb4e24b5df298..802c9e6a14d5a016fee700aa3e20f240ffb21ecf 100644 |
--- a/base/win/win_util.cc |
+++ b/base/win/win_util.cc |
@@ -6,7 +6,6 @@ |
#include <aclapi.h> |
#include <cfgmgr32.h> |
-#include <lm.h> |
#include <powrprof.h> |
#include <shobjidl.h> // Must be before propkey. |
#include <initguid.h> |
@@ -17,6 +16,7 @@ |
#include <roapi.h> |
#include <sddl.h> |
#include <setupapi.h> |
+#include <shlwapi.h> |
#include <signal.h> |
#include <stddef.h> |
#include <stdlib.h> |
@@ -518,20 +518,15 @@ bool IsTabletDevice(std::string* reason) { |
return is_tablet; |
} |
-enum DomainEnrollementState {UNKNOWN = -1, NOT_ENROLLED, ENROLLED}; |
+enum DomainEnrollmentState {UNKNOWN = -1, NOT_ENROLLED, ENROLLED}; |
static volatile long int g_domain_state = UNKNOWN; |
bool IsEnrolledToDomain() { |
// Doesn't make any sense to retry inside a user session because joining a |
// domain will only kick in on a restart. |
if (g_domain_state == UNKNOWN) { |
- LPWSTR domain; |
- NETSETUP_JOIN_STATUS join_status; |
- if(::NetGetJoinInformation(NULL, &domain, &join_status) != NERR_Success) |
scottmg
2016/06/09 17:12:14
From a quick skim, it looks like we could remove n
robliao
2016/06/09 18:51:52
Yep. Removed 1/4 instances.
The remaining 3...
ch
|
- return false; |
- ::NetApiBufferFree(domain); |
::InterlockedCompareExchange(&g_domain_state, |
- join_status == ::NetSetupDomainName ? |
+ !!IsOS(OS_DOMAINMEMBER) ? |
grt (UTC plus 2)
2016/06/09 16:51:41
is there a benefit to doing this? is there a gain
robliao
2016/06/09 16:56:10
This way, MS maintains the code necessary to check
|
ENROLLED : NOT_ENROLLED, |
UNKNOWN); |
} |