156 references to Interop
System.DirectoryServices.AccountManagement (156)
_generated\0\LibraryImports.g.cs (16)
35internal static partial global::Interop.BOOL ConvertSidToStringSid(nint sid, out string stringSid) 41global::Interop.BOOL __retVal = default; 67static extern unsafe global::Interop.BOOL __PInvoke(nint __sid_native, ushort** __stringSid_native); 77internal static unsafe partial global::Interop.BOOL ConvertStringSidToSid(string StringSid, out void* Sid) 81global::Interop.BOOL __retVal; 95static extern unsafe global::Interop.BOOL __PInvoke(ushort* __StringSid_native, void** __Sid_native); 451private static partial uint LsaOpenPolicy(ref global::Interop.UNICODE_STRING SystemName, ref global::Interop.OBJECT_ATTRIBUTES ObjectAttributes, int AccessMask, out global::Microsoft.Win32.SafeHandles.SafeLsaPolicyHandle PolicyHandle) 463fixed (global::Interop.OBJECT_ATTRIBUTES* __ObjectAttributes_native = &ObjectAttributes) 464fixed (global::Interop.UNICODE_STRING* __SystemName_native = &SystemName) 490static extern unsafe uint __PInvoke(global::Interop.UNICODE_STRING* __SystemName_native, global::Interop.OBJECT_ATTRIBUTES* __ObjectAttributes_native, int __AccessMask_native, nint* __PolicyHandle_native); 678internal static partial bool AuthzInitializeContextFromSid(int Flags, nint UserSid, nint AuthzResourceManager, nint pExpirationTime, global::Interop.LUID Identitifier, nint DynamicGroupArgs, out nint pAuthzClientContext) 698static extern unsafe int __PInvoke(int __Flags_native, nint __UserSid_native, nint __AuthzResourceManager_native, nint __pExpirationTime_native, global::Interop.LUID __Identitifier_native, nint __DynamicGroupArgs_native, nint* __pAuthzClientContext_native); 819internal static partial int DsRoleGetPrimaryDomainInformation(string lpServer, global::Interop.Dsrole.DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel, out nint Buffer) 833static extern unsafe int __PInvoke(ushort* __lpServer_native, global::Interop.Dsrole.DSROLE_PRIMARY_DOMAIN_INFO_LEVEL __InfoLevel_native, nint* __Buffer_native);
src\runtime\src\libraries\Common\src\Interop\Windows\Activeds\Interop.ADsOpenObject.cs (1)
11[LibraryImport(Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.ConvertStringSidToSid.cs (1)
12[LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSidToSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.CopySid.cs (1)
11[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.EqualDomainSid.cs (1)
11[LibraryImport(Interop.Libraries.Advapi32)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.GetLengthSid.cs (1)
11[LibraryImport(Interop.Libraries.Advapi32)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.GetSidIdentifierAuthority.cs (2)
25[LibraryImport(Interop.Libraries.Advapi32)] 28[LibraryImport(Interop.Libraries.Advapi32)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.GetTokenInformation.cs (1)
12[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LookupAccountSid.cs (1)
11[LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LookupAccountSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaClose.cs (1)
11[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaFreeMemory.cs (1)
11[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaLookupSids.cs (6)
12[LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupSids", SetLastError = true)] 30referencedDomains.Initialize((uint)Marshal.SizeOf<Interop.LSA_REFERENCED_DOMAIN_LIST>()); 31Interop.LSA_REFERENCED_DOMAIN_LIST domainList = referencedDomains.Read<Interop.LSA_REFERENCED_DOMAIN_LIST>(0); 43Interop.LSA_TRUST_INFORMATION* pTrustInformation = (Interop.LSA_TRUST_INFORMATION*)domainList.Domains;
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaNtStatusToWinError.cs (1)
11[LibraryImport(Interop.Libraries.Advapi32, SetLastError = false)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaOpenPolicy.cs (1)
30[LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LsaOpenPolicy", SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.OpenThreadToken_SafeTokenHandle.cs (1)
13[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.RevertToSelf.cs (1)
11[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Authz\Interop.AuthzInitializeContextFromSid.cs (3)
15[LibraryImport(Interop.Libraries.Authz, SetLastError = true)] 22Interop.LUID Identitifier, 26[LibraryImport(Interop.Libraries.Authz)]
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.GetCurrentThread.cs (1)
11[LibraryImport(Interop.Libraries.Kernel32)]
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;
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeTokenHandle.cs (1)
35return Interop.Kernel32.CloseHandle(handle);
System\DirectoryServices\AccountManagement\AD\ADStoreCtx.cs (3)
1554if (Interop.Advapi32.ConvertStringSidToSid(sddlSid, out pGroupSid) != Interop.BOOL.FALSE) 1565Interop.Kernel32.LocalFree(pGroupSid);
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 (3)
503if (Interop.Advapi32.ConvertStringSidToSid(urnValue, out pSid) != Interop.BOOL.FALSE) 526Interop.Kernel32.LocalFree(pSid);
System\DirectoryServices\AccountManagement\AD\SidList.cs (21)
49internal SidList(Interop.SID_AND_ATTRIBUTES[] sidAndAttr) 87Interop.OBJECT_ATTRIBUTES oa = default; 89uint err = Interop.Advapi32.LsaOpenPolicy( 92(int)Interop.Advapi32.PolicyRights.POLICY_LOOKUP_NAMES, 102Interop.Advapi32.LsaNtStatusToWinError(err))); 111err = Interop.Advapi32.LsaLookupSids( 119if (err != Interop.StatusOptions.STATUS_SUCCESS && 120err != Interop.StatusOptions.STATUS_SOME_NOT_MAPPED && 121err != Interop.StatusOptions.STATUS_NONE_MAPPED) 130Interop.Advapi32.LsaNtStatusToWinError(err))); 136namesHandle.Initialize((uint)sidCount, (uint)Marshal.SizeOf<Interop.LSA_TRANSLATED_NAME>()); 138Interop.LSA_TRANSLATED_NAME[] names = new Interop.LSA_TRANSLATED_NAME[sidCount]; 145Interop.LSA_REFERENCED_DOMAIN_LIST domainList = domainsHandle.Read<Interop.LSA_REFERENCED_DOMAIN_LIST>(0); 154Interop.LSA_TRUST_INFORMATION[] domains = new Interop.LSA_TRUST_INFORMATION[domainCount]; 160domains[i] = *(Interop.LSA_TRUST_INFORMATION*)pCurrentDomain; 161pCurrentDomain += sizeof(Interop.LSA_TRUST_INFORMATION); 173Interop.LSA_TRANSLATED_NAME name = names[i]; 186Interop.LSA_TRUST_INFORMATION domain = domains[name.DomainIndex];
System\DirectoryServices\AccountManagement\AuthZSet.cs (19)
54Interop.LUID luid = default; 65f = Interop.Authz.AuthzInitializeResourceManager( 66Interop.Authz.AUTHZ_RM_FLAG_NO_AUDIT, 79f = Interop.Authz.AuthzInitializeContextFromSid( 96f = Interop.Authz.AuthzGetInformationFromContext( 113f = Interop.Authz.AuthzGetInformationFromContext( 134Interop.TOKEN_GROUPS tokenGroups = *(Interop.TOKEN_GROUPS*)pBuffer; 142Interop.SID_AND_ATTRIBUTES[] groups = new Interop.SID_AND_ATTRIBUTES[groupCount]; 144IntPtr currentItem = pBuffer + sizeof(Interop.TOKEN_GROUPS) - sizeof(Interop.SID_AND_ATTRIBUTES); 148groups[i] = *(Interop.SID_AND_ATTRIBUTES*)currentItem; 150currentItem += sizeof(Interop.SID_AND_ATTRIBUTES); 210Interop.Authz.AuthzFreeContext(pClientContext); 213Interop.Authz.AuthzFreeResourceManager(pResManager); 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\GlobalDebug.cs (2)
31message = "[" + Interop.Kernel32.GetCurrentThreadId().ToString("x", CultureInfo.InvariantCulture) + "] " + message; 39message = "[" + Interop.Kernel32.GetCurrentThreadId().ToString("x", CultureInfo.InvariantCulture) + "] " + message;
System\DirectoryServices\AccountManagement\interopt.cs (2)
25int hr = Interop.Activeds.ADsOpenObject(path, userName, password, flags, ref iid, out ppObjPtr); 447public Interop.UNICODE_INTPTR_STRING DomainName;
System\DirectoryServices\AccountManagement\NetCred.cs (5)
69fixed (char* splitUsername = new char[Interop.Credui.CRED_MAX_USERNAME_LENGTH]) 70fixed (char* splitDomain = new char[Interop.Credui.CRED_MAX_DOMAIN_TARGET_LENGTH]) 72int result = Interop.Credui.CredUIParseUserName( 75Interop.Credui.CRED_MAX_USERNAME_LENGTH, 77Interop.Credui.CRED_MAX_DOMAIN_TARGET_LENGTH);
System\DirectoryServices\AccountManagement\SAM\SAMStoreCtx.cs (2)
1053int err = Interop.Wkscli.NetWkstaGetInfo(_machineUserSuppliedName, 100, ref buffer); 1073Interop.Netutils.NetApiBufferFree(buffer);
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 (51)
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( 355Interop.Kernel32.GetCurrentThread(), 367if (!Interop.Advapi32.OpenProcessToken( 368Interop.Kernel32.GetCurrentProcess(), 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, 433Interop.TOKEN_USER tokenUser = *(Interop.TOKEN_USER*)pBuffer; 436Debug.Assert(Interop.Advapi32.IsValidSid(pUserSid)); 439int userSidLength = Interop.Advapi32.GetLengthSid(pUserSid); 441success = Interop.Advapi32.CopySid(userSidLength, pCopyOfUserSid, pUserSid); 472Interop.OBJECT_ATTRIBUTES oa = default; 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); 564int err = Interop.Logoncli.DsGetDcName(computerName, domainName, IntPtr.Zero, siteName, flags, out domainControllerInfoPtr); 584Interop.Netutils.NetApiBufferFree(domainControllerInfoPtr); 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); 772Interop.Kernel32.CloseHandle(hToken); 786Interop.Advapi32.RevertToSelf(); 787Interop.Kernel32.CloseHandle(hUserToken); 797err = Interop.Dsrole.DsRoleGetPrimaryDomainInformation(computerName, Interop.Dsrole.DSROLE_PRIMARY_DOMAIN_INFO_LEVEL.DsRolePrimaryDomainInfoBasic, out dsRoleInfoPtr); 817Interop.Dsrole.DsRoleFreeMemory(dsRoleInfoPtr); 829Debug.Assert(Interop.Advapi32.IsValidSid(pSid)); 831IntPtr psubAuthorityCount = Interop.Advapi32.GetSidSubAuthorityCount(pSid); 856IntPtr pcurrentSubauthority = Interop.Advapi32.GetSidSubAuthority(pSid, i);