-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from Sergio0694/dev/disable-runtime-marshalling
Add [DisableRuntimeMarshalling] polyfill
- Loading branch information
Showing
4 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
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
31 changes: 31 additions & 0 deletions
31
...es/RuntimeSupported/System.Runtime.CompilerServices.DisableRuntimeMarshallingAttribute.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 @@ | ||
// <auto-generated/> | ||
#pragma warning disable | ||
#nullable enable annotations | ||
|
||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Runtime.CompilerServices | ||
{ | ||
/// <summary> | ||
/// Disables the built-in runtime managed/unmanaged marshalling subsystem for | ||
/// P/Invokes, Delegate types, and unmanaged function pointer invocations. | ||
/// </summary> | ||
/// <remarks> | ||
/// The built-in marshalling subsystem has some behaviors that cannot be changed due to | ||
/// backward-compatibility requirements. This attribute allows disabling the built-in | ||
/// subsystem and instead uses the following rules for P/Invokes, Delegates, | ||
/// and unmanaged function pointer invocations: | ||
/// | ||
/// - All value types that do not contain reference type fields recursively (<c>unmanaged</c> in C#) are blittable | ||
/// - Value types that recursively have any fields that have <c>[StructLayout(LayoutKind.Auto)]</c> are disallowed from interop. | ||
/// - All reference types are disallowed from usage in interop scenarios. | ||
/// - SetLastError support in P/Invokes is disabled. | ||
/// - varargs support is disabled. | ||
/// - LCIDConversionAttribute support is disabled. | ||
/// </remarks> | ||
[global::System.AttributeUsage(global::System.AttributeTargets.Assembly, Inherited = false, AllowMultiple = false)] | ||
internal sealed class DisableRuntimeMarshallingAttribute : global::System.Attribute | ||
{ | ||
} | ||
} |
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