Skip to content

Commit

Permalink
Fix System.DirectoryServices.AccountManagement build
Browse files Browse the repository at this point in the history
System.DirectoryServices.AccountManagement now builds against
src/System.DirectoryServices instead of ref/System.DirectoryServices
(because the package doesn't contain the ref assembly).

Because of that, the compiler now gets confused because of the
System.DirectoryServices.Interop namespace and the global Interop class.
This happens even though the DirectoryServices.Interop namespace doesn't include any
public types.

That results in the following erros:
src\libraries\System.DirectoryServices.AccountManagement\src\System\DirectoryServices\AccountManagement\AD\SidList.cs(50,26): error CS0246: The type or namespace name 'SID_AND_ATTRIBUTES' could not be found (are you missing a using directive or an assembly reference?)
src\libraries\System.DirectoryServices.AccountManagement\src\System\DirectoryServices\AccountManagement\interopt.cs(439,20): error CS0246: The type or namespace name 'UNICODE_INTPTR_STRING' could not be found (are you missing a using directive or an assembly reference?)

This commit fixes that by removing the System.DirectoryServices.Interop
namespace and moving the types into the parent namespace.
  • Loading branch information
ViktorHofer committed Nov 22, 2022
1 parent 64e5da2 commit f7e4f6d
Show file tree
Hide file tree
Showing 24 changed files with 14 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<argument>ILLink</argument>
<argument>IL2050</argument>
<property name="Scope">member</property>
<property name="Target">M:System.DirectoryServices.Interop.UnsafeNativeMethods.ADsOpenObject(System.String,System.String,System.String,System.Int32,System.Guid@,System.Object@)</property>
<property name="Target">M:System.DirectoryServices.UnsafeNativeMethods.ADsOpenObject(System.String,System.String,System.String,System.Int32,System.Guid@,System.Object@)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System.DirectoryServices.Interop
namespace System.DirectoryServices
{
internal enum AdsOptions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System.DirectoryServices.Interop
namespace System.DirectoryServices
{
internal enum AdsPropertyOperation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.Runtime.InteropServices;

namespace System.DirectoryServices.Interop
namespace System.DirectoryServices
{
[StructLayout(LayoutKind.Sequential)]
internal unsafe struct AdsSearchColumn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.Runtime.InteropServices;

namespace System.DirectoryServices.Interop
namespace System.DirectoryServices
{
[StructLayout(LayoutKind.Sequential)]
internal struct AdsSearchPreferenceInfo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System.DirectoryServices.Interop
namespace System.DirectoryServices
{
internal enum AdsSearchPreferences
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.Runtime.InteropServices;

namespace System.DirectoryServices.Interop
namespace System.DirectoryServices
{
[StructLayout(LayoutKind.Sequential)]
internal struct AdsSortKey
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System.DirectoryServices.Interop
namespace System.DirectoryServices
{
internal enum AdsType
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.Runtime.InteropServices;

namespace System.DirectoryServices.Interop
namespace System.DirectoryServices
{
[StructLayout(LayoutKind.Sequential)]
internal struct Ads_Pointer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Runtime.InteropServices;
using System.Globalization;

namespace System.DirectoryServices.Interop
namespace System.DirectoryServices
{
[StructLayout(LayoutKind.Sequential)]
internal struct SystemTime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System.DirectoryServices.Interop
namespace System.DirectoryServices
{
internal static class NativeMethods
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Security;
using System.Runtime.InteropServices;

namespace System.DirectoryServices.Interop
namespace System.DirectoryServices
{
internal static partial class SafeNativeMethods
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Runtime.InteropServices;
using System.Security;

namespace System.DirectoryServices.Interop
namespace System.DirectoryServices
{

[StructLayout(LayoutKind.Explicit)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public void SeizeRoleOwnership(ActiveDirectoryRole role)
// Increment the RIDAvailablePool by 30k.
if (role == ActiveDirectoryRole.RidRole)
{
System.DirectoryServices.Interop.UnsafeNativeMethods.IADsLargeInteger ridPool = (System.DirectoryServices.Interop.UnsafeNativeMethods.IADsLargeInteger)roleObjectEntry.Properties[PropertyManager.RIDAvailablePool].Value!;
System.DirectoryServices.UnsafeNativeMethods.IADsLargeInteger ridPool = (System.DirectoryServices.UnsafeNativeMethods.IADsLargeInteger)roleObjectEntry.Properties[PropertyManager.RIDAvailablePool].Value!;

// check the overflow of the low part
if (ridPool.LowPart + UpdateRidPoolSeizureValue < ridPool.LowPart)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.DirectoryServices.Interop;

namespace System.DirectoryServices
{
/// <devdoc>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System.Runtime.InteropServices;
using System.Collections;
using System.DirectoryServices.Interop;

namespace System.DirectoryServices
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System.Runtime.InteropServices;
using System.Diagnostics;
using System.DirectoryServices.Interop;
using System.ComponentModel;
using System.Threading;
using System.Reflection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.DirectoryServices.Interop;
using System.ComponentModel;

namespace System.DirectoryServices
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Runtime.InteropServices;
using System.Collections;
using System.Collections.Specialized;
using System.DirectoryServices.Interop;
using System.ComponentModel;

using INTPTR_INTPTRCAST = System.IntPtr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.DirectoryServices.Interop;

namespace System.DirectoryServices
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System.Runtime.InteropServices;
using System.Collections;
using System.DirectoryServices.Interop;
using System.Globalization;

namespace System.DirectoryServices
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections;
using System.DirectoryServices.Interop;

namespace System.DirectoryServices
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections;
using System.DirectoryServices.Interop;

namespace System.DirectoryServices
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Net;
using System.Runtime.InteropServices;
using System.Collections;
using System.DirectoryServices.Interop;
using System.Text;

using INTPTR_INTPTRCAST = System.IntPtr;
Expand Down

0 comments on commit f7e4f6d

Please sign in to comment.