Esempio n. 1
0
        internal override bool MoveNext()
        {
            bool flag;

            do
            {
                flag = false;
                AuthZSet authZSet = this;
                authZSet.currentGroup = authZSet.currentGroup + 1;
                if (this.currentGroup < this.groupSidList.Length)
                {
                    if (this.userType != ContextType.Machine)
                    {
                        continue;
                    }
                    IntPtr item  = this.groupSidList[this.currentGroup].pSid;
                    bool   flag1 = false;
                    if (Utils.ClassifySID(item) != SidType.RealObject || !UnsafeNativeMethods.EqualDomainSid(this.psUserSid.DangerousGetHandle(), item, ref flag1) || !flag1)
                    {
                        continue;
                    }
                    int lastRidFromSid = Utils.GetLastRidFromSid(item);
                    if (lastRidFromSid != 0x201)
                    {
                        continue;
                    }
                    flag = true;
                }
                else
                {
                    return(false);
                }
            }while (flag);
            return(true);
        }
Esempio n. 2
0
		internal override ResultSet GetGroupsMemberOfAZ(Principal p)
		{
			ResultSet authZSet;
			SecurityIdentifier sid = p.Sid;
			if (sid != null)
			{
				byte[] numArray = new byte[sid.BinaryLength];
				sid.GetBinaryForm(numArray, 0);
				if (numArray != null)
				{
					try
					{
						authZSet = new AuthZSet(numArray, this.credentials, this.contextOptions, this.MachineFlatName, this, this.ctxBase);
					}
					catch (COMException cOMException1)
					{
						COMException cOMException = cOMException1;
						throw ExceptionHelper.GetExceptionFromCOMException(cOMException);
					}
					return authZSet;
				}
				else
				{
					throw new ArgumentException(StringResources.StoreCtxSecurityIdentityClaimBadFormat);
				}
			}
			else
			{
				throw new InvalidOperationException(StringResources.StoreCtxNeedValueSecurityIdentityClaimToQuery);
			}
		}