-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make System.DirectoryServices.AccountManagement use GeneratedDllImport (
- Loading branch information
1 parent
f45dfdc
commit ec7b11d
Showing
43 changed files
with
703 additions
and
695 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsOpenObject.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Activeds | ||
{ | ||
[DllImport(Interop.Libraries.Activeds, CharSet = CharSet.Unicode, ExactSpelling = true)] | ||
internal static extern int ADsOpenObject(string path, string userName, string password, int flags, [In, Out] ref Guid iid, [Out, MarshalAs(UnmanagedType.Interface)] out object ppObject); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertSidToStringSid.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Advapi32 | ||
{ | ||
[GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ConvertSidToStringSidW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] | ||
internal static partial BOOL ConvertSidToStringSid(IntPtr sid, ref string stringSid); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CopySid.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Advapi32 | ||
{ | ||
[GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] | ||
internal static partial bool CopySid(int destinationLength, IntPtr pSidDestination, IntPtr pSidSource); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EqualDomainSid.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Advapi32 | ||
{ | ||
[GeneratedDllImport(Interop.Libraries.Advapi32)] | ||
public static partial bool EqualDomainSid(IntPtr pSid1, IntPtr pSid2, ref bool equal); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetLengthSid.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Advapi32 | ||
{ | ||
[GeneratedDllImport(Interop.Libraries.Advapi32)] | ||
internal static partial int GetLengthSid(IntPtr sid); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSidIdentifierAuthority.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Advapi32 | ||
{ | ||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] | ||
internal struct SID_IDENTIFIER_AUTHORITY | ||
{ | ||
public byte b1; | ||
public byte b2; | ||
public byte b3; | ||
public byte b4; | ||
public byte b5; | ||
public byte b6; | ||
} | ||
|
||
[GeneratedDllImport(Libraries.Advapi32)] | ||
internal static partial IntPtr GetSidIdentifierAuthority(IntPtr sid); | ||
|
||
[GeneratedDllImport(Interop.Libraries.Advapi32)] | ||
internal static partial IntPtr GetSidSubAuthority(IntPtr sid, int index); | ||
|
||
[GeneratedDllImport(Interop.Libraries.Advapi32)] | ||
internal static partial IntPtr GetSidSubAuthorityCount(IntPtr sid); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...s/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation_SafeLocalAllocHandle.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using Microsoft.Win32.SafeHandles; | ||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Advapi32 | ||
{ | ||
[GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] | ||
internal static partial bool GetTokenInformation( | ||
SafeAccessTokenHandle TokenHandle, | ||
uint TokenInformationClass, | ||
SafeLocalAllocHandle TokenInformation, | ||
uint TokenInformationLength, | ||
out uint ReturnLength); | ||
|
||
[GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] | ||
internal static partial bool GetTokenInformation( | ||
IntPtr TokenHandle, | ||
uint TokenInformationClass, | ||
SafeLocalAllocHandle TokenInformation, | ||
uint TokenInformationLength, | ||
out uint ReturnLength); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser_IntPtr.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Advapi32 | ||
{ | ||
[GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] | ||
internal static partial int ImpersonateLoggedOnUser(IntPtr userToken); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsValidSid.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Advapi32 | ||
{ | ||
[GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] | ||
internal static partial bool IsValidSid(IntPtr sid); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LogonUser.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Advapi32 | ||
{ | ||
[GeneratedDllImport(Libraries.Advapi32, EntryPoint = "LogonUserW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] | ||
internal static partial int LogonUser( | ||
string username, | ||
string domain, | ||
string password, | ||
int logonType, | ||
int logonProvider, | ||
ref IntPtr token); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaQueryInformationPolicy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Advapi32 | ||
{ | ||
[GeneratedDllImport(Libraries.Advapi32)] | ||
internal static partial uint LsaQueryInformationPolicy( | ||
IntPtr policyHandle, | ||
int policyInformationClass, | ||
ref IntPtr buffer); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzGetInformationFromContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Authz | ||
{ | ||
[GeneratedDllImport(Libraries.Authz, SetLastError = true)] | ||
internal static partial bool AuthzGetInformationFromContext( | ||
IntPtr hAuthzClientContext, | ||
int InfoClass, | ||
int BufferSize, | ||
out int pSizeRequired, | ||
IntPtr Buffer); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeContextFromSid.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Authz | ||
{ | ||
internal const int AUTHZ_RM_FLAG_NO_AUDIT = 0x1; | ||
internal const int AUTHZ_RM_FLAG_INITIALIZE_UNDER_IMPERSONATION = 0x2; | ||
internal const int AUTHZ_VALID_RM_INIT_FLAGS = (AUTHZ_RM_FLAG_NO_AUDIT | AUTHZ_RM_FLAG_INITIALIZE_UNDER_IMPERSONATION); | ||
|
||
[GeneratedDllImport(Interop.Libraries.Authz, SetLastError = true)] | ||
internal static partial bool AuthzInitializeContextFromSid( | ||
int Flags, | ||
IntPtr UserSid, | ||
IntPtr AuthzResourceManager, | ||
IntPtr pExpirationTime, | ||
Interop.LUID Identitifier, | ||
IntPtr DynamicGroupArgs, | ||
out IntPtr pAuthzClientContext); | ||
|
||
[GeneratedDllImport(Interop.Libraries.Authz)] | ||
internal static partial bool AuthzFreeContext(IntPtr AuthzClientContext); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeResourceManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Authz | ||
{ | ||
[GeneratedDllImport(Libraries.Authz, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] | ||
internal static partial bool AuthzInitializeResourceManager( | ||
int flags, | ||
IntPtr pfnAccessCheck, | ||
IntPtr pfnComputeDynamicGroups, | ||
IntPtr pfnFreeDynamicGroups, | ||
string name, | ||
out IntPtr rm); | ||
|
||
[GeneratedDllImport(Libraries.Authz)] | ||
internal static partial bool AuthzFreeResourceManager(IntPtr rm); | ||
} | ||
} |
Oops, something went wrong.