Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3067,6 +3067,7 @@ public ComNativeDescriptorProxy()

[UnsafeAccessor(UnsafeAccessorKind.Constructor)]
[return: UnsafeAccessorType("System.Windows.Forms.ComponentModel.Com2Interop.ComNativeDescriptor, System.Windows.Forms")]
[MethodImpl(MethodImplOptions.NoInlining)]
static extern object CreateComNativeDescriptor();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ internal static Delegate CreateObjectArrayDelegate(Type delegateType, Func<objec
{
return CreateObjectArrayDelegate(null, delegateType, handler);

[UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name="CreateObjectArrayDelegate")]
[UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateObjectArrayDelegate")]
[MethodImpl(MethodImplOptions.NoInlining)]
static extern Delegate CreateObjectArrayDelegate(
[UnsafeAccessorType("Internal.Runtime.Augments.DynamicDelegateAugments, System.Private.CoreLib")] object? _,
Type delegateType,
Expand Down
19 changes: 9 additions & 10 deletions src/libraries/System.Private.CoreLib/src/System/AppDomain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,16 +406,13 @@ public void SetThreadPrincipal(IPrincipal principal)
principal = (IPrincipal)GetDefaultPrincipal(null);
break;
case PrincipalPolicy.WindowsPrincipal:
try
{
principal = (IPrincipal)GetDefaultWindowsPrincipal(null);
break;
}
catch (MissingMethodException ex)
{
// WindowsPrincipal is not available, throw PNSE
throw new PlatformNotSupportedException(SR.PlatformNotSupported_Principal, ex);
}
#if TARGET_WINDOWS
principal = (IPrincipal)GetDefaultWindowsPrincipal(null);
break;
#else
// WindowsPrincipal is not available, throw PNSE
throw new PlatformNotSupportedException(SR.PlatformNotSupported_Principal);
#endif
}
}

Expand All @@ -426,10 +423,12 @@ public void SetThreadPrincipal(IPrincipal principal)
static extern object GetDefaultPrincipal(
[UnsafeAccessorType("System.Security.Principal.GenericPrincipal, System.Security.Claims")] object? _);

#if TARGET_WINDOWS
[UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "GetDefaultInstance")]
[return: UnsafeAccessorType("System.Security.Principal.WindowsPrincipal, System.Security.Principal.Windows")]
static extern object GetDefaultWindowsPrincipal(
[UnsafeAccessorType("System.Security.Principal.WindowsPrincipal, System.Security.Principal.Windows")] object? _);
#endif
}
}
}
Loading