54 references to Advapi32
System.DirectoryServices.AccountManagement (54)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLsaMemoryHandle.cs (1)
21return Interop.Advapi32.LsaFreeMemory(handle) == 0;
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLsaPolicyHandle.cs (1)
20return Interop.Advapi32.LsaClose(handle) == 0;
System\DirectoryServices\AccountManagement\AD\ADStoreCtx.cs (1)
1554if (Interop.Advapi32.ConvertStringSidToSid(sddlSid, out pGroupSid) != Interop.BOOL.FALSE)
System\DirectoryServices\AccountManagement\AD\ADStoreCtx_LoadStore.cs (2)
529if (Interop.Advapi32.IsValidSid(pSid) && (Utils.ClassifySID(pSid) == SidType.FakeObject)) 584if (Interop.Advapi32.IsValidSid(pSid) && (Utils.ClassifySID(pSid) == SidType.FakeObject))
System\DirectoryServices\AccountManagement\AD\ADStoreCtx_Query.cs (1)
503if (Interop.Advapi32.ConvertStringSidToSid(urnValue, out pSid) != Interop.BOOL.FALSE)
System\DirectoryServices\AccountManagement\AD\SidList.cs (5)
89uint err = Interop.Advapi32.LsaOpenPolicy( 92(int)Interop.Advapi32.PolicyRights.POLICY_LOOKUP_NAMES, 102Interop.Advapi32.LsaNtStatusToWinError(err))); 111err = Interop.Advapi32.LsaLookupSids( 130Interop.Advapi32.LsaNtStatusToWinError(err)));
System\DirectoryServices\AccountManagement\AuthZSet.cs (3)
282bool success = Interop.Advapi32.EqualDomainSid(_psUserSid.DangerousGetHandle(), pSid, ref sameDomain); 329if (Interop.Advapi32.EqualDomainSid(_psMachineSid.DangerousGetHandle(), pSid, ref inMachineDomain)) 422if (Utils.ClassifySID(pSid) == SidType.RealObject && Interop.Advapi32.EqualDomainSid(_psUserSid.DangerousGetHandle(), pSid, ref sameDomain))
System\DirectoryServices\AccountManagement\SAM\SAMStoreCtx_LoadStore.cs (2)
356if (Interop.Advapi32.IsValidSid(pSid) && (Utils.ClassifySID(pSid) == SidType.FakeObject)) 421if (Interop.Advapi32.IsValidSid(pSid) && (Utils.ClassifySID(pSid) == SidType.FakeObject))
System\DirectoryServices\AccountManagement\Utils.cs (38)
125if (Interop.Advapi32.ConvertSidToStringSid(pSid, out string sddlSid) != Interop.BOOL.FALSE) 176int sidLength = Interop.Advapi32.GetLengthSid(pSid); 203Debug.Assert(Interop.Advapi32.IsValidSid(pSid)); 206IntPtr pIdentAuth = Interop.Advapi32.GetSidIdentifierAuthority(pSid); 208Interop.Advapi32.SID_IDENTIFIER_AUTHORITY identAuth = *(Interop.Advapi32.SID_IDENTIFIER_AUTHORITY*)pIdentAuth; 210IntPtr pRid = Interop.Advapi32.GetSidSubAuthority(pSid, 0); 247IntPtr pRidCount = Interop.Advapi32.GetSidSubAuthorityCount(pSid); 249IntPtr pLastRid = Interop.Advapi32.GetSidSubAuthority(pSid, ridCount - 1); 316bool success = Interop.Advapi32.EqualDomainSid(pCopyOfUserSid, pMachineDomainSid, ref sameDomain); 354if (!Interop.Advapi32.OpenThreadToken( 367if (!Interop.Advapi32.OpenProcessToken( 393bool success = Interop.Advapi32.GetTokenInformation( 395(uint)Interop.Advapi32.TOKEN_INFORMATION_CLASS.TokenUser, 414success = Interop.Advapi32.GetTokenInformation( 416(uint)Interop.Advapi32.TOKEN_INFORMATION_CLASS.TokenUser, 436Debug.Assert(Interop.Advapi32.IsValidSid(pUserSid)); 439int userSidLength = Interop.Advapi32.GetLengthSid(pUserSid); 441success = Interop.Advapi32.CopySid(userSidLength, pCopyOfUserSid, pUserSid); 474uint err = Interop.Advapi32.LsaOpenPolicy( 477(int)Interop.Advapi32.PolicyRights.POLICY_VIEW_LOCAL_INFORMATION, 481GlobalDebug.WriteLineIf(GlobalDebug.Error, "Utils", "GetMachineDomainSid: LsaOpenPolicy failed, gle=" + Interop.Advapi32.LsaNtStatusToWinError(err)); 485Interop.Advapi32.LsaNtStatusToWinError(err))); 489err = Interop.Advapi32.LsaQueryInformationPolicy( 496GlobalDebug.WriteLineIf(GlobalDebug.Error, "Utils", "GetMachineDomainSid: LsaQueryInformationPolicy failed, gle=" + Interop.Advapi32.LsaNtStatusToWinError(err)); 500Interop.Advapi32.LsaNtStatusToWinError(err))); 506Debug.Assert(Interop.Advapi32.IsValidSid(info.DomainSid)); 509int sidLength = Interop.Advapi32.GetLengthSid(info.DomainSid); 511bool success = Interop.Advapi32.CopySid(sidLength, pCopyOfSid, info.DomainSid); 530Interop.Advapi32.LsaFreeMemory(pBuffer); 607int f = Interop.Advapi32.LookupAccountSid(serverName, sid, null, ref nameLength, null, ref domainNameLength, out accountUsage); 624f = Interop.Advapi32.LookupAccountSid(serverName, sid, sbName, ref nameLength, sbDomainName, ref domainNameLength, out accountUsage); 748int result = Interop.Advapi32.LogonUser( 765result = Interop.Advapi32.ImpersonateLoggedOnUser(hToken); 786Interop.Advapi32.RevertToSelf(); 829Debug.Assert(Interop.Advapi32.IsValidSid(pSid)); 831IntPtr psubAuthorityCount = Interop.Advapi32.GetSidSubAuthorityCount(pSid); 856IntPtr pcurrentSubauthority = Interop.Advapi32.GetSidSubAuthority(pSid, i);