From ec0ff585f0d0c26a53aca3d3d6346d5282199273 Mon Sep 17 00:00:00 2001 From: Next Turn <45985406+NextTurn@users.noreply.github.com> Date: Fri, 1 Nov 2019 09:30:42 +0800 Subject: [PATCH 1/2] Update structure marshaling guidance for .NET Core 3.0 --- docs/standard/native-interop/customize-struct-marshaling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/standard/native-interop/customize-struct-marshaling.md b/docs/standard/native-interop/customize-struct-marshaling.md index 1cbaf40a785fc..2fab5aeebe563 100644 --- a/docs/standard/native-interop/customize-struct-marshaling.md +++ b/docs/standard/native-interop/customize-struct-marshaling.md @@ -21,7 +21,7 @@ Sometimes the default marshaling rules for structures aren't exactly what you ne **✔️ DO** only use `LayoutKind.Explicit` in marshaling when your native struct is also has an explicit layout, such as a union. -**❌ AVOID** using `LayoutKind.Explicit` when marshaling structures on non-Windows platforms. The .NET Core runtime doesn't support passing explicit structures by value to native functions on Intel or AMD 64-bit non-Windows systems. However, the runtime supports passing explicit structures by reference on all platforms. +**❌ AVOID** using `LayoutKind.Explicit` when marshaling structures on non-Windows platforms if you need to target runtimes before .NET Core 3.0. The .NET Core runtime before 3.0 Preview 4 doesn't support passing explicit structures by value to native functions on Intel or AMD 64-bit non-Windows systems. However, the runtime supports passing explicit structures by reference on all platforms. ## Customizing boolean field marshaling From 4bb328a0e0665a1264d07f9893ec18dd8f26d591 Mon Sep 17 00:00:00 2001 From: Next Turn <45985406+NextTurn@users.noreply.github.com> Date: Fri, 1 Nov 2019 14:17:43 +0800 Subject: [PATCH 2/2] Update docs/standard/native-interop/customize-struct-marshaling.md Co-Authored-By: Maira Wenzel --- docs/standard/native-interop/customize-struct-marshaling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/standard/native-interop/customize-struct-marshaling.md b/docs/standard/native-interop/customize-struct-marshaling.md index 2fab5aeebe563..cadcf4dd053dc 100644 --- a/docs/standard/native-interop/customize-struct-marshaling.md +++ b/docs/standard/native-interop/customize-struct-marshaling.md @@ -21,7 +21,7 @@ Sometimes the default marshaling rules for structures aren't exactly what you ne **✔️ DO** only use `LayoutKind.Explicit` in marshaling when your native struct is also has an explicit layout, such as a union. -**❌ AVOID** using `LayoutKind.Explicit` when marshaling structures on non-Windows platforms if you need to target runtimes before .NET Core 3.0. The .NET Core runtime before 3.0 Preview 4 doesn't support passing explicit structures by value to native functions on Intel or AMD 64-bit non-Windows systems. However, the runtime supports passing explicit structures by reference on all platforms. +**❌ AVOID** using `LayoutKind.Explicit` when marshaling structures on non-Windows platforms if you need to target runtimes before .NET Core 3.0. The .NET Core runtime before 3.0 doesn't support passing explicit structures by value to native functions on Intel or AMD 64-bit non-Windows systems. However, the runtime supports passing explicit structures by reference on all platforms. ## Customizing boolean field marshaling