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

Unified Diff: components/policy/core/common/policy_loader_win.cc

Issue 2056033002: Clean Up Remaining Domain Check Call and netapi32.lib Usage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@isos
Patch Set: 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 | « components/policy/core/common/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/core/common/policy_loader_win.cc
diff --git a/components/policy/core/common/policy_loader_win.cc b/components/policy/core/common/policy_loader_win.cc
index fcf740d0792e9a49f240f372e727c71446c1220e..58c0441f6941733224cdbeecd1d41ab00279765a 100644
--- a/components/policy/core/common/policy_loader_win.cc
+++ b/components/policy/core/common/policy_loader_win.cc
@@ -5,7 +5,6 @@
#include "components/policy/core/common/policy_loader_win.h"
#include <windows.h>
-#include <lm.h> // For limits.
#include <ntdsapi.h> // For Ds[Un]Bind
#include <rpc.h> // For struct GUID
#include <shlwapi.h> // For PathIsUNC()
@@ -95,7 +94,8 @@ GUID kRegistrySettingsCSEGUID = REGISTRY_EXTENSION_GUID;
// (a) existing enumerated constants should never be deleted or reordered, and
// (b) new constants should only be appended at the end of the enumeration.
enum DomainCheckErrors {
- DOMAIN_CHECK_ERROR_GET_JOIN_INFO = 0,
+ // The check error below is no longer possible.
+ DEPRECATED_DOMAIN_CHECK_ERROR_GET_JOIN_INFO = 0,
DOMAIN_CHECK_ERROR_DS_BIND = 1,
DOMAIN_CHECK_ERROR_SIZE, // Not a DomainCheckError. Must be last.
};
@@ -334,18 +334,7 @@ void CollectEnterpriseUMAs() {
base::win::OSInfo::GetInstance()->version_type(),
base::win::SUITE_LAST);
- // Get the computer's domain status.
- LPWSTR domain;
- NETSETUP_JOIN_STATUS join_status;
- if (NERR_Success != ::NetGetJoinInformation(NULL, &domain, &join_status)) {
- UMA_HISTOGRAM_ENUMERATION("EnterpriseCheck.DomainCheckFailed",
- DOMAIN_CHECK_ERROR_GET_JOIN_INFO,
- DOMAIN_CHECK_ERROR_SIZE);
- return;
- }
- ::NetApiBufferFree(domain);
-
- bool in_domain = join_status == NetSetupDomainName;
+ bool in_domain = base::win::IsEnrolledToDomain();
UMA_HISTOGRAM_BOOLEAN("EnterpriseCheck.InDomain", in_domain);
if (in_domain) {
// This check will tell us how often are domain computers actually
« no previous file with comments | « components/policy/core/common/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698