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

Unified Diff: base/win/win_util.cc

Issue 140553005: Add Windows utillity function to verify if a computer is part of a domain. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed the nits. Created 6 years, 11 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/win/win_util.h ('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 cc64c650cb6580bbe41ee1438329b18f4875f6d2..7b85418a1ea79917215a33ec5e0fc125c99fe15b 100644
--- a/base/win/win_util.cc
+++ b/base/win/win_util.cc
@@ -5,6 +5,7 @@
#include "base/win/win_util.h"
#include <aclapi.h>
+#include <lm.h>
#include <shellapi.h>
#include <shlobj.h>
#include <shobjidl.h> // Must be before propkey.
@@ -355,6 +356,16 @@ BOOL GetMonitorInfoWrapper(HMONITOR monitor, MONITORINFO* mi) {
return ret;
}
+bool IsEnrolledToDomain() {
+ LPWSTR domain;
+ NETSETUP_JOIN_STATUS join_status;
+ if(::NetGetJoinInformation(NULL, &domain, &join_status) != NERR_Success)
+ return false;
+ ::NetApiBufferFree(domain);
+
+ return join_status == ::NetSetupDomainName;
+}
+
} // namespace win
} // namespace base
« no previous file with comments | « base/win/win_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698