}
Debug.Assert(g.UnderlyingObject != null && g.UnderlyingObject is DirectoryEntry);
- UnsafeNativeMethods.IADsGroup adsGroup = (UnsafeNativeMethods.IADsGroup)((DirectoryEntry)g.UnderlyingObject).NativeObject;
IEnumerable cachedMembersEnum = null; //This variables stores a reference to the direct members enumerator of the group.
// Only real principals can be directly a member of the group, since only real principals
{
GlobalDebug.WriteLineIf(GlobalDebug.Info, "ADStoreCtx", "LoadDirectoryEntryAttributes, path={0}", de.Path);
- string[] ldapAttributesUsed = new string[]
- {
- "accountExpires",
- "badPasswordTime",
- "badPwdCount",
- "displayName",
- "distinguishedName",
- "description",
- "employeeID",
- "givenName",
- "groupType",
- "homeDirectory",
- "homeDrive",
- "lastLogon",
- "lastLogonTimestamp",
- "lockoutTime",
- "logonHours",
- "mail",
- "member",
- "memberOf",
- "middleName",
- "msDS-User-Account-Control-Computed",
- "ntSecurityDescriptor",
- "objectClass",
- "objectGuid",
- "objectSid",
- "primaryGroupID",
- "pwdLastSet",
- "samAccountName",
- "scriptPath",
- "servicePrincipalName",
- "sn",
- "telephoneNumber",
- "userAccountControl",
- "userCertificate",
- "userPrincipalName",
- "userWorkstations"
- };
try
{
// de.RefreshCache(ldapAttributesUsed);
userStoreCtx.GetType());
_userType = userStoreCtx.OwningContext.ContextType;
- _userCtxBase = userCtxBase;
_userStoreCtx = userStoreCtx;
_credentials = credentials;
_contextOptions = contextOptions;
// Preload the PrincipalContext cache with the user's PrincipalContext
_contexts[flatUserAuthority] = userStoreCtx.OwningContext;
- IntPtr hUser = IntPtr.Zero;
-
//
// Get the SIDs of the groups to which the user belongs
//
// The user's options
private readonly ContextOptions _contextOptions;
- // The ctxBase (e.g., DirectoryEntry) from the user's StoreCtx
- private readonly object _userCtxBase;
-
// The type (domain, local, etc.) of the user
private readonly ContextType _userType;
ctxBase.Path);
_storeCtx = storeCtx;
- _ctxBase = ctxBase;
_group = group;
_originalGroup = group;
{
needToRetry = false;
- object[] nativeMembers = new object[1];
-
bool f = _membersEnumerator.MoveNext();
if (f) // got a value
bool isLocal = false;
// Ask the OS to resolve the SID to its target.
- int accountUsage = 0;
- string name;
string domainName;
int err = Utils.LookupSid(
_storeCtx.MachineUserSuppliedName,
_storeCtx.Credentials,
sid,
- out name,
+ out _,
out domainName,
- out accountUsage);
+ out _);
if (err != 0)
{
private bool _disposed = false;
private readonly SAMStoreCtx _storeCtx;
- private readonly DirectoryEntry _ctxBase;
private bool _atBeginning = true;
string name;
string domainName;
- int accountUsage;
// Map the SID to a machine and account name
// If this fails, there's no match
- int err = Utils.LookupSid(this.MachineUserSuppliedName, _credentials, sid, out name, out domainName, out accountUsage);
+ int err = Utils.LookupSid(this.MachineUserSuppliedName, _credentials, sid, out name, out domainName, out _);
if (err != 0)
{
{
byte[] sid = (byte[])de.Properties["objectSid"][0];
- string stringizedSid = Utils.ByteArrayToString(sid);
string sddlSid = Utils.ConvertSidToSDDL(sid);
SecurityIdentifier SidObj = new SecurityIdentifier(sddlSid);
p.LoadValueIntoProperty(propertyName, (object)SidObj);
internal static Principal DirectoryEntryAsPrincipal(DirectoryEntry de, StoreCtx storeCtx)
{
- string className = de.SchemaClassName;
-
// Unlike AD, we don't have to worry about cross-store refs here. In AD, if there's
// a cross-store ref, we'll get back a DirectoryEntry of the FPO object. In the WinNT ADSI
// provider, we'll get back the DirectoryEntry of the remote object itself --- ADSI does
try
{
string entryName = (string)rootEntry.Properties["distinguishedName"].Value;
-
// Search for computer "serviceConnectionObjects" where the keywords attribute
// contains the specified keyword
// set up the searcher object