Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3804)

Unified Diff: base/win/win_util.cc

Issue 2048083003: Use IsOS(OS_DOMAINMEMBER) to Check for Domain Membership (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove the '!!' Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/win_util.cc
diff --git a/base/win/win_util.cc b/base/win/win_util.cc
index e0d0de1b418866d960598d3f983fb4e24b5df298..ce59baa287d4e9820ea4428492c27834d5e37b05 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)
- return false;
- ::NetApiBufferFree(domain);
::InterlockedCompareExchange(&g_domain_state,
- join_status == ::NetSetupDomainName ?
+ IsOS(OS_DOMAINMEMBER) ?
ENROLLED : NOT_ENROLLED,
UNKNOWN);
}
« no previous file with comments | « base/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698